cognetivy 0.1.31 → 0.1.32

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,112 @@
1
+ function uA(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in e)){const s=Object.getOwnPropertyDescriptor(i,l);s&&Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function r(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=r(l);fetch(l.href,s)}})();var v7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Us(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rm={exports:{}},is={};var yb;function fA(){if(yb)return is;yb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,l,s){var c=null;if(s!==void 0&&(c=""+s),l.key!==void 0&&(c=""+l.key),"key"in l){s={};for(var f in l)f!=="key"&&(s[f]=l[f])}else s=l;return l=s.ref,{$$typeof:e,type:i,key:c,ref:l!==void 0?l:null,props:s}}return is.Fragment=t,is.jsx=r,is.jsxs=r,is}var xb;function dA(){return xb||(xb=1,Rm.exports=fA()),Rm.exports}var g=dA(),jm={exports:{}},Re={};var vb;function hA(){if(vb)return Re;vb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=x&&B[x]||B["@@iterator"],typeof B=="function"?B:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function N(B,G,D){this.props=B,this.context=G,this.refs=_,this.updater=D||E}N.prototype.isReactComponent={},N.prototype.setState=function(B,G){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,G,"setState")},N.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function k(){}k.prototype=N.prototype;function C(B,G,D){this.props=B,this.context=G,this.refs=_,this.updater=D||E}var A=C.prototype=new k;A.constructor=C,S(A,N.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function j(){}var z={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function H(B,G,D){var oe=D.ref;return{$$typeof:e,type:B,key:G,ref:oe!==void 0?oe:null,props:D}}function X(B,G){return H(B.type,G,B.props)}function q(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function F(B){var G={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(D){return G[D]})}var Y=/\/+/g;function O(B,G){return typeof B=="object"&&B!==null&&B.key!=null?F(""+B.key):G.toString(36)}function U(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(j,j):(B.status="pending",B.then(function(G){B.status==="pending"&&(B.status="fulfilled",B.value=G)},function(G){B.status==="pending"&&(B.status="rejected",B.reason=G)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function R(B,G,D,oe,K){var J=typeof B;(J==="undefined"||J==="boolean")&&(B=null);var te=!1;if(B===null)te=!0;else switch(J){case"bigint":case"string":case"number":te=!0;break;case"object":switch(B.$$typeof){case e:case t:te=!0;break;case m:return te=B._init,R(te(B._payload),G,D,oe,K)}}if(te)return K=K(B),te=oe===""?"."+O(B,0):oe,L(K)?(D="",te!=null&&(D=te.replace(Y,"$&/")+"/"),R(K,G,D,"",function(he){return he})):K!=null&&(q(K)&&(K=X(K,D+(K.key==null||B&&B.key===K.key?"":(""+K.key).replace(Y,"$&/")+"/")+te)),G.push(K)),1;te=0;var ne=oe===""?".":oe+":";if(L(B))for(var se=0;se<B.length;se++)oe=B[se],J=ne+O(oe,se),te+=R(oe,G,D,J,K);else if(se=b(B),typeof se=="function")for(B=se.call(B),se=0;!(oe=B.next()).done;)oe=oe.value,J=ne+O(oe,se++),te+=R(oe,G,D,J,K);else if(J==="object"){if(typeof B.then=="function")return R(U(B),G,D,oe,K);throw G=String(B),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return te}function V(B,G,D){if(B==null)return B;var oe=[],K=0;return R(B,oe,"","",function(J){return G.call(D,J,K++)}),oe}function $(B){if(B._status===-1){var G=B._result;G=G(),G.then(function(D){(B._status===0||B._status===-1)&&(B._status=1,B._result=D)},function(D){(B._status===0||B._status===-1)&&(B._status=2,B._result=D)}),B._status===-1&&(B._status=0,B._result=G)}if(B._status===1)return B._result.default;throw B._result}var W=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},M={map:V,forEach:function(B,G,D){V(B,function(){G.apply(this,arguments)},D)},count:function(B){var G=0;return V(B,function(){G++}),G},toArray:function(B){return V(B,function(G){return G})||[]},only:function(B){if(!q(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Re.Activity=p,Re.Children=M,Re.Component=N,Re.Fragment=r,Re.Profiler=l,Re.PureComponent=C,Re.StrictMode=i,Re.Suspense=h,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Re.__COMPILER_RUNTIME={__proto__:null,c:function(B){return z.H.useMemoCache(B)}},Re.cache=function(B){return function(){return B.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(B,G,D){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var oe=S({},B.props),K=B.key;if(G!=null)for(J in G.key!==void 0&&(K=""+G.key),G)!P.call(G,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&G.ref===void 0||(oe[J]=G[J]);var J=arguments.length-2;if(J===1)oe.children=D;else if(1<J){for(var te=Array(J),ne=0;ne<J;ne++)te[ne]=arguments[ne+2];oe.children=te}return H(B.type,K,oe)},Re.createContext=function(B){return B={$$typeof:c,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:s,_context:B},B},Re.createElement=function(B,G,D){var oe,K={},J=null;if(G!=null)for(oe in G.key!==void 0&&(J=""+G.key),G)P.call(G,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(K[oe]=G[oe]);var te=arguments.length-2;if(te===1)K.children=D;else if(1<te){for(var ne=Array(te),se=0;se<te;se++)ne[se]=arguments[se+2];K.children=ne}if(B&&B.defaultProps)for(oe in te=B.defaultProps,te)K[oe]===void 0&&(K[oe]=te[oe]);return H(B,J,K)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(B){return{$$typeof:f,render:B}},Re.isValidElement=q,Re.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:$}},Re.memo=function(B,G){return{$$typeof:d,type:B,compare:G===void 0?null:G}},Re.startTransition=function(B){var G=z.T,D={};z.T=D;try{var oe=B(),K=z.S;K!==null&&K(D,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(j,W)}catch(J){W(J)}finally{G!==null&&D.types!==null&&(G.types=D.types),z.T=G}},Re.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Re.use=function(B){return z.H.use(B)},Re.useActionState=function(B,G,D){return z.H.useActionState(B,G,D)},Re.useCallback=function(B,G){return z.H.useCallback(B,G)},Re.useContext=function(B){return z.H.useContext(B)},Re.useDebugValue=function(){},Re.useDeferredValue=function(B,G){return z.H.useDeferredValue(B,G)},Re.useEffect=function(B,G){return z.H.useEffect(B,G)},Re.useEffectEvent=function(B){return z.H.useEffectEvent(B)},Re.useId=function(){return z.H.useId()},Re.useImperativeHandle=function(B,G,D){return z.H.useImperativeHandle(B,G,D)},Re.useInsertionEffect=function(B,G){return z.H.useInsertionEffect(B,G)},Re.useLayoutEffect=function(B,G){return z.H.useLayoutEffect(B,G)},Re.useMemo=function(B,G){return z.H.useMemo(B,G)},Re.useOptimistic=function(B,G){return z.H.useOptimistic(B,G)},Re.useReducer=function(B,G,D){return z.H.useReducer(B,G,D)},Re.useRef=function(B){return z.H.useRef(B)},Re.useState=function(B){return z.H.useState(B)},Re.useSyncExternalStore=function(B,G,D){return z.H.useSyncExternalStore(B,G,D)},Re.useTransition=function(){return z.H.useTransition()},Re.version="19.2.4",Re}var bb;function Vs(){return bb||(bb=1,jm.exports=hA()),jm.exports}var w=Vs();const to=Us(w),xS=uA({__proto__:null,default:to},[w]);var Mm={exports:{}},ls={},Om={exports:{}},Dm={};var wb;function mA(){return wb||(wb=1,(function(e){function t(R,V){var $=R.length;R.push(V);e:for(;0<$;){var W=$-1>>>1,M=R[W];if(0<l(M,V))R[W]=V,R[$]=M,$=W;else break e}}function r(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var V=R[0],$=R.pop();if($!==V){R[0]=$;e:for(var W=0,M=R.length,B=M>>>1;W<B;){var G=2*(W+1)-1,D=R[G],oe=G+1,K=R[oe];if(0>l(D,$))oe<M&&0>l(K,D)?(R[W]=K,R[oe]=$,W=oe):(R[W]=D,R[G]=$,W=G);else if(oe<M&&0>l(K,$))R[W]=K,R[oe]=$,W=oe;else break e}}return V}function l(R,V){var $=R.sortIndex-V.sortIndex;return $!==0?$:R.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],d=[],m=1,p=null,x=3,b=!1,E=!1,S=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(R){for(var V=r(d);V!==null;){if(V.callback===null)i(d);else if(V.startTime<=R)i(d),V.sortIndex=V.expirationTime,t(h,V);else break;V=r(d)}}function L(R){if(S=!1,A(R),!E)if(r(h)!==null)E=!0,j||(j=!0,F());else{var V=r(d);V!==null&&U(L,V.startTime-R)}}var j=!1,z=-1,P=5,H=-1;function X(){return _?!0:!(e.unstable_now()-H<P)}function q(){if(_=!1,j){var R=e.unstable_now();H=R;var V=!0;try{e:{E=!1,S&&(S=!1,k(z),z=-1),b=!0;var $=x;try{t:{for(A(R),p=r(h);p!==null&&!(p.expirationTime>R&&X());){var W=p.callback;if(typeof W=="function"){p.callback=null,x=p.priorityLevel;var M=W(p.expirationTime<=R);if(R=e.unstable_now(),typeof M=="function"){p.callback=M,A(R),V=!0;break t}p===r(h)&&i(h),A(R)}else i(h);p=r(h)}if(p!==null)V=!0;else{var B=r(d);B!==null&&U(L,B.startTime-R),V=!1}}break e}finally{p=null,x=$,b=!1}V=void 0}}finally{V?F():j=!1}}}var F;if(typeof C=="function")F=function(){C(q)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,O=Y.port2;Y.port1.onmessage=q,F=function(){O.postMessage(null)}}else F=function(){N(q,0)};function U(R,V){z=N(function(){R(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(R){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var $=x;x=V;try{return R()}finally{x=$}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(R,V){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var $=x;x=R;try{return V()}finally{x=$}},e.unstable_scheduleCallback=function(R,V,$){var W=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?W+$:W):$=W,R){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=$+M,R={id:m++,callback:V,priorityLevel:R,startTime:$,expirationTime:M,sortIndex:-1},$>W?(R.sortIndex=$,t(d,R),r(h)===null&&R===r(d)&&(S?(k(z),z=-1):S=!0,U(L,$-W))):(R.sortIndex=M,t(h,R),E||b||(E=!0,j||(j=!0,F()))),R},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(R){var V=x;return function(){var $=x;x=V;try{return R.apply(this,arguments)}finally{x=$}}}})(Dm)),Dm}var Sb;function pA(){return Sb||(Sb=1,Om.exports=mA()),Om.exports}var zm={exports:{}},qt={};var Eb;function gA(){if(Eb)return qt;Eb=1;var e=Vs();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function s(h,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:p==null?null:""+p,children:h,containerInfo:d,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,qt.createPortal=function(h,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return s(h,d,null,m)},qt.flushSync=function(h){var d=c.T,m=i.p;try{if(c.T=null,i.p=2,h)return h()}finally{c.T=d,i.p=m,i.d.f()}},qt.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(h,d))},qt.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},qt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var m=d.as,p=f(m,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?i.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:x,fetchPriority:b}):m==="script"&&i.d.X(h,{crossOrigin:p,integrity:x,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},qt.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=f(d.as,d.crossOrigin);i.d.M(h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(h)},qt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=f(m,d.crossOrigin);i.d.L(h,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},qt.preloadModule=function(h,d){if(typeof h=="string")if(d){var m=f(d.as,d.crossOrigin);i.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(h)},qt.requestFormReset=function(h){i.d.r(h)},qt.unstable_batchedUpdates=function(h,d){return h(d)},qt.useFormState=function(h,d,m){return c.H.useFormState(h,d,m)},qt.useFormStatus=function(){return c.H.useHostTransitionStatus()},qt.version="19.2.4",qt}var Cb;function vS(){if(Cb)return zm.exports;Cb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zm.exports=gA(),zm.exports}var Nb;function yA(){if(Nb)return ls;Nb=1;var e=pA(),t=Vs(),r=vS();function i(n){var o="https://react.dev/errors/"+n;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)o+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function s(n){var o=n,a=n;if(n.alternate)for(;o.return;)o=o.return;else{n=o;do o=n,(o.flags&4098)!==0&&(a=o.return),n=o.return;while(n)}return o.tag===3?a:null}function c(n){if(n.tag===13){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function f(n){if(n.tag===31){var o=n.memoizedState;if(o===null&&(n=n.alternate,n!==null&&(o=n.memoizedState)),o!==null)return o.dehydrated}return null}function h(n){if(s(n)!==n)throw Error(i(188))}function d(n){var o=n.alternate;if(!o){if(o=s(n),o===null)throw Error(i(188));return o!==n?null:n}for(var a=n,u=o;;){var y=a.return;if(y===null)break;var v=y.alternate;if(v===null){if(u=y.return,u!==null){a=u;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===a)return h(y),n;if(v===u)return h(y),o;v=v.sibling}throw Error(i(188))}if(a.return!==u.return)a=y,u=v;else{for(var T=!1,I=y.child;I;){if(I===a){T=!0,a=y,u=v;break}if(I===u){T=!0,u=y,a=v;break}I=I.sibling}if(!T){for(I=v.child;I;){if(I===a){T=!0,a=v,u=y;break}if(I===u){T=!0,u=v,a=y;break}I=I.sibling}if(!T)throw Error(i(189))}}if(a.alternate!==u)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?n:o}function m(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n;for(n=n.child;n!==null;){if(o=m(n),o!==null)return o;n=n.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function F(n){return n===null||typeof n!="object"?null:(n=q&&n[q]||n["@@iterator"],typeof n=="function"?n:null)}var Y=Symbol.for("react.client.reference");function O(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Y?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case N:return"Profiler";case _:return"StrictMode";case L:return"Suspense";case j:return"SuspenseList";case H:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case E:return"Portal";case C:return n.displayName||"Context";case k:return(n._context.displayName||"Context")+".Consumer";case A:var o=n.render;return n=n.displayName,n||(n=o.displayName||o.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case z:return o=n.displayName||null,o!==null?o:O(n.type)||"Memo";case P:o=n._payload,n=n._init;try{return O(n(o))}catch{}}return null}var U=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},W=[],M=-1;function B(n){return{current:n}}function G(n){0>M||(n.current=W[M],W[M]=null,M--)}function D(n,o){M++,W[M]=n.current,n.current=o}var oe=B(null),K=B(null),J=B(null),te=B(null);function ne(n,o){switch(D(J,o),D(K,n),D(oe,null),o.nodeType){case 9:case 11:n=(n=o.documentElement)&&(n=n.namespaceURI)?Pv(n):0;break;default:if(n=o.tagName,o=o.namespaceURI)o=Pv(o),n=Uv(o,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(oe),D(oe,n)}function se(){G(oe),G(K),G(J)}function he(n){n.memoizedState!==null&&D(te,n);var o=oe.current,a=Uv(o,n.type);o!==a&&(D(K,n),D(oe,a))}function me(n){K.current===n&&(G(oe),G(K)),te.current===n&&(G(te),ts._currentValue=$)}var ge,xe;function _e(n){if(ge===void 0)try{throw Error()}catch(a){var o=a.stack.trim().match(/\n( *(at )?)/);ge=o&&o[1]||"",xe=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ge+n+xe}var $e=!1;function Pe(n,o){if(!n||$e)return"";$e=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ae){var le=ae}Reflect.construct(n,[],de)}else{try{de.call()}catch(ae){le=ae}n.call(de.prototype)}}else{try{throw Error()}catch(ae){le=ae}(de=n())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&le&&typeof ae.stack=="string")return[ae.stack,le.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),T=v[0],I=v[1];if(T&&I){var Z=T.split(`
4
+ `),ie=I.split(`
5
+ `);for(y=u=0;u<Z.length&&!Z[u].includes("DetermineComponentFrameRoot");)u++;for(;y<ie.length&&!ie[y].includes("DetermineComponentFrameRoot");)y++;if(u===Z.length||y===ie.length)for(u=Z.length-1,y=ie.length-1;1<=u&&0<=y&&Z[u]!==ie[y];)y--;for(;1<=u&&0<=y;u--,y--)if(Z[u]!==ie[y]){if(u!==1||y!==1)do if(u--,y--,0>y||Z[u]!==ie[y]){var ue=`
6
+ `+Z[u].replace(" at new "," at ");return n.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",n.displayName)),ue}while(1<=u&&0<=y);break}}}finally{$e=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?_e(a):""}function st(n,o){switch(n.tag){case 26:case 27:case 5:return _e(n.type);case 16:return _e("Lazy");case 13:return n.child!==o&&o!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Pe(n.type,!1);case 11:return Pe(n.type.render,!1);case 1:return Pe(n.type,!0);case 31:return _e("Activity");default:return""}}function fn(n){try{var o="",a=null;do o+=st(n,a),a=n,n=n.return;while(n);return o}catch(u){return`
7
+ Error generating stack: `+u.message+`
8
+ `+u.stack}}var Vt=Object.prototype.hasOwnProperty,Kt=e.unstable_scheduleCallback,Vn=e.unstable_cancelCallback,Rr=e.unstable_shouldYield,jr=e.unstable_requestPaint,Rt=e.unstable_now,ho=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,Le=e.unstable_LowPriority,qe=e.unstable_IdlePriority,Xt=e.log,$n=e.unstable_setDisableYieldValue,Lt=null,vt=null;function $t(n){if(typeof Xt=="function"&&$n(n),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(Lt,n)}catch{}}var Qe=Math.clz32?Math.clz32:xd,ar=Math.log,dn=Math.LN2;function xd(n){return n>>>=0,n===0?32:31-(ar(n)/dn|0)|0}var Yi=256,qi=262144,Fi=4194304;function Mr(n){var o=n&42;if(o!==0)return o;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Xi(n,o,a){var u=n.pendingLanes;if(u===0)return 0;var y=0,v=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var I=u&134217727;return I!==0?(u=I&~v,u!==0?y=Mr(u):(T&=I,T!==0?y=Mr(T):a||(a=I&~n,a!==0&&(y=Mr(a))))):(I=u&~v,I!==0?y=Mr(I):T!==0?y=Mr(T):a||(a=u&~n,a!==0&&(y=Mr(a)))),y===0?0:o!==0&&o!==y&&(o&v)===0&&(v=y&-y,a=o&-o,v>=a||v===32&&(a&4194048)!==0)?o:y}function ii(n,o){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&o)===0}function vd(n,o){switch(n){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rc(){var n=Fi;return Fi<<=1,(Fi&62914560)===0&&(Fi=4194304),n}function da(n){for(var o=[],a=0;31>a;a++)o.push(n);return o}function li(n,o){n.pendingLanes|=o,o!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function bd(n,o,a,u,y,v){var T=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var I=n.entanglements,Z=n.expirationTimes,ie=n.hiddenUpdates;for(a=T&~a;0<a;){var ue=31-Qe(a),de=1<<ue;I[ue]=0,Z[ue]=-1;var le=ie[ue];if(le!==null)for(ie[ue]=null,ue=0;ue<le.length;ue++){var ae=le[ue];ae!==null&&(ae.lane&=-536870913)}a&=~de}u!==0&&oc(n,u,0),v!==0&&y===0&&n.tag!==0&&(n.suspendedLanes|=v&~(T&~o))}function oc(n,o,a){n.pendingLanes|=o,n.suspendedLanes&=~o;var u=31-Qe(o);n.entangledLanes|=o,n.entanglements[u]=n.entanglements[u]|1073741824|a&261930}function ic(n,o){var a=n.entangledLanes|=o;for(n=n.entanglements;a;){var u=31-Qe(a),y=1<<u;y&o|n[u]&o&&(n[u]|=o),a&=~y}}function lc(n,o){var a=o&-o;return a=(a&42)!==0?1:ha(a),(a&(n.suspendedLanes|o))!==0?0:a}function ha(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ma(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function ac(){var n=V.p;return n!==0?n:(n=window.event,n===void 0?32:ub(n.type))}function sc(n,o){var a=V.p;try{return V.p=n,o()}finally{V.p=a}}var sr=Math.random().toString(36).slice(2),jt="__reactFiber$"+sr,Yt="__reactProps$"+sr,Or="__reactContainer$"+sr,Gi="__reactEvents$"+sr,cc="__reactListeners$"+sr,wd="__reactHandles$"+sr,uc="__reactResources$"+sr,ai="__reactMarker$"+sr;function pa(n){delete n[jt],delete n[Yt],delete n[Gi],delete n[cc],delete n[wd]}function mo(n){var o=n[jt];if(o)return o;for(var a=n.parentNode;a;){if(o=a[Or]||a[jt]){if(a=o.alternate,o.child!==null||a!==null&&a.child!==null)for(n=Gv(n);n!==null;){if(a=n[jt])return a;n=Gv(n)}return o}n=a,a=n.parentNode}return null}function po(n){if(n=n[jt]||n[Or]){var o=n.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return n}return null}function go(n){var o=n.tag;if(o===5||o===26||o===27||o===6)return n.stateNode;throw Error(i(33))}function yo(n){var o=n[uc];return o||(o=n[uc]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Et(n){n[ai]=!0}var fc=new Set,dc={};function Dr(n,o){xo(n,o),xo(n+"Capture",o)}function xo(n,o){for(dc[n]=o,n=0;n<o.length;n++)fc.add(o[n])}var Sd=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ga={},hc={};function Ed(n){return Vt.call(hc,n)?!0:Vt.call(ga,n)?!1:Sd.test(n)?hc[n]=!0:(ga[n]=!0,!1)}function Wi(n,o,a){if(Ed(o))if(a===null)n.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(o);return}}n.setAttribute(o,""+a)}}function Zi(n,o,a){if(a===null)n.removeAttribute(o);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttribute(o,""+a)}}function Yn(n,o,a,u){if(u===null)n.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(o,a,""+u)}}function Qt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function mc(n){var o=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Cd(n,o,a){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,o);if(!n.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,v=u.set;return Object.defineProperty(n,o,{configurable:!0,get:function(){return y.call(this)},set:function(T){a=""+T,v.call(this,T)}}),Object.defineProperty(n,o,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(T){a=""+T},stopTracking:function(){n._valueTracker=null,delete n[o]}}}}function Ki(n){if(!n._valueTracker){var o=mc(n)?"checked":"value";n._valueTracker=Cd(n,o,""+n[o])}}function pc(n){if(!n)return!1;var o=n._valueTracker;if(!o)return!0;var a=o.getValue(),u="";return n&&(u=mc(n)?n.checked?"true":"false":n.value),n=u,n!==a?(o.setValue(n),!0):!1}function si(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Nd=/[\n"\\]/g;function Jt(n){return n.replace(Nd,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ci(n,o,a,u,y,v,T,I){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),o!=null?T==="number"?(o===0&&n.value===""||n.value!=o)&&(n.value=""+Qt(o)):n.value!==""+Qt(o)&&(n.value=""+Qt(o)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),o!=null?ya(n,T,Qt(o)):a!=null?ya(n,T,Qt(a)):u!=null&&n.removeAttribute("value"),y==null&&v!=null&&(n.defaultChecked=!!v),y!=null&&(n.checked=y&&typeof y!="function"&&typeof y!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?n.name=""+Qt(I):n.removeAttribute("name")}function gc(n,o,a,u,y,v,T,I){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),o!=null||a!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Ki(n);return}a=a!=null?""+Qt(a):"",o=o!=null?""+Qt(o):a,I||o===n.value||(n.value=o),n.defaultValue=o}u=u??y,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=I?n.checked:!!u,n.defaultChecked=!!u,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),Ki(n)}function ya(n,o,a){o==="number"&&si(n.ownerDocument)===n||n.defaultValue===""+a||(n.defaultValue=""+a)}function zr(n,o,a,u){if(n=n.options,o){o={};for(var y=0;y<a.length;y++)o["$"+a[y]]=!0;for(a=0;a<n.length;a++)y=o.hasOwnProperty("$"+n[a].value),n[a].selected!==y&&(n[a].selected=y),y&&u&&(n[a].defaultSelected=!0)}else{for(a=""+Qt(a),o=null,y=0;y<n.length;y++){if(n[y].value===a){n[y].selected=!0,u&&(n[y].defaultSelected=!0);return}o!==null||n[y].disabled||(o=n[y])}o!==null&&(o.selected=!0)}}function zy(n,o,a){if(o!=null&&(o=""+Qt(o),o!==n.value&&(n.value=o),a==null)){n.defaultValue!==o&&(n.defaultValue=o);return}n.defaultValue=a!=null?""+Qt(a):""}function Ly(n,o,a,u){if(o==null){if(u!=null){if(a!=null)throw Error(i(92));if(U(u)){if(1<u.length)throw Error(i(93));u=u[0]}a=u}a==null&&(a=""),o=a}a=Qt(o),n.defaultValue=a,u=n.textContent,u===a&&u!==""&&u!==null&&(n.value=u),Ki(n)}function Qi(n,o){if(o){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=o;return}}n.textContent=o}var ik=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Iy(n,o,a){var u=o.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?n.setProperty(o,""):o==="float"?n.cssFloat="":n[o]="":u?n.setProperty(o,a):typeof a!="number"||a===0||ik.has(o)?o==="float"?n.cssFloat=a:n[o]=(""+a).trim():n[o]=a+"px"}function By(n,o,a){if(o!=null&&typeof o!="object")throw Error(i(62));if(n=n.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var y in o)u=o[y],o.hasOwnProperty(y)&&a[y]!==u&&Iy(n,y,u)}else for(var v in o)o.hasOwnProperty(v)&&Iy(n,v,o[v])}function _d(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lk=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ak=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function yc(n){return ak.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Lr(){}var kd=null;function Td(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ji=null,el=null;function Hy(n){var o=po(n);if(o&&(n=o.stateNode)){var a=n[Yt]||null;e:switch(n=o.stateNode,o.type){case"input":if(ci(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),o=a.name,a.type==="radio"&&o!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Jt(""+o)+'"][type="radio"]'),o=0;o<a.length;o++){var u=a[o];if(u!==n&&u.form===n.form){var y=u[Yt]||null;if(!y)throw Error(i(90));ci(u,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(o=0;o<a.length;o++)u=a[o],u.form===n.form&&pc(u)}break e;case"textarea":zy(n,a.value,a.defaultValue);break e;case"select":o=a.value,o!=null&&zr(n,!!a.multiple,o,!1)}}}var Ad=!1;function Py(n,o,a){if(Ad)return n(o,a);Ad=!0;try{var u=n(o);return u}finally{if(Ad=!1,(Ji!==null||el!==null)&&(ou(),Ji&&(o=Ji,n=el,el=Ji=null,Hy(o),n)))for(o=0;o<n.length;o++)Hy(n[o])}}function xa(n,o){var a=n.stateNode;if(a===null)return null;var u=a[Yt]||null;if(u===null)return null;a=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(a&&typeof a!="function")throw Error(i(231,o,typeof a));return a}var Ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rd=!1;if(Ir)try{var va={};Object.defineProperty(va,"passive",{get:function(){Rd=!0}}),window.addEventListener("test",va,va),window.removeEventListener("test",va,va)}catch{Rd=!1}var vo=null,jd=null,xc=null;function Uy(){if(xc)return xc;var n,o=jd,a=o.length,u,y="value"in vo?vo.value:vo.textContent,v=y.length;for(n=0;n<a&&o[n]===y[n];n++);var T=a-n;for(u=1;u<=T&&o[a-u]===y[v-u];u++);return xc=y.slice(n,1<u?1-u:void 0)}function vc(n){var o=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&o===13&&(n=13)):n=o,n===10&&(n=13),32<=n||n===13?n:0}function bc(){return!0}function Vy(){return!1}function en(n){function o(a,u,y,v,T){this._reactName=a,this._targetInst=y,this.type=u,this.nativeEvent=v,this.target=T,this.currentTarget=null;for(var I in n)n.hasOwnProperty(I)&&(a=n[I],this[I]=a?a(v):v[I]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?bc:Vy,this.isPropagationStopped=Vy,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=bc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bc)},persist:function(){},isPersistent:bc}),o}var ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wc=en(ui),ba=p({},ui,{view:0,detail:0}),sk=en(ba),Md,Od,wa,Sc=p({},ba,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==wa&&(wa&&n.type==="mousemove"?(Md=n.screenX-wa.screenX,Od=n.screenY-wa.screenY):Od=Md=0,wa=n),Md)},movementY:function(n){return"movementY"in n?n.movementY:Od}}),$y=en(Sc),ck=p({},Sc,{dataTransfer:0}),uk=en(ck),fk=p({},ba,{relatedTarget:0}),Dd=en(fk),dk=p({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),hk=en(dk),mk=p({},ui,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),pk=en(mk),gk=p({},ui,{data:0}),Yy=en(gk),yk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xk={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"},vk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bk(n){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(n):(n=vk[n])?!!o[n]:!1}function zd(){return bk}var wk=p({},ba,{key:function(n){if(n.key){var o=yk[n.key]||n.key;if(o!=="Unidentified")return o}return n.type==="keypress"?(n=vc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?xk[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(n){return n.type==="keypress"?vc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?vc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Sk=en(wk),Ek=p({},Sc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qy=en(Ek),Ck=p({},ba,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Nk=en(Ck),_k=p({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),kk=en(_k),Tk=p({},Sc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Ak=en(Tk),Rk=p({},ui,{newState:0,oldState:0}),jk=en(Rk),Mk=[9,13,27,32],Ld=Ir&&"CompositionEvent"in window,Sa=null;Ir&&"documentMode"in document&&(Sa=document.documentMode);var Ok=Ir&&"TextEvent"in window&&!Sa,Fy=Ir&&(!Ld||Sa&&8<Sa&&11>=Sa),Xy=" ",Gy=!1;function Wy(n,o){switch(n){case"keyup":return Mk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zy(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var tl=!1;function Dk(n,o){switch(n){case"compositionend":return Zy(o);case"keypress":return o.which!==32?null:(Gy=!0,Xy);case"textInput":return n=o.data,n===Xy&&Gy?null:n;default:return null}}function zk(n,o){if(tl)return n==="compositionend"||!Ld&&Wy(n,o)?(n=Uy(),xc=jd=vo=null,tl=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Fy&&o.locale!=="ko"?null:o.data;default:return null}}var Lk={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 Ky(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o==="input"?!!Lk[n.type]:o==="textarea"}function Qy(n,o,a,u){Ji?el?el.push(u):el=[u]:Ji=u,o=fu(o,"onChange"),0<o.length&&(a=new wc("onChange","change",null,a,u),n.push({event:a,listeners:o}))}var Ea=null,Ca=null;function Ik(n){Dv(n,0)}function Ec(n){var o=go(n);if(pc(o))return n}function Jy(n,o){if(n==="change")return o}var ex=!1;if(Ir){var Id;if(Ir){var Bd="oninput"in document;if(!Bd){var tx=document.createElement("div");tx.setAttribute("oninput","return;"),Bd=typeof tx.oninput=="function"}Id=Bd}else Id=!1;ex=Id&&(!document.documentMode||9<document.documentMode)}function nx(){Ea&&(Ea.detachEvent("onpropertychange",rx),Ca=Ea=null)}function rx(n){if(n.propertyName==="value"&&Ec(Ca)){var o=[];Qy(o,Ca,n,Td(n)),Py(Ik,o)}}function Bk(n,o,a){n==="focusin"?(nx(),Ea=o,Ca=a,Ea.attachEvent("onpropertychange",rx)):n==="focusout"&&nx()}function Hk(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ec(Ca)}function Pk(n,o){if(n==="click")return Ec(o)}function Uk(n,o){if(n==="input"||n==="change")return Ec(o)}function Vk(n,o){return n===o&&(n!==0||1/n===1/o)||n!==n&&o!==o}var hn=typeof Object.is=="function"?Object.is:Vk;function Na(n,o){if(hn(n,o))return!0;if(typeof n!="object"||n===null||typeof o!="object"||o===null)return!1;var a=Object.keys(n),u=Object.keys(o);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var y=a[u];if(!Vt.call(o,y)||!hn(n[y],o[y]))return!1}return!0}function ox(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function ix(n,o){var a=ox(n);n=0;for(var u;a;){if(a.nodeType===3){if(u=n+a.textContent.length,n<=o&&u>=o)return{node:a,offset:o-n};n=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ox(a)}}function lx(n,o){return n&&o?n===o?!0:n&&n.nodeType===3?!1:o&&o.nodeType===3?lx(n,o.parentNode):"contains"in n?n.contains(o):n.compareDocumentPosition?!!(n.compareDocumentPosition(o)&16):!1:!1}function ax(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var o=si(n.document);o instanceof n.HTMLIFrameElement;){try{var a=typeof o.contentWindow.location.href=="string"}catch{a=!1}if(a)n=o.contentWindow;else break;o=si(n.document)}return o}function Hd(n){var o=n&&n.nodeName&&n.nodeName.toLowerCase();return o&&(o==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||o==="textarea"||n.contentEditable==="true")}var $k=Ir&&"documentMode"in document&&11>=document.documentMode,nl=null,Pd=null,_a=null,Ud=!1;function sx(n,o,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Ud||nl==null||nl!==si(u)||(u=nl,"selectionStart"in u&&Hd(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),_a&&Na(_a,u)||(_a=u,u=fu(Pd,"onSelect"),0<u.length&&(o=new wc("onSelect","select",null,o,a),n.push({event:o,listeners:u}),o.target=nl)))}function fi(n,o){var a={};return a[n.toLowerCase()]=o.toLowerCase(),a["Webkit"+n]="webkit"+o,a["Moz"+n]="moz"+o,a}var rl={animationend:fi("Animation","AnimationEnd"),animationiteration:fi("Animation","AnimationIteration"),animationstart:fi("Animation","AnimationStart"),transitionrun:fi("Transition","TransitionRun"),transitionstart:fi("Transition","TransitionStart"),transitioncancel:fi("Transition","TransitionCancel"),transitionend:fi("Transition","TransitionEnd")},Vd={},cx={};Ir&&(cx=document.createElement("div").style,"AnimationEvent"in window||(delete rl.animationend.animation,delete rl.animationiteration.animation,delete rl.animationstart.animation),"TransitionEvent"in window||delete rl.transitionend.transition);function di(n){if(Vd[n])return Vd[n];if(!rl[n])return n;var o=rl[n],a;for(a in o)if(o.hasOwnProperty(a)&&a in cx)return Vd[n]=o[a];return n}var ux=di("animationend"),fx=di("animationiteration"),dx=di("animationstart"),Yk=di("transitionrun"),qk=di("transitionstart"),Fk=di("transitioncancel"),hx=di("transitionend"),mx=new Map,$d="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$d.push("scrollEnd");function qn(n,o){mx.set(n,o),Dr(o,[n])}var Cc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Rn=[],ol=0,Yd=0;function Nc(){for(var n=ol,o=Yd=ol=0;o<n;){var a=Rn[o];Rn[o++]=null;var u=Rn[o];Rn[o++]=null;var y=Rn[o];Rn[o++]=null;var v=Rn[o];if(Rn[o++]=null,u!==null&&y!==null){var T=u.pending;T===null?y.next=y:(y.next=T.next,T.next=y),u.pending=y}v!==0&&px(a,y,v)}}function _c(n,o,a,u){Rn[ol++]=n,Rn[ol++]=o,Rn[ol++]=a,Rn[ol++]=u,Yd|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function qd(n,o,a,u){return _c(n,o,a,u),kc(n)}function hi(n,o){return _c(n,null,null,o),kc(n)}function px(n,o,a){n.lanes|=a;var u=n.alternate;u!==null&&(u.lanes|=a);for(var y=!1,v=n.return;v!==null;)v.childLanes|=a,u=v.alternate,u!==null&&(u.childLanes|=a),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(y=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,y&&o!==null&&(y=31-Qe(a),n=v.hiddenUpdates,u=n[y],u===null?n[y]=[o]:u.push(o),o.lane=a|536870912),v):null}function kc(n){if(50<Ga)throw Ga=0,em=null,Error(i(185));for(var o=n.return;o!==null;)n=o,o=n.return;return n.tag===3?n.stateNode:null}var il={};function Xk(n,o,a,u){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(n,o,a,u){return new Xk(n,o,a,u)}function Fd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Br(n,o){var a=n.alternate;return a===null?(a=mn(n.tag,o,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=o,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&65011712,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,o=n.dependencies,a.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function gx(n,o){n.flags&=65011714;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=o,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,o=a.dependencies,n.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),n}function Tc(n,o,a,u,y,v){var T=0;if(u=n,typeof n=="function")Fd(n)&&(T=1);else if(typeof n=="string")T=QT(n,a,oe.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case H:return n=mn(31,a,o,y),n.elementType=H,n.lanes=v,n;case S:return mi(a.children,y,v,o);case _:T=8,y|=24;break;case N:return n=mn(12,a,o,y|2),n.elementType=N,n.lanes=v,n;case L:return n=mn(13,a,o,y),n.elementType=L,n.lanes=v,n;case j:return n=mn(19,a,o,y),n.elementType=j,n.lanes=v,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case C:T=10;break e;case k:T=9;break e;case A:T=11;break e;case z:T=14;break e;case P:T=16,u=null;break e}T=29,a=Error(i(130,n===null?"null":typeof n,"")),u=null}return o=mn(T,a,o,y),o.elementType=n,o.type=u,o.lanes=v,o}function mi(n,o,a,u){return n=mn(7,n,u,o),n.lanes=a,n}function Xd(n,o,a){return n=mn(6,n,null,o),n.lanes=a,n}function yx(n){var o=mn(18,null,null,0);return o.stateNode=n,o}function Gd(n,o,a){return o=mn(4,n.children!==null?n.children:[],n.key,o),o.lanes=a,o.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},o}var xx=new WeakMap;function jn(n,o){if(typeof n=="object"&&n!==null){var a=xx.get(n);return a!==void 0?a:(o={value:n,source:o,stack:fn(o)},xx.set(n,o),o)}return{value:n,source:o,stack:fn(o)}}var ll=[],al=0,Ac=null,ka=0,Mn=[],On=0,bo=null,cr=1,ur="";function Hr(n,o){ll[al++]=ka,ll[al++]=Ac,Ac=n,ka=o}function vx(n,o,a){Mn[On++]=cr,Mn[On++]=ur,Mn[On++]=bo,bo=n;var u=cr;n=ur;var y=32-Qe(u)-1;u&=~(1<<y),a+=1;var v=32-Qe(o)+y;if(30<v){var T=y-y%5;v=(u&(1<<T)-1).toString(32),u>>=T,y-=T,cr=1<<32-Qe(o)+y|a<<y|u,ur=v+n}else cr=1<<v|a<<y|u,ur=n}function Wd(n){n.return!==null&&(Hr(n,1),vx(n,1,0))}function Zd(n){for(;n===Ac;)Ac=ll[--al],ll[al]=null,ka=ll[--al],ll[al]=null;for(;n===bo;)bo=Mn[--On],Mn[On]=null,ur=Mn[--On],Mn[On]=null,cr=Mn[--On],Mn[On]=null}function bx(n,o){Mn[On++]=cr,Mn[On++]=ur,Mn[On++]=bo,cr=o.id,ur=o.overflow,bo=n}var It=null,ct=null,Ye=!1,wo=null,Dn=!1,Kd=Error(i(519));function So(n){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ta(jn(o,n)),Kd}function wx(n){var o=n.stateNode,a=n.type,u=n.memoizedProps;switch(o[jt]=n,o[Yt]=u,a){case"dialog":He("cancel",o),He("close",o);break;case"iframe":case"object":case"embed":He("load",o);break;case"video":case"audio":for(a=0;a<Za.length;a++)He(Za[a],o);break;case"source":He("error",o);break;case"img":case"image":case"link":He("error",o),He("load",o);break;case"details":He("toggle",o);break;case"input":He("invalid",o),gc(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":He("invalid",o);break;case"textarea":He("invalid",o),Ly(o,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||o.textContent===""+a||u.suppressHydrationWarning===!0||Bv(o.textContent,a)?(u.popover!=null&&(He("beforetoggle",o),He("toggle",o)),u.onScroll!=null&&He("scroll",o),u.onScrollEnd!=null&&He("scrollend",o),u.onClick!=null&&(o.onclick=Lr),o=!0):o=!1,o||So(n,!0)}function Sx(n){for(It=n.return;It;)switch(It.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:It=It.return}}function sl(n){if(n!==It)return!1;if(!Ye)return Sx(n),Ye=!0,!1;var o=n.tag,a;if((a=o!==3&&o!==27)&&((a=o===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||pm(n.type,n.memoizedProps)),a=!a),a&&ct&&So(n),Sx(n),o===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));ct=Xv(n)}else if(o===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));ct=Xv(n)}else o===27?(o=ct,Lo(n.type)?(n=bm,bm=null,ct=n):ct=o):ct=It?Ln(n.stateNode.nextSibling):null;return!0}function pi(){ct=It=null,Ye=!1}function Qd(){var n=wo;return n!==null&&(on===null?on=n:on.push.apply(on,n),wo=null),n}function Ta(n){wo===null?wo=[n]:wo.push(n)}var Jd=B(null),gi=null,Pr=null;function Eo(n,o,a){D(Jd,o._currentValue),o._currentValue=a}function Ur(n){n._currentValue=Jd.current,G(Jd)}function eh(n,o,a){for(;n!==null;){var u=n.alternate;if((n.childLanes&o)!==o?(n.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),n===a)break;n=n.return}}function th(n,o,a,u){var y=n.child;for(y!==null&&(y.return=n);y!==null;){var v=y.dependencies;if(v!==null){var T=y.child;v=v.firstContext;e:for(;v!==null;){var I=v;v=y;for(var Z=0;Z<o.length;Z++)if(I.context===o[Z]){v.lanes|=a,I=v.alternate,I!==null&&(I.lanes|=a),eh(v.return,a,n),u||(T=null);break e}v=I.next}}else if(y.tag===18){if(T=y.return,T===null)throw Error(i(341));T.lanes|=a,v=T.alternate,v!==null&&(v.lanes|=a),eh(T,a,n),T=null}else T=y.child;if(T!==null)T.return=y;else for(T=y;T!==null;){if(T===n){T=null;break}if(y=T.sibling,y!==null){y.return=T.return,T=y;break}T=T.return}y=T}}function cl(n,o,a,u){n=null;for(var y=o,v=!1;y!==null;){if(!v){if((y.flags&524288)!==0)v=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var T=y.alternate;if(T===null)throw Error(i(387));if(T=T.memoizedProps,T!==null){var I=y.type;hn(y.pendingProps.value,T.value)||(n!==null?n.push(I):n=[I])}}else if(y===te.current){if(T=y.alternate,T===null)throw Error(i(387));T.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(n!==null?n.push(ts):n=[ts])}y=y.return}n!==null&&th(o,n,a,u),o.flags|=262144}function Rc(n){for(n=n.firstContext;n!==null;){if(!hn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function yi(n){gi=n,Pr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Bt(n){return Ex(gi,n)}function jc(n,o){return gi===null&&yi(n),Ex(n,o)}function Ex(n,o){var a=o._currentValue;if(o={context:o,memoizedValue:a,next:null},Pr===null){if(n===null)throw Error(i(308));Pr=o,n.dependencies={lanes:0,firstContext:o},n.flags|=524288}else Pr=Pr.next=o;return a}var Gk=typeof AbortController<"u"?AbortController:function(){var n=[],o=this.signal={aborted:!1,addEventListener:function(a,u){n.push(u)}};this.abort=function(){o.aborted=!0,n.forEach(function(a){return a()})}},Wk=e.unstable_scheduleCallback,Zk=e.unstable_NormalPriority,Ct={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nh(){return{controller:new Gk,data:new Map,refCount:0}}function Aa(n){n.refCount--,n.refCount===0&&Wk(Zk,function(){n.controller.abort()})}var Ra=null,rh=0,ul=0,fl=null;function Kk(n,o){if(Ra===null){var a=Ra=[];rh=0,ul=lm(),fl={status:"pending",value:void 0,then:function(u){a.push(u)}}}return rh++,o.then(Cx,Cx),o}function Cx(){if(--rh===0&&Ra!==null){fl!==null&&(fl.status="fulfilled");var n=Ra;Ra=null,ul=0,fl=null;for(var o=0;o<n.length;o++)(0,n[o])()}}function Qk(n,o){var a=[],u={status:"pending",value:null,reason:null,then:function(y){a.push(y)}};return n.then(function(){u.status="fulfilled",u.value=o;for(var y=0;y<a.length;y++)(0,a[y])(o)},function(y){for(u.status="rejected",u.reason=y,y=0;y<a.length;y++)(0,a[y])(void 0)}),u}var Nx=R.S;R.S=function(n,o){sv=Rt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&Kk(n,o),Nx!==null&&Nx(n,o)};var xi=B(null);function oh(){var n=xi.current;return n!==null?n:ot.pooledCache}function Mc(n,o){o===null?D(xi,xi.current):D(xi,o.pool)}function _x(){var n=oh();return n===null?null:{parent:Ct._currentValue,pool:n}}var dl=Error(i(460)),ih=Error(i(474)),Oc=Error(i(542)),Dc={then:function(){}};function kx(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Tx(n,o,a){switch(a=n[a],a===void 0?n.push(o):a!==o&&(o.then(Lr,Lr),o=a),o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,Rx(n),n;default:if(typeof o.status=="string")o.then(Lr,Lr);else{if(n=ot,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=o,n.status="pending",n.then(function(u){if(o.status==="pending"){var y=o;y.status="fulfilled",y.value=u}},function(u){if(o.status==="pending"){var y=o;y.status="rejected",y.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw n=o.reason,Rx(n),n}throw bi=o,dl}}function vi(n){try{var o=n._init;return o(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(bi=a,dl):a}}var bi=null;function Ax(){if(bi===null)throw Error(i(459));var n=bi;return bi=null,n}function Rx(n){if(n===dl||n===Oc)throw Error(i(483))}var hl=null,ja=0;function zc(n){var o=ja;return ja+=1,hl===null&&(hl=[]),Tx(hl,n,o)}function Ma(n,o){o=o.props.ref,n.ref=o!==void 0?o:null}function Lc(n,o){throw o.$$typeof===x?Error(i(525)):(n=Object.prototype.toString.call(o),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":n)))}function jx(n){function o(ee,Q){if(n){var re=ee.deletions;re===null?(ee.deletions=[Q],ee.flags|=16):re.push(Q)}}function a(ee,Q){if(!n)return null;for(;Q!==null;)o(ee,Q),Q=Q.sibling;return null}function u(ee){for(var Q=new Map;ee!==null;)ee.key!==null?Q.set(ee.key,ee):Q.set(ee.index,ee),ee=ee.sibling;return Q}function y(ee,Q){return ee=Br(ee,Q),ee.index=0,ee.sibling=null,ee}function v(ee,Q,re){return ee.index=re,n?(re=ee.alternate,re!==null?(re=re.index,re<Q?(ee.flags|=67108866,Q):re):(ee.flags|=67108866,Q)):(ee.flags|=1048576,Q)}function T(ee){return n&&ee.alternate===null&&(ee.flags|=67108866),ee}function I(ee,Q,re,fe){return Q===null||Q.tag!==6?(Q=Xd(re,ee.mode,fe),Q.return=ee,Q):(Q=y(Q,re),Q.return=ee,Q)}function Z(ee,Q,re,fe){var Ne=re.type;return Ne===S?ue(ee,Q,re.props.children,fe,re.key):Q!==null&&(Q.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===P&&vi(Ne)===Q.type)?(Q=y(Q,re.props),Ma(Q,re),Q.return=ee,Q):(Q=Tc(re.type,re.key,re.props,null,ee.mode,fe),Ma(Q,re),Q.return=ee,Q)}function ie(ee,Q,re,fe){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==re.containerInfo||Q.stateNode.implementation!==re.implementation?(Q=Gd(re,ee.mode,fe),Q.return=ee,Q):(Q=y(Q,re.children||[]),Q.return=ee,Q)}function ue(ee,Q,re,fe,Ne){return Q===null||Q.tag!==7?(Q=mi(re,ee.mode,fe,Ne),Q.return=ee,Q):(Q=y(Q,re),Q.return=ee,Q)}function de(ee,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Xd(""+Q,ee.mode,re),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return re=Tc(Q.type,Q.key,Q.props,null,ee.mode,re),Ma(re,Q),re.return=ee,re;case E:return Q=Gd(Q,ee.mode,re),Q.return=ee,Q;case P:return Q=vi(Q),de(ee,Q,re)}if(U(Q)||F(Q))return Q=mi(Q,ee.mode,re,null),Q.return=ee,Q;if(typeof Q.then=="function")return de(ee,zc(Q),re);if(Q.$$typeof===C)return de(ee,jc(ee,Q),re);Lc(ee,Q)}return null}function le(ee,Q,re,fe){var Ne=Q!==null?Q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ne!==null?null:I(ee,Q,""+re,fe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===Ne?Z(ee,Q,re,fe):null;case E:return re.key===Ne?ie(ee,Q,re,fe):null;case P:return re=vi(re),le(ee,Q,re,fe)}if(U(re)||F(re))return Ne!==null?null:ue(ee,Q,re,fe,null);if(typeof re.then=="function")return le(ee,Q,zc(re),fe);if(re.$$typeof===C)return le(ee,Q,jc(ee,re),fe);Lc(ee,re)}return null}function ae(ee,Q,re,fe,Ne){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return ee=ee.get(re)||null,I(Q,ee,""+fe,Ne);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case b:return ee=ee.get(fe.key===null?re:fe.key)||null,Z(Q,ee,fe,Ne);case E:return ee=ee.get(fe.key===null?re:fe.key)||null,ie(Q,ee,fe,Ne);case P:return fe=vi(fe),ae(ee,Q,re,fe,Ne)}if(U(fe)||F(fe))return ee=ee.get(re)||null,ue(Q,ee,fe,Ne,null);if(typeof fe.then=="function")return ae(ee,Q,re,zc(fe),Ne);if(fe.$$typeof===C)return ae(ee,Q,re,jc(Q,fe),Ne);Lc(Q,fe)}return null}function be(ee,Q,re,fe){for(var Ne=null,Xe=null,Ee=Q,De=Q=0,Ve=null;Ee!==null&&De<re.length;De++){Ee.index>De?(Ve=Ee,Ee=null):Ve=Ee.sibling;var Ge=le(ee,Ee,re[De],fe);if(Ge===null){Ee===null&&(Ee=Ve);break}n&&Ee&&Ge.alternate===null&&o(ee,Ee),Q=v(Ge,Q,De),Xe===null?Ne=Ge:Xe.sibling=Ge,Xe=Ge,Ee=Ve}if(De===re.length)return a(ee,Ee),Ye&&Hr(ee,De),Ne;if(Ee===null){for(;De<re.length;De++)Ee=de(ee,re[De],fe),Ee!==null&&(Q=v(Ee,Q,De),Xe===null?Ne=Ee:Xe.sibling=Ee,Xe=Ee);return Ye&&Hr(ee,De),Ne}for(Ee=u(Ee);De<re.length;De++)Ve=ae(Ee,ee,De,re[De],fe),Ve!==null&&(n&&Ve.alternate!==null&&Ee.delete(Ve.key===null?De:Ve.key),Q=v(Ve,Q,De),Xe===null?Ne=Ve:Xe.sibling=Ve,Xe=Ve);return n&&Ee.forEach(function(Uo){return o(ee,Uo)}),Ye&&Hr(ee,De),Ne}function Te(ee,Q,re,fe){if(re==null)throw Error(i(151));for(var Ne=null,Xe=null,Ee=Q,De=Q=0,Ve=null,Ge=re.next();Ee!==null&&!Ge.done;De++,Ge=re.next()){Ee.index>De?(Ve=Ee,Ee=null):Ve=Ee.sibling;var Uo=le(ee,Ee,Ge.value,fe);if(Uo===null){Ee===null&&(Ee=Ve);break}n&&Ee&&Uo.alternate===null&&o(ee,Ee),Q=v(Uo,Q,De),Xe===null?Ne=Uo:Xe.sibling=Uo,Xe=Uo,Ee=Ve}if(Ge.done)return a(ee,Ee),Ye&&Hr(ee,De),Ne;if(Ee===null){for(;!Ge.done;De++,Ge=re.next())Ge=de(ee,Ge.value,fe),Ge!==null&&(Q=v(Ge,Q,De),Xe===null?Ne=Ge:Xe.sibling=Ge,Xe=Ge);return Ye&&Hr(ee,De),Ne}for(Ee=u(Ee);!Ge.done;De++,Ge=re.next())Ge=ae(Ee,ee,De,Ge.value,fe),Ge!==null&&(n&&Ge.alternate!==null&&Ee.delete(Ge.key===null?De:Ge.key),Q=v(Ge,Q,De),Xe===null?Ne=Ge:Xe.sibling=Ge,Xe=Ge);return n&&Ee.forEach(function(cA){return o(ee,cA)}),Ye&&Hr(ee,De),Ne}function rt(ee,Q,re,fe){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var Ne=re.key;Q!==null;){if(Q.key===Ne){if(Ne=re.type,Ne===S){if(Q.tag===7){a(ee,Q.sibling),fe=y(Q,re.props.children),fe.return=ee,ee=fe;break e}}else if(Q.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===P&&vi(Ne)===Q.type){a(ee,Q.sibling),fe=y(Q,re.props),Ma(fe,re),fe.return=ee,ee=fe;break e}a(ee,Q);break}else o(ee,Q);Q=Q.sibling}re.type===S?(fe=mi(re.props.children,ee.mode,fe,re.key),fe.return=ee,ee=fe):(fe=Tc(re.type,re.key,re.props,null,ee.mode,fe),Ma(fe,re),fe.return=ee,ee=fe)}return T(ee);case E:e:{for(Ne=re.key;Q!==null;){if(Q.key===Ne)if(Q.tag===4&&Q.stateNode.containerInfo===re.containerInfo&&Q.stateNode.implementation===re.implementation){a(ee,Q.sibling),fe=y(Q,re.children||[]),fe.return=ee,ee=fe;break e}else{a(ee,Q);break}else o(ee,Q);Q=Q.sibling}fe=Gd(re,ee.mode,fe),fe.return=ee,ee=fe}return T(ee);case P:return re=vi(re),rt(ee,Q,re,fe)}if(U(re))return be(ee,Q,re,fe);if(F(re)){if(Ne=F(re),typeof Ne!="function")throw Error(i(150));return re=Ne.call(re),Te(ee,Q,re,fe)}if(typeof re.then=="function")return rt(ee,Q,zc(re),fe);if(re.$$typeof===C)return rt(ee,Q,jc(ee,re),fe);Lc(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Q!==null&&Q.tag===6?(a(ee,Q.sibling),fe=y(Q,re),fe.return=ee,ee=fe):(a(ee,Q),fe=Xd(re,ee.mode,fe),fe.return=ee,ee=fe),T(ee)):a(ee,Q)}return function(ee,Q,re,fe){try{ja=0;var Ne=rt(ee,Q,re,fe);return hl=null,Ne}catch(Ee){if(Ee===dl||Ee===Oc)throw Ee;var Xe=mn(29,Ee,null,ee.mode);return Xe.lanes=fe,Xe.return=ee,Xe}}}var wi=jx(!0),Mx=jx(!1),Co=!1;function lh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ah(n,o){n=n.updateQueue,o.updateQueue===n&&(o.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function No(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function _o(n,o,a){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Ze&2)!==0){var y=u.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),u.pending=o,o=kc(n),px(n,null,a),o}return _c(n,u,o,a),kc(n)}function Oa(n,o,a){if(o=o.updateQueue,o!==null&&(o=o.shared,(a&4194048)!==0)){var u=o.lanes;u&=n.pendingLanes,a|=u,o.lanes=a,ic(n,a)}}function sh(n,o){var a=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var y=null,v=null;if(a=a.firstBaseUpdate,a!==null){do{var T={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};v===null?y=v=T:v=v.next=T,a=a.next}while(a!==null);v===null?y=v=o:v=v.next=o}else y=v=o;a={baseState:u.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=o:n.next=o,a.lastBaseUpdate=o}var ch=!1;function Da(){if(ch){var n=fl;if(n!==null)throw n}}function za(n,o,a,u){ch=!1;var y=n.updateQueue;Co=!1;var v=y.firstBaseUpdate,T=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var Z=I,ie=Z.next;Z.next=null,T===null?v=ie:T.next=ie,T=Z;var ue=n.alternate;ue!==null&&(ue=ue.updateQueue,I=ue.lastBaseUpdate,I!==T&&(I===null?ue.firstBaseUpdate=ie:I.next=ie,ue.lastBaseUpdate=Z))}if(v!==null){var de=y.baseState;T=0,ue=ie=Z=null,I=v;do{var le=I.lane&-536870913,ae=le!==I.lane;if(ae?(Ue&le)===le:(u&le)===le){le!==0&&le===ul&&(ch=!0),ue!==null&&(ue=ue.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var be=n,Te=I;le=o;var rt=a;switch(Te.tag){case 1:if(be=Te.payload,typeof be=="function"){de=be.call(rt,de,le);break e}de=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Te.payload,le=typeof be=="function"?be.call(rt,de,le):be,le==null)break e;de=p({},de,le);break e;case 2:Co=!0}}le=I.callback,le!==null&&(n.flags|=64,ae&&(n.flags|=8192),ae=y.callbacks,ae===null?y.callbacks=[le]:ae.push(le))}else ae={lane:le,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ue===null?(ie=ue=ae,Z=de):ue=ue.next=ae,T|=le;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;ae=I,I=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);ue===null&&(Z=de),y.baseState=Z,y.firstBaseUpdate=ie,y.lastBaseUpdate=ue,v===null&&(y.shared.lanes=0),jo|=T,n.lanes=T,n.memoizedState=de}}function Ox(n,o){if(typeof n!="function")throw Error(i(191,n));n.call(o)}function Dx(n,o){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)Ox(a[n],o)}var ml=B(null),Ic=B(0);function zx(n,o){n=Zr,D(Ic,n),D(ml,o),Zr=n|o.baseLanes}function uh(){D(Ic,Zr),D(ml,ml.current)}function fh(){Zr=Ic.current,G(ml),G(Ic)}var pn=B(null),zn=null;function ko(n){var o=n.alternate;D(bt,bt.current&1),D(pn,n),zn===null&&(o===null||ml.current!==null||o.memoizedState!==null)&&(zn=n)}function dh(n){D(bt,bt.current),D(pn,n),zn===null&&(zn=n)}function Lx(n){n.tag===22?(D(bt,bt.current),D(pn,n),zn===null&&(zn=n)):To()}function To(){D(bt,bt.current),D(pn,pn.current)}function gn(n){G(pn),zn===n&&(zn=null),G(bt)}var bt=B(0);function Bc(n){for(var o=n;o!==null;){if(o.tag===13){var a=o.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xm(a)||vm(a)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Vr=0,Me=null,tt=null,Nt=null,Hc=!1,pl=!1,Si=!1,Pc=0,La=0,gl=null,Jk=0;function gt(){throw Error(i(321))}function hh(n,o){if(o===null)return!1;for(var a=0;a<o.length&&a<n.length;a++)if(!hn(n[a],o[a]))return!1;return!0}function mh(n,o,a,u,y,v){return Vr=v,Me=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,R.H=n===null||n.memoizedState===null?v0:Ah,Si=!1,v=a(u,y),Si=!1,pl&&(v=Bx(o,a,u,y)),Ix(n),v}function Ix(n){R.H=Ha;var o=tt!==null&&tt.next!==null;if(Vr=0,Nt=tt=Me=null,Hc=!1,La=0,gl=null,o)throw Error(i(300));n===null||_t||(n=n.dependencies,n!==null&&Rc(n)&&(_t=!0))}function Bx(n,o,a,u){Me=n;var y=0;do{if(pl&&(gl=null),La=0,pl=!1,25<=y)throw Error(i(301));if(y+=1,Nt=tt=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}R.H=b0,v=o(a,u)}while(pl);return v}function eT(){var n=R.H,o=n.useState()[0];return o=typeof o.then=="function"?Ia(o):o,n=n.useState()[0],(tt!==null?tt.memoizedState:null)!==n&&(Me.flags|=1024),o}function ph(){var n=Pc!==0;return Pc=0,n}function gh(n,o,a){o.updateQueue=n.updateQueue,o.flags&=-2053,n.lanes&=~a}function yh(n){if(Hc){for(n=n.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Hc=!1}Vr=0,Nt=tt=Me=null,pl=!1,La=Pc=0,gl=null}function Gt(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?Me.memoizedState=Nt=n:Nt=Nt.next=n,Nt}function wt(){if(tt===null){var n=Me.alternate;n=n!==null?n.memoizedState:null}else n=tt.next;var o=Nt===null?Me.memoizedState:Nt.next;if(o!==null)Nt=o,tt=n;else{if(n===null)throw Me.alternate===null?Error(i(467)):Error(i(310));tt=n,n={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Nt===null?Me.memoizedState=Nt=n:Nt=Nt.next=n}return Nt}function Uc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ia(n){var o=La;return La+=1,gl===null&&(gl=[]),n=Tx(gl,n,o),o=Me,(Nt===null?o.memoizedState:Nt.next)===null&&(o=o.alternate,R.H=o===null||o.memoizedState===null?v0:Ah),n}function Vc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Ia(n);if(n.$$typeof===C)return Bt(n)}throw Error(i(438,String(n)))}function xh(n){var o=null,a=Me.updateQueue;if(a!==null&&(o=a.memoCache),o==null){var u=Me.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(y){return y.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),a===null&&(a=Uc(),Me.updateQueue=a),a.memoCache=o,a=o.data[o.index],a===void 0)for(a=o.data[o.index]=Array(n),u=0;u<n;u++)a[u]=X;return o.index++,a}function $r(n,o){return typeof o=="function"?o(n):o}function $c(n){var o=wt();return vh(o,tt,n)}function vh(n,o,a){var u=n.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=a;var y=n.baseQueue,v=u.pending;if(v!==null){if(y!==null){var T=y.next;y.next=v.next,v.next=T}o.baseQueue=y=v,u.pending=null}if(v=n.baseState,y===null)n.memoizedState=v;else{o=y.next;var I=T=null,Z=null,ie=o,ue=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Ue&de)===de:(Vr&de)===de){var le=ie.revertLane;if(le===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===ul&&(ue=!0);else if((Vr&le)===le){ie=ie.next,le===ul&&(ue=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(I=Z=de,T=v):Z=Z.next=de,Me.lanes|=le,jo|=le;de=ie.action,Si&&a(v,de),v=ie.hasEagerState?ie.eagerState:a(v,de)}else le={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(I=Z=le,T=v):Z=Z.next=le,Me.lanes|=de,jo|=de;ie=ie.next}while(ie!==null&&ie!==o);if(Z===null?T=v:Z.next=I,!hn(v,n.memoizedState)&&(_t=!0,ue&&(a=fl,a!==null)))throw a;n.memoizedState=v,n.baseState=T,n.baseQueue=Z,u.lastRenderedState=v}return y===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function bh(n){var o=wt(),a=o.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var u=a.dispatch,y=a.pending,v=o.memoizedState;if(y!==null){a.pending=null;var T=y=y.next;do v=n(v,T.action),T=T.next;while(T!==y);hn(v,o.memoizedState)||(_t=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),a.lastRenderedState=v}return[v,u]}function Hx(n,o,a){var u=Me,y=wt(),v=Ye;if(v){if(a===void 0)throw Error(i(407));a=a()}else a=o();var T=!hn((tt||y).memoizedState,a);if(T&&(y.memoizedState=a,_t=!0),y=y.queue,Eh(Vx.bind(null,u,y,n),[n]),y.getSnapshot!==o||T||Nt!==null&&Nt.memoizedState.tag&1){if(u.flags|=2048,yl(9,{destroy:void 0},Ux.bind(null,u,y,a,o),null),ot===null)throw Error(i(349));v||(Vr&127)!==0||Px(u,o,a)}return a}function Px(n,o,a){n.flags|=16384,n={getSnapshot:o,value:a},o=Me.updateQueue,o===null?(o=Uc(),Me.updateQueue=o,o.stores=[n]):(a=o.stores,a===null?o.stores=[n]:a.push(n))}function Ux(n,o,a,u){o.value=a,o.getSnapshot=u,$x(o)&&Yx(n)}function Vx(n,o,a){return a(function(){$x(o)&&Yx(n)})}function $x(n){var o=n.getSnapshot;n=n.value;try{var a=o();return!hn(n,a)}catch{return!0}}function Yx(n){var o=hi(n,2);o!==null&&ln(o,n,2)}function wh(n){var o=Gt();if(typeof n=="function"){var a=n;if(n=a(),Si){$t(!0);try{a()}finally{$t(!1)}}}return o.memoizedState=o.baseState=n,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:n},o}function qx(n,o,a,u){return n.baseState=a,vh(n,tt,typeof u=="function"?u:$r)}function tT(n,o,a,u,y){if(Fc(n))throw Error(i(485));if(n=o.action,n!==null){var v={payload:y,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){v.listeners.push(T)}};R.T!==null?a(!0):v.isTransition=!1,u(v),a=o.pending,a===null?(v.next=o.pending=v,Fx(o,v)):(v.next=a.next,o.pending=a.next=v)}}function Fx(n,o){var a=o.action,u=o.payload,y=n.state;if(o.isTransition){var v=R.T,T={};R.T=T;try{var I=a(y,u),Z=R.S;Z!==null&&Z(T,I),Xx(n,o,I)}catch(ie){Sh(n,o,ie)}finally{v!==null&&T.types!==null&&(v.types=T.types),R.T=v}}else try{v=a(y,u),Xx(n,o,v)}catch(ie){Sh(n,o,ie)}}function Xx(n,o,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){Gx(n,o,u)},function(u){return Sh(n,o,u)}):Gx(n,o,a)}function Gx(n,o,a){o.status="fulfilled",o.value=a,Wx(o),n.state=a,o=n.pending,o!==null&&(a=o.next,a===o?n.pending=null:(a=a.next,o.next=a,Fx(n,a)))}function Sh(n,o,a){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=a,Wx(o),o=o.next;while(o!==u)}n.action=null}function Wx(n){n=n.listeners;for(var o=0;o<n.length;o++)(0,n[o])()}function Zx(n,o){return o}function Kx(n,o){if(Ye){var a=ot.formState;if(a!==null){e:{var u=Me;if(Ye){if(ct){t:{for(var y=ct,v=Dn;y.nodeType!==8;){if(!v){y=null;break t}if(y=Ln(y.nextSibling),y===null){y=null;break t}}v=y.data,y=v==="F!"||v==="F"?y:null}if(y){ct=Ln(y.nextSibling),u=y.data==="F!";break e}}So(u)}u=!1}u&&(o=a[0])}}return a=Gt(),a.memoizedState=a.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zx,lastRenderedState:o},a.queue=u,a=g0.bind(null,Me,u),u.dispatch=a,u=wh(!1),v=Th.bind(null,Me,!1,u.queue),u=Gt(),y={state:o,dispatch:null,action:n,pending:null},u.queue=y,a=tT.bind(null,Me,y,v,a),y.dispatch=a,u.memoizedState=n,[o,a,!1]}function Qx(n){var o=wt();return Jx(o,tt,n)}function Jx(n,o,a){if(o=vh(n,o,Zx)[0],n=$c($r)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Ia(o)}catch(T){throw T===dl?Oc:T}else u=o;o=wt();var y=o.queue,v=y.dispatch;return a!==o.memoizedState&&(Me.flags|=2048,yl(9,{destroy:void 0},nT.bind(null,y,a),null)),[u,v,n]}function nT(n,o){n.action=o}function e0(n){var o=wt(),a=tt;if(a!==null)return Jx(o,a,n);wt(),o=o.memoizedState,a=wt();var u=a.queue.dispatch;return a.memoizedState=n,[o,u,!1]}function yl(n,o,a,u){return n={tag:n,create:a,deps:u,inst:o,next:null},o=Me.updateQueue,o===null&&(o=Uc(),Me.updateQueue=o),a=o.lastEffect,a===null?o.lastEffect=n.next=n:(u=a.next,a.next=n,n.next=u,o.lastEffect=n),n}function t0(){return wt().memoizedState}function Yc(n,o,a,u){var y=Gt();Me.flags|=n,y.memoizedState=yl(1|o,{destroy:void 0},a,u===void 0?null:u)}function qc(n,o,a,u){var y=wt();u=u===void 0?null:u;var v=y.memoizedState.inst;tt!==null&&u!==null&&hh(u,tt.memoizedState.deps)?y.memoizedState=yl(o,v,a,u):(Me.flags|=n,y.memoizedState=yl(1|o,v,a,u))}function n0(n,o){Yc(8390656,8,n,o)}function Eh(n,o){qc(2048,8,n,o)}function rT(n){Me.flags|=4;var o=Me.updateQueue;if(o===null)o=Uc(),Me.updateQueue=o,o.events=[n];else{var a=o.events;a===null?o.events=[n]:a.push(n)}}function r0(n){var o=wt().memoizedState;return rT({ref:o,nextImpl:n}),function(){if((Ze&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function o0(n,o){return qc(4,2,n,o)}function i0(n,o){return qc(4,4,n,o)}function l0(n,o){if(typeof o=="function"){n=n();var a=o(n);return function(){typeof a=="function"?a():o(null)}}if(o!=null)return n=n(),o.current=n,function(){o.current=null}}function a0(n,o,a){a=a!=null?a.concat([n]):null,qc(4,4,l0.bind(null,o,n),a)}function Ch(){}function s0(n,o){var a=wt();o=o===void 0?null:o;var u=a.memoizedState;return o!==null&&hh(o,u[1])?u[0]:(a.memoizedState=[n,o],n)}function c0(n,o){var a=wt();o=o===void 0?null:o;var u=a.memoizedState;if(o!==null&&hh(o,u[1]))return u[0];if(u=n(),Si){$t(!0);try{n()}finally{$t(!1)}}return a.memoizedState=[u,o],u}function Nh(n,o,a){return a===void 0||(Vr&1073741824)!==0&&(Ue&261930)===0?n.memoizedState=o:(n.memoizedState=a,n=uv(),Me.lanes|=n,jo|=n,a)}function u0(n,o,a,u){return hn(a,o)?a:ml.current!==null?(n=Nh(n,a,u),hn(n,o)||(_t=!0),n):(Vr&42)===0||(Vr&1073741824)!==0&&(Ue&261930)===0?(_t=!0,n.memoizedState=a):(n=uv(),Me.lanes|=n,jo|=n,o)}function f0(n,o,a,u,y){var v=V.p;V.p=v!==0&&8>v?v:8;var T=R.T,I={};R.T=I,Th(n,!1,o,a);try{var Z=y(),ie=R.S;if(ie!==null&&ie(I,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ue=Qk(Z,u);Ba(n,o,ue,vn(n))}else Ba(n,o,u,vn(n))}catch(de){Ba(n,o,{then:function(){},status:"rejected",reason:de},vn())}finally{V.p=v,T!==null&&I.types!==null&&(T.types=I.types),R.T=T}}function oT(){}function _h(n,o,a,u){if(n.tag!==5)throw Error(i(476));var y=d0(n).queue;f0(n,y,o,$,a===null?oT:function(){return h0(n),a(u)})}function d0(n){var o=n.memoizedState;if(o!==null)return o;o={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:$},next:null};var a={};return o.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:a},next:null},n.memoizedState=o,n=n.alternate,n!==null&&(n.memoizedState=o),o}function h0(n){var o=d0(n);o.next===null&&(o=n.alternate.memoizedState),Ba(n,o.next.queue,{},vn())}function kh(){return Bt(ts)}function m0(){return wt().memoizedState}function p0(){return wt().memoizedState}function iT(n){for(var o=n.return;o!==null;){switch(o.tag){case 24:case 3:var a=vn();n=No(a);var u=_o(o,n,a);u!==null&&(ln(u,o,a),Oa(u,o,a)),o={cache:nh()},n.payload=o;return}o=o.return}}function lT(n,o,a){var u=vn();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Fc(n)?y0(o,a):(a=qd(n,o,a,u),a!==null&&(ln(a,n,u),x0(a,o,u)))}function g0(n,o,a){var u=vn();Ba(n,o,a,u)}function Ba(n,o,a,u){var y={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Fc(n))y0(o,y);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var T=o.lastRenderedState,I=v(T,a);if(y.hasEagerState=!0,y.eagerState=I,hn(I,T))return _c(n,o,y,0),ot===null&&Nc(),!1}catch{}if(a=qd(n,o,y,u),a!==null)return ln(a,n,u),x0(a,o,u),!0}return!1}function Th(n,o,a,u){if(u={lane:2,revertLane:lm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Fc(n)){if(o)throw Error(i(479))}else o=qd(n,a,u,2),o!==null&&ln(o,n,2)}function Fc(n){var o=n.alternate;return n===Me||o!==null&&o===Me}function y0(n,o){pl=Hc=!0;var a=n.pending;a===null?o.next=o:(o.next=a.next,a.next=o),n.pending=o}function x0(n,o,a){if((a&4194048)!==0){var u=o.lanes;u&=n.pendingLanes,a|=u,o.lanes=a,ic(n,a)}}var Ha={readContext:Bt,use:Vc,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Ha.useEffectEvent=gt;var v0={readContext:Bt,use:Vc,useCallback:function(n,o){return Gt().memoizedState=[n,o===void 0?null:o],n},useContext:Bt,useEffect:n0,useImperativeHandle:function(n,o,a){a=a!=null?a.concat([n]):null,Yc(4194308,4,l0.bind(null,o,n),a)},useLayoutEffect:function(n,o){return Yc(4194308,4,n,o)},useInsertionEffect:function(n,o){Yc(4,2,n,o)},useMemo:function(n,o){var a=Gt();o=o===void 0?null:o;var u=n();if(Si){$t(!0);try{n()}finally{$t(!1)}}return a.memoizedState=[u,o],u},useReducer:function(n,o,a){var u=Gt();if(a!==void 0){var y=a(o);if(Si){$t(!0);try{a(o)}finally{$t(!1)}}}else y=o;return u.memoizedState=u.baseState=y,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:y},u.queue=n,n=n.dispatch=lT.bind(null,Me,n),[u.memoizedState,n]},useRef:function(n){var o=Gt();return n={current:n},o.memoizedState=n},useState:function(n){n=wh(n);var o=n.queue,a=g0.bind(null,Me,o);return o.dispatch=a,[n.memoizedState,a]},useDebugValue:Ch,useDeferredValue:function(n,o){var a=Gt();return Nh(a,n,o)},useTransition:function(){var n=wh(!1);return n=f0.bind(null,Me,n.queue,!0,!1),Gt().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,o,a){var u=Me,y=Gt();if(Ye){if(a===void 0)throw Error(i(407));a=a()}else{if(a=o(),ot===null)throw Error(i(349));(Ue&127)!==0||Px(u,o,a)}y.memoizedState=a;var v={value:a,getSnapshot:o};return y.queue=v,n0(Vx.bind(null,u,v,n),[n]),u.flags|=2048,yl(9,{destroy:void 0},Ux.bind(null,u,v,a,o),null),a},useId:function(){var n=Gt(),o=ot.identifierPrefix;if(Ye){var a=ur,u=cr;a=(u&~(1<<32-Qe(u)-1)).toString(32)+a,o="_"+o+"R_"+a,a=Pc++,0<a&&(o+="H"+a.toString(32)),o+="_"}else a=Jk++,o="_"+o+"r_"+a.toString(32)+"_";return n.memoizedState=o},useHostTransitionStatus:kh,useFormState:Kx,useActionState:Kx,useOptimistic:function(n){var o=Gt();o.memoizedState=o.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=a,o=Th.bind(null,Me,!0,a),a.dispatch=o,[n,o]},useMemoCache:xh,useCacheRefresh:function(){return Gt().memoizedState=iT.bind(null,Me)},useEffectEvent:function(n){var o=Gt(),a={impl:n};return o.memoizedState=a,function(){if((Ze&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Ah={readContext:Bt,use:Vc,useCallback:s0,useContext:Bt,useEffect:Eh,useImperativeHandle:a0,useInsertionEffect:o0,useLayoutEffect:i0,useMemo:c0,useReducer:$c,useRef:t0,useState:function(){return $c($r)},useDebugValue:Ch,useDeferredValue:function(n,o){var a=wt();return u0(a,tt.memoizedState,n,o)},useTransition:function(){var n=$c($r)[0],o=wt().memoizedState;return[typeof n=="boolean"?n:Ia(n),o]},useSyncExternalStore:Hx,useId:m0,useHostTransitionStatus:kh,useFormState:Qx,useActionState:Qx,useOptimistic:function(n,o){var a=wt();return qx(a,tt,n,o)},useMemoCache:xh,useCacheRefresh:p0};Ah.useEffectEvent=r0;var b0={readContext:Bt,use:Vc,useCallback:s0,useContext:Bt,useEffect:Eh,useImperativeHandle:a0,useInsertionEffect:o0,useLayoutEffect:i0,useMemo:c0,useReducer:bh,useRef:t0,useState:function(){return bh($r)},useDebugValue:Ch,useDeferredValue:function(n,o){var a=wt();return tt===null?Nh(a,n,o):u0(a,tt.memoizedState,n,o)},useTransition:function(){var n=bh($r)[0],o=wt().memoizedState;return[typeof n=="boolean"?n:Ia(n),o]},useSyncExternalStore:Hx,useId:m0,useHostTransitionStatus:kh,useFormState:e0,useActionState:e0,useOptimistic:function(n,o){var a=wt();return tt!==null?qx(a,tt,n,o):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:xh,useCacheRefresh:p0};b0.useEffectEvent=r0;function Rh(n,o,a,u){o=n.memoizedState,a=a(u,o),a=a==null?o:p({},o,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var jh={enqueueSetState:function(n,o,a){n=n._reactInternals;var u=vn(),y=No(u);y.payload=o,a!=null&&(y.callback=a),o=_o(n,y,u),o!==null&&(ln(o,n,u),Oa(o,n,u))},enqueueReplaceState:function(n,o,a){n=n._reactInternals;var u=vn(),y=No(u);y.tag=1,y.payload=o,a!=null&&(y.callback=a),o=_o(n,y,u),o!==null&&(ln(o,n,u),Oa(o,n,u))},enqueueForceUpdate:function(n,o){n=n._reactInternals;var a=vn(),u=No(a);u.tag=2,o!=null&&(u.callback=o),o=_o(n,u,a),o!==null&&(ln(o,n,a),Oa(o,n,a))}};function w0(n,o,a,u,y,v,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,v,T):o.prototype&&o.prototype.isPureReactComponent?!Na(a,u)||!Na(y,v):!0}function S0(n,o,a,u){n=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(a,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(a,u),o.state!==n&&jh.enqueueReplaceState(o,o.state,null)}function Ei(n,o){var a=o;if("ref"in o){a={};for(var u in o)u!=="ref"&&(a[u]=o[u])}if(n=n.defaultProps){a===o&&(a=p({},a));for(var y in n)a[y]===void 0&&(a[y]=n[y])}return a}function E0(n){Cc(n)}function C0(n){console.error(n)}function N0(n){Cc(n)}function Xc(n,o){try{var a=n.onUncaughtError;a(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function _0(n,o,a){try{var u=n.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Mh(n,o,a){return a=No(a),a.tag=3,a.payload={element:null},a.callback=function(){Xc(n,o)},a}function k0(n){return n=No(n),n.tag=3,n}function T0(n,o,a,u){var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var v=u.value;n.payload=function(){return y(v)},n.callback=function(){_0(o,a,u)}}var T=a.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){_0(o,a,u),typeof y!="function"&&(Mo===null?Mo=new Set([this]):Mo.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})})}function aT(n,o,a,u,y){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=a.alternate,o!==null&&cl(o,a,y,!0),a=pn.current,a!==null){switch(a.tag){case 31:case 13:return zn===null?iu():a.alternate===null&&yt===0&&(yt=3),a.flags&=-257,a.flags|=65536,a.lanes=y,u===Dc?a.flags|=16384:(o=a.updateQueue,o===null?a.updateQueue=new Set([u]):o.add(u),rm(n,u,y)),!1;case 22:return a.flags|=65536,u===Dc?a.flags|=16384:(o=a.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=o):(a=o.retryQueue,a===null?o.retryQueue=new Set([u]):a.add(u)),rm(n,u,y)),!1}throw Error(i(435,a.tag))}return rm(n,u,y),iu(),!1}if(Ye)return o=pn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=y,u!==Kd&&(n=Error(i(422),{cause:u}),Ta(jn(n,a)))):(u!==Kd&&(o=Error(i(423),{cause:u}),Ta(jn(o,a))),n=n.current.alternate,n.flags|=65536,y&=-y,n.lanes|=y,u=jn(u,a),y=Mh(n.stateNode,u,y),sh(n,y),yt!==4&&(yt=2)),!1;var v=Error(i(520),{cause:u});if(v=jn(v,a),Xa===null?Xa=[v]:Xa.push(v),yt!==4&&(yt=2),o===null)return!0;u=jn(u,a),a=o;do{switch(a.tag){case 3:return a.flags|=65536,n=y&-y,a.lanes|=n,n=Mh(a.stateNode,u,n),sh(a,n),!1;case 1:if(o=a.type,v=a.stateNode,(a.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Mo===null||!Mo.has(v))))return a.flags|=65536,y&=-y,a.lanes|=y,y=k0(y),T0(y,n,a,u),sh(a,y),!1}a=a.return}while(a!==null);return!1}var Oh=Error(i(461)),_t=!1;function Ht(n,o,a,u){o.child=n===null?Mx(o,null,a,u):wi(o,n.child,a,u)}function A0(n,o,a,u,y){a=a.render;var v=o.ref;if("ref"in u){var T={};for(var I in u)I!=="ref"&&(T[I]=u[I])}else T=u;return yi(o),u=mh(n,o,a,T,v,y),I=ph(),n!==null&&!_t?(gh(n,o,y),Yr(n,o,y)):(Ye&&I&&Wd(o),o.flags|=1,Ht(n,o,u,y),o.child)}function R0(n,o,a,u,y){if(n===null){var v=a.type;return typeof v=="function"&&!Fd(v)&&v.defaultProps===void 0&&a.compare===null?(o.tag=15,o.type=v,j0(n,o,v,u,y)):(n=Tc(a.type,null,u,o,o.mode,y),n.ref=o.ref,n.return=o,o.child=n)}if(v=n.child,!Uh(n,y)){var T=v.memoizedProps;if(a=a.compare,a=a!==null?a:Na,a(T,u)&&n.ref===o.ref)return Yr(n,o,y)}return o.flags|=1,n=Br(v,u),n.ref=o.ref,n.return=o,o.child=n}function j0(n,o,a,u,y){if(n!==null){var v=n.memoizedProps;if(Na(v,u)&&n.ref===o.ref)if(_t=!1,o.pendingProps=u=v,Uh(n,y))(n.flags&131072)!==0&&(_t=!0);else return o.lanes=n.lanes,Yr(n,o,y)}return Dh(n,o,a,u,y)}function M0(n,o,a,u){var y=u.children,v=n!==null?n.memoizedState:null;if(n===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|a:a,n!==null){for(u=o.child=n.child,y=0;u!==null;)y=y|u.lanes|u.childLanes,u=u.sibling;u=y&~v}else u=0,o.child=null;return O0(n,o,v,a,u)}if((a&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},n!==null&&Mc(o,v!==null?v.cachePool:null),v!==null?zx(o,v):uh(),Lx(o);else return u=o.lanes=536870912,O0(n,o,v!==null?v.baseLanes|a:a,a,u)}else v!==null?(Mc(o,v.cachePool),zx(o,v),To(),o.memoizedState=null):(n!==null&&Mc(o,null),uh(),To());return Ht(n,o,y,a),o.child}function Pa(n,o){return n!==null&&n.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function O0(n,o,a,u,y){var v=oh();return v=v===null?null:{parent:Ct._currentValue,pool:v},o.memoizedState={baseLanes:a,cachePool:v},n!==null&&Mc(o,null),uh(),Lx(o),n!==null&&cl(n,o,u,!0),o.childLanes=y,null}function Gc(n,o){return o=Zc({mode:o.mode,children:o.children},n.mode),o.ref=n.ref,n.child=o,o.return=n,o}function D0(n,o,a){return wi(o,n.child,null,a),n=Gc(o,o.pendingProps),n.flags|=2,gn(o),o.memoizedState=null,n}function sT(n,o,a){var u=o.pendingProps,y=(o.flags&128)!==0;if(o.flags&=-129,n===null){if(Ye){if(u.mode==="hidden")return n=Gc(o,u),o.lanes=536870912,Pa(null,n);if(dh(o),(n=ct)?(n=Fv(n,Dn),n=n!==null&&n.data==="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:bo!==null?{id:cr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},a=yx(n),a.return=o,o.child=a,It=o,ct=null)):n=null,n===null)throw So(o);return o.lanes=536870912,null}return Gc(o,u)}var v=n.memoizedState;if(v!==null){var T=v.dehydrated;if(dh(o),y)if(o.flags&256)o.flags&=-257,o=D0(n,o,a);else if(o.memoizedState!==null)o.child=n.child,o.flags|=128,o=null;else throw Error(i(558));else if(_t||cl(n,o,a,!1),y=(a&n.childLanes)!==0,_t||y){if(u=ot,u!==null&&(T=lc(u,a),T!==0&&T!==v.retryLane))throw v.retryLane=T,hi(n,T),ln(u,n,T),Oh;iu(),o=D0(n,o,a)}else n=v.treeContext,ct=Ln(T.nextSibling),It=o,Ye=!0,wo=null,Dn=!1,n!==null&&bx(o,n),o=Gc(o,u),o.flags|=4096;return o}return n=Br(n.child,{mode:u.mode,children:u.children}),n.ref=o.ref,o.child=n,n.return=o,n}function Wc(n,o){var a=o.ref;if(a===null)n!==null&&n.ref!==null&&(o.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(n===null||n.ref!==a)&&(o.flags|=4194816)}}function Dh(n,o,a,u,y){return yi(o),a=mh(n,o,a,u,void 0,y),u=ph(),n!==null&&!_t?(gh(n,o,y),Yr(n,o,y)):(Ye&&u&&Wd(o),o.flags|=1,Ht(n,o,a,y),o.child)}function z0(n,o,a,u,y,v){return yi(o),o.updateQueue=null,a=Bx(o,u,a,y),Ix(n),u=ph(),n!==null&&!_t?(gh(n,o,v),Yr(n,o,v)):(Ye&&u&&Wd(o),o.flags|=1,Ht(n,o,a,v),o.child)}function L0(n,o,a,u,y){if(yi(o),o.stateNode===null){var v=il,T=a.contextType;typeof T=="object"&&T!==null&&(v=Bt(T)),v=new a(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=jh,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},lh(o),T=a.contextType,v.context=typeof T=="object"&&T!==null?Bt(T):il,v.state=o.memoizedState,T=a.getDerivedStateFromProps,typeof T=="function"&&(Rh(o,a,T,u),v.state=o.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(T=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),T!==v.state&&jh.enqueueReplaceState(v,v.state,null),za(o,u,v,y),Da(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(n===null){v=o.stateNode;var I=o.memoizedProps,Z=Ei(a,I);v.props=Z;var ie=v.context,ue=a.contextType;T=il,typeof ue=="object"&&ue!==null&&(T=Bt(ue));var de=a.getDerivedStateFromProps;ue=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",I=o.pendingProps!==I,ue||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(I||ie!==T)&&S0(o,v,u,T),Co=!1;var le=o.memoizedState;v.state=le,za(o,u,v,y),Da(),ie=o.memoizedState,I||le!==ie||Co?(typeof de=="function"&&(Rh(o,a,de,u),ie=o.memoizedState),(Z=Co||w0(o,a,Z,u,le,ie,T))?(ue||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=T,u=Z):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,ah(n,o),T=o.memoizedProps,ue=Ei(a,T),v.props=ue,de=o.pendingProps,le=v.context,ie=a.contextType,Z=il,typeof ie=="object"&&ie!==null&&(Z=Bt(ie)),I=a.getDerivedStateFromProps,(ie=typeof I=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T!==de||le!==Z)&&S0(o,v,u,Z),Co=!1,le=o.memoizedState,v.state=le,za(o,u,v,y),Da();var ae=o.memoizedState;T!==de||le!==ae||Co||n!==null&&n.dependencies!==null&&Rc(n.dependencies)?(typeof I=="function"&&(Rh(o,a,I,u),ae=o.memoizedState),(ue=Co||w0(o,a,ue,u,le,ae,Z)||n!==null&&n.dependencies!==null&&Rc(n.dependencies))?(ie||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ae,Z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ae,Z)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ae),v.props=u,v.state=ae,v.context=Z,u=ue):(typeof v.componentDidUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&le===n.memoizedState||(o.flags|=1024),u=!1)}return v=u,Wc(n,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,n!==null&&u?(o.child=wi(o,n.child,null,y),o.child=wi(o,null,a,y)):Ht(n,o,a,y),o.memoizedState=v.state,n=o.child):n=Yr(n,o,y),n}function I0(n,o,a,u){return pi(),o.flags|=256,Ht(n,o,a,u),o.child}var zh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lh(n){return{baseLanes:n,cachePool:_x()}}function Ih(n,o,a){return n=n!==null?n.childLanes&~a:0,o&&(n|=xn),n}function B0(n,o,a){var u=o.pendingProps,y=!1,v=(o.flags&128)!==0,T;if((T=v)||(T=n!==null&&n.memoizedState===null?!1:(bt.current&2)!==0),T&&(y=!0,o.flags&=-129),T=(o.flags&32)!==0,o.flags&=-33,n===null){if(Ye){if(y?ko(o):To(),(n=ct)?(n=Fv(n,Dn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(o.memoizedState={dehydrated:n,treeContext:bo!==null?{id:cr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},a=yx(n),a.return=o,o.child=a,It=o,ct=null)):n=null,n===null)throw So(o);return vm(n)?o.lanes=32:o.lanes=536870912,null}var I=u.children;return u=u.fallback,y?(To(),y=o.mode,I=Zc({mode:"hidden",children:I},y),u=mi(u,y,a,null),I.return=o,u.return=o,I.sibling=u,o.child=I,u=o.child,u.memoizedState=Lh(a),u.childLanes=Ih(n,T,a),o.memoizedState=zh,Pa(null,u)):(ko(o),Bh(o,I))}var Z=n.memoizedState;if(Z!==null&&(I=Z.dehydrated,I!==null)){if(v)o.flags&256?(ko(o),o.flags&=-257,o=Hh(n,o,a)):o.memoizedState!==null?(To(),o.child=n.child,o.flags|=128,o=null):(To(),I=u.fallback,y=o.mode,u=Zc({mode:"visible",children:u.children},y),I=mi(I,y,a,null),I.flags|=2,u.return=o,I.return=o,u.sibling=I,o.child=u,wi(o,n.child,null,a),u=o.child,u.memoizedState=Lh(a),u.childLanes=Ih(n,T,a),o.memoizedState=zh,o=Pa(null,u));else if(ko(o),vm(I)){if(T=I.nextSibling&&I.nextSibling.dataset,T)var ie=T.dgst;T=ie,u=Error(i(419)),u.stack="",u.digest=T,Ta({value:u,source:null,stack:null}),o=Hh(n,o,a)}else if(_t||cl(n,o,a,!1),T=(a&n.childLanes)!==0,_t||T){if(T=ot,T!==null&&(u=lc(T,a),u!==0&&u!==Z.retryLane))throw Z.retryLane=u,hi(n,u),ln(T,n,u),Oh;xm(I)||iu(),o=Hh(n,o,a)}else xm(I)?(o.flags|=192,o.child=n.child,o=null):(n=Z.treeContext,ct=Ln(I.nextSibling),It=o,Ye=!0,wo=null,Dn=!1,n!==null&&bx(o,n),o=Bh(o,u.children),o.flags|=4096);return o}return y?(To(),I=u.fallback,y=o.mode,Z=n.child,ie=Z.sibling,u=Br(Z,{mode:"hidden",children:u.children}),u.subtreeFlags=Z.subtreeFlags&65011712,ie!==null?I=Br(ie,I):(I=mi(I,y,a,null),I.flags|=2),I.return=o,u.return=o,u.sibling=I,o.child=u,Pa(null,u),u=o.child,I=n.child.memoizedState,I===null?I=Lh(a):(y=I.cachePool,y!==null?(Z=Ct._currentValue,y=y.parent!==Z?{parent:Z,pool:Z}:y):y=_x(),I={baseLanes:I.baseLanes|a,cachePool:y}),u.memoizedState=I,u.childLanes=Ih(n,T,a),o.memoizedState=zh,Pa(n.child,u)):(ko(o),a=n.child,n=a.sibling,a=Br(a,{mode:"visible",children:u.children}),a.return=o,a.sibling=null,n!==null&&(T=o.deletions,T===null?(o.deletions=[n],o.flags|=16):T.push(n)),o.child=a,o.memoizedState=null,a)}function Bh(n,o){return o=Zc({mode:"visible",children:o},n.mode),o.return=n,n.child=o}function Zc(n,o){return n=mn(22,n,null,o),n.lanes=0,n}function Hh(n,o,a){return wi(o,n.child,null,a),n=Bh(o,o.pendingProps.children),n.flags|=2,o.memoizedState=null,n}function H0(n,o,a){n.lanes|=o;var u=n.alternate;u!==null&&(u.lanes|=o),eh(n.return,o,a)}function Ph(n,o,a,u,y,v){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:y,treeForkCount:v}:(T.isBackwards=o,T.rendering=null,T.renderingStartTime=0,T.last=u,T.tail=a,T.tailMode=y,T.treeForkCount=v)}function P0(n,o,a){var u=o.pendingProps,y=u.revealOrder,v=u.tail;u=u.children;var T=bt.current,I=(T&2)!==0;if(I?(T=T&1|2,o.flags|=128):T&=1,D(bt,T),Ht(n,o,u,a),u=Ye?ka:0,!I&&n!==null&&(n.flags&128)!==0)e:for(n=o.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&H0(n,a,o);else if(n.tag===19)H0(n,a,o);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===o)break e;for(;n.sibling===null;){if(n.return===null||n.return===o)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(y){case"forwards":for(a=o.child,y=null;a!==null;)n=a.alternate,n!==null&&Bc(n)===null&&(y=a),a=a.sibling;a=y,a===null?(y=o.child,o.child=null):(y=a.sibling,a.sibling=null),Ph(o,!1,y,a,v,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,y=o.child,o.child=null;y!==null;){if(n=y.alternate,n!==null&&Bc(n)===null){o.child=y;break}n=y.sibling,y.sibling=a,a=y,y=n}Ph(o,!0,a,null,v,u);break;case"together":Ph(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function Yr(n,o,a){if(n!==null&&(o.dependencies=n.dependencies),jo|=o.lanes,(a&o.childLanes)===0)if(n!==null){if(cl(n,o,a,!1),(a&o.childLanes)===0)return null}else return null;if(n!==null&&o.child!==n.child)throw Error(i(153));if(o.child!==null){for(n=o.child,a=Br(n,n.pendingProps),o.child=a,a.return=o;n.sibling!==null;)n=n.sibling,a=a.sibling=Br(n,n.pendingProps),a.return=o;a.sibling=null}return o.child}function Uh(n,o){return(n.lanes&o)!==0?!0:(n=n.dependencies,!!(n!==null&&Rc(n)))}function cT(n,o,a){switch(o.tag){case 3:ne(o,o.stateNode.containerInfo),Eo(o,Ct,n.memoizedState.cache),pi();break;case 27:case 5:he(o);break;case 4:ne(o,o.stateNode.containerInfo);break;case 10:Eo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,dh(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(ko(o),o.flags|=128,null):(a&o.child.childLanes)!==0?B0(n,o,a):(ko(o),n=Yr(n,o,a),n!==null?n.sibling:null);ko(o);break;case 19:var y=(n.flags&128)!==0;if(u=(a&o.childLanes)!==0,u||(cl(n,o,a,!1),u=(a&o.childLanes)!==0),y){if(u)return P0(n,o,a);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),D(bt,bt.current),u)break;return null;case 22:return o.lanes=0,M0(n,o,a,o.pendingProps);case 24:Eo(o,Ct,n.memoizedState.cache)}return Yr(n,o,a)}function U0(n,o,a){if(n!==null)if(n.memoizedProps!==o.pendingProps)_t=!0;else{if(!Uh(n,a)&&(o.flags&128)===0)return _t=!1,cT(n,o,a);_t=(n.flags&131072)!==0}else _t=!1,Ye&&(o.flags&1048576)!==0&&vx(o,ka,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(n=vi(o.elementType),o.type=n,typeof n=="function")Fd(n)?(u=Ei(n,u),o.tag=1,o=L0(null,o,n,u,a)):(o.tag=0,o=Dh(null,o,n,u,a));else{if(n!=null){var y=n.$$typeof;if(y===A){o.tag=11,o=A0(null,o,n,u,a);break e}else if(y===z){o.tag=14,o=R0(null,o,n,u,a);break e}}throw o=O(n)||n,Error(i(306,o,""))}}return o;case 0:return Dh(n,o,o.type,o.pendingProps,a);case 1:return u=o.type,y=Ei(u,o.pendingProps),L0(n,o,u,y,a);case 3:e:{if(ne(o,o.stateNode.containerInfo),n===null)throw Error(i(387));u=o.pendingProps;var v=o.memoizedState;y=v.element,ah(n,o),za(o,u,null,a);var T=o.memoizedState;if(u=T.cache,Eo(o,Ct,u),u!==v.cache&&th(o,[Ct],a,!0),Da(),u=T.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:T.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=I0(n,o,u,a);break e}else if(u!==y){y=jn(Error(i(424)),o),Ta(y),o=I0(n,o,u,a);break e}else for(n=o.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ct=Ln(n.firstChild),It=o,Ye=!0,wo=null,Dn=!0,a=Mx(o,null,u,a),o.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(pi(),u===y){o=Yr(n,o,a);break e}Ht(n,o,u,a)}o=o.child}return o;case 26:return Wc(n,o),n===null?(a=Qv(o.type,null,o.pendingProps,null))?o.memoizedState=a:Ye||(a=o.type,n=o.pendingProps,u=du(J.current).createElement(a),u[jt]=o,u[Yt]=n,Pt(u,a,n),Et(u),o.stateNode=u):o.memoizedState=Qv(o.type,n.memoizedProps,o.pendingProps,n.memoizedState),null;case 27:return he(o),n===null&&Ye&&(u=o.stateNode=Wv(o.type,o.pendingProps,J.current),It=o,Dn=!0,y=ct,Lo(o.type)?(bm=y,ct=Ln(u.firstChild)):ct=y),Ht(n,o,o.pendingProps.children,a),Wc(n,o),n===null&&(o.flags|=4194304),o.child;case 5:return n===null&&Ye&&((y=u=ct)&&(u=HT(u,o.type,o.pendingProps,Dn),u!==null?(o.stateNode=u,It=o,ct=Ln(u.firstChild),Dn=!1,y=!0):y=!1),y||So(o)),he(o),y=o.type,v=o.pendingProps,T=n!==null?n.memoizedProps:null,u=v.children,pm(y,v)?u=null:T!==null&&pm(y,T)&&(o.flags|=32),o.memoizedState!==null&&(y=mh(n,o,eT,null,null,a),ts._currentValue=y),Wc(n,o),Ht(n,o,u,a),o.child;case 6:return n===null&&Ye&&((n=a=ct)&&(a=PT(a,o.pendingProps,Dn),a!==null?(o.stateNode=a,It=o,ct=null,n=!0):n=!1),n||So(o)),null;case 13:return B0(n,o,a);case 4:return ne(o,o.stateNode.containerInfo),u=o.pendingProps,n===null?o.child=wi(o,null,u,a):Ht(n,o,u,a),o.child;case 11:return A0(n,o,o.type,o.pendingProps,a);case 7:return Ht(n,o,o.pendingProps,a),o.child;case 8:return Ht(n,o,o.pendingProps.children,a),o.child;case 12:return Ht(n,o,o.pendingProps.children,a),o.child;case 10:return u=o.pendingProps,Eo(o,o.type,u.value),Ht(n,o,u.children,a),o.child;case 9:return y=o.type._context,u=o.pendingProps.children,yi(o),y=Bt(y),u=u(y),o.flags|=1,Ht(n,o,u,a),o.child;case 14:return R0(n,o,o.type,o.pendingProps,a);case 15:return j0(n,o,o.type,o.pendingProps,a);case 19:return P0(n,o,a);case 31:return sT(n,o,a);case 22:return M0(n,o,a,o.pendingProps);case 24:return yi(o),u=Bt(Ct),n===null?(y=oh(),y===null&&(y=ot,v=nh(),y.pooledCache=v,v.refCount++,v!==null&&(y.pooledCacheLanes|=a),y=v),o.memoizedState={parent:u,cache:y},lh(o),Eo(o,Ct,y)):((n.lanes&a)!==0&&(ah(n,o),za(o,null,null,a),Da()),y=n.memoizedState,v=o.memoizedState,y.parent!==u?(y={parent:u,cache:u},o.memoizedState=y,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=y),Eo(o,Ct,u)):(u=v.cache,Eo(o,Ct,u),u!==y.cache&&th(o,[Ct],a,!0))),Ht(n,o,o.pendingProps.children,a),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function qr(n){n.flags|=4}function Vh(n,o,a,u,y){if((o=(n.mode&32)!==0)&&(o=!1),o){if(n.flags|=16777216,(y&335544128)===y)if(n.stateNode.complete)n.flags|=8192;else if(mv())n.flags|=8192;else throw bi=Dc,ih}else n.flags&=-16777217}function V0(n,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!rb(o))if(mv())n.flags|=8192;else throw bi=Dc,ih}function Kc(n,o){o!==null&&(n.flags|=4),n.flags&16384&&(o=n.tag!==22?rc():536870912,n.lanes|=o,wl|=o)}function Ua(n,o){if(!Ye)switch(n.tailMode){case"hidden":o=n.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?n.tail=null:a.sibling=null;break;case"collapsed":a=n.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?o||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function ut(n){var o=n.alternate!==null&&n.alternate.child===n.child,a=0,u=0;if(o)for(var y=n.child;y!==null;)a|=y.lanes|y.childLanes,u|=y.subtreeFlags&65011712,u|=y.flags&65011712,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)a|=y.lanes|y.childLanes,u|=y.subtreeFlags,u|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=u,n.childLanes=a,o}function uT(n,o,a){var u=o.pendingProps;switch(Zd(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(o),null;case 1:return ut(o),null;case 3:return a=o.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Ur(Ct),se(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(sl(o)?qr(o):n===null||n.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Qd())),ut(o),null;case 26:var y=o.type,v=o.memoizedState;return n===null?(qr(o),v!==null?(ut(o),V0(o,v)):(ut(o),Vh(o,y,null,u,a))):v?v!==n.memoizedState?(qr(o),ut(o),V0(o,v)):(ut(o),o.flags&=-16777217):(n=n.memoizedProps,n!==u&&qr(o),ut(o),Vh(o,y,n,u,a)),null;case 27:if(me(o),a=J.current,y=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==u&&qr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return ut(o),null}n=oe.current,sl(o)?wx(o):(n=Wv(y,u,a),o.stateNode=n,qr(o))}return ut(o),null;case 5:if(me(o),y=o.type,n!==null&&o.stateNode!=null)n.memoizedProps!==u&&qr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return ut(o),null}if(v=oe.current,sl(o))wx(o);else{var T=du(J.current);switch(v){case 1:v=T.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:v=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":v=T.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":v=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":v=T.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?T.createElement("select",{is:u.is}):T.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?T.createElement(y,{is:u.is}):T.createElement(y)}}v[jt]=o,v[Yt]=u;e:for(T=o.child;T!==null;){if(T.tag===5||T.tag===6)v.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===o)break e;for(;T.sibling===null;){if(T.return===null||T.return===o)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}o.stateNode=v;e:switch(Pt(v,y,u),y){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&qr(o)}}return ut(o),Vh(o,o.type,n===null?null:n.memoizedProps,o.pendingProps,a),null;case 6:if(n&&o.stateNode!=null)n.memoizedProps!==u&&qr(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(i(166));if(n=J.current,sl(o)){if(n=o.stateNode,a=o.memoizedProps,u=null,y=It,y!==null)switch(y.tag){case 27:case 5:u=y.memoizedProps}n[jt]=o,n=!!(n.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||Bv(n.nodeValue,a)),n||So(o,!0)}else n=du(n).createTextNode(u),n[jt]=o,o.stateNode=n}return ut(o),null;case 31:if(a=o.memoizedState,n===null||n.memoizedState!==null){if(u=sl(o),a!==null){if(n===null){if(!u)throw Error(i(318));if(n=o.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[jt]=o}else pi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ut(o),n=!1}else a=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return o.flags&256?(gn(o),o):(gn(o),null);if((o.flags&128)!==0)throw Error(i(558))}return ut(o),null;case 13:if(u=o.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(y=sl(o),u!==null&&u.dehydrated!==null){if(n===null){if(!y)throw Error(i(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[jt]=o}else pi(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ut(o),y=!1}else y=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(gn(o),o):(gn(o),null)}return gn(o),(o.flags&128)!==0?(o.lanes=a,o):(a=u!==null,n=n!==null&&n.memoizedState!==null,a&&(u=o.child,y=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(y=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==y&&(u.flags|=2048)),a!==n&&a&&(o.child.flags|=8192),Kc(o,o.updateQueue),ut(o),null);case 4:return se(),n===null&&um(o.stateNode.containerInfo),ut(o),null;case 10:return Ur(o.type),ut(o),null;case 19:if(G(bt),u=o.memoizedState,u===null)return ut(o),null;if(y=(o.flags&128)!==0,v=u.rendering,v===null)if(y)Ua(u,!1);else{if(yt!==0||n!==null&&(n.flags&128)!==0)for(n=o.child;n!==null;){if(v=Bc(n),v!==null){for(o.flags|=128,Ua(u,!1),n=v.updateQueue,o.updateQueue=n,Kc(o,n),o.subtreeFlags=0,n=a,a=o.child;a!==null;)gx(a,n),a=a.sibling;return D(bt,bt.current&1|2),Ye&&Hr(o,u.treeForkCount),o.child}n=n.sibling}u.tail!==null&&Rt()>nu&&(o.flags|=128,y=!0,Ua(u,!1),o.lanes=4194304)}else{if(!y)if(n=Bc(v),n!==null){if(o.flags|=128,y=!0,n=n.updateQueue,o.updateQueue=n,Kc(o,n),Ua(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Ye)return ut(o),null}else 2*Rt()-u.renderingStartTime>nu&&a!==536870912&&(o.flags|=128,y=!0,Ua(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(n=u.last,n!==null?n.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Rt(),n.sibling=null,a=bt.current,D(bt,y?a&1|2:a&1),Ye&&Hr(o,u.treeForkCount),n):(ut(o),null);case 22:case 23:return gn(o),fh(),u=o.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(a&536870912)!==0&&(o.flags&128)===0&&(ut(o),o.subtreeFlags&6&&(o.flags|=8192)):ut(o),a=o.updateQueue,a!==null&&Kc(o,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==a&&(o.flags|=2048),n!==null&&G(xi),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),o.memoizedState.cache!==a&&(o.flags|=2048),Ur(Ct),ut(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function fT(n,o){switch(Zd(o),o.tag){case 1:return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 3:return Ur(Ct),se(),n=o.flags,(n&65536)!==0&&(n&128)===0?(o.flags=n&-65537|128,o):null;case 26:case 27:case 5:return me(o),null;case 31:if(o.memoizedState!==null){if(gn(o),o.alternate===null)throw Error(i(340));pi()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 13:if(gn(o),n=o.memoizedState,n!==null&&n.dehydrated!==null){if(o.alternate===null)throw Error(i(340));pi()}return n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 19:return G(bt),null;case 4:return se(),null;case 10:return Ur(o.type),null;case 22:case 23:return gn(o),fh(),n!==null&&G(xi),n=o.flags,n&65536?(o.flags=n&-65537|128,o):null;case 24:return Ur(Ct),null;case 25:return null;default:return null}}function $0(n,o){switch(Zd(o),o.tag){case 3:Ur(Ct),se();break;case 26:case 27:case 5:me(o);break;case 4:se();break;case 31:o.memoizedState!==null&&gn(o);break;case 13:gn(o);break;case 19:G(bt);break;case 10:Ur(o.type);break;case 22:case 23:gn(o),fh(),n!==null&&G(xi);break;case 24:Ur(Ct)}}function Va(n,o){try{var a=o.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var y=u.next;a=y;do{if((a.tag&n)===n){u=void 0;var v=a.create,T=a.inst;u=v(),T.destroy=u}a=a.next}while(a!==y)}}catch(I){et(o,o.return,I)}}function Ao(n,o,a){try{var u=o.updateQueue,y=u!==null?u.lastEffect:null;if(y!==null){var v=y.next;u=v;do{if((u.tag&n)===n){var T=u.inst,I=T.destroy;if(I!==void 0){T.destroy=void 0,y=o;var Z=a,ie=I;try{ie()}catch(ue){et(y,Z,ue)}}}u=u.next}while(u!==v)}}catch(ue){et(o,o.return,ue)}}function Y0(n){var o=n.updateQueue;if(o!==null){var a=n.stateNode;try{Dx(o,a)}catch(u){et(n,n.return,u)}}}function q0(n,o,a){a.props=Ei(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(u){et(n,o,u)}}function $a(n,o){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof a=="function"?n.refCleanup=a(u):a.current=u}}catch(y){et(n,o,y)}}function fr(n,o){var a=n.ref,u=n.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(y){et(n,o,y)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(y){et(n,o,y)}else a.current=null}function F0(n){var o=n.type,a=n.memoizedProps,u=n.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(y){et(n,n.return,y)}}function $h(n,o,a){try{var u=n.stateNode;OT(u,n.type,a,o),u[Yt]=o}catch(y){et(n,n.return,y)}}function X0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Lo(n.type)||n.tag===4}function Yh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||X0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Lo(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function qh(n,o,a){var u=n.tag;if(u===5||u===6)n=n.stateNode,o?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(n,o):(o=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,o.appendChild(n),a=a._reactRootContainer,a!=null||o.onclick!==null||(o.onclick=Lr));else if(u!==4&&(u===27&&Lo(n.type)&&(a=n.stateNode,o=null),n=n.child,n!==null))for(qh(n,o,a),n=n.sibling;n!==null;)qh(n,o,a),n=n.sibling}function Qc(n,o,a){var u=n.tag;if(u===5||u===6)n=n.stateNode,o?a.insertBefore(n,o):a.appendChild(n);else if(u!==4&&(u===27&&Lo(n.type)&&(a=n.stateNode),n=n.child,n!==null))for(Qc(n,o,a),n=n.sibling;n!==null;)Qc(n,o,a),n=n.sibling}function G0(n){var o=n.stateNode,a=n.memoizedProps;try{for(var u=n.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);Pt(o,u,a),o[jt]=n,o[Yt]=a}catch(v){et(n,n.return,v)}}var Fr=!1,kt=!1,Fh=!1,W0=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function dT(n,o){if(n=n.containerInfo,hm=vu,n=ax(n),Hd(n)){if("selectionStart"in n)var a={start:n.selectionStart,end:n.selectionEnd};else e:{a=(a=n.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var y=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{a.nodeType,v.nodeType}catch{a=null;break e}var T=0,I=-1,Z=-1,ie=0,ue=0,de=n,le=null;t:for(;;){for(var ae;de!==a||y!==0&&de.nodeType!==3||(I=T+y),de!==v||u!==0&&de.nodeType!==3||(Z=T+u),de.nodeType===3&&(T+=de.nodeValue.length),(ae=de.firstChild)!==null;)le=de,de=ae;for(;;){if(de===n)break t;if(le===a&&++ie===y&&(I=T),le===v&&++ue===u&&(Z=T),(ae=de.nextSibling)!==null)break;de=le,le=de.parentNode}de=ae}a=I===-1||Z===-1?null:{start:I,end:Z}}else a=null}a=a||{start:0,end:0}}else a=null;for(mm={focusedElem:n,selectionRange:a},vu=!1,Dt=o;Dt!==null;)if(o=Dt,n=o.child,(o.subtreeFlags&1028)!==0&&n!==null)n.return=o,Dt=n;else for(;Dt!==null;){switch(o=Dt,v=o.alternate,n=o.flags,o.tag){case 0:if((n&4)!==0&&(n=o.updateQueue,n=n!==null?n.events:null,n!==null))for(a=0;a<n.length;a++)y=n[a],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&v!==null){n=void 0,a=o,y=v.memoizedProps,v=v.memoizedState,u=a.stateNode;try{var be=Ei(a.type,y);n=u.getSnapshotBeforeUpdate(be,v),u.__reactInternalSnapshotBeforeUpdate=n}catch(Te){et(a,a.return,Te)}}break;case 3:if((n&1024)!==0){if(n=o.stateNode.containerInfo,a=n.nodeType,a===9)ym(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ym(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=o.sibling,n!==null){n.return=o.return,Dt=n;break}Dt=o.return}}function Z0(n,o,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Gr(n,a),u&4&&Va(5,a);break;case 1:if(Gr(n,a),u&4)if(n=a.stateNode,o===null)try{n.componentDidMount()}catch(T){et(a,a.return,T)}else{var y=Ei(a.type,o.memoizedProps);o=o.memoizedState;try{n.componentDidUpdate(y,o,n.__reactInternalSnapshotBeforeUpdate)}catch(T){et(a,a.return,T)}}u&64&&Y0(a),u&512&&$a(a,a.return);break;case 3:if(Gr(n,a),u&64&&(n=a.updateQueue,n!==null)){if(o=null,a.child!==null)switch(a.child.tag){case 27:case 5:o=a.child.stateNode;break;case 1:o=a.child.stateNode}try{Dx(n,o)}catch(T){et(a,a.return,T)}}break;case 27:o===null&&u&4&&G0(a);case 26:case 5:Gr(n,a),o===null&&u&4&&F0(a),u&512&&$a(a,a.return);break;case 12:Gr(n,a);break;case 31:Gr(n,a),u&4&&J0(n,a);break;case 13:Gr(n,a),u&4&&ev(n,a),u&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=wT.bind(null,a),UT(n,a))));break;case 22:if(u=a.memoizedState!==null||Fr,!u){o=o!==null&&o.memoizedState!==null||kt,y=Fr;var v=kt;Fr=u,(kt=o)&&!v?Wr(n,a,(a.subtreeFlags&8772)!==0):Gr(n,a),Fr=y,kt=v}break;case 30:break;default:Gr(n,a)}}function K0(n){var o=n.alternate;o!==null&&(n.alternate=null,K0(o)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(o=n.stateNode,o!==null&&pa(o)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var ft=null,tn=!1;function Xr(n,o,a){for(a=a.child;a!==null;)Q0(n,o,a),a=a.sibling}function Q0(n,o,a){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Lt,a)}catch{}switch(a.tag){case 26:kt||fr(a,o),Xr(n,o,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:kt||fr(a,o);var u=ft,y=tn;Lo(a.type)&&(ft=a.stateNode,tn=!1),Xr(n,o,a),Qa(a.stateNode),ft=u,tn=y;break;case 5:kt||fr(a,o);case 6:if(u=ft,y=tn,ft=null,Xr(n,o,a),ft=u,tn=y,ft!==null)if(tn)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(a.stateNode)}catch(v){et(a,o,v)}else try{ft.removeChild(a.stateNode)}catch(v){et(a,o,v)}break;case 18:ft!==null&&(tn?(n=ft,Yv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),Al(n)):Yv(ft,a.stateNode));break;case 4:u=ft,y=tn,ft=a.stateNode.containerInfo,tn=!0,Xr(n,o,a),ft=u,tn=y;break;case 0:case 11:case 14:case 15:Ao(2,a,o),kt||Ao(4,a,o),Xr(n,o,a);break;case 1:kt||(fr(a,o),u=a.stateNode,typeof u.componentWillUnmount=="function"&&q0(a,o,u)),Xr(n,o,a);break;case 21:Xr(n,o,a);break;case 22:kt=(u=kt)||a.memoizedState!==null,Xr(n,o,a),kt=u;break;default:Xr(n,o,a)}}function J0(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Al(n)}catch(a){et(o,o.return,a)}}}function ev(n,o){if(o.memoizedState===null&&(n=o.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Al(n)}catch(a){et(o,o.return,a)}}function hT(n){switch(n.tag){case 31:case 13:case 19:var o=n.stateNode;return o===null&&(o=n.stateNode=new W0),o;case 22:return n=n.stateNode,o=n._retryCache,o===null&&(o=n._retryCache=new W0),o;default:throw Error(i(435,n.tag))}}function Jc(n,o){var a=hT(n);o.forEach(function(u){if(!a.has(u)){a.add(u);var y=ST.bind(null,n,u);u.then(y,y)}})}function nn(n,o){var a=o.deletions;if(a!==null)for(var u=0;u<a.length;u++){var y=a[u],v=n,T=o,I=T;e:for(;I!==null;){switch(I.tag){case 27:if(Lo(I.type)){ft=I.stateNode,tn=!1;break e}break;case 5:ft=I.stateNode,tn=!1;break e;case 3:case 4:ft=I.stateNode.containerInfo,tn=!0;break e}I=I.return}if(ft===null)throw Error(i(160));Q0(v,T,y),ft=null,tn=!1,v=y.alternate,v!==null&&(v.return=null),y.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)tv(o,n),o=o.sibling}var Fn=null;function tv(n,o){var a=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:nn(o,n),rn(n),u&4&&(Ao(3,n,n.return),Va(3,n),Ao(5,n,n.return));break;case 1:nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),u&64&&Fr&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var y=Fn;if(nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),u&4){var v=a!==null?a.memoizedState:null;if(u=n.memoizedState,a===null)if(u===null)if(n.stateNode===null){e:{u=n.type,a=n.memoizedProps,y=y.ownerDocument||y;t:switch(u){case"title":v=y.getElementsByTagName("title")[0],(!v||v[ai]||v[jt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=y.createElement(u),y.head.insertBefore(v,y.querySelector("head > title"))),Pt(v,u,a),v[jt]=n,Et(v),u=v;break e;case"link":var T=tb("link","href",y).get(u+(a.href||""));if(T){for(var I=0;I<T.length;I++)if(v=T[I],v.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&v.getAttribute("rel")===(a.rel==null?null:a.rel)&&v.getAttribute("title")===(a.title==null?null:a.title)&&v.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){T.splice(I,1);break t}}v=y.createElement(u),Pt(v,u,a),y.head.appendChild(v);break;case"meta":if(T=tb("meta","content",y).get(u+(a.content||""))){for(I=0;I<T.length;I++)if(v=T[I],v.getAttribute("content")===(a.content==null?null:""+a.content)&&v.getAttribute("name")===(a.name==null?null:a.name)&&v.getAttribute("property")===(a.property==null?null:a.property)&&v.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&v.getAttribute("charset")===(a.charSet==null?null:a.charSet)){T.splice(I,1);break t}}v=y.createElement(u),Pt(v,u,a),y.head.appendChild(v);break;default:throw Error(i(468,u))}v[jt]=n,Et(v),u=v}n.stateNode=u}else nb(y,n.type,n.stateNode);else n.stateNode=eb(y,u,n.memoizedProps);else v!==u?(v===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):v.count--,u===null?nb(y,n.type,n.stateNode):eb(y,u,n.memoizedProps)):u===null&&n.stateNode!==null&&$h(n,n.memoizedProps,a.memoizedProps)}break;case 27:nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),a!==null&&u&4&&$h(n,n.memoizedProps,a.memoizedProps);break;case 5:if(nn(o,n),rn(n),u&512&&(kt||a===null||fr(a,a.return)),n.flags&32){y=n.stateNode;try{Qi(y,"")}catch(be){et(n,n.return,be)}}u&4&&n.stateNode!=null&&(y=n.memoizedProps,$h(n,y,a!==null?a.memoizedProps:y)),u&1024&&(Fh=!0);break;case 6:if(nn(o,n),rn(n),u&4){if(n.stateNode===null)throw Error(i(162));u=n.memoizedProps,a=n.stateNode;try{a.nodeValue=u}catch(be){et(n,n.return,be)}}break;case 3:if(pu=null,y=Fn,Fn=hu(o.containerInfo),nn(o,n),Fn=y,rn(n),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Al(o.containerInfo)}catch(be){et(n,n.return,be)}Fh&&(Fh=!1,nv(n));break;case 4:u=Fn,Fn=hu(n.stateNode.containerInfo),nn(o,n),rn(n),Fn=u;break;case 12:nn(o,n),rn(n);break;case 31:nn(o,n),rn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Jc(n,u)));break;case 13:nn(o,n),rn(n),n.child.flags&8192&&n.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(tu=Rt()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Jc(n,u)));break;case 22:y=n.memoizedState!==null;var Z=a!==null&&a.memoizedState!==null,ie=Fr,ue=kt;if(Fr=ie||y,kt=ue||Z,nn(o,n),kt=ue,Fr=ie,rn(n),u&8192)e:for(o=n.stateNode,o._visibility=y?o._visibility&-2:o._visibility|1,y&&(a===null||Z||Fr||kt||Ci(n)),a=null,o=n;;){if(o.tag===5||o.tag===26){if(a===null){Z=a=o;try{if(v=Z.stateNode,y)T=v.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{I=Z.stateNode;var de=Z.memoizedProps.style,le=de!=null&&de.hasOwnProperty("display")?de.display:null;I.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(be){et(Z,Z.return,be)}}}else if(o.tag===6){if(a===null){Z=o;try{Z.stateNode.nodeValue=y?"":Z.memoizedProps}catch(be){et(Z,Z.return,be)}}}else if(o.tag===18){if(a===null){Z=o;try{var ae=Z.stateNode;y?qv(ae,!0):qv(Z.stateNode,!1)}catch(be){et(Z,Z.return,be)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===n)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break e;for(;o.sibling===null;){if(o.return===null||o.return===n)break e;a===o&&(a=null),o=o.return}a===o&&(a=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=n.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,Jc(n,a))));break;case 19:nn(o,n),rn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,Jc(n,u)));break;case 30:break;case 21:break;default:nn(o,n),rn(n)}}function rn(n){var o=n.flags;if(o&2){try{for(var a,u=n.return;u!==null;){if(X0(u)){a=u;break}u=u.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var y=a.stateNode,v=Yh(n);Qc(n,v,y);break;case 5:var T=a.stateNode;a.flags&32&&(Qi(T,""),a.flags&=-33);var I=Yh(n);Qc(n,I,T);break;case 3:case 4:var Z=a.stateNode.containerInfo,ie=Yh(n);qh(n,ie,Z);break;default:throw Error(i(161))}}catch(ue){et(n,n.return,ue)}n.flags&=-3}o&4096&&(n.flags&=-4097)}function nv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var o=n;nv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),n=n.sibling}}function Gr(n,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Z0(n,o.alternate,o),o=o.sibling}function Ci(n){for(n=n.child;n!==null;){var o=n;switch(o.tag){case 0:case 11:case 14:case 15:Ao(4,o,o.return),Ci(o);break;case 1:fr(o,o.return);var a=o.stateNode;typeof a.componentWillUnmount=="function"&&q0(o,o.return,a),Ci(o);break;case 27:Qa(o.stateNode);case 26:case 5:fr(o,o.return),Ci(o);break;case 22:o.memoizedState===null&&Ci(o);break;case 30:Ci(o);break;default:Ci(o)}n=n.sibling}}function Wr(n,o,a){for(a=a&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,y=n,v=o,T=v.flags;switch(v.tag){case 0:case 11:case 15:Wr(y,v,a),Va(4,v);break;case 1:if(Wr(y,v,a),u=v,y=u.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ie){et(u,u.return,ie)}if(u=v,y=u.updateQueue,y!==null){var I=u.stateNode;try{var Z=y.shared.hiddenCallbacks;if(Z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Z.length;y++)Ox(Z[y],I)}catch(ie){et(u,u.return,ie)}}a&&T&64&&Y0(v),$a(v,v.return);break;case 27:G0(v);case 26:case 5:Wr(y,v,a),a&&u===null&&T&4&&F0(v),$a(v,v.return);break;case 12:Wr(y,v,a);break;case 31:Wr(y,v,a),a&&T&4&&J0(y,v);break;case 13:Wr(y,v,a),a&&T&4&&ev(y,v);break;case 22:v.memoizedState===null&&Wr(y,v,a),$a(v,v.return);break;case 30:break;default:Wr(y,v,a)}o=o.sibling}}function Xh(n,o){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(n=o.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&Aa(a))}function Gh(n,o){n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&Aa(n))}function Xn(n,o,a,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)rv(n,o,a,u),o=o.sibling}function rv(n,o,a,u){var y=o.flags;switch(o.tag){case 0:case 11:case 15:Xn(n,o,a,u),y&2048&&Va(9,o);break;case 1:Xn(n,o,a,u);break;case 3:Xn(n,o,a,u),y&2048&&(n=null,o.alternate!==null&&(n=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==n&&(o.refCount++,n!=null&&Aa(n)));break;case 12:if(y&2048){Xn(n,o,a,u),n=o.stateNode;try{var v=o.memoizedProps,T=v.id,I=v.onPostCommit;typeof I=="function"&&I(T,o.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(Z){et(o,o.return,Z)}}else Xn(n,o,a,u);break;case 31:Xn(n,o,a,u);break;case 13:Xn(n,o,a,u);break;case 23:break;case 22:v=o.stateNode,T=o.alternate,o.memoizedState!==null?v._visibility&2?Xn(n,o,a,u):Ya(n,o):v._visibility&2?Xn(n,o,a,u):(v._visibility|=2,xl(n,o,a,u,(o.subtreeFlags&10256)!==0||!1)),y&2048&&Xh(T,o);break;case 24:Xn(n,o,a,u),y&2048&&Gh(o.alternate,o);break;default:Xn(n,o,a,u)}}function xl(n,o,a,u,y){for(y=y&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=n,T=o,I=a,Z=u,ie=T.flags;switch(T.tag){case 0:case 11:case 15:xl(v,T,I,Z,y),Va(8,T);break;case 23:break;case 22:var ue=T.stateNode;T.memoizedState!==null?ue._visibility&2?xl(v,T,I,Z,y):Ya(v,T):(ue._visibility|=2,xl(v,T,I,Z,y)),y&&ie&2048&&Xh(T.alternate,T);break;case 24:xl(v,T,I,Z,y),y&&ie&2048&&Gh(T.alternate,T);break;default:xl(v,T,I,Z,y)}o=o.sibling}}function Ya(n,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var a=n,u=o,y=u.flags;switch(u.tag){case 22:Ya(a,u),y&2048&&Xh(u.alternate,u);break;case 24:Ya(a,u),y&2048&&Gh(u.alternate,u);break;default:Ya(a,u)}o=o.sibling}}var qa=8192;function vl(n,o,a){if(n.subtreeFlags&qa)for(n=n.child;n!==null;)ov(n,o,a),n=n.sibling}function ov(n,o,a){switch(n.tag){case 26:vl(n,o,a),n.flags&qa&&n.memoizedState!==null&&JT(a,Fn,n.memoizedState,n.memoizedProps);break;case 5:vl(n,o,a);break;case 3:case 4:var u=Fn;Fn=hu(n.stateNode.containerInfo),vl(n,o,a),Fn=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=qa,qa=16777216,vl(n,o,a),qa=u):vl(n,o,a));break;default:vl(n,o,a)}}function iv(n){var o=n.alternate;if(o!==null&&(n=o.child,n!==null)){o.child=null;do o=n.sibling,n.sibling=null,n=o;while(n!==null)}}function Fa(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var a=0;a<o.length;a++){var u=o[a];Dt=u,av(u,n)}iv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)lv(n),n=n.sibling}function lv(n){switch(n.tag){case 0:case 11:case 15:Fa(n),n.flags&2048&&Ao(9,n,n.return);break;case 3:Fa(n);break;case 12:Fa(n);break;case 22:var o=n.stateNode;n.memoizedState!==null&&o._visibility&2&&(n.return===null||n.return.tag!==13)?(o._visibility&=-3,eu(n)):Fa(n);break;default:Fa(n)}}function eu(n){var o=n.deletions;if((n.flags&16)!==0){if(o!==null)for(var a=0;a<o.length;a++){var u=o[a];Dt=u,av(u,n)}iv(n)}for(n=n.child;n!==null;){switch(o=n,o.tag){case 0:case 11:case 15:Ao(8,o,o.return),eu(o);break;case 22:a=o.stateNode,a._visibility&2&&(a._visibility&=-3,eu(o));break;default:eu(o)}n=n.sibling}}function av(n,o){for(;Dt!==null;){var a=Dt;switch(a.tag){case 0:case 11:case 15:Ao(8,a,o);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Aa(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,Dt=u;else e:for(a=n;Dt!==null;){u=Dt;var y=u.sibling,v=u.return;if(K0(u),u===a){Dt=null;break e}if(y!==null){y.return=v,Dt=y;break e}Dt=v}}}var mT={getCacheForType:function(n){var o=Bt(Ct),a=o.data.get(n);return a===void 0&&(a=n(),o.data.set(n,a)),a},cacheSignal:function(){return Bt(Ct).controller.signal}},pT=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ot=null,Be=null,Ue=0,Je=0,yn=null,Ro=!1,bl=!1,Wh=!1,Zr=0,yt=0,jo=0,Ni=0,Zh=0,xn=0,wl=0,Xa=null,on=null,Kh=!1,tu=0,sv=0,nu=1/0,ru=null,Mo=null,Mt=0,Oo=null,Sl=null,Kr=0,Qh=0,Jh=null,cv=null,Ga=0,em=null;function vn(){return(Ze&2)!==0&&Ue!==0?Ue&-Ue:R.T!==null?lm():ac()}function uv(){if(xn===0)if((Ue&536870912)===0||Ye){var n=qi;qi<<=1,(qi&3932160)===0&&(qi=262144),xn=n}else xn=536870912;return n=pn.current,n!==null&&(n.flags|=32),xn}function ln(n,o,a){(n===ot&&(Je===2||Je===9)||n.cancelPendingCommit!==null)&&(El(n,0),Do(n,Ue,xn,!1)),li(n,a),((Ze&2)===0||n!==ot)&&(n===ot&&((Ze&2)===0&&(Ni|=a),yt===4&&Do(n,Ue,xn,!1)),dr(n))}function fv(n,o,a){if((Ze&6)!==0)throw Error(i(327));var u=!a&&(o&127)===0&&(o&n.expiredLanes)===0||ii(n,o),y=u?xT(n,o):nm(n,o,!0),v=u;do{if(y===0){bl&&!u&&Do(n,o,0,!1);break}else{if(a=n.current.alternate,v&&!gT(a)){y=nm(n,o,!1),v=!1;continue}if(y===2){if(v=o,n.errorRecoveryDisabledLanes&v)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){o=T;e:{var I=n;y=Xa;var Z=I.current.memoizedState.isDehydrated;if(Z&&(El(I,T).flags|=256),T=nm(I,T,!1),T!==2){if(Wh&&!Z){I.errorRecoveryDisabledLanes|=v,Ni|=v,y=4;break e}v=on,on=y,v!==null&&(on===null?on=v:on.push.apply(on,v))}y=T}if(v=!1,y!==2)continue}}if(y===1){El(n,0),Do(n,o,0,!0);break}e:{switch(u=n,v=y,v){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:Do(u,o,xn,!Ro);break e;case 2:on=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(y=tu+300-Rt(),10<y)){if(Do(u,o,xn,!Ro),Xi(u,0,!0)!==0)break e;Kr=o,u.timeoutHandle=Vv(dv.bind(null,u,a,on,ru,Kh,o,xn,Ni,wl,Ro,v,"Throttled",-0,0),y);break e}dv(u,a,on,ru,Kh,o,xn,Ni,wl,Ro,v,null,-0,0)}}break}while(!0);dr(n)}function dv(n,o,a,u,y,v,T,I,Z,ie,ue,de,le,ae){if(n.timeoutHandle=-1,de=o.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lr},ov(o,v,de);var be=(v&62914560)===v?tu-Rt():(v&4194048)===v?sv-Rt():0;if(be=eA(de,be),be!==null){Kr=v,n.cancelPendingCommit=be(bv.bind(null,n,o,v,a,u,y,T,I,Z,ue,de,null,le,ae)),Do(n,v,T,!ie);return}}bv(n,o,v,a,u,y,T,I,Z)}function gT(n){for(var o=n;;){var a=o.tag;if((a===0||a===11||a===15)&&o.flags&16384&&(a=o.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var y=a[u],v=y.getSnapshot;y=y.value;try{if(!hn(v(),y))return!1}catch{return!1}}if(a=o.child,o.subtreeFlags&16384&&a!==null)a.return=o,o=a;else{if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Do(n,o,a,u){o&=~Zh,o&=~Ni,n.suspendedLanes|=o,n.pingedLanes&=~o,u&&(n.warmLanes|=o),u=n.expirationTimes;for(var y=o;0<y;){var v=31-Qe(y),T=1<<v;u[v]=-1,y&=~T}a!==0&&oc(n,a,o)}function ou(){return(Ze&6)===0?(Wa(0),!1):!0}function tm(){if(Be!==null){if(Je===0)var n=Be.return;else n=Be,Pr=gi=null,yh(n),hl=null,ja=0,n=Be;for(;n!==null;)$0(n.alternate,n),n=n.return;Be=null}}function El(n,o){var a=n.timeoutHandle;a!==-1&&(n.timeoutHandle=-1,LT(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),Kr=0,tm(),ot=n,Be=a=Br(n.current,null),Ue=o,Je=0,yn=null,Ro=!1,bl=ii(n,o),Wh=!1,wl=xn=Zh=Ni=jo=yt=0,on=Xa=null,Kh=!1,(o&8)!==0&&(o|=o&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=o;0<u;){var y=31-Qe(u),v=1<<y;o|=n[y],u&=~v}return Zr=o,Nc(),a}function hv(n,o){Me=null,R.H=Ha,o===dl||o===Oc?(o=Ax(),Je=3):o===ih?(o=Ax(),Je=4):Je=o===Oh?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,yn=o,Be===null&&(yt=1,Xc(n,jn(o,n.current)))}function mv(){var n=pn.current;return n===null?!0:(Ue&4194048)===Ue?zn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?n===zn:!1}function pv(){var n=R.H;return R.H=Ha,n===null?Ha:n}function gv(){var n=R.A;return R.A=mT,n}function iu(){yt=4,Ro||(Ue&4194048)!==Ue&&pn.current!==null||(bl=!0),(jo&134217727)===0&&(Ni&134217727)===0||ot===null||Do(ot,Ue,xn,!1)}function nm(n,o,a){var u=Ze;Ze|=2;var y=pv(),v=gv();(ot!==n||Ue!==o)&&(ru=null,El(n,o)),o=!1;var T=yt;e:do try{if(Je!==0&&Be!==null){var I=Be,Z=yn;switch(Je){case 8:tm(),T=6;break e;case 3:case 2:case 9:case 6:pn.current===null&&(o=!0);var ie=Je;if(Je=0,yn=null,Cl(n,I,Z,ie),a&&bl){T=0;break e}break;default:ie=Je,Je=0,yn=null,Cl(n,I,Z,ie)}}yT(),T=yt;break}catch(ue){hv(n,ue)}while(!0);return o&&n.shellSuspendCounter++,Pr=gi=null,Ze=u,R.H=y,R.A=v,Be===null&&(ot=null,Ue=0,Nc()),T}function yT(){for(;Be!==null;)yv(Be)}function xT(n,o){var a=Ze;Ze|=2;var u=pv(),y=gv();ot!==n||Ue!==o?(ru=null,nu=Rt()+500,El(n,o)):bl=ii(n,o);e:do try{if(Je!==0&&Be!==null){o=Be;var v=yn;t:switch(Je){case 1:Je=0,yn=null,Cl(n,o,v,1);break;case 2:case 9:if(kx(v)){Je=0,yn=null,xv(o);break}o=function(){Je!==2&&Je!==9||ot!==n||(Je=7),dr(n)},v.then(o,o);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:kx(v)?(Je=0,yn=null,xv(o)):(Je=0,yn=null,Cl(n,o,v,7));break;case 5:var T=null;switch(Be.tag){case 26:T=Be.memoizedState;case 5:case 27:var I=Be;if(T?rb(T):I.stateNode.complete){Je=0,yn=null;var Z=I.sibling;if(Z!==null)Be=Z;else{var ie=I.return;ie!==null?(Be=ie,lu(ie)):Be=null}break t}}Je=0,yn=null,Cl(n,o,v,5);break;case 6:Je=0,yn=null,Cl(n,o,v,6);break;case 8:tm(),yt=6;break e;default:throw Error(i(462))}}vT();break}catch(ue){hv(n,ue)}while(!0);return Pr=gi=null,R.H=u,R.A=y,Ze=a,Be!==null?0:(ot=null,Ue=0,Nc(),yt)}function vT(){for(;Be!==null&&!Rr();)yv(Be)}function yv(n){var o=U0(n.alternate,n,Zr);n.memoizedProps=n.pendingProps,o===null?lu(n):Be=o}function xv(n){var o=n,a=o.alternate;switch(o.tag){case 15:case 0:o=z0(a,o,o.pendingProps,o.type,void 0,Ue);break;case 11:o=z0(a,o,o.pendingProps,o.type.render,o.ref,Ue);break;case 5:yh(o);default:$0(a,o),o=Be=gx(o,Zr),o=U0(a,o,Zr)}n.memoizedProps=n.pendingProps,o===null?lu(n):Be=o}function Cl(n,o,a,u){Pr=gi=null,yh(o),hl=null,ja=0;var y=o.return;try{if(aT(n,y,o,a,Ue)){yt=1,Xc(n,jn(a,n.current)),Be=null;return}}catch(v){if(y!==null)throw Be=y,v;yt=1,Xc(n,jn(a,n.current)),Be=null;return}o.flags&32768?(Ye||u===1?n=!0:bl||(Ue&536870912)!==0?n=!1:(Ro=n=!0,(u===2||u===9||u===3||u===6)&&(u=pn.current,u!==null&&u.tag===13&&(u.flags|=16384))),vv(o,n)):lu(o)}function lu(n){var o=n;do{if((o.flags&32768)!==0){vv(o,Ro);return}n=o.return;var a=uT(o.alternate,o,Zr);if(a!==null){Be=a;return}if(o=o.sibling,o!==null){Be=o;return}Be=o=n}while(o!==null);yt===0&&(yt=5)}function vv(n,o){do{var a=fT(n.alternate,n);if(a!==null){a.flags&=32767,Be=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!o&&(n=n.sibling,n!==null)){Be=n;return}Be=n=a}while(n!==null);yt=6,Be=null}function bv(n,o,a,u,y,v,T,I,Z){n.cancelPendingCommit=null;do au();while(Mt!==0);if((Ze&6)!==0)throw Error(i(327));if(o!==null){if(o===n.current)throw Error(i(177));if(v=o.lanes|o.childLanes,v|=Yd,bd(n,a,v,T,I,Z),n===ot&&(Be=ot=null,Ue=0),Sl=o,Oo=n,Kr=a,Qh=v,Jh=y,cv=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,ET(ke,function(){return Nv(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=R.T,R.T=null,y=V.p,V.p=2,T=Ze,Ze|=4;try{dT(n,o,a)}finally{Ze=T,V.p=y,R.T=u}}Mt=1,wv(),Sv(),Ev()}}function wv(){if(Mt===1){Mt=0;var n=Oo,o=Sl,a=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||a){a=R.T,R.T=null;var u=V.p;V.p=2;var y=Ze;Ze|=4;try{tv(o,n);var v=mm,T=ax(n.containerInfo),I=v.focusedElem,Z=v.selectionRange;if(T!==I&&I&&I.ownerDocument&&lx(I.ownerDocument.documentElement,I)){if(Z!==null&&Hd(I)){var ie=Z.start,ue=Z.end;if(ue===void 0&&(ue=ie),"selectionStart"in I)I.selectionStart=ie,I.selectionEnd=Math.min(ue,I.value.length);else{var de=I.ownerDocument||document,le=de&&de.defaultView||window;if(le.getSelection){var ae=le.getSelection(),be=I.textContent.length,Te=Math.min(Z.start,be),rt=Z.end===void 0?Te:Math.min(Z.end,be);!ae.extend&&Te>rt&&(T=rt,rt=Te,Te=T);var ee=ix(I,Te),Q=ix(I,rt);if(ee&&Q&&(ae.rangeCount!==1||ae.anchorNode!==ee.node||ae.anchorOffset!==ee.offset||ae.focusNode!==Q.node||ae.focusOffset!==Q.offset)){var re=de.createRange();re.setStart(ee.node,ee.offset),ae.removeAllRanges(),Te>rt?(ae.addRange(re),ae.extend(Q.node,Q.offset)):(re.setEnd(Q.node,Q.offset),ae.addRange(re))}}}}for(de=[],ae=I;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<de.length;I++){var fe=de[I];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}vu=!!hm,mm=hm=null}finally{Ze=y,V.p=u,R.T=a}}n.current=o,Mt=2}}function Sv(){if(Mt===2){Mt=0;var n=Oo,o=Sl,a=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||a){a=R.T,R.T=null;var u=V.p;V.p=2;var y=Ze;Ze|=4;try{Z0(n,o.alternate,o)}finally{Ze=y,V.p=u,R.T=a}}Mt=3}}function Ev(){if(Mt===4||Mt===3){Mt=0,jr();var n=Oo,o=Sl,a=Kr,u=cv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Mt=5:(Mt=0,Sl=Oo=null,Cv(n,n.pendingLanes));var y=n.pendingLanes;if(y===0&&(Mo=null),ma(a),o=o.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Lt,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=R.T,y=V.p,V.p=2,R.T=null;try{for(var v=n.onRecoverableError,T=0;T<u.length;T++){var I=u[T];v(I.value,{componentStack:I.stack})}}finally{R.T=o,V.p=y}}(Kr&3)!==0&&au(),dr(n),y=n.pendingLanes,(a&261930)!==0&&(y&42)!==0?n===em?Ga++:(Ga=0,em=n):Ga=0,Wa(0)}}function Cv(n,o){(n.pooledCacheLanes&=o)===0&&(o=n.pooledCache,o!=null&&(n.pooledCache=null,Aa(o)))}function au(){return wv(),Sv(),Ev(),Nv()}function Nv(){if(Mt!==5)return!1;var n=Oo,o=Qh;Qh=0;var a=ma(Kr),u=R.T,y=V.p;try{V.p=32>a?32:a,R.T=null,a=Jh,Jh=null;var v=Oo,T=Kr;if(Mt=0,Sl=Oo=null,Kr=0,(Ze&6)!==0)throw Error(i(331));var I=Ze;if(Ze|=4,lv(v.current),rv(v,v.current,T,a),Ze=I,Wa(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Lt,v)}catch{}return!0}finally{V.p=y,R.T=u,Cv(n,o)}}function _v(n,o,a){o=jn(a,o),o=Mh(n.stateNode,o,2),n=_o(n,o,2),n!==null&&(li(n,2),dr(n))}function et(n,o,a){if(n.tag===3)_v(n,n,a);else for(;o!==null;){if(o.tag===3){_v(o,n,a);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Mo===null||!Mo.has(u))){n=jn(a,n),a=k0(2),u=_o(o,a,2),u!==null&&(T0(a,u,o,n),li(u,2),dr(u));break}}o=o.return}}function rm(n,o,a){var u=n.pingCache;if(u===null){u=n.pingCache=new pT;var y=new Set;u.set(o,y)}else y=u.get(o),y===void 0&&(y=new Set,u.set(o,y));y.has(a)||(Wh=!0,y.add(a),n=bT.bind(null,n,o,a),o.then(n,n))}function bT(n,o,a){var u=n.pingCache;u!==null&&u.delete(o),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,ot===n&&(Ue&a)===a&&(yt===4||yt===3&&(Ue&62914560)===Ue&&300>Rt()-tu?(Ze&2)===0&&El(n,0):Zh|=a,wl===Ue&&(wl=0)),dr(n)}function kv(n,o){o===0&&(o=rc()),n=hi(n,o),n!==null&&(li(n,o),dr(n))}function wT(n){var o=n.memoizedState,a=0;o!==null&&(a=o.retryLane),kv(n,a)}function ST(n,o){var a=0;switch(n.tag){case 31:case 13:var u=n.stateNode,y=n.memoizedState;y!==null&&(a=y.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(o),kv(n,a)}function ET(n,o){return Kt(n,o)}var su=null,Nl=null,om=!1,cu=!1,im=!1,zo=0;function dr(n){n!==Nl&&n.next===null&&(Nl===null?su=Nl=n:Nl=Nl.next=n),cu=!0,om||(om=!0,NT())}function Wa(n,o){if(!im&&cu){im=!0;do for(var a=!1,u=su;u!==null;){if(n!==0){var y=u.pendingLanes;if(y===0)var v=0;else{var T=u.suspendedLanes,I=u.pingedLanes;v=(1<<31-Qe(42|n)+1)-1,v&=y&~(T&~I),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(a=!0,jv(u,v))}else v=Ue,v=Xi(u,u===ot?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||ii(u,v)||(a=!0,jv(u,v));u=u.next}while(a);im=!1}}function CT(){Tv()}function Tv(){cu=om=!1;var n=0;zo!==0&&zT()&&(n=zo);for(var o=Rt(),a=null,u=su;u!==null;){var y=u.next,v=Av(u,o);v===0?(u.next=null,a===null?su=y:a.next=y,y===null&&(Nl=a)):(a=u,(n!==0||(v&3)!==0)&&(cu=!0)),u=y}Mt!==0&&Mt!==5||Wa(n),zo!==0&&(zo=0)}function Av(n,o){for(var a=n.suspendedLanes,u=n.pingedLanes,y=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var T=31-Qe(v),I=1<<T,Z=y[T];Z===-1?((I&a)===0||(I&u)!==0)&&(y[T]=vd(I,o)):Z<=o&&(n.expiredLanes|=I),v&=~I}if(o=ot,a=Ue,a=Xi(n,n===o?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,a===0||n===o&&(Je===2||Je===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&Vn(u),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||ii(n,a)){if(o=a&-a,o===n.callbackPriority)return o;switch(u!==null&&Vn(u),ma(a)){case 2:case 8:a=ye;break;case 32:a=ke;break;case 268435456:a=qe;break;default:a=ke}return u=Rv.bind(null,n),a=Kt(a,u),n.callbackPriority=o,n.callbackNode=a,o}return u!==null&&u!==null&&Vn(u),n.callbackPriority=2,n.callbackNode=null,2}function Rv(n,o){if(Mt!==0&&Mt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(au()&&n.callbackNode!==a)return null;var u=Ue;return u=Xi(n,n===ot?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(fv(n,u,o),Av(n,Rt()),n.callbackNode!=null&&n.callbackNode===a?Rv.bind(null,n):null)}function jv(n,o){if(au())return null;fv(n,o,!0)}function NT(){IT(function(){(Ze&6)!==0?Kt(ce,CT):Tv()})}function lm(){if(zo===0){var n=ul;n===0&&(n=Yi,Yi<<=1,(Yi&261888)===0&&(Yi=256)),zo=n}return zo}function Mv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:yc(""+n)}function Ov(n,o){var a=o.ownerDocument.createElement("input");return a.name=o.name,a.value=o.value,n.id&&a.setAttribute("form",n.id),o.parentNode.insertBefore(a,o),n=new FormData(n),a.parentNode.removeChild(a),n}function _T(n,o,a,u,y){if(o==="submit"&&a&&a.stateNode===y){var v=Mv((y[Yt]||null).action),T=u.submitter;T&&(o=(o=T[Yt]||null)?Mv(o.formAction):T.getAttribute("formAction"),o!==null&&(v=o,T=null));var I=new wc("action","action",null,u,y);n.push({event:I,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(zo!==0){var Z=T?Ov(y,T):new FormData(y);_h(a,{pending:!0,data:Z,method:y.method,action:v},null,Z)}}else typeof v=="function"&&(I.preventDefault(),Z=T?Ov(y,T):new FormData(y),_h(a,{pending:!0,data:Z,method:y.method,action:v},v,Z))},currentTarget:y}]})}}for(var am=0;am<$d.length;am++){var sm=$d[am],kT=sm.toLowerCase(),TT=sm[0].toUpperCase()+sm.slice(1);qn(kT,"on"+TT)}qn(ux,"onAnimationEnd"),qn(fx,"onAnimationIteration"),qn(dx,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(Yk,"onTransitionRun"),qn(qk,"onTransitionStart"),qn(Fk,"onTransitionCancel"),qn(hx,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),Dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Dr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Za="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(" "),AT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Za));function Dv(n,o){o=(o&4)!==0;for(var a=0;a<n.length;a++){var u=n[a],y=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var T=u.length-1;0<=T;T--){var I=u[T],Z=I.instance,ie=I.currentTarget;if(I=I.listener,Z!==v&&y.isPropagationStopped())break e;v=I,y.currentTarget=ie;try{v(y)}catch(ue){Cc(ue)}y.currentTarget=null,v=Z}else for(T=0;T<u.length;T++){if(I=u[T],Z=I.instance,ie=I.currentTarget,I=I.listener,Z!==v&&y.isPropagationStopped())break e;v=I,y.currentTarget=ie;try{v(y)}catch(ue){Cc(ue)}y.currentTarget=null,v=Z}}}}function He(n,o){var a=o[Gi];a===void 0&&(a=o[Gi]=new Set);var u=n+"__bubble";a.has(u)||(zv(o,n,2,!1),a.add(u))}function cm(n,o,a){var u=0;o&&(u|=4),zv(a,n,u,o)}var uu="_reactListening"+Math.random().toString(36).slice(2);function um(n){if(!n[uu]){n[uu]=!0,fc.forEach(function(a){a!=="selectionchange"&&(AT.has(a)||cm(a,!1,n),cm(a,!0,n))});var o=n.nodeType===9?n:n.ownerDocument;o===null||o[uu]||(o[uu]=!0,cm("selectionchange",!1,o))}}function zv(n,o,a,u){switch(ub(o)){case 2:var y=rA;break;case 8:y=oA;break;default:y=Nm}a=y.bind(null,o,a,n),y=void 0,!Rd||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),u?y!==void 0?n.addEventListener(o,a,{capture:!0,passive:y}):n.addEventListener(o,a,!0):y!==void 0?n.addEventListener(o,a,{passive:y}):n.addEventListener(o,a,!1)}function fm(n,o,a,u,y){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var T=u.tag;if(T===3||T===4){var I=u.stateNode.containerInfo;if(I===y)break;if(T===4)for(T=u.return;T!==null;){var Z=T.tag;if((Z===3||Z===4)&&T.stateNode.containerInfo===y)return;T=T.return}for(;I!==null;){if(T=mo(I),T===null)return;if(Z=T.tag,Z===5||Z===6||Z===26||Z===27){u=v=T;continue e}I=I.parentNode}}u=u.return}Py(function(){var ie=v,ue=Td(a),de=[];e:{var le=mx.get(n);if(le!==void 0){var ae=wc,be=n;switch(n){case"keypress":if(vc(a)===0)break e;case"keydown":case"keyup":ae=Sk;break;case"focusin":be="focus",ae=Dd;break;case"focusout":be="blur",ae=Dd;break;case"beforeblur":case"afterblur":ae=Dd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=$y;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=uk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Nk;break;case ux:case fx:case dx:ae=hk;break;case hx:ae=kk;break;case"scroll":case"scrollend":ae=sk;break;case"wheel":ae=Ak;break;case"copy":case"cut":case"paste":ae=pk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=qy;break;case"toggle":case"beforetoggle":ae=jk}var Te=(o&4)!==0,rt=!Te&&(n==="scroll"||n==="scrollend"),ee=Te?le!==null?le+"Capture":null:le;Te=[];for(var Q=ie,re;Q!==null;){var fe=Q;if(re=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||re===null||ee===null||(fe=xa(Q,ee),fe!=null&&Te.push(Ka(Q,fe,re))),rt)break;Q=Q.return}0<Te.length&&(le=new ae(le,be,null,a,ue),de.push({event:le,listeners:Te}))}}if((o&7)===0){e:{if(le=n==="mouseover"||n==="pointerover",ae=n==="mouseout"||n==="pointerout",le&&a!==kd&&(be=a.relatedTarget||a.fromElement)&&(mo(be)||be[Or]))break e;if((ae||le)&&(le=ue.window===ue?ue:(le=ue.ownerDocument)?le.defaultView||le.parentWindow:window,ae?(be=a.relatedTarget||a.toElement,ae=ie,be=be?mo(be):null,be!==null&&(rt=s(be),Te=be.tag,be!==rt||Te!==5&&Te!==27&&Te!==6)&&(be=null)):(ae=null,be=ie),ae!==be)){if(Te=$y,fe="onMouseLeave",ee="onMouseEnter",Q="mouse",(n==="pointerout"||n==="pointerover")&&(Te=qy,fe="onPointerLeave",ee="onPointerEnter",Q="pointer"),rt=ae==null?le:go(ae),re=be==null?le:go(be),le=new Te(fe,Q+"leave",ae,a,ue),le.target=rt,le.relatedTarget=re,fe=null,mo(ue)===ie&&(Te=new Te(ee,Q+"enter",be,a,ue),Te.target=re,Te.relatedTarget=rt,fe=Te),rt=fe,ae&&be)t:{for(Te=RT,ee=ae,Q=be,re=0,fe=ee;fe;fe=Te(fe))re++;fe=0;for(var Ne=Q;Ne;Ne=Te(Ne))fe++;for(;0<re-fe;)ee=Te(ee),re--;for(;0<fe-re;)Q=Te(Q),fe--;for(;re--;){if(ee===Q||Q!==null&&ee===Q.alternate){Te=ee;break t}ee=Te(ee),Q=Te(Q)}Te=null}else Te=null;ae!==null&&Lv(de,le,ae,Te,!1),be!==null&&rt!==null&&Lv(de,rt,be,Te,!0)}}e:{if(le=ie?go(ie):window,ae=le.nodeName&&le.nodeName.toLowerCase(),ae==="select"||ae==="input"&&le.type==="file")var Xe=Jy;else if(Ky(le))if(ex)Xe=Uk;else{Xe=Hk;var Ee=Bk}else ae=le.nodeName,!ae||ae.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ie&&_d(ie.elementType)&&(Xe=Jy):Xe=Pk;if(Xe&&(Xe=Xe(n,ie))){Qy(de,Xe,a,ue);break e}Ee&&Ee(n,le,ie),n==="focusout"&&ie&&le.type==="number"&&ie.memoizedProps.value!=null&&ya(le,"number",le.value)}switch(Ee=ie?go(ie):window,n){case"focusin":(Ky(Ee)||Ee.contentEditable==="true")&&(nl=Ee,Pd=ie,_a=null);break;case"focusout":_a=Pd=nl=null;break;case"mousedown":Ud=!0;break;case"contextmenu":case"mouseup":case"dragend":Ud=!1,sx(de,a,ue);break;case"selectionchange":if($k)break;case"keydown":case"keyup":sx(de,a,ue)}var De;if(Ld)e:{switch(n){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else tl?Wy(n,a)&&(Ve="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Fy&&a.locale!=="ko"&&(tl||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&tl&&(De=Uy()):(vo=ue,jd="value"in vo?vo.value:vo.textContent,tl=!0)),Ee=fu(ie,Ve),0<Ee.length&&(Ve=new Yy(Ve,n,null,a,ue),de.push({event:Ve,listeners:Ee}),De?Ve.data=De:(De=Zy(a),De!==null&&(Ve.data=De)))),(De=Ok?Dk(n,a):zk(n,a))&&(Ve=fu(ie,"onBeforeInput"),0<Ve.length&&(Ee=new Yy("onBeforeInput","beforeinput",null,a,ue),de.push({event:Ee,listeners:Ve}),Ee.data=De)),_T(de,n,ie,a,ue)}Dv(de,o)})}function Ka(n,o,a){return{instance:n,listener:o,currentTarget:a}}function fu(n,o){for(var a=o+"Capture",u=[];n!==null;){var y=n,v=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||v===null||(y=xa(n,a),y!=null&&u.unshift(Ka(n,y,v)),y=xa(n,o),y!=null&&u.push(Ka(n,y,v))),n.tag===3)return u;n=n.return}return[]}function RT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Lv(n,o,a,u,y){for(var v=o._reactName,T=[];a!==null&&a!==u;){var I=a,Z=I.alternate,ie=I.stateNode;if(I=I.tag,Z!==null&&Z===u)break;I!==5&&I!==26&&I!==27||ie===null||(Z=ie,y?(ie=xa(a,v),ie!=null&&T.unshift(Ka(a,ie,Z))):y||(ie=xa(a,v),ie!=null&&T.push(Ka(a,ie,Z)))),a=a.return}T.length!==0&&n.push({event:o,listeners:T})}var jT=/\r\n?/g,MT=/\u0000|\uFFFD/g;function Iv(n){return(typeof n=="string"?n:""+n).replace(jT,`
9
+ `).replace(MT,"")}function Bv(n,o){return o=Iv(o),Iv(n)===o}function nt(n,o,a,u,y,v){switch(a){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||Qi(n,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&Qi(n,""+u);break;case"className":Zi(n,"class",u);break;case"tabIndex":Zi(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Zi(n,a,u);break;case"style":By(n,u,v);break;case"data":if(o!=="object"){Zi(n,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||a!=="href")){n.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(a);break}u=yc(""+u),n.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(a==="formAction"?(o!=="input"&&nt(n,o,"name",y.name,y,null),nt(n,o,"formEncType",y.formEncType,y,null),nt(n,o,"formMethod",y.formMethod,y,null),nt(n,o,"formTarget",y.formTarget,y,null)):(nt(n,o,"encType",y.encType,y,null),nt(n,o,"method",y.method,y,null),nt(n,o,"target",y.target,y,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(a);break}u=yc(""+u),n.setAttribute(a,u);break;case"onClick":u!=null&&(n.onclick=Lr);break;case"onScroll":u!=null&&He("scroll",n);break;case"onScrollEnd":u!=null&&He("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(a=u.__html,a!=null){if(y.children!=null)throw Error(i(60));n.innerHTML=a}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}a=yc(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(a,""+u):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(a,""):n.removeAttribute(a);break;case"capture":case"download":u===!0?n.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(a,u):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(a,u):n.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(a):n.setAttribute(a,u);break;case"popover":He("beforetoggle",n),He("toggle",n),Wi(n,"popover",u);break;case"xlinkActuate":Yn(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Yn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Yn(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Yn(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Yn(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Yn(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Yn(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Wi(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=lk.get(a)||a,Wi(n,a,u))}}function dm(n,o,a,u,y,v){switch(a){case"style":By(n,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(a=u.__html,a!=null){if(y.children!=null)throw Error(i(60));n.innerHTML=a}}break;case"children":typeof u=="string"?Qi(n,u):(typeof u=="number"||typeof u=="bigint")&&Qi(n,""+u);break;case"onScroll":u!=null&&He("scroll",n);break;case"onScrollEnd":u!=null&&He("scrollend",n);break;case"onClick":u!=null&&(n.onclick=Lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(y=a.endsWith("Capture"),o=a.slice(2,y?a.length-7:void 0),v=n[Yt]||null,v=v!=null?v[a]:null,typeof v=="function"&&n.removeEventListener(o,v,y),typeof u=="function")){typeof v!="function"&&v!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(o,u,y);break e}a in n?n[a]=u:u===!0?n.setAttribute(a,""):Wi(n,a,u)}}}function Pt(n,o,a){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",n),He("load",n);var u=!1,y=!1,v;for(v in a)if(a.hasOwnProperty(v)){var T=a[v];if(T!=null)switch(v){case"src":u=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:nt(n,o,v,T,a,null)}}y&&nt(n,o,"srcSet",a.srcSet,a,null),u&&nt(n,o,"src",a.src,a,null);return;case"input":He("invalid",n);var I=v=T=y=null,Z=null,ie=null;for(u in a)if(a.hasOwnProperty(u)){var ue=a[u];if(ue!=null)switch(u){case"name":y=ue;break;case"type":T=ue;break;case"checked":Z=ue;break;case"defaultChecked":ie=ue;break;case"value":v=ue;break;case"defaultValue":I=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(i(137,o));break;default:nt(n,o,u,ue,a,null)}}gc(n,v,I,Z,ie,T,y,!1);return;case"select":He("invalid",n),u=T=v=null;for(y in a)if(a.hasOwnProperty(y)&&(I=a[y],I!=null))switch(y){case"value":v=I;break;case"defaultValue":T=I;break;case"multiple":u=I;default:nt(n,o,y,I,a,null)}o=v,a=T,n.multiple=!!u,o!=null?zr(n,!!u,o,!1):a!=null&&zr(n,!!u,a,!0);return;case"textarea":He("invalid",n),v=y=u=null;for(T in a)if(a.hasOwnProperty(T)&&(I=a[T],I!=null))switch(T){case"value":u=I;break;case"defaultValue":y=I;break;case"children":v=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(91));break;default:nt(n,o,T,I,a,null)}Ly(n,u,y,v);return;case"option":for(Z in a)a.hasOwnProperty(Z)&&(u=a[Z],u!=null)&&(Z==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":nt(n,o,Z,u,a,null));return;case"dialog":He("beforetoggle",n),He("toggle",n),He("cancel",n),He("close",n);break;case"iframe":case"object":He("load",n);break;case"video":case"audio":for(u=0;u<Za.length;u++)He(Za[u],n);break;case"image":He("error",n),He("load",n);break;case"details":He("toggle",n);break;case"embed":case"source":case"link":He("error",n),He("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in a)if(a.hasOwnProperty(ie)&&(u=a[ie],u!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:nt(n,o,ie,u,a,null)}return;default:if(_d(o)){for(ue in a)a.hasOwnProperty(ue)&&(u=a[ue],u!==void 0&&dm(n,o,ue,u,a,void 0));return}}for(I in a)a.hasOwnProperty(I)&&(u=a[I],u!=null&&nt(n,o,I,u,a,null))}function OT(n,o,a,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,v=null,T=null,I=null,Z=null,ie=null,ue=null;for(ae in a){var de=a[ae];if(a.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:u.hasOwnProperty(ae)||nt(n,o,ae,null,u,de)}}for(var le in u){var ae=u[le];if(de=a[le],u.hasOwnProperty(le)&&(ae!=null||de!=null))switch(le){case"type":v=ae;break;case"name":y=ae;break;case"checked":ie=ae;break;case"defaultChecked":ue=ae;break;case"value":T=ae;break;case"defaultValue":I=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,o));break;default:ae!==de&&nt(n,o,le,ae,u,de)}}ci(n,T,I,Z,ie,ue,v,y);return;case"select":ae=T=I=le=null;for(v in a)if(Z=a[v],a.hasOwnProperty(v)&&Z!=null)switch(v){case"value":break;case"multiple":ae=Z;default:u.hasOwnProperty(v)||nt(n,o,v,null,u,Z)}for(y in u)if(v=u[y],Z=a[y],u.hasOwnProperty(y)&&(v!=null||Z!=null))switch(y){case"value":le=v;break;case"defaultValue":I=v;break;case"multiple":T=v;default:v!==Z&&nt(n,o,y,v,u,Z)}o=I,a=T,u=ae,le!=null?zr(n,!!a,le,!1):!!u!=!!a&&(o!=null?zr(n,!!a,o,!0):zr(n,!!a,a?[]:"",!1));return;case"textarea":ae=le=null;for(I in a)if(y=a[I],a.hasOwnProperty(I)&&y!=null&&!u.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:nt(n,o,I,null,u,y)}for(T in u)if(y=u[T],v=a[T],u.hasOwnProperty(T)&&(y!=null||v!=null))switch(T){case"value":le=y;break;case"defaultValue":ae=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==v&&nt(n,o,T,y,u,v)}zy(n,le,ae);return;case"option":for(var be in a)le=a[be],a.hasOwnProperty(be)&&le!=null&&!u.hasOwnProperty(be)&&(be==="selected"?n.selected=!1:nt(n,o,be,null,u,le));for(Z in u)le=u[Z],ae=a[Z],u.hasOwnProperty(Z)&&le!==ae&&(le!=null||ae!=null)&&(Z==="selected"?n.selected=le&&typeof le!="function"&&typeof le!="symbol":nt(n,o,Z,le,u,ae));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in a)le=a[Te],a.hasOwnProperty(Te)&&le!=null&&!u.hasOwnProperty(Te)&&nt(n,o,Te,null,u,le);for(ie in u)if(le=u[ie],ae=a[ie],u.hasOwnProperty(ie)&&le!==ae&&(le!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(i(137,o));break;default:nt(n,o,ie,le,u,ae)}return;default:if(_d(o)){for(var rt in a)le=a[rt],a.hasOwnProperty(rt)&&le!==void 0&&!u.hasOwnProperty(rt)&&dm(n,o,rt,void 0,u,le);for(ue in u)le=u[ue],ae=a[ue],!u.hasOwnProperty(ue)||le===ae||le===void 0&&ae===void 0||dm(n,o,ue,le,u,ae);return}}for(var ee in a)le=a[ee],a.hasOwnProperty(ee)&&le!=null&&!u.hasOwnProperty(ee)&&nt(n,o,ee,null,u,le);for(de in u)le=u[de],ae=a[de],!u.hasOwnProperty(de)||le===ae||le==null&&ae==null||nt(n,o,de,le,u,ae)}function Hv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DT(){if(typeof performance.getEntriesByType=="function"){for(var n=0,o=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var y=a[u],v=y.transferSize,T=y.initiatorType,I=y.duration;if(v&&I&&Hv(T)){for(T=0,I=y.responseEnd,u+=1;u<a.length;u++){var Z=a[u],ie=Z.startTime;if(ie>I)break;var ue=Z.transferSize,de=Z.initiatorType;ue&&Hv(de)&&(Z=Z.responseEnd,T+=ue*(Z<I?1:(I-ie)/(Z-ie)))}if(--u,o+=8*(v+T)/(y.duration/1e3),n++,10<n)break}}if(0<n)return o/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var hm=null,mm=null;function du(n){return n.nodeType===9?n:n.ownerDocument}function Pv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Uv(n,o){if(n===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&o==="foreignObject"?0:n}function pm(n,o){return n==="textarea"||n==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var gm=null;function zT(){var n=window.event;return n&&n.type==="popstate"?n===gm?!1:(gm=n,!0):(gm=null,!1)}var Vv=typeof setTimeout=="function"?setTimeout:void 0,LT=typeof clearTimeout=="function"?clearTimeout:void 0,$v=typeof Promise=="function"?Promise:void 0,IT=typeof queueMicrotask=="function"?queueMicrotask:typeof $v<"u"?function(n){return $v.resolve(null).then(n).catch(BT)}:Vv;function BT(n){setTimeout(function(){throw n})}function Lo(n){return n==="head"}function Yv(n,o){var a=o,u=0;do{var y=a.nextSibling;if(n.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"||a==="/&"){if(u===0){n.removeChild(y),Al(o);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")Qa(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,Qa(a);for(var v=a.firstChild;v;){var T=v.nextSibling,I=v.nodeName;v[ai]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&v.rel.toLowerCase()==="stylesheet"||a.removeChild(v),v=T}}else a==="body"&&Qa(n.ownerDocument.body);a=y}while(a);Al(o)}function qv(n,o){var a=n;n=0;do{var u=a.nextSibling;if(a.nodeType===1?o?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(o?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=u}while(a)}function ym(n){var o=n.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var a=o;switch(o=o.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ym(a),pa(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function HT(n,o,a,u){for(;n.nodeType===1;){var y=a;if(n.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ai])switch(o){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==y.rel||n.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||n.getAttribute("title")!==(y.title==null?null:y.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(v=n.getAttribute("src"),(v!==(y.src==null?null:y.src)||n.getAttribute("type")!==(y.type==null?null:y.type)||n.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(o==="input"&&n.type==="hidden"){var v=y.name==null?null:""+y.name;if(y.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=Ln(n.nextSibling),n===null)break}return null}function PT(n,o,a){if(o==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Ln(n.nextSibling),n===null))return null;return n}function Fv(n,o){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Ln(n.nextSibling),n===null))return null;return n}function xm(n){return n.data==="$?"||n.data==="$~"}function vm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function UT(n,o){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=o;else if(n.data!=="$?"||a.readyState!=="loading")o();else{var u=function(){o(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Ln(n){for(;n!=null;n=n.nextSibling){var o=n.nodeType;if(o===1||o===3)break;if(o===8){if(o=n.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return n}var bm=null;function Xv(n){n=n.nextSibling;for(var o=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(o===0)return Ln(n.nextSibling);o--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||o++}n=n.nextSibling}return null}function Gv(n){n=n.previousSibling;for(var o=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(o===0)return n;o--}else a!=="/$"&&a!=="/&"||o++}n=n.previousSibling}return null}function Wv(n,o,a){switch(o=du(a),n){case"html":if(n=o.documentElement,!n)throw Error(i(452));return n;case"head":if(n=o.head,!n)throw Error(i(453));return n;case"body":if(n=o.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Qa(n){for(var o=n.attributes;o.length;)n.removeAttributeNode(o[0]);pa(n)}var In=new Map,Zv=new Set;function hu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Qr=V.d;V.d={f:VT,r:$T,D:YT,C:qT,L:FT,m:XT,X:WT,S:GT,M:ZT};function VT(){var n=Qr.f(),o=ou();return n||o}function $T(n){var o=po(n);o!==null&&o.tag===5&&o.type==="form"?h0(o):Qr.r(n)}var _l=typeof document>"u"?null:document;function Kv(n,o,a){var u=_l;if(u&&typeof o=="string"&&o){var y=Jt(o);y='link[rel="'+n+'"][href="'+y+'"]',typeof a=="string"&&(y+='[crossorigin="'+a+'"]'),Zv.has(y)||(Zv.add(y),n={rel:n,crossOrigin:a,href:o},u.querySelector(y)===null&&(o=u.createElement("link"),Pt(o,"link",n),Et(o),u.head.appendChild(o)))}}function YT(n){Qr.D(n),Kv("dns-prefetch",n,null)}function qT(n,o){Qr.C(n,o),Kv("preconnect",n,o)}function FT(n,o,a){Qr.L(n,o,a);var u=_l;if(u&&n&&o){var y='link[rel="preload"][as="'+Jt(o)+'"]';o==="image"&&a&&a.imageSrcSet?(y+='[imagesrcset="'+Jt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(y+='[imagesizes="'+Jt(a.imageSizes)+'"]')):y+='[href="'+Jt(n)+'"]';var v=y;switch(o){case"style":v=kl(n);break;case"script":v=Tl(n)}In.has(v)||(n=p({rel:"preload",href:o==="image"&&a&&a.imageSrcSet?void 0:n,as:o},a),In.set(v,n),u.querySelector(y)!==null||o==="style"&&u.querySelector(Ja(v))||o==="script"&&u.querySelector(es(v))||(o=u.createElement("link"),Pt(o,"link",n),Et(o),u.head.appendChild(o)))}}function XT(n,o){Qr.m(n,o);var a=_l;if(a&&n){var u=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Jt(u)+'"][href="'+Jt(n)+'"]',v=y;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Tl(n)}if(!In.has(v)&&(n=p({rel:"modulepreload",href:n},o),In.set(v,n),a.querySelector(y)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(es(v)))return}u=a.createElement("link"),Pt(u,"link",n),Et(u),a.head.appendChild(u)}}}function GT(n,o,a){Qr.S(n,o,a);var u=_l;if(u&&n){var y=yo(u).hoistableStyles,v=kl(n);o=o||"default";var T=y.get(v);if(!T){var I={loading:0,preload:null};if(T=u.querySelector(Ja(v)))I.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":o},a),(a=In.get(v))&&wm(n,a);var Z=T=u.createElement("link");Et(Z),Pt(Z,"link",n),Z._p=new Promise(function(ie,ue){Z.onload=ie,Z.onerror=ue}),Z.addEventListener("load",function(){I.loading|=1}),Z.addEventListener("error",function(){I.loading|=2}),I.loading|=4,mu(T,o,u)}T={type:"stylesheet",instance:T,count:1,state:I},y.set(v,T)}}}function WT(n,o){Qr.X(n,o);var a=_l;if(a&&n){var u=yo(a).hoistableScripts,y=Tl(n),v=u.get(y);v||(v=a.querySelector(es(y)),v||(n=p({src:n,async:!0},o),(o=In.get(y))&&Sm(n,o),v=a.createElement("script"),Et(v),Pt(v,"link",n),a.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(y,v))}}function ZT(n,o){Qr.M(n,o);var a=_l;if(a&&n){var u=yo(a).hoistableScripts,y=Tl(n),v=u.get(y);v||(v=a.querySelector(es(y)),v||(n=p({src:n,async:!0,type:"module"},o),(o=In.get(y))&&Sm(n,o),v=a.createElement("script"),Et(v),Pt(v,"link",n),a.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(y,v))}}function Qv(n,o,a,u){var y=(y=J.current)?hu(y):null;if(!y)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(o=kl(a.href),a=yo(y).hoistableStyles,u=a.get(o),u||(u={type:"style",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=kl(a.href);var v=yo(y).hoistableStyles,T=v.get(n);if(T||(y=y.ownerDocument||y,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,T),(v=y.querySelector(Ja(n)))&&!v._p&&(T.instance=v,T.state.loading=5),In.has(n)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},In.set(n,a),v||KT(y,n,a,T.state))),o&&u===null)throw Error(i(528,""));return T}if(o&&u!==null)throw Error(i(529,""));return null;case"script":return o=a.async,a=a.src,typeof a=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Tl(a),a=yo(y).hoistableScripts,u=a.get(o),u||(u={type:"script",instance:null,count:0,state:null},a.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function kl(n){return'href="'+Jt(n)+'"'}function Ja(n){return'link[rel="stylesheet"]['+n+"]"}function Jv(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function KT(n,o,a,u){n.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=n.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),Pt(o,"link",a),Et(o),n.head.appendChild(o))}function Tl(n){return'[src="'+Jt(n)+'"]'}function es(n){return"script[async]"+n}function eb(n,o,a){if(o.count++,o.instance===null)switch(o.type){case"style":var u=n.querySelector('style[data-href~="'+Jt(a.href)+'"]');if(u)return o.instance=u,Et(u),u;var y=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Et(u),Pt(u,"style",y),mu(u,a.precedence,n),o.instance=u;case"stylesheet":y=kl(a.href);var v=n.querySelector(Ja(y));if(v)return o.state.loading|=4,o.instance=v,Et(v),v;u=Jv(a),(y=In.get(y))&&wm(u,y),v=(n.ownerDocument||n).createElement("link"),Et(v);var T=v;return T._p=new Promise(function(I,Z){T.onload=I,T.onerror=Z}),Pt(v,"link",u),o.state.loading|=4,mu(v,a.precedence,n),o.instance=v;case"script":return v=Tl(a.src),(y=n.querySelector(es(v)))?(o.instance=y,Et(y),y):(u=a,(y=In.get(v))&&(u=p({},a),Sm(u,y)),n=n.ownerDocument||n,y=n.createElement("script"),Et(y),Pt(y,"link",u),n.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,mu(u,a.precedence,n));return o.instance}function mu(n,o,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=u.length?u[u.length-1]:null,v=y,T=0;T<u.length;T++){var I=u[T];if(I.dataset.precedence===o)v=I;else if(v!==y)break}v?v.parentNode.insertBefore(n,v.nextSibling):(o=a.nodeType===9?a.head:a,o.insertBefore(n,o.firstChild))}function wm(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.title==null&&(n.title=o.title)}function Sm(n,o){n.crossOrigin==null&&(n.crossOrigin=o.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=o.referrerPolicy),n.integrity==null&&(n.integrity=o.integrity)}var pu=null;function tb(n,o,a){if(pu===null){var u=new Map,y=pu=new Map;y.set(a,u)}else y=pu,u=y.get(a),u||(u=new Map,y.set(a,u));if(u.has(n))return u;for(u.set(n,null),a=a.getElementsByTagName(n),y=0;y<a.length;y++){var v=a[y];if(!(v[ai]||v[jt]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var T=v.getAttribute(o)||"";T=n+T;var I=u.get(T);I?I.push(v):u.set(T,[v])}}return u}function nb(n,o,a){n=n.ownerDocument||n,n.head.insertBefore(a,o==="title"?n.querySelector("head > title"):null)}function QT(n,o,a){if(a===1||o.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(n=o.disabled,typeof o.precedence=="string"&&n==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function rb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function JT(n,o,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var y=kl(u.href),v=o.querySelector(Ja(y));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(n.count++,n=gu.bind(n),o.then(n,n)),a.state.loading|=4,a.instance=v,Et(v);return}v=o.ownerDocument||o,u=Jv(u),(y=In.get(y))&&wm(u,y),v=v.createElement("link"),Et(v);var T=v;T._p=new Promise(function(I,Z){T.onload=I,T.onerror=Z}),Pt(v,"link",u),a.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,o),(o=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=gu.bind(n),o.addEventListener("load",a),o.addEventListener("error",a))}}var Em=0;function eA(n,o){return n.stylesheets&&n.count===0&&xu(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var u=setTimeout(function(){if(n.stylesheets&&xu(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+o);0<n.imgBytes&&Em===0&&(Em=62500*DT());var y=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&xu(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>Em?50:800)+o);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(y)}}:null}function gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xu(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var yu=null;function xu(n,o){n.stylesheets=null,n.unsuspend!==null&&(n.count++,yu=new Map,o.forEach(tA,n),yu=null,gu.call(n))}function tA(n,o){if(!(o.state.loading&4)){var a=yu.get(n);if(a)var u=a.get(null);else{a=new Map,yu.set(n,a);for(var y=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<y.length;v++){var T=y[v];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(a.set(T.dataset.precedence,T),u=T)}u&&a.set(null,u)}y=o.instance,T=y.getAttribute("data-precedence"),v=a.get(T)||u,v===u&&a.set(null,y),a.set(T,y),this.count++,u=gu.bind(this),y.addEventListener("load",u),y.addEventListener("error",u),v?v.parentNode.insertBefore(y,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(y,n.firstChild)),o.state.loading|=4}}var ts={$$typeof:C,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function nA(n,o,a,u,y,v,T,I,Z){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=da(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=da(0),this.hiddenUpdates=da(null),this.identifierPrefix=u,this.onUncaughtError=y,this.onCaughtError=v,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function ob(n,o,a,u,y,v,T,I,Z,ie,ue,de){return n=new nA(n,o,a,T,Z,ie,ue,de,I),o=1,v===!0&&(o|=24),v=mn(3,null,null,o),n.current=v,v.stateNode=n,o=nh(),o.refCount++,n.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:a,cache:o},lh(v),n}function ib(n){return n?(n=il,n):il}function lb(n,o,a,u,y,v){y=ib(y),u.context===null?u.context=y:u.pendingContext=y,u=No(o),u.payload={element:a},v=v===void 0?null:v,v!==null&&(u.callback=v),a=_o(n,u,o),a!==null&&(ln(a,n,o),Oa(a,n,o))}function ab(n,o){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<o?a:o}}function Cm(n,o){ab(n,o),(n=n.alternate)&&ab(n,o)}function sb(n){if(n.tag===13||n.tag===31){var o=hi(n,67108864);o!==null&&ln(o,n,67108864),Cm(n,67108864)}}function cb(n){if(n.tag===13||n.tag===31){var o=vn();o=ha(o);var a=hi(n,o);a!==null&&ln(a,n,o),Cm(n,o)}}var vu=!0;function rA(n,o,a,u){var y=R.T;R.T=null;var v=V.p;try{V.p=2,Nm(n,o,a,u)}finally{V.p=v,R.T=y}}function oA(n,o,a,u){var y=R.T;R.T=null;var v=V.p;try{V.p=8,Nm(n,o,a,u)}finally{V.p=v,R.T=y}}function Nm(n,o,a,u){if(vu){var y=_m(u);if(y===null)fm(n,o,u,bu,a),fb(n,u);else if(lA(y,n,o,a,u))u.stopPropagation();else if(fb(n,u),o&4&&-1<iA.indexOf(n)){for(;y!==null;){var v=po(y);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var T=Mr(v.pendingLanes);if(T!==0){var I=v;for(I.pendingLanes|=2,I.entangledLanes|=2;T;){var Z=1<<31-Qe(T);I.entanglements[1]|=Z,T&=~Z}dr(v),(Ze&6)===0&&(nu=Rt()+500,Wa(0))}}break;case 31:case 13:I=hi(v,2),I!==null&&ln(I,v,2),ou(),Cm(v,2)}if(v=_m(u),v===null&&fm(n,o,u,bu,a),v===y)break;y=v}y!==null&&u.stopPropagation()}else fm(n,o,u,null,a)}}function _m(n){return n=Td(n),km(n)}var bu=null;function km(n){if(bu=null,n=mo(n),n!==null){var o=s(n);if(o===null)n=null;else{var a=o.tag;if(a===13){if(n=c(o),n!==null)return n;n=null}else if(a===31){if(n=f(o),n!==null)return n;n=null}else if(a===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;n=null}else o!==n&&(n=null)}}return bu=n,null}function ub(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ho()){case ce:return 2;case ye:return 8;case ke:case Le:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Tm=!1,Io=null,Bo=null,Ho=null,ns=new Map,rs=new Map,Po=[],iA="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function fb(n,o){switch(n){case"focusin":case"focusout":Io=null;break;case"dragenter":case"dragleave":Bo=null;break;case"mouseover":case"mouseout":Ho=null;break;case"pointerover":case"pointerout":ns.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(o.pointerId)}}function os(n,o,a,u,y,v){return n===null||n.nativeEvent!==v?(n={blockedOn:o,domEventName:a,eventSystemFlags:u,nativeEvent:v,targetContainers:[y]},o!==null&&(o=po(o),o!==null&&sb(o)),n):(n.eventSystemFlags|=u,o=n.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),n)}function lA(n,o,a,u,y){switch(o){case"focusin":return Io=os(Io,n,o,a,u,y),!0;case"dragenter":return Bo=os(Bo,n,o,a,u,y),!0;case"mouseover":return Ho=os(Ho,n,o,a,u,y),!0;case"pointerover":var v=y.pointerId;return ns.set(v,os(ns.get(v)||null,n,o,a,u,y)),!0;case"gotpointercapture":return v=y.pointerId,rs.set(v,os(rs.get(v)||null,n,o,a,u,y)),!0}return!1}function db(n){var o=mo(n.target);if(o!==null){var a=s(o);if(a!==null){if(o=a.tag,o===13){if(o=c(a),o!==null){n.blockedOn=o,sc(n.priority,function(){cb(a)});return}}else if(o===31){if(o=f(a),o!==null){n.blockedOn=o,sc(n.priority,function(){cb(a)});return}}else if(o===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function wu(n){if(n.blockedOn!==null)return!1;for(var o=n.targetContainers;0<o.length;){var a=_m(n.nativeEvent);if(a===null){a=n.nativeEvent;var u=new a.constructor(a.type,a);kd=u,a.target.dispatchEvent(u),kd=null}else return o=po(a),o!==null&&sb(o),n.blockedOn=a,!1;o.shift()}return!0}function hb(n,o,a){wu(n)&&a.delete(o)}function aA(){Tm=!1,Io!==null&&wu(Io)&&(Io=null),Bo!==null&&wu(Bo)&&(Bo=null),Ho!==null&&wu(Ho)&&(Ho=null),ns.forEach(hb),rs.forEach(hb)}function Su(n,o){n.blockedOn===o&&(n.blockedOn=null,Tm||(Tm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aA)))}var Eu=null;function mb(n){Eu!==n&&(Eu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Eu===n&&(Eu=null);for(var o=0;o<n.length;o+=3){var a=n[o],u=n[o+1],y=n[o+2];if(typeof u!="function"){if(km(u||a)===null)continue;break}var v=po(a);v!==null&&(n.splice(o,3),o-=3,_h(v,{pending:!0,data:y,method:a.method,action:u},u,y))}}))}function Al(n){function o(Z){return Su(Z,n)}Io!==null&&Su(Io,n),Bo!==null&&Su(Bo,n),Ho!==null&&Su(Ho,n),ns.forEach(o),rs.forEach(o);for(var a=0;a<Po.length;a++){var u=Po[a];u.blockedOn===n&&(u.blockedOn=null)}for(;0<Po.length&&(a=Po[0],a.blockedOn===null);)db(a),a.blockedOn===null&&Po.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var y=a[u],v=a[u+1],T=y[Yt]||null;if(typeof v=="function")T||mb(a);else if(T){var I=null;if(v&&v.hasAttribute("formAction")){if(y=v,T=v[Yt]||null)I=T.formAction;else if(km(y)!==null)continue}else I=T.action;typeof I=="function"?a[u+1]=I:(a.splice(u,3),u-=3),mb(a)}}}function pb(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(T){return y=T})},focusReset:"manual",scroll:"manual"})}function o(){y!==null&&(y(),y=null),u||setTimeout(a,20)}function a(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,y=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),y!==null&&(y(),y=null)}}}function Am(n){this._internalRoot=n}Cu.prototype.render=Am.prototype.render=function(n){var o=this._internalRoot;if(o===null)throw Error(i(409));var a=o.current,u=vn();lb(a,u,n,o,null,null)},Cu.prototype.unmount=Am.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var o=n.containerInfo;lb(n.current,2,null,n,null,null),ou(),o[Or]=null}};function Cu(n){this._internalRoot=n}Cu.prototype.unstable_scheduleHydration=function(n){if(n){var o=ac();n={blockedOn:null,target:n,priority:o};for(var a=0;a<Po.length&&o!==0&&o<Po[a].priority;a++);Po.splice(a,0,n),a===0&&db(n)}};var gb=t.version;if(gb!=="19.2.4")throw Error(i(527,gb,"19.2.4"));V.findDOMNode=function(n){var o=n._reactInternals;if(o===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=d(o),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var sA={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{Lt=Nu.inject(sA),vt=Nu}catch{}}return ls.createRoot=function(n,o){if(!l(n))throw Error(i(299));var a=!1,u="",y=E0,v=C0,T=N0;return o!=null&&(o.unstable_strictMode===!0&&(a=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(T=o.onRecoverableError)),o=ob(n,1,!1,null,null,a,u,null,y,v,T,pb),n[Or]=o.current,um(n),new Am(o)},ls.hydrateRoot=function(n,o,a){if(!l(n))throw Error(i(299));var u=!1,y="",v=E0,T=C0,I=N0,Z=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(y=a.identifierPrefix),a.onUncaughtError!==void 0&&(v=a.onUncaughtError),a.onCaughtError!==void 0&&(T=a.onCaughtError),a.onRecoverableError!==void 0&&(I=a.onRecoverableError),a.formState!==void 0&&(Z=a.formState)),o=ob(n,1,!0,o,a??null,u,y,Z,v,T,I,pb),o.context=ib(null),a=o.current,u=vn(),u=ha(u),y=No(u),y.callback=null,_o(a,y,u),a=u,o.current.lanes=a,li(o,a),dr(o),n[Or]=o.current,um(n),new Cu(o)},ls.version="19.2.4",ls}var _b;function xA(){if(_b)return Mm.exports;_b=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Mm.exports=yA(),Mm.exports}var vA=xA();var kb="popstate";function bA(e={}){function t(i,l){let{pathname:s,search:c,hash:f}=i.location;return Tp("",{pathname:s,search:c,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function r(i,l){return typeof l=="string"?l:Es(l)}return SA(t,r,null,e)}function dt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wA(){return Math.random().toString(36).substring(2,10)}function Tb(e,t){return{usr:e.state,key:e.key,idx:t}}function Tp(e,t,r=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?na(t):t,state:r,key:t&&t.key||i||wA()}}function Es({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function na(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function SA(e,t,r,i={}){let{window:l=document.defaultView,v5Compat:s=!1}=i,c=l.history,f="POP",h=null,d=m();d==null&&(d=0,c.replaceState({...c.state,idx:d},""));function m(){return(c.state||{idx:null}).idx}function p(){f="POP";let _=m(),N=_==null?null:_-d;d=_,h&&h({action:f,location:S.location,delta:N})}function x(_,N){f="PUSH";let k=Tp(S.location,_,N);d=m()+1;let C=Tb(k,d),A=S.createHref(k);try{c.pushState(C,"",A)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(A)}s&&h&&h({action:f,location:S.location,delta:1})}function b(_,N){f="REPLACE";let k=Tp(S.location,_,N);d=m();let C=Tb(k,d),A=S.createHref(k);c.replaceState(C,"",A),s&&h&&h({action:f,location:S.location,delta:0})}function E(_){return EA(_)}let S={get action(){return f},get location(){return e(l,c)},listen(_){if(h)throw new Error("A history only accepts one active listener");return l.addEventListener(kb,p),h=_,()=>{l.removeEventListener(kb,p),h=null}},createHref(_){return t(l,_)},createURL:E,encodeLocation(_){let N=E(_);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:b,go(_){return c.go(_)}};return S}function EA(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),dt(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Es(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=r+i),new URL(i,r)}function bS(e,t,r="/"){return CA(e,t,r,!1)}function CA(e,t,r,i){let l=typeof t=="string"?na(t):t,s=lo(l.pathname||"/",r);if(s==null)return null;let c=wS(e);NA(c);let f=null;for(let h=0;f==null&&h<c.length;++h){let d=LA(s);f=DA(c[h],d,i)}return f}function wS(e,t=[],r=[],i="",l=!1){let s=(c,f,h=l,d)=>{let m={relativePath:d===void 0?c.path||"":d,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&h)return;dt(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let p=ro([i,m.relativePath]),x=r.concat(m);c.children&&c.children.length>0&&(dt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),wS(c.children,t,x,p,h)),!(c.path==null&&!c.index)&&t.push({path:p,score:MA(p,c.index),routesMeta:x})};return e.forEach((c,f)=>{if(c.path===""||!c.path?.includes("?"))s(c,f);else for(let h of SS(c.path))s(c,f,!0,h)}),t}function SS(e){let t=e.split("/");if(t.length===0)return[];let[r,...i]=t,l=r.endsWith("?"),s=r.replace(/\?$/,"");if(i.length===0)return l?[s,""]:[s];let c=SS(i.join("/")),f=[];return f.push(...c.map(h=>h===""?s:[s,h].join("/"))),l&&f.push(...c),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function NA(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:OA(t.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var _A=/^:[\w-]+$/,kA=3,TA=2,AA=1,RA=10,jA=-2,Ab=e=>e==="*";function MA(e,t){let r=e.split("/"),i=r.length;return r.some(Ab)&&(i+=jA),t&&(i+=TA),r.filter(l=>!Ab(l)).reduce((l,s)=>l+(_A.test(s)?kA:s===""?AA:RA),i)}function OA(e,t){return e.length===t.length&&e.slice(0,-1).every((i,l)=>i===t[l])?e[e.length-1]-t[t.length-1]:0}function DA(e,t,r=!1){let{routesMeta:i}=e,l={},s="/",c=[];for(let f=0;f<i.length;++f){let h=i[f],d=f===i.length-1,m=s==="/"?t:t.slice(s.length)||"/",p=sf({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},m),x=h.route;if(!p&&d&&r&&!i[i.length-1].route.index&&(p=sf({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!p)return null;Object.assign(l,p.params),c.push({params:l,pathname:ro([s,p.pathname]),pathnameBase:PA(ro([s,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(s=ro([s,p.pathnameBase]))}return c}function sf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=zA(e.path,e.caseSensitive,e.end),l=t.match(r);if(!l)return null;let s=l[0],c=s.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:i.reduce((d,{paramName:m,isOptional:p},x)=>{if(m==="*"){let E=f[x]||"";c=s.slice(0,s.length-E.length).replace(/(.)\/+$/,"$1")}const b=f[x];return p&&!b?d[m]=void 0:d[m]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:c,pattern:e}}function zA(e,t=!1,r=!0){Hn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,h)=>(i.push({paramName:f,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),i]}function LA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function lo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}var IA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function BA(e,t="/"){let{pathname:r,search:i="",hash:l=""}=typeof e=="string"?na(e):e,s;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?s=Rb(r.substring(1),"/"):s=Rb(r,t)):s=t,{pathname:s,search:UA(i),hash:VA(l)}}function Rb(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function Lm(e,t,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function HA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function wg(e){let t=HA(e);return t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase)}function Sg(e,t,r,i=!1){let l;typeof e=="string"?l=na(e):(l={...e},dt(!l.pathname||!l.pathname.includes("?"),Lm("?","pathname","search",l)),dt(!l.pathname||!l.pathname.includes("#"),Lm("#","pathname","hash",l)),dt(!l.search||!l.search.includes("#"),Lm("#","search","hash",l)));let s=e===""||l.pathname==="",c=s?"/":l.pathname,f;if(c==null)f=r;else{let p=t.length-1;if(!i&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),p-=1;l.pathname=x.join("/")}f=p>=0?t[p]:"/"}let h=BA(l,f),d=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(d||m)&&(h.pathname+="/"),h}var ro=e=>e.join("/").replace(/\/\/+/g,"/"),PA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,VA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,$A=class{constructor(e,t,r,i=!1){this.status=e,this.statusText=t||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function YA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function qA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ES=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function CS(e,t){let r=e;if(typeof r!="string"||!IA.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,l=!1;if(ES)try{let s=new URL(window.location.href),c=r.startsWith("//")?new URL(s.protocol+r):new URL(r),f=lo(c.pathname,t);c.origin===s.origin&&f!=null?r=f+c.search+c.hash:l=!0}catch{Hn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var NS=["POST","PUT","PATCH","DELETE"];new Set(NS);var FA=["GET",...NS];new Set(FA);var ra=w.createContext(null);ra.displayName="DataRouter";var Df=w.createContext(null);Df.displayName="DataRouterState";var XA=w.createContext(!1),_S=w.createContext({isTransitioning:!1});_S.displayName="ViewTransition";var GA=w.createContext(new Map);GA.displayName="Fetchers";var WA=w.createContext(null);WA.displayName="Await";var An=w.createContext(null);An.displayName="Navigation";var $s=w.createContext(null);$s.displayName="Location";var Pn=w.createContext({outlet:null,matches:[],isDataRoute:!1});Pn.displayName="Route";var Eg=w.createContext(null);Eg.displayName="RouteError";var kS="REACT_ROUTER_ERROR",ZA="REDIRECT",KA="ROUTE_ERROR_RESPONSE";function QA(e){if(e.startsWith(`${kS}:${ZA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function JA(e){if(e.startsWith(`${kS}:${KA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new $A(t.status,t.statusText,t.data)}catch{}}function eR(e,{relative:t}={}){dt(oa(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=w.useContext(An),{hash:l,pathname:s,search:c}=Ys(e,{relative:t}),f=s;return r!=="/"&&(f=s==="/"?r:ro([r,s])),i.createHref({pathname:f,search:c,hash:l})}function oa(){return w.useContext($s)!=null}function Nr(){return dt(oa(),"useLocation() may be used only in the context of a <Router> component."),w.useContext($s).location}var TS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function AS(e){w.useContext(An).static||w.useLayoutEffect(e)}function zf(){let{isDataRoute:e}=w.useContext(Pn);return e?pR():tR()}function tR(){dt(oa(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(ra),{basename:t,navigator:r}=w.useContext(An),{matches:i}=w.useContext(Pn),{pathname:l}=Nr(),s=JSON.stringify(wg(i)),c=w.useRef(!1);return AS(()=>{c.current=!0}),w.useCallback((h,d={})=>{if(Hn(c.current,TS),!c.current)return;if(typeof h=="number"){r.go(h);return}let m=Sg(h,JSON.parse(s),l,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ro([t,m.pathname])),(d.replace?r.replace:r.push)(m,d.state,d)},[t,r,s,l,e])}var nR=w.createContext(null);function rR(e){let t=w.useContext(Pn).outlet;return w.useMemo(()=>t&&w.createElement(nR.Provider,{value:e},t),[t,e])}function Cg(){let{matches:e}=w.useContext(Pn),t=e[e.length-1];return t?t.params:{}}function Ys(e,{relative:t}={}){let{matches:r}=w.useContext(Pn),{pathname:i}=Nr(),l=JSON.stringify(wg(r));return w.useMemo(()=>Sg(e,JSON.parse(l),i,t==="path"),[e,l,i,t])}function oR(e,t){return RS(e,t)}function RS(e,t,r,i,l){dt(oa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=w.useContext(An),{matches:c}=w.useContext(Pn),f=c[c.length-1],h=f?f.params:{},d=f?f.pathname:"/",m=f?f.pathnameBase:"/",p=f&&f.route;{let k=p&&p.path||"";MS(d,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let x=Nr(),b;if(t){let k=typeof t=="string"?na(t):t;dt(m==="/"||k.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${k.pathname}" was given in the \`location\` prop.`),b=k}else b=x;let E=b.pathname||"/",S=E;if(m!=="/"){let k=m.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(k.length).join("/")}let _=bS(e,{pathname:S});Hn(p||_!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Hn(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=cR(_&&_.map(k=>Object.assign({},k,{params:Object.assign({},h,k.params),pathname:ro([m,s.encodeLocation?s.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:ro([m,s.encodeLocation?s.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,r,i,l);return t&&N?w.createElement($s.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},N):N}function iR(){let e=mR(),t=YA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:s},"ErrorBoundary")," or"," ",w.createElement("code",{style:s},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:l},r):null,c)}var lR=w.createElement(iR,null),jS=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=JA(e.digest);r&&(e=r)}let t=e!==void 0?w.createElement(Pn.Provider,{value:this.props.routeContext},w.createElement(Eg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(aR,{error:e},t):t}};jS.contextType=XA;var Im=new WeakMap;function aR({children:e,error:t}){let{basename:r}=w.useContext(An);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=QA(t.digest);if(i){let l=Im.get(t);if(l)throw l;let s=CS(i.location,r);if(ES&&!Im.get(t))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw Im.set(t,c),c}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function sR({routeContext:e,match:t,children:r}){let i=w.useContext(ra);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Pn.Provider,{value:e},r)}function cR(e,t=[],r=null,i=null,l=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,c=r?.errors;if(c!=null){let m=s.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);dt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let f=!1,h=-1;if(r)for(let m=0;m<s.length;m++){let p=s[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=m),p.route.id){let{loaderData:x,errors:b}=r,E=p.route.loader&&!x.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||E){f=!0,h>=0?s=s.slice(0,h+1):s=[s[0]];break}}}let d=r&&i?(m,p)=>{i(m,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:qA(r.matches),errorInfo:p})}:void 0;return s.reduceRight((m,p,x)=>{let b,E=!1,S=null,_=null;r&&(b=c&&p.route.id?c[p.route.id]:void 0,S=p.route.errorElement||lR,f&&(h<0&&x===0?(MS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,_=null):h===x&&(E=!0,_=p.route.hydrateFallbackElement||null)));let N=t.concat(s.slice(0,x+1)),k=()=>{let C;return b?C=S:E?C=_:p.route.Component?C=w.createElement(p.route.Component,null):p.route.element?C=p.route.element:C=m,w.createElement(sR,{match:p,routeContext:{outlet:m,matches:N,isDataRoute:r!=null},children:C})};return r&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?w.createElement(jS,{location:r.location,revalidation:r.revalidation,component:S,error:b,children:k(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:d}):k()},null)}function Ng(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function uR(e){let t=w.useContext(ra);return dt(t,Ng(e)),t}function fR(e){let t=w.useContext(Df);return dt(t,Ng(e)),t}function dR(e){let t=w.useContext(Pn);return dt(t,Ng(e)),t}function _g(e){let t=dR(e),r=t.matches[t.matches.length-1];return dt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function hR(){return _g("useRouteId")}function mR(){let e=w.useContext(Eg),t=fR("useRouteError"),r=_g("useRouteError");return e!==void 0?e:t.errors?.[r]}function pR(){let{router:e}=uR("useNavigate"),t=_g("useNavigate"),r=w.useRef(!1);return AS(()=>{r.current=!0}),w.useCallback(async(l,s={})=>{Hn(r.current,TS),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...s}))},[e,t])}var jb={};function MS(e,t,r){!t&&!jb[e]&&(jb[e]=!0,Hn(!1,r))}w.memo(gR);function gR({routes:e,future:t,state:r,onError:i}){return RS(e,void 0,r,i,t)}function yR({to:e,replace:t,state:r,relative:i}){dt(oa(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=w.useContext(An);Hn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=w.useContext(Pn),{pathname:c}=Nr(),f=zf(),h=Sg(e,wg(s),c,i==="path"),d=JSON.stringify(h);return w.useEffect(()=>{f(JSON.parse(d),{replace:t,state:r,relative:i})},[f,d,i,t,r]),null}function xR(e){return rR(e.context)}function Gn(e){dt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function vR({basename:e="/",children:t=null,location:r,navigationType:i="POP",navigator:l,static:s=!1,unstable_useTransitions:c}){dt(!oa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=w.useMemo(()=>({basename:f,navigator:l,static:s,unstable_useTransitions:c,future:{}}),[f,l,s,c]);typeof r=="string"&&(r=na(r));let{pathname:d="/",search:m="",hash:p="",state:x=null,key:b="default"}=r,E=w.useMemo(()=>{let S=lo(d,f);return S==null?null:{location:{pathname:S,search:m,hash:p,state:x,key:b},navigationType:i}},[f,d,m,p,x,b,i]);return Hn(E!=null,`<Router basename="${f}"> is not able to match the URL "${d}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:w.createElement(An.Provider,{value:h},w.createElement($s.Provider,{children:t,value:E}))}function bR({children:e,location:t}){return oR(Ap(e),t)}function Ap(e,t=[]){let r=[];return w.Children.forEach(e,(i,l)=>{if(!w.isValidElement(i))return;let s=[...t,l];if(i.type===w.Fragment){r.push.apply(r,Ap(i.props.children,s));return}dt(i.type===Gn,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),dt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let c={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(c.children=Ap(i.props.children,s)),r.push(c)}),r}var Zu="get",Ku="application/x-www-form-urlencoded";function Lf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wR(e){return Lf(e)&&e.tagName.toLowerCase()==="button"}function SR(e){return Lf(e)&&e.tagName.toLowerCase()==="form"}function ER(e){return Lf(e)&&e.tagName.toLowerCase()==="input"}function CR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NR(e,t){return e.button===0&&(!t||t==="_self")&&!CR(e)}function Rp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let i=e[r];return t.concat(Array.isArray(i)?i.map(l=>[r,l]):[[r,i]])},[]))}function _R(e,t){let r=Rp(e);return t&&t.forEach((i,l)=>{r.has(l)||t.getAll(l).forEach(s=>{r.append(l,s)})}),r}var _u=null;function kR(){if(_u===null)try{new FormData(document.createElement("form"),0),_u=!1}catch{_u=!0}return _u}var TR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bm(e){return e!=null&&!TR.has(e)?(Hn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ku}"`),null):e}function AR(e,t){let r,i,l,s,c;if(SR(e)){let f=e.getAttribute("action");i=f?lo(f,t):null,r=e.getAttribute("method")||Zu,l=Bm(e.getAttribute("enctype"))||Ku,s=new FormData(e)}else if(wR(e)||ER(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(i=h?lo(h,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Zu,l=Bm(e.getAttribute("formenctype"))||Bm(f.getAttribute("enctype"))||Ku,s=new FormData(f,e),!kR()){let{name:d,type:m,value:p}=e;if(m==="image"){let x=d?`${d}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else d&&s.append(d,p)}}else{if(Lf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Zu,i=null,l=Ku,c=e}return s&&l==="text/plain"&&(c=s,s=void 0),{action:i,method:r.toLowerCase(),encType:l,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function kg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function RR(e,t,r,i){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${i}`:l.pathname=`${l.pathname}.${i}`:l.pathname==="/"?l.pathname=`_root.${i}`:t&&lo(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${i}`,l}async function jR(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function MR(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function OR(e,t,r){let i=await Promise.all(e.map(async l=>{let s=t.routes[l.route.id];if(s){let c=await jR(s,r);return c.links?c.links():[]}return[]}));return IR(i.flat(1).filter(MR).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Mb(e,t,r,i,l,s){let c=(h,d)=>r[d]?h.route.id!==r[d].route.id:!0,f=(h,d)=>r[d].pathname!==h.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==h.params["*"];return s==="assets"?t.filter((h,d)=>c(h,d)||f(h,d)):s==="data"?t.filter((h,d)=>{let m=i.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,d)||f(h,d))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function DR(e,t,{includeHydrateFallback:r}={}){return zR(e.map(i=>{let l=t.routes[i.route.id];if(!l)return[];let s=[l.module];return l.clientActionModule&&(s=s.concat(l.clientActionModule)),l.clientLoaderModule&&(s=s.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(s=s.concat(l.hydrateFallbackModule)),l.imports&&(s=s.concat(l.imports)),s}).flat(1))}function zR(e){return[...new Set(e)]}function LR(e){let t={},r=Object.keys(e).sort();for(let i of r)t[i]=e[i];return t}function IR(e,t){let r=new Set;return new Set(t),e.reduce((i,l)=>{let s=JSON.stringify(LR(l));return r.has(s)||(r.add(s),i.push({key:s,link:l})),i},[])}function OS(){let e=w.useContext(ra);return kg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function BR(){let e=w.useContext(Df);return kg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tg=w.createContext(void 0);Tg.displayName="FrameworkContext";function DS(){let e=w.useContext(Tg);return kg(e,"You must render this element inside a <HydratedRouter> element"),e}function HR(e,t){let r=w.useContext(Tg),[i,l]=w.useState(!1),[s,c]=w.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:p}=t,x=w.useRef(null);w.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=N=>{N.forEach(k=>{c(k.isIntersecting)})},_=new IntersectionObserver(S,{threshold:.5});return x.current&&_.observe(x.current),()=>{_.disconnect()}}},[e]),w.useEffect(()=>{if(i){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[i]);let b=()=>{l(!0)},E=()=>{l(!1),c(!1)};return r?e!=="intent"?[s,x,{}]:[s,x,{onFocus:as(f,b),onBlur:as(h,E),onMouseEnter:as(d,b),onMouseLeave:as(m,E),onTouchStart:as(p,b)}]:[!1,x,{}]}function as(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function PR({page:e,...t}){let{router:r}=OS(),i=w.useMemo(()=>bS(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?w.createElement(VR,{page:e,matches:i,...t}):null}function UR(e){let{manifest:t,routeModules:r}=DS(),[i,l]=w.useState([]);return w.useEffect(()=>{let s=!1;return OR(e,t,r).then(c=>{s||l(c)}),()=>{s=!0}},[e,t,r]),i}function VR({page:e,matches:t,...r}){let i=Nr(),{future:l,manifest:s,routeModules:c}=DS(),{basename:f}=OS(),{loaderData:h,matches:d}=BR(),m=w.useMemo(()=>Mb(e,t,d,s,i,"data"),[e,t,d,s,i]),p=w.useMemo(()=>Mb(e,t,d,s,i,"assets"),[e,t,d,s,i]),x=w.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let S=new Set,_=!1;if(t.forEach(k=>{let C=s.routes[k.route.id];!C||!C.hasLoader||(!m.some(A=>A.route.id===k.route.id)&&k.route.id in h&&c[k.route.id]?.shouldRevalidate||C.hasClientLoader?_=!0:S.add(k.route.id))}),S.size===0)return[];let N=RR(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return _&&S.size>0&&N.searchParams.set("_routes",t.filter(k=>S.has(k.route.id)).map(k=>k.route.id).join(",")),[N.pathname+N.search]},[f,l.unstable_trailingSlashAwareDataRequests,h,i,s,m,t,e,c]),b=w.useMemo(()=>DR(p,s),[p,s]),E=UR(p);return w.createElement(w.Fragment,null,x.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...r})),b.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...r})),E.map(({key:S,link:_})=>w.createElement("link",{key:S,nonce:r.nonce,..._,crossOrigin:_.crossOrigin??r.crossOrigin})))}function $R(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var YR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{YR&&(window.__reactRouterVersion="7.13.0")}catch{}function qR({basename:e,children:t,unstable_useTransitions:r,window:i}){let l=w.useRef();l.current==null&&(l.current=bA({window:i,v5Compat:!0}));let s=l.current,[c,f]=w.useState({action:s.action,location:s.location}),h=w.useCallback(d=>{r===!1?f(d):w.startTransition(()=>f(d))},[r]);return w.useLayoutEffect(()=>s.listen(h),[s,h]),w.createElement(vR,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:s,unstable_useTransitions:r})}var zS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pt=w.forwardRef(function({onClick:t,discover:r="render",prefetch:i="none",relative:l,reloadDocument:s,replace:c,state:f,target:h,to:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:x,...b},E){let{basename:S,unstable_useTransitions:_}=w.useContext(An),N=typeof d=="string"&&zS.test(d),k=CS(d,S);d=k.to;let C=eR(d,{relative:l}),[A,L,j]=HR(i,b),z=WR(d,{replace:c,state:f,target:h,preventScrollReset:m,relative:l,viewTransition:p,unstable_defaultShouldRevalidate:x,unstable_useTransitions:_});function P(X){t&&t(X),X.defaultPrevented||z(X)}let H=w.createElement("a",{...b,...j,href:k.absoluteURL||C,onClick:k.isExternal||s?t:P,ref:$R(E,L),target:h,"data-discover":!N&&r==="render"?"true":void 0});return A&&!N?w.createElement(w.Fragment,null,H,w.createElement(PR,{page:C})):H});pt.displayName="Link";var FR=w.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:i="",end:l=!1,style:s,to:c,viewTransition:f,children:h,...d},m){let p=Ys(c,{relative:d.relative}),x=Nr(),b=w.useContext(Df),{navigator:E,basename:S}=w.useContext(An),_=b!=null&&ej(p)&&f===!0,N=E.encodeLocation?E.encodeLocation(p).pathname:p.pathname,k=x.pathname,C=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(k=k.toLowerCase(),C=C?C.toLowerCase():null,N=N.toLowerCase()),C&&S&&(C=lo(C,S)||C);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let L=k===N||!l&&k.startsWith(N)&&k.charAt(A)==="/",j=C!=null&&(C===N||!l&&C.startsWith(N)&&C.charAt(N.length)==="/"),z={isActive:L,isPending:j,isTransitioning:_},P=L?t:void 0,H;typeof i=="function"?H=i(z):H=[i,L?"active":null,j?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(z):s;return w.createElement(pt,{...d,"aria-current":P,className:H,ref:m,style:X,to:c,viewTransition:f},typeof h=="function"?h(z):h)});FR.displayName="NavLink";var XR=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:i,replace:l,state:s,method:c=Zu,action:f,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:x,...b},E)=>{let{unstable_useTransitions:S}=w.useContext(An),_=QR(),N=JR(f,{relative:d}),k=c.toLowerCase()==="get"?"get":"post",C=typeof f=="string"&&zS.test(f),A=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let j=L.nativeEvent.submitter,z=j?.getAttribute("formmethod")||c,P=()=>_(j||L.currentTarget,{fetcherKey:t,method:z,navigate:r,replace:l,state:s,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:x});S&&r!==!1?w.startTransition(()=>P()):P()};return w.createElement("form",{ref:E,method:k,action:N,onSubmit:i?h:A,...b,"data-discover":!C&&e==="render"?"true":void 0})});XR.displayName="Form";function GR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function LS(e){let t=w.useContext(ra);return dt(t,GR(e)),t}function WR(e,{target:t,replace:r,state:i,preventScrollReset:l,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let d=zf(),m=Nr(),p=Ys(e,{relative:s});return w.useCallback(x=>{if(NR(x,t)){x.preventDefault();let b=r!==void 0?r:Es(m)===Es(p),E=()=>d(e,{replace:b,state:i,preventScrollReset:l,relative:s,viewTransition:c,unstable_defaultShouldRevalidate:f});h?w.startTransition(()=>E()):E()}},[m,d,p,r,i,t,e,l,s,c,f,h])}function qs(e){Hn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(Rp(e)),r=w.useRef(!1),i=Nr(),l=w.useMemo(()=>_R(i.search,r.current?null:t.current),[i.search]),s=zf(),c=w.useCallback((f,h)=>{const d=Rp(typeof f=="function"?f(new URLSearchParams(l)):f);r.current=!0,s("?"+d,h)},[s,l]);return[l,c]}var ZR=0,KR=()=>`__${String(++ZR)}__`;function QR(){let{router:e}=LS("useSubmit"),{basename:t}=w.useContext(An),r=hR(),i=e.fetch,l=e.navigate;return w.useCallback(async(s,c={})=>{let{action:f,method:h,encType:d,formData:m,body:p}=AR(s,t);if(c.navigate===!1){let x=c.fetcherKey||KR();await i(x,r,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:p,formMethod:c.method||h,formEncType:c.encType||d,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:p,formMethod:c.method||h,formEncType:c.encType||d,replace:c.replace,state:c.state,fromRouteId:r,flushSync:c.flushSync,viewTransition:c.viewTransition})},[i,l,t,r])}function JR(e,{relative:t}={}){let{basename:r}=w.useContext(An),i=w.useContext(Pn);dt(i,"useFormAction must be used inside a RouteContext");let[l]=i.matches.slice(-1),s={...Ys(e||".",{relative:t})},c=Nr();if(e==null){s.search=c.search;let f=new URLSearchParams(s.search),h=f.getAll("index");if(h.some(m=>m==="")){f.delete("index"),h.filter(p=>p).forEach(p=>f.append("index",p));let m=f.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&l.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:ro([r,s.pathname])),Es(s)}function ej(e,{relative:t}={}){let r=w.useContext(_S);dt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=LS("useViewTransitionState"),l=Ys(e,{relative:t});if(!r.isTransitioning)return!1;let s=lo(r.currentLocation.pathname,i)||r.currentLocation.pathname,c=lo(r.nextLocation.pathname,i)||r.nextLocation.pathname;return sf(l.pathname,c)!=null||sf(l.pathname,s)!=null}var Fs=vS();const tj=Us(Fs),IS="studio-theme",BS=w.createContext(null);function nj(){if(typeof window>"u")return"light";const e=localStorage.getItem(IS);return e==="light"||e==="dark"?e:"light"}function rj({children:e}){const[t,r]=w.useState(nj);w.useEffect(()=>{const s=document.documentElement;s.classList.remove("light","dark"),s.classList.add(t),localStorage.setItem(IS,t)},[t]);const i=s=>r(s),l=()=>r(s=>s==="dark"?"light":"dark");return g.jsx(BS.Provider,{value:{theme:t,setTheme:i,toggleTheme:l},children:e})}function HS(){const e=w.useContext(BS);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function PS(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=PS(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function US(){for(var e,t,r=0,i="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=PS(e))&&(i&&(i+=" "),i+=t);return i}const oj=(e,t)=>{const r=new Array(e.length+t.length);for(let i=0;i<e.length;i++)r[i]=e[i];for(let i=0;i<t.length;i++)r[e.length+i]=t[i];return r},ij=(e,t)=>({classGroupId:e,validator:t}),VS=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),cf="-",Ob=[],lj="arbitrary..",aj=e=>{const t=cj(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return sj(c);const f=c.split(cf),h=f[0]===""&&f.length>1?1:0;return $S(f,h,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const h=i[c],d=r[c];return h?d?oj(d,h):h:d||Ob}return r[c]||Ob}}},$S=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const l=e[t],s=r.nextPart.get(l);if(s){const d=$S(e,t+1,s);if(d)return d}const c=r.validators;if(c===null)return;const f=t===0?e.join(cf):e.slice(t).join(cf),h=c.length;for(let d=0;d<h;d++){const m=c[d];if(m.validator(f))return m.classGroupId}},sj=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),i=t.slice(0,r);return i?lj+i:void 0})(),cj=e=>{const{theme:t,classGroups:r}=e;return uj(r,t)},uj=(e,t)=>{const r=VS();for(const i in e){const l=e[i];Ag(l,r,i,t)}return r},Ag=(e,t,r,i)=>{const l=e.length;for(let s=0;s<l;s++){const c=e[s];fj(c,t,r,i)}},fj=(e,t,r,i)=>{if(typeof e=="string"){dj(e,t,r);return}if(typeof e=="function"){hj(e,t,r,i);return}mj(e,t,r,i)},dj=(e,t,r)=>{const i=e===""?t:YS(t,e);i.classGroupId=r},hj=(e,t,r,i)=>{if(pj(e)){Ag(e(i),t,r,i);return}t.validators===null&&(t.validators=[]),t.validators.push(ij(r,e))},mj=(e,t,r,i)=>{const l=Object.entries(e),s=l.length;for(let c=0;c<s;c++){const[f,h]=l[c];Ag(h,YS(t,f),r,i)}},YS=(e,t)=>{let r=e;const i=t.split(cf),l=i.length;for(let s=0;s<l;s++){const c=i[s];let f=r.nextPart.get(c);f||(f=VS(),r.nextPart.set(c,f)),r=f}return r},pj=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,gj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null);const l=(s,c)=>{r[s]=c,t++,t>e&&(t=0,i=r,r=Object.create(null))};return{get(s){let c=r[s];if(c!==void 0)return c;if((c=i[s])!==void 0)return l(s,c),c},set(s,c){s in r?r[s]=c:l(s,c)}}},jp="!",Db=":",yj=[],zb=(e,t,r,i,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:l}),xj=e=>{const{prefix:t,experimentalParseClassName:r}=e;let i=l=>{const s=[];let c=0,f=0,h=0,d;const m=l.length;for(let S=0;S<m;S++){const _=l[S];if(c===0&&f===0){if(_===Db){s.push(l.slice(h,S)),h=S+1;continue}if(_==="/"){d=S;continue}}_==="["?c++:_==="]"?c--:_==="("?f++:_===")"&&f--}const p=s.length===0?l:l.slice(h);let x=p,b=!1;p.endsWith(jp)?(x=p.slice(0,-1),b=!0):p.startsWith(jp)&&(x=p.slice(1),b=!0);const E=d&&d>h?d-h:void 0;return zb(s,b,x,E)};if(t){const l=t+Db,s=i;i=c=>c.startsWith(l)?s(c.slice(l.length)):zb(yj,!1,c,void 0,!0)}if(r){const l=i;i=s=>r({className:s,parseClassName:l})}return i},vj=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{t.set(r,1e6+i)}),r=>{const i=[];let l=[];for(let s=0;s<r.length;s++){const c=r[s],f=c[0]==="[",h=t.has(c);f||h?(l.length>0&&(l.sort(),i.push(...l),l=[]),i.push(c)):l.push(c)}return l.length>0&&(l.sort(),i.push(...l)),i}},bj=e=>({cache:gj(e.cacheSize),parseClassName:xj(e),sortModifiers:vj(e),...aj(e)}),wj=/\s+/,Sj=(e,t)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:l,sortModifiers:s}=t,c=[],f=e.trim().split(wj);let h="";for(let d=f.length-1;d>=0;d-=1){const m=f[d],{isExternal:p,modifiers:x,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:S}=r(m);if(p){h=m+(h.length>0?" "+h:h);continue}let _=!!S,N=i(_?E.substring(0,S):E);if(!N){if(!_){h=m+(h.length>0?" "+h:h);continue}if(N=i(E),!N){h=m+(h.length>0?" "+h:h);continue}_=!1}const k=x.length===0?"":x.length===1?x[0]:s(x).join(":"),C=b?k+jp:k,A=C+N;if(c.indexOf(A)>-1)continue;c.push(A);const L=l(N,_);for(let j=0;j<L.length;++j){const z=L[j];c.push(C+z)}h=m+(h.length>0?" "+h:h)}return h},Ej=(...e)=>{let t=0,r,i,l="";for(;t<e.length;)(r=e[t++])&&(i=qS(r))&&(l&&(l+=" "),l+=i);return l},qS=e=>{if(typeof e=="string")return e;let t,r="";for(let i=0;i<e.length;i++)e[i]&&(t=qS(e[i]))&&(r&&(r+=" "),r+=t);return r},Cj=(e,...t)=>{let r,i,l,s;const c=h=>{const d=t.reduce((m,p)=>p(m),e());return r=bj(d),i=r.cache.get,l=r.cache.set,s=f,f(h)},f=h=>{const d=i(h);if(d)return d;const m=Sj(h,r);return l(h,m),m};return s=c,(...h)=>s(Ej(...h))},Nj=[],Ot=e=>{const t=r=>r[e]||Nj;return t.isThemeGetter=!0,t},FS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_j=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Aj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vo=e=>_j.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),$o=e=>!!e&&Number.isInteger(Number(e)),Hm=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),Jr=e=>kj.test(e),GS=()=>!0,Mj=e=>Tj.test(e)&&!Aj.test(e),Rg=()=>!1,Oj=e=>Rj.test(e),Dj=e=>jj.test(e),zj=e=>!we(e)&&!Se(e),Lj=e=>ti(e,KS,Rg),we=e=>FS.test(e),_i=e=>ti(e,QS,Mj),Lb=e=>ti(e,Yj,Ie),Ij=e=>ti(e,eE,GS),Bj=e=>ti(e,JS,Rg),Ib=e=>ti(e,WS,Rg),Hj=e=>ti(e,ZS,Dj),ku=e=>ti(e,tE,Oj),Se=e=>XS.test(e),ss=e=>Vi(e,QS),Pj=e=>Vi(e,JS),Bb=e=>Vi(e,WS),Uj=e=>Vi(e,KS),Vj=e=>Vi(e,ZS),Tu=e=>Vi(e,tE,!0),$j=e=>Vi(e,eE,!0),ti=(e,t,r)=>{const i=FS.exec(e);return i?i[1]?t(i[1]):r(i[2]):!1},Vi=(e,t,r=!1)=>{const i=XS.exec(e);return i?i[1]?t(i[1]):r:!1},WS=e=>e==="position"||e==="percentage",ZS=e=>e==="image"||e==="url",KS=e=>e==="length"||e==="size"||e==="bg-size",QS=e=>e==="length",Yj=e=>e==="number",JS=e=>e==="family-name",eE=e=>e==="number"||e==="weight",tE=e=>e==="shadow",qj=()=>{const e=Ot("color"),t=Ot("font"),r=Ot("text"),i=Ot("font-weight"),l=Ot("tracking"),s=Ot("leading"),c=Ot("breakpoint"),f=Ot("container"),h=Ot("spacing"),d=Ot("radius"),m=Ot("shadow"),p=Ot("inset-shadow"),x=Ot("text-shadow"),b=Ot("drop-shadow"),E=Ot("blur"),S=Ot("perspective"),_=Ot("aspect"),N=Ot("ease"),k=Ot("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...A(),Se,we],j=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[Se,we,h],H=()=>[Vo,"full","auto",...P()],X=()=>[$o,"none","subgrid",Se,we],q=()=>["auto",{span:["full",$o,Se,we]},$o,Se,we],F=()=>[$o,"auto",Se,we],Y=()=>["auto","min","max","fr",Se,we],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...P()],V=()=>[Vo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],$=()=>[Vo,"screen","full","dvw","lvw","svw","min","max","fit",...P()],W=()=>[Vo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],M=()=>[e,Se,we],B=()=>[...A(),Bb,Ib,{position:[Se,we]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Uj,Lj,{size:[Se,we]}],oe=()=>[Hm,ss,_i],K=()=>["","none","full",d,Se,we],J=()=>["",Ie,ss,_i],te=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ie,Hm,Bb,Ib],he=()=>["","none",E,Se,we],me=()=>["none",Ie,Se,we],ge=()=>["none",Ie,Se,we],xe=()=>[Ie,Se,we],_e=()=>[Vo,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jr],breakpoint:[Jr],color:[GS],container:[Jr],"drop-shadow":[Jr],ease:["in","out","in-out"],font:[zj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jr],shadow:[Jr],spacing:["px",Ie],text:[Jr],"text-shadow":[Jr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vo,we,Se,_]}],container:["container"],columns:[{columns:[Ie,we,Se,f]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{"inset-s":H(),start:H()}],end:[{"inset-e":H(),end:H()}],"inset-bs":[{"inset-bs":H()}],"inset-be":[{"inset-be":H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[$o,"auto",Se,we]}],basis:[{basis:[Vo,"full","auto",f,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Vo,"auto","initial","none",we]}],grow:[{grow:["",Ie,Se,we]}],shrink:[{shrink:["",Ie,Se,we]}],order:[{order:[$o,"first","last","none",Se,we]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,ss,_i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,$j,Ij]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hm,we]}],"font-family":[{font:[Pj,Bj,t]}],"font-features":[{"font-features":[we]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Se,we]}],"line-clamp":[{"line-clamp":[Ie,"none",Se,Lb]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",Se,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",Se,_i]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Ie,"auto",Se,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$o,Se,we],radial:["",Se,we],conic:[$o,Se,we]},Vj,Hj]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,Se,we]}],"outline-w":[{outline:["",Ie,ss,_i]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",m,Tu,ku]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,Tu,ku]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Ie,_i]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",x,Tu,ku]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Ie,Se,we]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Se,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,we]}],filter:[{filter:["","none",Se,we]}],blur:[{blur:he()}],brightness:[{brightness:[Ie,Se,we]}],contrast:[{contrast:[Ie,Se,we]}],"drop-shadow":[{"drop-shadow":["","none",b,Tu,ku]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Ie,Se,we]}],"hue-rotate":[{"hue-rotate":[Ie,Se,we]}],invert:[{invert:["",Ie,Se,we]}],saturate:[{saturate:[Ie,Se,we]}],sepia:[{sepia:["",Ie,Se,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,we]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,Se,we]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,Se,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,Se,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,Se,we]}],"backdrop-invert":[{"backdrop-invert":["",Ie,Se,we]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,Se,we]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,Se,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,Se,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",Se,we]}],ease:[{ease:["linear","initial",N,Se,we]}],delay:[{delay:[Ie,Se,we]}],animate:[{animate:["none",k,Se,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Se,we]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Se,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se,we]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Ie,ss,_i,Lb]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Fj=Cj(qj);function ve(...e){return Fj(US(e))}const En="text-primary/90 hover:text-primary",Hb=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#f43f5e","#06b6d4","#f97316","#d946ef","#14b8a6","#6366f1","#ec4899","#84cc16","#0ea5e9","#a855f7","#eab308","#22c55e","#ef4444","#64748b"];function xr(e){let t=0;for(let i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;const r=Math.abs(t)%Hb.length;return Hb[r]}function Pb(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function uf(e,t,r,i="export.csv"){const l=(r??t).map(Pb).join(","),s=p=>p==null?"":typeof p=="string"?p:typeof p=="number"||typeof p=="boolean"?String(p):Array.isArray(p)?p.map(s).join("; "):typeof p=="object"?JSON.stringify(p):String(p),c=e.map(p=>t.map(x=>Pb(s(p[x]))).join(",")),f=[l,...c].join(`
12
+ `),h=new Blob([f],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(h),m=document.createElement("a");m.href=d,m.download=i,m.click(),URL.revokeObjectURL(d)}function ji(e){if(!e)return"-";try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"medium"})}catch{return e}}function Xj(e){if(e)return e.step??e.step_id??e.node_id}function Ub(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nE(...e){return t=>{let r=!1;const i=e.map(l=>{const s=Ub(l,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let l=0;l<i.length;l++){const s=i[l];typeof s=="function"?s():Ub(e[l],null)}}}}function We(...e){return w.useCallback(nE(...e),e)}function ql(e){const t=Wj(e),r=w.forwardRef((i,l)=>{const{children:s,...c}=i,f=w.Children.toArray(s),h=f.find(Kj);if(h){const d=h.props.children,m=f.map(p=>p===h?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...c,ref:l,children:w.isValidElement(d)?w.cloneElement(d,void 0,m):null})}return g.jsx(t,{...c,ref:l,children:s})});return r.displayName=`${e}.Slot`,r}var Gj=ql("Slot");function Wj(e){const t=w.forwardRef((r,i)=>{const{children:l,...s}=r;if(w.isValidElement(l)){const c=Jj(l),f=Qj(s,l.props);return l.type!==w.Fragment&&(f.ref=i?nE(i,c):c),w.cloneElement(l,f)}return w.Children.count(l)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zj=Symbol("radix.slottable");function Kj(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zj}function Qj(e,t){const r={...t};for(const i in t){const l=e[i],s=t[i];/^on[A-Z]/.test(i)?l&&s?r[i]=(...f)=>{const h=s(...f);return l(...f),h}:l&&(r[i]=l):i==="style"?r[i]={...l,...s}:i==="className"&&(r[i]=[l,s].filter(Boolean).join(" "))}return{...e,...r}}function Jj(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var eM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oe=eM.reduce((e,t)=>{const r=ql(`Primitive.${t}`),i=w.forwardRef((l,s)=>{const{asChild:c,...f}=l,h=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(h,{...f,ref:s})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function tM(e,t){e&&Fs.flushSync(()=>e.dispatchEvent(t))}var rE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),nM="VisuallyHidden",rM=w.forwardRef((e,t)=>g.jsx(Oe.span,{...e,ref:t,style:{...rE,...e.style}}));rM.displayName=nM;function oM(e,t){const r=w.createContext(t),i=s=>{const{children:c,...f}=s,h=w.useMemo(()=>f,Object.values(f));return g.jsx(r.Provider,{value:h,children:c})};i.displayName=e+"Provider";function l(s){const c=w.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[i,l]}function uo(e,t=[]){let r=[];function i(s,c){const f=w.createContext(c),h=r.length;r=[...r,c];const d=p=>{const{scope:x,children:b,...E}=p,S=x?.[e]?.[h]||f,_=w.useMemo(()=>E,Object.values(E));return g.jsx(S.Provider,{value:_,children:b})};d.displayName=s+"Provider";function m(p,x){const b=x?.[e]?.[h]||f,E=w.useContext(b);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,m]}const l=()=>{const s=r.map(c=>w.createContext(c));return function(f){const h=f?.[e]||s;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return l.scopeName=e,[i,iM(l,...t)]}function iM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(s){const c=i.reduce((f,{useScope:h,scopeName:d})=>{const p=h(s)[`__scope${d}`];return{...f,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}function oE(e){const t=e+"CollectionProvider",[r,i]=uo(t),[l,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:_,children:N}=S,k=to.useRef(null),C=to.useRef(new Map).current;return g.jsx(l,{scope:_,itemMap:C,collectionRef:k,children:N})};c.displayName=t;const f=e+"CollectionSlot",h=ql(f),d=to.forwardRef((S,_)=>{const{scope:N,children:k}=S,C=s(f,N),A=We(_,C.collectionRef);return g.jsx(h,{ref:A,children:k})});d.displayName=f;const m=e+"CollectionItemSlot",p="data-radix-collection-item",x=ql(m),b=to.forwardRef((S,_)=>{const{scope:N,children:k,...C}=S,A=to.useRef(null),L=We(_,A),j=s(m,N);return to.useEffect(()=>(j.itemMap.set(A,{ref:A,...C}),()=>{j.itemMap.delete(A)})),g.jsx(x,{[p]:"",ref:L,children:k})});b.displayName=m;function E(S){const _=s(e+"CollectionConsumer",S);return to.useCallback(()=>{const k=_.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(_.itemMap.values()).sort((j,z)=>C.indexOf(j.ref.current)-C.indexOf(z.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:c,Slot:d,ItemSlot:b},E,i]}function je(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e?.(l),r===!1||!l.defaultPrevented)return t?.(l)}}var Ut=globalThis?.document?w.useLayoutEffect:()=>{},lM=xS[" useInsertionEffect ".trim().toString()]||Ut;function Mi({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[l,s,c]=aM({defaultProp:t,onChange:r}),f=e!==void 0,h=f?e:l;{const m=w.useRef(e!==void 0);w.useEffect(()=>{const p=m.current;p!==f&&console.warn(`${i} is changing from ${p?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=f},[f,i])}const d=w.useCallback(m=>{if(f){const p=sM(m)?m(e):m;p!==e&&c.current?.(p)}else s(m)},[f,e,s,c]);return[h,d]}function aM({defaultProp:e,onChange:t}){const[r,i]=w.useState(e),l=w.useRef(r),s=w.useRef(t);return lM(()=>{s.current=t},[t]),w.useEffect(()=>{l.current!==r&&(s.current?.(r),l.current=r)},[r,l]),[r,i,s]}function sM(e){return typeof e=="function"}function cM(e,t){return w.useReducer((r,i)=>t[r][i]??r,e)}var _r=e=>{const{present:t,children:r}=e,i=uM(t),l=typeof r=="function"?r({present:i.isPresent}):w.Children.only(r),s=We(i.ref,fM(l));return typeof r=="function"||i.isPresent?w.cloneElement(l,{ref:s}):null};_r.displayName="Presence";function uM(e){const[t,r]=w.useState(),i=w.useRef(null),l=w.useRef(e),s=w.useRef("none"),c=e?"mounted":"unmounted",[f,h]=cM(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Au(i.current);s.current=f==="mounted"?d:"none"},[f]),Ut(()=>{const d=i.current,m=l.current;if(m!==e){const x=s.current,b=Au(d);e?h("MOUNT"):b==="none"||d?.display==="none"?h("UNMOUNT"):h(m&&x!==b?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,h]),Ut(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,p=b=>{const S=Au(i.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(h("ANIMATION_END"),!l.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},x=b=>{b.target===t&&(s.current=Au(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:w.useCallback(d=>{i.current=d?getComputedStyle(d):null,r(d)},[])}}function Au(e){return e?.animationName||"none"}function fM(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dM=xS[" useId ".trim().toString()]||(()=>{}),hM=0;function Zo(e){const[t,r]=w.useState(dM());return Ut(()=>{r(i=>i??String(hM++))},[e]),e||(t?`radix-${t}`:"")}var mM=w.createContext(void 0);function If(e){const t=w.useContext(mM);return e||t||"ltr"}function Zt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>t.current?.(...r),[])}function pM(e,t=globalThis?.document){const r=Zt(e);w.useEffect(()=>{const i=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[r,t])}var gM="DismissableLayer",Mp="dismissableLayer.update",yM="dismissableLayer.pointerDownOutside",xM="dismissableLayer.focusOutside",Vb,iE=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jg=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:s,onInteractOutside:c,onDismiss:f,...h}=e,d=w.useContext(iE),[m,p]=w.useState(null),x=m?.ownerDocument??globalThis?.document,[,b]=w.useState({}),E=We(t,z=>p(z)),S=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(_),k=m?S.indexOf(m):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,A=k>=N,L=wM(z=>{const P=z.target,H=[...d.branches].some(X=>X.contains(P));!A||H||(l?.(z),c?.(z),z.defaultPrevented||f?.())},x),j=SM(z=>{const P=z.target;[...d.branches].some(X=>X.contains(P))||(s?.(z),c?.(z),z.defaultPrevented||f?.())},x);return pM(z=>{k===d.layers.size-1&&(i?.(z),!z.defaultPrevented&&f&&(z.preventDefault(),f()))},x),w.useEffect(()=>{if(m)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Vb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),$b(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Vb)}},[m,x,r,d]),w.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),$b())},[m,d]),w.useEffect(()=>{const z=()=>b({});return document.addEventListener(Mp,z),()=>document.removeEventListener(Mp,z)},[]),g.jsx(Oe.div,{...h,ref:E,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,j.onFocusCapture),onBlurCapture:je(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,L.onPointerDownCapture)})});jg.displayName=gM;var vM="DismissableLayerBranch",bM=w.forwardRef((e,t)=>{const r=w.useContext(iE),i=w.useRef(null),l=We(t,i);return w.useEffect(()=>{const s=i.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),g.jsx(Oe.div,{...e,ref:l})});bM.displayName=vM;function wM(e,t=globalThis?.document){const r=Zt(e),i=w.useRef(!1),l=w.useRef(()=>{});return w.useEffect(()=>{const s=f=>{if(f.target&&!i.current){let h=function(){lE(yM,r,d,{discrete:!0})};const d={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=h,t.addEventListener("click",l.current,{once:!0})):h()}else t.removeEventListener("click",l.current);i.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>i.current=!0}}function SM(e,t=globalThis?.document){const r=Zt(e),i=w.useRef(!1);return w.useEffect(()=>{const l=s=>{s.target&&!i.current&&lE(xM,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function $b(){const e=new CustomEvent(Mp);document.dispatchEvent(e)}function lE(e,t,r,{discrete:i}){const l=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),i?tM(l,s):l.dispatchEvent(s)}var Pm="focusScope.autoFocusOnMount",Um="focusScope.autoFocusOnUnmount",Yb={bubbles:!1,cancelable:!0},EM="FocusScope",Mg=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:s,...c}=e,[f,h]=w.useState(null),d=Zt(l),m=Zt(s),p=w.useRef(null),x=We(t,S=>h(S)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(i){let S=function(C){if(b.paused||!f)return;const A=C.target;f.contains(A)?p.current=A:Xo(p.current,{select:!0})},_=function(C){if(b.paused||!f)return;const A=C.relatedTarget;A!==null&&(f.contains(A)||Xo(p.current,{select:!0}))},N=function(C){if(document.activeElement===document.body)for(const L of C)L.removedNodes.length>0&&Xo(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",_);const k=new MutationObserver(N);return f&&k.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",_),k.disconnect()}}},[i,f,b.paused]),w.useEffect(()=>{if(f){Fb.add(b);const S=document.activeElement;if(!f.contains(S)){const N=new CustomEvent(Pm,Yb);f.addEventListener(Pm,d),f.dispatchEvent(N),N.defaultPrevented||(CM(AM(aE(f)),{select:!0}),document.activeElement===S&&Xo(f))}return()=>{f.removeEventListener(Pm,d),setTimeout(()=>{const N=new CustomEvent(Um,Yb);f.addEventListener(Um,m),f.dispatchEvent(N),N.defaultPrevented||Xo(S??document.body,{select:!0}),f.removeEventListener(Um,m),Fb.remove(b)},0)}}},[f,d,m,b]);const E=w.useCallback(S=>{if(!r&&!i||b.paused)return;const _=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(_&&N){const k=S.currentTarget,[C,A]=NM(k);C&&A?!S.shiftKey&&N===A?(S.preventDefault(),r&&Xo(C,{select:!0})):S.shiftKey&&N===C&&(S.preventDefault(),r&&Xo(A,{select:!0})):N===k&&S.preventDefault()}},[r,i,b.paused]);return g.jsx(Oe.div,{tabIndex:-1,...c,ref:x,onKeyDown:E})});Mg.displayName=EM;function CM(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(Xo(i,{select:t}),document.activeElement!==r)return}function NM(e){const t=aE(e),r=qb(t,e),i=qb(t.reverse(),e);return[r,i]}function aE(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function qb(e,t){for(const r of e)if(!_M(r,{upTo:t}))return r}function _M(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function kM(e){return e instanceof HTMLInputElement&&"select"in e}function Xo(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&kM(e)&&t&&e.select()}}var Fb=TM();function TM(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Xb(e,t),e.unshift(t)},remove(t){e=Xb(e,t),e[0]?.resume()}}}function Xb(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function AM(e){return e.filter(t=>t.tagName!=="A")}var RM="Portal",Og=w.forwardRef((e,t)=>{const{container:r,...i}=e,[l,s]=w.useState(!1);Ut(()=>s(!0),[]);const c=r||l&&globalThis?.document?.body;return c?tj.createPortal(g.jsx(Oe.div,{...i,ref:t}),c):null});Og.displayName=RM;var Vm=0;function sE(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gb()),document.body.insertAdjacentElement("beforeend",e[1]??Gb()),Vm++,()=>{Vm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Vm--}},[])}function Gb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var gr=function(){return gr=Object.assign||function(t){for(var r,i=1,l=arguments.length;i<l;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},gr.apply(this,arguments)};function cE(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(r[i[l]]=e[i[l]]);return r}function jM(e,t,r){if(r||arguments.length===2)for(var i=0,l=t.length,s;i<l;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))}var Qu="right-scroll-bar-position",Ju="width-before-scroll-bar",MM="with-scroll-bars-hidden",OM="--removed-body-scroll-bar-size";function $m(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function DM(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(i){var l=r.value;l!==i&&(r.value=i,r.callback(i,l))}}}})[0];return r.callback=t,r.facade}var zM=typeof window<"u"?w.useLayoutEffect:w.useEffect,Wb=new WeakMap;function LM(e,t){var r=DM(null,function(i){return e.forEach(function(l){return $m(l,i)})});return zM(function(){var i=Wb.get(r);if(i){var l=new Set(i),s=new Set(e),c=r.current;l.forEach(function(f){s.has(f)||$m(f,null)}),s.forEach(function(f){l.has(f)||$m(f,c)})}Wb.set(r,e)},[e]),r}function IM(e){return e}function BM(e,t){t===void 0&&(t=IM);var r=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var c=t(s,i);return r.push(c),function(){r=r.filter(function(f){return f!==c})}},assignSyncMedium:function(s){for(i=!0;r.length;){var c=r;r=[],c.forEach(s)}r={push:function(f){return s(f)},filter:function(){return r}}},assignMedium:function(s){i=!0;var c=[];if(r.length){var f=r;r=[],f.forEach(s),c=r}var h=function(){var m=c;c=[],m.forEach(s)},d=function(){return Promise.resolve().then(h)};d(),r={push:function(m){c.push(m),d()},filter:function(m){return c=c.filter(m),r}}}};return l}function HM(e){e===void 0&&(e={});var t=BM(null);return t.options=gr({async:!0,ssr:!1},e),t}var uE=function(e){var t=e.sideCar,r=cE(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return w.createElement(i,gr({},r))};uE.isSideCarExport=!0;function PM(e,t){return e.useMedium(t),uE}var fE=HM(),Ym=function(){},Bf=w.forwardRef(function(e,t){var r=w.useRef(null),i=w.useState({onScrollCapture:Ym,onWheelCapture:Ym,onTouchMoveCapture:Ym}),l=i[0],s=i[1],c=e.forwardProps,f=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,p=e.shards,x=e.sideCar,b=e.noRelative,E=e.noIsolation,S=e.inert,_=e.allowPinchZoom,N=e.as,k=N===void 0?"div":N,C=e.gapMode,A=cE(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=x,j=LM([r,t]),z=gr(gr({},A),l);return w.createElement(w.Fragment,null,m&&w.createElement(L,{sideCar:fE,removeScrollBar:d,shards:p,noRelative:b,noIsolation:E,inert:S,setCallbacks:s,allowPinchZoom:!!_,lockRef:r,gapMode:C}),c?w.cloneElement(w.Children.only(f),gr(gr({},z),{ref:j})):w.createElement(k,gr({},z,{className:h,ref:j}),f))});Bf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bf.classNames={fullWidth:Ju,zeroRight:Qu};var UM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UM();return t&&e.setAttribute("nonce",t),e}function $M(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function YM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qM=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VM())&&($M(t,r),YM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},FM=function(){var e=qM();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},dE=function(){var e=FM(),t=function(r){var i=r.styles,l=r.dynamic;return e(i,l),null};return t},XM={left:0,top:0,right:0,gap:0},qm=function(e){return parseInt(e||"",10)||0},GM=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[qm(r),qm(i),qm(l)]},WM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return XM;var t=GM(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},ZM=dE(),Bl="data-scroll-locked",KM=function(e,t,r,i){var l=e.left,s=e.top,c=e.right,f=e.gap;return r===void 0&&(r="margin"),`
13
+ .`.concat(MM,` {
14
+ overflow: hidden `).concat(i,`;
15
+ padding-right: `).concat(f,"px ").concat(i,`;
16
+ }
17
+ body[`).concat(Bl,`] {
18
+ overflow: hidden `).concat(i,`;
19
+ overscroll-behavior: contain;
20
+ `).concat([t&&"position: relative ".concat(i,";"),r==="margin"&&`
21
+ padding-left: `.concat(l,`px;
22
+ padding-top: `).concat(s,`px;
23
+ padding-right: `).concat(c,`px;
24
+ margin-left:0;
25
+ margin-top:0;
26
+ margin-right: `).concat(f,"px ").concat(i,`;
27
+ `),r==="padding"&&"padding-right: ".concat(f,"px ").concat(i,";")].filter(Boolean).join(""),`
28
+ }
29
+
30
+ .`).concat(Qu,` {
31
+ right: `).concat(f,"px ").concat(i,`;
32
+ }
33
+
34
+ .`).concat(Ju,` {
35
+ margin-right: `).concat(f,"px ").concat(i,`;
36
+ }
37
+
38
+ .`).concat(Qu," .").concat(Qu,` {
39
+ right: 0 `).concat(i,`;
40
+ }
41
+
42
+ .`).concat(Ju," .").concat(Ju,` {
43
+ margin-right: 0 `).concat(i,`;
44
+ }
45
+
46
+ body[`).concat(Bl,`] {
47
+ `).concat(OM,": ").concat(f,`px;
48
+ }
49
+ `)},Zb=function(){var e=parseInt(document.body.getAttribute(Bl)||"0",10);return isFinite(e)?e:0},QM=function(){w.useEffect(function(){return document.body.setAttribute(Bl,(Zb()+1).toString()),function(){var e=Zb()-1;e<=0?document.body.removeAttribute(Bl):document.body.setAttribute(Bl,e.toString())}},[])},JM=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,l=i===void 0?"margin":i;QM();var s=w.useMemo(function(){return WM(l)},[l]);return w.createElement(ZM,{styles:KM(s,!t,l,r?"":"!important")})},Op=!1;if(typeof window<"u")try{var Ru=Object.defineProperty({},"passive",{get:function(){return Op=!0,!0}});window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Op=!1}var Rl=Op?{passive:!1}:!1,eO=function(e){return e.tagName==="TEXTAREA"},hE=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!eO(e)&&r[t]==="visible")},tO=function(e){return hE(e,"overflowY")},nO=function(e){return hE(e,"overflowX")},Kb=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=mE(e,i);if(l){var s=pE(e,i),c=s[1],f=s[2];if(c>f)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},rO=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},oO=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},mE=function(e,t){return e==="v"?tO(t):nO(t)},pE=function(e,t){return e==="v"?rO(t):oO(t)},iO=function(e,t){return e==="h"&&t==="rtl"?-1:1},lO=function(e,t,r,i,l){var s=iO(e,window.getComputedStyle(t).direction),c=s*i,f=r.target,h=t.contains(f),d=!1,m=c>0,p=0,x=0;do{if(!f)break;var b=pE(e,f),E=b[0],S=b[1],_=b[2],N=S-_-s*E;(E||N)&&mE(e,f)&&(p+=N,x+=E);var k=f.parentNode;f=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!h&&f!==document.body||h&&(t.contains(f)||t===f));return(m&&Math.abs(p)<1||!m&&Math.abs(x)<1)&&(d=!0),d},ju=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qb=function(e){return[e.deltaX,e.deltaY]},Jb=function(e){return e&&"current"in e?e.current:e},aO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sO=function(e){return`
50
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
51
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
52
+ `)},cO=0,jl=[];function uO(e){var t=w.useRef([]),r=w.useRef([0,0]),i=w.useRef(),l=w.useState(cO++)[0],s=w.useState(dE)[0],c=w.useRef(e);w.useEffect(function(){c.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var S=jM([e.lockRef.current],(e.shards||[]).map(Jb),!0).filter(Boolean);return S.forEach(function(_){return _.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),S.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=w.useCallback(function(S,_){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var N=ju(S),k=r.current,C="deltaX"in S?S.deltaX:k[0]-N[0],A="deltaY"in S?S.deltaY:k[1]-N[1],L,j=S.target,z=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in S&&z==="h"&&j.type==="range")return!1;var P=window.getSelection(),H=P&&P.anchorNode,X=H?H===j||H.contains(j):!1;if(X)return!1;var q=Kb(z,j);if(!q)return!0;if(q?L=z:(L=z==="v"?"h":"v",q=Kb(z,j)),!q)return!1;if(!i.current&&"changedTouches"in S&&(C||A)&&(i.current=L),!L)return!0;var F=i.current||L;return lO(F,_,S,F==="h"?C:A)},[]),h=w.useCallback(function(S){var _=S;if(!(!jl.length||jl[jl.length-1]!==s)){var N="deltaY"in _?Qb(_):ju(_),k=t.current.filter(function(L){return L.name===_.type&&(L.target===_.target||_.target===L.shadowParent)&&aO(L.delta,N)})[0];if(k&&k.should){_.cancelable&&_.preventDefault();return}if(!k){var C=(c.current.shards||[]).map(Jb).filter(Boolean).filter(function(L){return L.contains(_.target)}),A=C.length>0?f(_,C[0]):!c.current.noIsolation;A&&_.cancelable&&_.preventDefault()}}},[]),d=w.useCallback(function(S,_,N,k){var C={name:S,delta:_,target:N,should:k,shadowParent:fO(N)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),m=w.useCallback(function(S){r.current=ju(S),i.current=void 0},[]),p=w.useCallback(function(S){d(S.type,Qb(S),S.target,f(S,e.lockRef.current))},[]),x=w.useCallback(function(S){d(S.type,ju(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return jl.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",h,Rl),document.addEventListener("touchmove",h,Rl),document.addEventListener("touchstart",m,Rl),function(){jl=jl.filter(function(S){return S!==s}),document.removeEventListener("wheel",h,Rl),document.removeEventListener("touchmove",h,Rl),document.removeEventListener("touchstart",m,Rl)}},[]);var b=e.removeScrollBar,E=e.inert;return w.createElement(w.Fragment,null,E?w.createElement(s,{styles:sO(l)}):null,b?w.createElement(JM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dO=PM(fE,uO);var Dg=w.forwardRef(function(e,t){return w.createElement(Bf,gr({},e,{ref:t,sideCar:dO}))});Dg.classNames=Bf.classNames;var hO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ml=new WeakMap,Mu=new WeakMap,Ou={},Fm=0,gE=function(e){return e&&(e.host||gE(e.parentNode))},mO=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=gE(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},pO=function(e,t,r,i){var l=mO(t,Array.isArray(e)?e:[e]);Ou[r]||(Ou[r]=new WeakMap);var s=Ou[r],c=[],f=new Set,h=new Set(l),d=function(p){!p||f.has(p)||(f.add(p),d(p.parentNode))};l.forEach(d);var m=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(x){if(f.has(x))m(x);else try{var b=x.getAttribute(i),E=b!==null&&b!=="false",S=(Ml.get(x)||0)+1,_=(s.get(x)||0)+1;Ml.set(x,S),s.set(x,_),c.push(x),S===1&&E&&Mu.set(x,!0),_===1&&x.setAttribute(r,"true"),E||x.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return m(t),f.clear(),Fm++,function(){c.forEach(function(p){var x=Ml.get(p)-1,b=s.get(p)-1;Ml.set(p,x),s.set(p,b),x||(Mu.has(p)||p.removeAttribute(i),Mu.delete(p)),b||p.removeAttribute(r)}),Fm--,Fm||(Ml=new WeakMap,Ml=new WeakMap,Mu=new WeakMap,Ou={})}},yE=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),l=hO(e);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),pO(i,l,r,"aria-hidden")):function(){return null}},Hf="Dialog",[xE]=uo(Hf),[gO,ir]=xE(Hf),vE=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:l,onOpenChange:s,modal:c=!0}=e,f=w.useRef(null),h=w.useRef(null),[d,m]=Mi({prop:i,defaultProp:l??!1,onChange:s,caller:Hf});return g.jsx(gO,{scope:t,triggerRef:f,contentRef:h,contentId:Zo(),titleId:Zo(),descriptionId:Zo(),open:d,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(p=>!p),[m]),modal:c,children:r})};vE.displayName=Hf;var bE="DialogTrigger",yO=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(bE,r),s=We(t,l.triggerRef);return g.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Ig(l.open),...i,ref:s,onClick:je(e.onClick,l.onOpenToggle)})});yO.displayName=bE;var zg="DialogPortal",[xO,wE]=xE(zg,{forceMount:void 0}),SE=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:l}=e,s=ir(zg,t);return g.jsx(xO,{scope:t,forceMount:r,children:w.Children.map(i,c=>g.jsx(_r,{present:r||s.open,children:g.jsx(Og,{asChild:!0,container:l,children:c})}))})};SE.displayName=zg;var ff="DialogOverlay",EE=w.forwardRef((e,t)=>{const r=wE(ff,e.__scopeDialog),{forceMount:i=r.forceMount,...l}=e,s=ir(ff,e.__scopeDialog);return s.modal?g.jsx(_r,{present:i||s.open,children:g.jsx(bO,{...l,ref:t})}):null});EE.displayName=ff;var vO=ql("DialogOverlay.RemoveScroll"),bO=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(ff,r);return g.jsx(Dg,{as:vO,allowPinchZoom:!0,shards:[l.contentRef],children:g.jsx(Oe.div,{"data-state":Ig(l.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),Oi="DialogContent",CE=w.forwardRef((e,t)=>{const r=wE(Oi,e.__scopeDialog),{forceMount:i=r.forceMount,...l}=e,s=ir(Oi,e.__scopeDialog);return g.jsx(_r,{present:i||s.open,children:s.modal?g.jsx(wO,{...l,ref:t}):g.jsx(SO,{...l,ref:t})})});CE.displayName=Oi;var wO=w.forwardRef((e,t)=>{const r=ir(Oi,e.__scopeDialog),i=w.useRef(null),l=We(t,r.contentRef,i);return w.useEffect(()=>{const s=i.current;if(s)return yE(s)},[]),g.jsx(NE,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&s.preventDefault()}),onFocusOutside:je(e.onFocusOutside,s=>s.preventDefault())})}),SO=w.forwardRef((e,t)=>{const r=ir(Oi,e.__scopeDialog),i=w.useRef(!1),l=w.useRef(!1);return g.jsx(NE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(i.current||r.triggerRef.current?.focus(),s.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=s.target;r.triggerRef.current?.contains(c)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&l.current&&s.preventDefault()}})}),NE=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:s,...c}=e,f=ir(Oi,r),h=w.useRef(null),d=We(t,h);return sE(),g.jsxs(g.Fragment,{children:[g.jsx(Mg,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:l,onUnmountAutoFocus:s,children:g.jsx(jg,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ig(f.open),...c,ref:d,onDismiss:()=>f.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(EO,{titleId:f.titleId}),g.jsx(NO,{contentRef:h,descriptionId:f.descriptionId})]})]})}),Lg="DialogTitle",_E=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(Lg,r);return g.jsx(Oe.h2,{id:l.titleId,...i,ref:t})});_E.displayName=Lg;var kE="DialogDescription",TE=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(kE,r);return g.jsx(Oe.p,{id:l.descriptionId,...i,ref:t})});TE.displayName=kE;var AE="DialogClose",RE=w.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,l=ir(AE,r);return g.jsx(Oe.button,{type:"button",...i,ref:t,onClick:je(e.onClick,()=>l.onOpenChange(!1))})});RE.displayName=AE;function Ig(e){return e?"open":"closed"}var jE="DialogTitleWarning",[b7,ME]=oM(jE,{contentName:Oi,titleName:Lg,docsSlug:"dialog"}),EO=({titleId:e})=>{const t=ME(jE),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
+
54
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
+
56
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},CO="DialogDescriptionWarning",NO=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ME(CO).contentName}}.`;return w.useEffect(()=>{const l=e.current?.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},OE=vE,DE=SE,zE=EE,LE=CE,IE=_E,BE=TE,HE=RE,Xm={exports:{}},Gm={};var ew;function _O(){if(ew)return Gm;ew=1;var e=Vs();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var r=typeof Object.is=="function"?Object.is:t,i=e.useState,l=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function f(p,x){var b=x(),E=i({inst:{value:b,getSnapshot:x}}),S=E[0].inst,_=E[1];return s(function(){S.value=b,S.getSnapshot=x,h(S)&&_({inst:S})},[p,b,x]),l(function(){return h(S)&&_({inst:S}),p(function(){h(S)&&_({inst:S})})},[p]),c(b),b}function h(p){var x=p.getSnapshot;p=p.value;try{var b=x();return!r(p,b)}catch{return!0}}function d(p,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Gm}var tw;function kO(){return tw||(tw=1,Xm.exports=_O()),Xm.exports}function Bg(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Hg(e){const[t,r]=w.useState(void 0);return Ut(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let c,f;if("borderBoxSize"in s){const h=s.borderBoxSize,d=Array.isArray(h)?h[0]:h;c=d.inlineSize,f=d.blockSize}else c=e.offsetWidth,f=e.offsetHeight;r({width:c,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),t}var Pf="Checkbox",[TO]=uo(Pf),[AO,Pg]=TO(Pf);function RO(e){const{__scopeCheckbox:t,checked:r,children:i,defaultChecked:l,disabled:s,form:c,name:f,onCheckedChange:h,required:d,value:m="on",internal_do_not_use_render:p}=e,[x,b]=Mi({prop:r,defaultProp:l??!1,onChange:h,caller:Pf}),[E,S]=w.useState(null),[_,N]=w.useState(null),k=w.useRef(!1),C=E?!!c||!!E.closest("form"):!0,A={checked:x,disabled:s,setChecked:b,control:E,setControl:S,name:f,form:c,value:m,hasConsumerStoppedPropagationRef:k,required:d,defaultChecked:Ko(l)?!1:l,isFormControl:C,bubbleInput:_,setBubbleInput:N};return g.jsx(AO,{scope:t,...A,children:jO(p)?p(A):i})}var PE="CheckboxTrigger",UE=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...i},l)=>{const{control:s,value:c,disabled:f,checked:h,required:d,setControl:m,setChecked:p,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:E}=Pg(PE,e),S=We(l,m),_=w.useRef(h);return w.useEffect(()=>{const N=s?.form;if(N){const k=()=>p(_.current);return N.addEventListener("reset",k),()=>N.removeEventListener("reset",k)}},[s,p]),g.jsx(Oe.button,{type:"button",role:"checkbox","aria-checked":Ko(h)?"mixed":h,"aria-required":d,"data-state":XE(h),"data-disabled":f?"":void 0,disabled:f,value:c,...i,ref:S,onKeyDown:je(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:je(r,N=>{p(k=>Ko(k)?!0:!k),E&&b&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})})});UE.displayName=PE;var VE=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:i,checked:l,defaultChecked:s,required:c,disabled:f,value:h,onCheckedChange:d,form:m,...p}=e;return g.jsx(RO,{__scopeCheckbox:r,checked:l,defaultChecked:s,disabled:f,required:c,onCheckedChange:d,name:i,form:m,value:h,internal_do_not_use_render:({isFormControl:x})=>g.jsxs(g.Fragment,{children:[g.jsx(UE,{...p,ref:t,__scopeCheckbox:r}),x&&g.jsx(FE,{__scopeCheckbox:r})]})})});VE.displayName=Pf;var $E="CheckboxIndicator",YE=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:i,...l}=e,s=Pg($E,r);return g.jsx(_r,{present:i||Ko(s.checked)||s.checked===!0,children:g.jsx(Oe.span,{"data-state":XE(s.checked),"data-disabled":s.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});YE.displayName=$E;var qE="CheckboxBubbleInput",FE=w.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:i,hasConsumerStoppedPropagationRef:l,checked:s,defaultChecked:c,required:f,disabled:h,name:d,value:m,form:p,bubbleInput:x,setBubbleInput:b}=Pg(qE,e),E=We(r,b),S=Bg(s),_=Hg(i);w.useEffect(()=>{const k=x;if(!k)return;const C=window.HTMLInputElement.prototype,L=Object.getOwnPropertyDescriptor(C,"checked").set,j=!l.current;if(S!==s&&L){const z=new Event("click",{bubbles:j});k.indeterminate=Ko(s),L.call(k,Ko(s)?!1:s),k.dispatchEvent(z)}},[x,S,s,l]);const N=w.useRef(Ko(s)?!1:s);return g.jsx(Oe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??N.current,required:f,disabled:h,name:d,value:m,form:p,...t,tabIndex:-1,ref:E,style:{...t.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});FE.displayName=qE;function jO(e){return typeof e=="function"}function Ko(e){return e==="indeterminate"}function XE(e){return Ko(e)?"indeterminate":e?"checked":"unchecked"}const MO=["top","right","bottom","left"],Qo=Math.min,wn=Math.max,df=Math.round,Du=Math.floor,br=e=>({x:e,y:e}),OO={left:"right",right:"left",bottom:"top",top:"bottom"},DO={start:"end",end:"start"};function Dp(e,t,r){return wn(e,Qo(t,r))}function ao(e,t){return typeof e=="function"?e(t):e}function so(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function Ug(e){return e==="x"?"y":"x"}function Vg(e){return e==="y"?"height":"width"}const zO=new Set(["top","bottom"]);function vr(e){return zO.has(so(e))?"y":"x"}function $g(e){return Ug(vr(e))}function LO(e,t,r){r===void 0&&(r=!1);const i=ia(e),l=$g(e),s=Vg(l);let c=l==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=hf(c)),[c,hf(c)]}function IO(e){const t=hf(e);return[zp(e),t,zp(t)]}function zp(e){return e.replace(/start|end/g,t=>DO[t])}const nw=["left","right"],rw=["right","left"],BO=["top","bottom"],HO=["bottom","top"];function PO(e,t,r){switch(e){case"top":case"bottom":return r?t?rw:nw:t?nw:rw;case"left":case"right":return t?BO:HO;default:return[]}}function UO(e,t,r,i){const l=ia(e);let s=PO(so(e),r==="start",i);return l&&(s=s.map(c=>c+"-"+l),t&&(s=s.concat(s.map(zp)))),s}function hf(e){return e.replace(/left|right|bottom|top/g,t=>OO[t])}function VO(e){return{top:0,right:0,bottom:0,left:0,...e}}function GE(e){return typeof e!="number"?VO(e):{top:e,right:e,bottom:e,left:e}}function mf(e){const{x:t,y:r,width:i,height:l}=e;return{width:i,height:l,top:r,left:t,right:t+i,bottom:r+l,x:t,y:r}}function ow(e,t,r){let{reference:i,floating:l}=e;const s=vr(t),c=$g(t),f=Vg(c),h=so(t),d=s==="y",m=i.x+i.width/2-l.width/2,p=i.y+i.height/2-l.height/2,x=i[f]/2-l[f]/2;let b;switch(h){case"top":b={x:m,y:i.y-l.height};break;case"bottom":b={x:m,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:p};break;case"left":b={x:i.x-l.width,y:p};break;default:b={x:i.x,y:i.y}}switch(ia(t)){case"start":b[c]-=x*(r&&d?-1:1);break;case"end":b[c]+=x*(r&&d?-1:1);break}return b}async function $O(e,t){var r;t===void 0&&(t={});const{x:i,y:l,platform:s,rects:c,elements:f,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:x=!1,padding:b=0}=ao(t,e),E=GE(b),_=f[x?p==="floating"?"reference":"floating":p],N=mf(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(_)))==null||r?_:_.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(f.floating)),boundary:d,rootBoundary:m,strategy:h})),k=p==="floating"?{x:i,y:l,width:c.floating.width,height:c.floating.height}:c.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f.floating)),A=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},L=mf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:C,strategy:h}):k);return{top:(N.top-L.top+E.top)/A.y,bottom:(L.bottom-N.bottom+E.bottom)/A.y,left:(N.left-L.left+E.left)/A.x,right:(L.right-N.right+E.right)/A.x}}const YO=async(e,t,r)=>{const{placement:i="bottom",strategy:l="absolute",middleware:s=[],platform:c}=r,f=s.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:l}),{x:m,y:p}=ow(d,i,h),x=i,b={},E=0;for(let _=0;_<f.length;_++){var S;const{name:N,fn:k}=f[_],{x:C,y:A,data:L,reset:j}=await k({x:m,y:p,initialPlacement:i,placement:x,strategy:l,middlewareData:b,rects:d,platform:{...c,detectOverflow:(S=c.detectOverflow)!=null?S:$O},elements:{reference:e,floating:t}});m=C??m,p=A??p,b={...b,[N]:{...b[N],...L}},j&&E<=50&&(E++,typeof j=="object"&&(j.placement&&(x=j.placement),j.rects&&(d=j.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:l}):j.rects),{x:m,y:p}=ow(d,x,h)),_=-1)}return{x:m,y:p,placement:x,strategy:l,middlewareData:b}},qO=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:l,rects:s,platform:c,elements:f,middlewareData:h}=t,{element:d,padding:m=0}=ao(e,t)||{};if(d==null)return{};const p=GE(m),x={x:r,y:i},b=$g(l),E=Vg(b),S=await c.getDimensions(d),_=b==="y",N=_?"top":"left",k=_?"bottom":"right",C=_?"clientHeight":"clientWidth",A=s.reference[E]+s.reference[b]-x[b]-s.floating[E],L=x[b]-s.reference[b],j=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let z=j?j[C]:0;(!z||!await(c.isElement==null?void 0:c.isElement(j)))&&(z=f.floating[C]||s.floating[E]);const P=A/2-L/2,H=z/2-S[E]/2-1,X=Qo(p[N],H),q=Qo(p[k],H),F=X,Y=z-S[E]-q,O=z/2-S[E]/2+P,U=Dp(F,O,Y),R=!h.arrow&&ia(l)!=null&&O!==U&&s.reference[E]/2-(O<F?X:q)-S[E]/2<0,V=R?O<F?O-F:O-Y:0;return{[b]:x[b]+V,data:{[b]:U,centerOffset:O-U-V,...R&&{alignmentOffset:V}},reset:R}}}),FO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,i;const{placement:l,middlewareData:s,rects:c,initialPlacement:f,platform:h,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,..._}=ao(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const N=so(l),k=vr(f),C=so(f)===f,A=await(h.isRTL==null?void 0:h.isRTL(d.floating)),L=x||(C||!S?[hf(f)]:IO(f)),j=E!=="none";!x&&j&&L.push(...UO(f,S,E,A));const z=[f,...L],P=await h.detectOverflow(t,_),H=[];let X=((i=s.flip)==null?void 0:i.overflows)||[];if(m&&H.push(P[N]),p){const O=LO(l,c,A);H.push(P[O[0]],P[O[1]])}if(X=[...X,{placement:l,overflows:H}],!H.every(O=>O<=0)){var q,F;const O=(((q=s.flip)==null?void 0:q.index)||0)+1,U=z[O];if(U&&(!(p==="alignment"?k!==vr(U):!1)||X.every($=>vr($.placement)===k?$.overflows[0]>0:!0)))return{data:{index:O,overflows:X},reset:{placement:U}};let R=(F=X.filter(V=>V.overflows[0]<=0).sort((V,$)=>V.overflows[1]-$.overflows[1])[0])==null?void 0:F.placement;if(!R)switch(b){case"bestFit":{var Y;const V=(Y=X.filter($=>{if(j){const W=vr($.placement);return W===k||W==="y"}return!0}).map($=>[$.placement,$.overflows.filter(W=>W>0).reduce((W,M)=>W+M,0)]).sort(($,W)=>$[1]-W[1])[0])==null?void 0:Y[0];V&&(R=V);break}case"initialPlacement":R=f;break}if(l!==R)return{reset:{placement:R}}}return{}}}};function iw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lw(e){return MO.some(t=>e[t]>=0)}const XO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:l="referenceHidden",...s}=ao(e,t);switch(l){case"referenceHidden":{const c=await i.detectOverflow(t,{...s,elementContext:"reference"}),f=iw(c,r.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:lw(f)}}}case"escaped":{const c=await i.detectOverflow(t,{...s,altBoundary:!0}),f=iw(c,r.floating);return{data:{escapedOffsets:f,escaped:lw(f)}}}default:return{}}}}},WE=new Set(["left","top"]);async function GO(e,t){const{placement:r,platform:i,elements:l}=e,s=await(i.isRTL==null?void 0:i.isRTL(l.floating)),c=so(r),f=ia(r),h=vr(r)==="y",d=WE.has(c)?-1:1,m=s&&h?-1:1,p=ao(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return f&&typeof E=="number"&&(b=f==="end"?E*-1:E),h?{x:b*m,y:x*d}:{x:x*d,y:b*m}}const WO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:l,y:s,placement:c,middlewareData:f}=t,h=await GO(t,e);return c===((r=f.offset)==null?void 0:r.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:l+h.x,y:s+h.y,data:{...h,placement:c}}}}},ZO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:l,platform:s}=t,{mainAxis:c=!0,crossAxis:f=!1,limiter:h={fn:N=>{let{x:k,y:C}=N;return{x:k,y:C}}},...d}=ao(e,t),m={x:r,y:i},p=await s.detectOverflow(t,d),x=vr(so(l)),b=Ug(x);let E=m[b],S=m[x];if(c){const N=b==="y"?"top":"left",k=b==="y"?"bottom":"right",C=E+p[N],A=E-p[k];E=Dp(C,E,A)}if(f){const N=x==="y"?"top":"left",k=x==="y"?"bottom":"right",C=S+p[N],A=S-p[k];S=Dp(C,S,A)}const _=h.fn({...t,[b]:E,[x]:S});return{..._,data:{x:_.x-r,y:_.y-i,enabled:{[b]:c,[x]:f}}}}}},KO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:i,placement:l,rects:s,middlewareData:c}=t,{offset:f=0,mainAxis:h=!0,crossAxis:d=!0}=ao(e,t),m={x:r,y:i},p=vr(l),x=Ug(p);let b=m[x],E=m[p];const S=ao(f,t),_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const C=x==="y"?"height":"width",A=s.reference[x]-s.floating[C]+_.mainAxis,L=s.reference[x]+s.reference[C]-_.mainAxis;b<A?b=A:b>L&&(b=L)}if(d){var N,k;const C=x==="y"?"width":"height",A=WE.has(so(l)),L=s.reference[p]-s.floating[C]+(A&&((N=c.offset)==null?void 0:N[p])||0)+(A?0:_.crossAxis),j=s.reference[p]+s.reference[C]+(A?0:((k=c.offset)==null?void 0:k[p])||0)-(A?_.crossAxis:0);E<L?E=L:E>j&&(E=j)}return{[x]:b,[p]:E}}}},QO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,i;const{placement:l,rects:s,platform:c,elements:f}=t,{apply:h=()=>{},...d}=ao(e,t),m=await c.detectOverflow(t,d),p=so(l),x=ia(l),b=vr(l)==="y",{width:E,height:S}=s.floating;let _,N;p==="top"||p==="bottom"?(_=p,N=x===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(N=p,_=x==="end"?"top":"bottom");const k=S-m.top-m.bottom,C=E-m.left-m.right,A=Qo(S-m[_],k),L=Qo(E-m[N],C),j=!t.middlewareData.shift;let z=A,P=L;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=C),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(z=k),j&&!x){const X=wn(m.left,0),q=wn(m.right,0),F=wn(m.top,0),Y=wn(m.bottom,0);b?P=E-2*(X!==0||q!==0?X+q:wn(m.left,m.right)):z=S-2*(F!==0||Y!==0?F+Y:wn(m.top,m.bottom))}await h({...t,availableWidth:P,availableHeight:z});const H=await c.getDimensions(f.floating);return E!==H.width||S!==H.height?{reset:{rects:!0}}:{}}}};function Uf(){return typeof window<"u"}function la(e){return ZE(e)?(e.nodeName||"").toLowerCase():"#document"}function Nn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kr(e){var t;return(t=(ZE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ZE(e){return Uf()?e instanceof Node||e instanceof Nn(e).Node:!1}function rr(e){return Uf()?e instanceof Element||e instanceof Nn(e).Element:!1}function Sr(e){return Uf()?e instanceof HTMLElement||e instanceof Nn(e).HTMLElement:!1}function aw(e){return!Uf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Nn(e).ShadowRoot}const JO=new Set(["inline","contents"]);function Xs(e){const{overflow:t,overflowX:r,overflowY:i,display:l}=or(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&!JO.has(l)}const eD=new Set(["table","td","th"]);function tD(e){return eD.has(la(e))}const nD=[":popover-open",":modal"];function Vf(e){return nD.some(t=>{try{return e.matches(t)}catch{return!1}})}const rD=["transform","translate","scale","rotate","perspective"],oD=["transform","translate","scale","rotate","perspective","filter"],iD=["paint","layout","strict","content"];function Yg(e){const t=qg(),r=rr(e)?or(e):e;return rD.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||oD.some(i=>(r.willChange||"").includes(i))||iD.some(i=>(r.contain||"").includes(i))}function lD(e){let t=Jo(e);for(;Sr(t)&&!Fl(t);){if(Yg(t))return t;if(Vf(t))return null;t=Jo(t)}return null}function qg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aD=new Set(["html","body","#document"]);function Fl(e){return aD.has(la(e))}function or(e){return Nn(e).getComputedStyle(e)}function $f(e){return rr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jo(e){if(la(e)==="html")return e;const t=e.assignedSlot||e.parentNode||aw(e)&&e.host||kr(e);return aw(t)?t.host:t}function KE(e){const t=Jo(e);return Fl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sr(t)&&Xs(t)?t:KE(t)}function Cs(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const l=KE(e),s=l===((i=e.ownerDocument)==null?void 0:i.body),c=Nn(l);if(s){const f=Lp(c);return t.concat(c,c.visualViewport||[],Xs(l)?l:[],f&&r?Cs(f):[])}return t.concat(l,Cs(l,[],r))}function Lp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function QE(e){const t=or(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const l=Sr(e),s=l?e.offsetWidth:r,c=l?e.offsetHeight:i,f=df(r)!==s||df(i)!==c;return f&&(r=s,i=c),{width:r,height:i,$:f}}function Fg(e){return rr(e)?e:e.contextElement}function Hl(e){const t=Fg(e);if(!Sr(t))return br(1);const r=t.getBoundingClientRect(),{width:i,height:l,$:s}=QE(t);let c=(s?df(r.width):r.width)/i,f=(s?df(r.height):r.height)/l;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const sD=br(0);function JE(e){const t=Nn(e);return!qg()||!t.visualViewport?sD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cD(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Nn(e)?!1:t}function Di(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),s=Fg(e);let c=br(1);t&&(i?rr(i)&&(c=Hl(i)):c=Hl(e));const f=cD(s,r,i)?JE(s):br(0);let h=(l.left+f.x)/c.x,d=(l.top+f.y)/c.y,m=l.width/c.x,p=l.height/c.y;if(s){const x=Nn(s),b=i&&rr(i)?Nn(i):i;let E=x,S=Lp(E);for(;S&&i&&b!==E;){const _=Hl(S),N=S.getBoundingClientRect(),k=or(S),C=N.left+(S.clientLeft+parseFloat(k.paddingLeft))*_.x,A=N.top+(S.clientTop+parseFloat(k.paddingTop))*_.y;h*=_.x,d*=_.y,m*=_.x,p*=_.y,h+=C,d+=A,E=Nn(S),S=Lp(E)}}return mf({width:m,height:p,x:h,y:d})}function Yf(e,t){const r=$f(e).scrollLeft;return t?t.left+r:Di(kr(e)).left+r}function eC(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-Yf(e,r),l=r.top+t.scrollTop;return{x:i,y:l}}function uD(e){let{elements:t,rect:r,offsetParent:i,strategy:l}=e;const s=l==="fixed",c=kr(i),f=t?Vf(t.floating):!1;if(i===c||f&&s)return r;let h={scrollLeft:0,scrollTop:0},d=br(1);const m=br(0),p=Sr(i);if((p||!p&&!s)&&((la(i)!=="body"||Xs(c))&&(h=$f(i)),Sr(i))){const b=Di(i);d=Hl(i),m.x=b.x+i.clientLeft,m.y=b.y+i.clientTop}const x=c&&!p&&!s?eC(c,h):br(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-h.scrollLeft*d.x+m.x+x.x,y:r.y*d.y-h.scrollTop*d.y+m.y+x.y}}function fD(e){return Array.from(e.getClientRects())}function dD(e){const t=kr(e),r=$f(e),i=e.ownerDocument.body,l=wn(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),s=wn(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let c=-r.scrollLeft+Yf(e);const f=-r.scrollTop;return or(i).direction==="rtl"&&(c+=wn(t.clientWidth,i.clientWidth)-l),{width:l,height:s,x:c,y:f}}const sw=25;function hD(e,t){const r=Nn(e),i=kr(e),l=r.visualViewport;let s=i.clientWidth,c=i.clientHeight,f=0,h=0;if(l){s=l.width,c=l.height;const m=qg();(!m||m&&t==="fixed")&&(f=l.offsetLeft,h=l.offsetTop)}const d=Yf(i);if(d<=0){const m=i.ownerDocument,p=m.body,x=getComputedStyle(p),b=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,E=Math.abs(i.clientWidth-p.clientWidth-b);E<=sw&&(s-=E)}else d<=sw&&(s+=d);return{width:s,height:c,x:f,y:h}}const mD=new Set(["absolute","fixed"]);function pD(e,t){const r=Di(e,!0,t==="fixed"),i=r.top+e.clientTop,l=r.left+e.clientLeft,s=Sr(e)?Hl(e):br(1),c=e.clientWidth*s.x,f=e.clientHeight*s.y,h=l*s.x,d=i*s.y;return{width:c,height:f,x:h,y:d}}function cw(e,t,r){let i;if(t==="viewport")i=hD(e,r);else if(t==="document")i=dD(kr(e));else if(rr(t))i=pD(t,r);else{const l=JE(e);i={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return mf(i)}function tC(e,t){const r=Jo(e);return r===t||!rr(r)||Fl(r)?!1:or(r).position==="fixed"||tC(r,t)}function gD(e,t){const r=t.get(e);if(r)return r;let i=Cs(e,[],!1).filter(f=>rr(f)&&la(f)!=="body"),l=null;const s=or(e).position==="fixed";let c=s?Jo(e):e;for(;rr(c)&&!Fl(c);){const f=or(c),h=Yg(c);!h&&f.position==="fixed"&&(l=null),(s?!h&&!l:!h&&f.position==="static"&&!!l&&mD.has(l.position)||Xs(c)&&!h&&tC(e,c))?i=i.filter(m=>m!==c):l=f,c=Jo(c)}return t.set(e,i),i}function yD(e){let{element:t,boundary:r,rootBoundary:i,strategy:l}=e;const c=[...r==="clippingAncestors"?Vf(t)?[]:gD(t,this._c):[].concat(r),i],f=c[0],h=c.reduce((d,m)=>{const p=cw(t,m,l);return d.top=wn(p.top,d.top),d.right=Qo(p.right,d.right),d.bottom=Qo(p.bottom,d.bottom),d.left=wn(p.left,d.left),d},cw(t,f,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function xD(e){const{width:t,height:r}=QE(e);return{width:t,height:r}}function vD(e,t,r){const i=Sr(t),l=kr(t),s=r==="fixed",c=Di(e,!0,s,t);let f={scrollLeft:0,scrollTop:0};const h=br(0);function d(){h.x=Yf(l)}if(i||!i&&!s)if((la(t)!=="body"||Xs(l))&&(f=$f(t)),i){const b=Di(t,!0,s,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else l&&d();s&&!i&&l&&d();const m=l&&!i&&!s?eC(l,f):br(0),p=c.left+f.scrollLeft-h.x-m.x,x=c.top+f.scrollTop-h.y-m.y;return{x:p,y:x,width:c.width,height:c.height}}function Wm(e){return or(e).position==="static"}function uw(e,t){if(!Sr(e)||or(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return kr(e)===r&&(r=r.ownerDocument.body),r}function nC(e,t){const r=Nn(e);if(Vf(e))return r;if(!Sr(e)){let l=Jo(e);for(;l&&!Fl(l);){if(rr(l)&&!Wm(l))return l;l=Jo(l)}return r}let i=uw(e,t);for(;i&&tD(i)&&Wm(i);)i=uw(i,t);return i&&Fl(i)&&Wm(i)&&!Yg(i)?r:i||lD(e)||r}const bD=async function(e){const t=this.getOffsetParent||nC,r=this.getDimensions,i=await r(e.floating);return{reference:vD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function wD(e){return or(e).direction==="rtl"}const SD={convertOffsetParentRelativeRectToViewportRelativeRect:uD,getDocumentElement:kr,getClippingRect:yD,getOffsetParent:nC,getElementRects:bD,getClientRects:fD,getDimensions:xD,getScale:Hl,isElement:rr,isRTL:wD};function rC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ED(e,t){let r=null,i;const l=kr(e);function s(){var f;clearTimeout(i),(f=r)==null||f.disconnect(),r=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),s();const d=e.getBoundingClientRect(),{left:m,top:p,width:x,height:b}=d;if(f||t(),!x||!b)return;const E=Du(p),S=Du(l.clientWidth-(m+x)),_=Du(l.clientHeight-(p+b)),N=Du(m),C={rootMargin:-E+"px "+-S+"px "+-_+"px "+-N+"px",threshold:wn(0,Qo(1,h))||1};let A=!0;function L(j){const z=j[0].intersectionRatio;if(z!==h){if(!A)return c();z?c(!1,z):i=setTimeout(()=>{c(!1,1e-7)},1e3)}z===1&&!rC(d,e.getBoundingClientRect())&&c(),A=!1}try{r=new IntersectionObserver(L,{...C,root:l.ownerDocument})}catch{r=new IntersectionObserver(L,C)}r.observe(e)}return c(!0),s}function CD(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,d=Fg(e),m=l||s?[...d?Cs(d):[],...Cs(t)]:[];m.forEach(N=>{l&&N.addEventListener("scroll",r,{passive:!0}),s&&N.addEventListener("resize",r)});const p=d&&f?ED(d,r):null;let x=-1,b=null;c&&(b=new ResizeObserver(N=>{let[k]=N;k&&k.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var C;(C=b)==null||C.observe(t)})),r()}),d&&!h&&b.observe(d),b.observe(t));let E,S=h?Di(e):null;h&&_();function _(){const N=Di(e);S&&!rC(S,N)&&r(),S=N,E=requestAnimationFrame(_)}return r(),()=>{var N;m.forEach(k=>{l&&k.removeEventListener("scroll",r),s&&k.removeEventListener("resize",r)}),p?.(),(N=b)==null||N.disconnect(),b=null,h&&cancelAnimationFrame(E)}}const ND=WO,_D=ZO,kD=FO,TD=QO,AD=XO,fw=qO,RD=KO,jD=(e,t,r)=>{const i=new Map,l={platform:SD,...r},s={...l.platform,_c:i};return YO(e,t,{...l,platform:s})};var MD=typeof document<"u",OD=function(){},ef=MD?w.useLayoutEffect:OD;function pf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!pf(e[i],t[i]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,l[i]))return!1;for(i=r;i--!==0;){const s=l[i];if(!(s==="_owner"&&e.$$typeof)&&!pf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function oC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dw(e,t){const r=oC(e);return Math.round(t*r)/r}function Zm(e){const t=w.useRef(e);return ef(()=>{t.current=e}),t}function DD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:l,elements:{reference:s,floating:c}={},transform:f=!0,whileElementsMounted:h,open:d}=e,[m,p]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=w.useState(i);pf(x,i)||b(i);const[E,S]=w.useState(null),[_,N]=w.useState(null),k=w.useCallback($=>{$!==j.current&&(j.current=$,S($))},[]),C=w.useCallback($=>{$!==z.current&&(z.current=$,N($))},[]),A=s||E,L=c||_,j=w.useRef(null),z=w.useRef(null),P=w.useRef(m),H=h!=null,X=Zm(h),q=Zm(l),F=Zm(d),Y=w.useCallback(()=>{if(!j.current||!z.current)return;const $={placement:t,strategy:r,middleware:x};q.current&&($.platform=q.current),jD(j.current,z.current,$).then(W=>{const M={...W,isPositioned:F.current!==!1};O.current&&!pf(P.current,M)&&(P.current=M,Fs.flushSync(()=>{p(M)}))})},[x,t,r,q,F]);ef(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[d]);const O=w.useRef(!1);ef(()=>(O.current=!0,()=>{O.current=!1}),[]),ef(()=>{if(A&&(j.current=A),L&&(z.current=L),A&&L){if(X.current)return X.current(A,L,Y);Y()}},[A,L,Y,X,H]);const U=w.useMemo(()=>({reference:j,floating:z,setReference:k,setFloating:C}),[k,C]),R=w.useMemo(()=>({reference:A,floating:L}),[A,L]),V=w.useMemo(()=>{const $={position:r,left:0,top:0};if(!R.floating)return $;const W=dw(R.floating,m.x),M=dw(R.floating,m.y);return f?{...$,transform:"translate("+W+"px, "+M+"px)",...oC(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:M}},[r,f,R.floating,m.x,m.y]);return w.useMemo(()=>({...m,update:Y,refs:U,elements:R,floatingStyles:V}),[m,Y,U,R,V])}const zD=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:l}=typeof e=="function"?e(r):e;return i&&t(i)?i.current!=null?fw({element:i.current,padding:l}).fn(r):{}:i?fw({element:i,padding:l}).fn(r):{}}}},LD=(e,t)=>({...ND(e),options:[e,t]}),ID=(e,t)=>({..._D(e),options:[e,t]}),BD=(e,t)=>({...RD(e),options:[e,t]}),HD=(e,t)=>({...kD(e),options:[e,t]}),PD=(e,t)=>({...TD(e),options:[e,t]}),UD=(e,t)=>({...AD(e),options:[e,t]}),VD=(e,t)=>({...zD(e),options:[e,t]});var $D="Arrow",iC=w.forwardRef((e,t)=>{const{children:r,width:i=10,height:l=5,...s}=e;return g.jsx(Oe.svg,{...s,ref:t,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});iC.displayName=$D;var YD=iC,Xg="Popper",[lC,aC]=uo(Xg),[qD,sC]=lC(Xg),cC=e=>{const{__scopePopper:t,children:r}=e,[i,l]=w.useState(null);return g.jsx(qD,{scope:t,anchor:i,onAnchorChange:l,children:r})};cC.displayName=Xg;var uC="PopperAnchor",fC=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...l}=e,s=sC(uC,r),c=w.useRef(null),f=We(t,c),h=w.useRef(null);return w.useEffect(()=>{const d=h.current;h.current=i?.current||c.current,d!==h.current&&s.onAnchorChange(h.current)}),i?null:g.jsx(Oe.div,{...l,ref:f})});fC.displayName=uC;var Gg="PopperContent",[FD,XD]=lC(Gg),dC=w.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:l=0,align:s="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:E,...S}=e,_=sC(Gg,r),[N,k]=w.useState(null),C=We(t,te=>k(te)),[A,L]=w.useState(null),j=Hg(A),z=j?.width??0,P=j?.height??0,H=i+(s!=="center"?"-"+s:""),X=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(d)?d:[d],F=q.length>0,Y={padding:X,boundary:q.filter(WD),altBoundary:F},{refs:O,floatingStyles:U,placement:R,isPositioned:V,middlewareData:$}=DD({strategy:"fixed",placement:H,whileElementsMounted:(...te)=>CD(...te,{animationFrame:b==="always"}),elements:{reference:_.anchor},middleware:[LD({mainAxis:l+P,alignmentAxis:c}),h&&ID({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?BD():void 0,...Y}),h&&HD({...Y}),PD({...Y,apply:({elements:te,rects:ne,availableWidth:se,availableHeight:he})=>{const{width:me,height:ge}=ne.reference,xe=te.floating.style;xe.setProperty("--radix-popper-available-width",`${se}px`),xe.setProperty("--radix-popper-available-height",`${he}px`),xe.setProperty("--radix-popper-anchor-width",`${me}px`),xe.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),A&&VD({element:A,padding:f}),ZD({arrowWidth:z,arrowHeight:P}),x&&UD({strategy:"referenceHidden",...Y})]}),[W,M]=pC(R),B=Zt(E);Ut(()=>{V&&B?.()},[V,B]);const G=$.arrow?.x,D=$.arrow?.y,oe=$.arrow?.centerOffset!==0,[K,J]=w.useState();return Ut(()=>{N&&J(window.getComputedStyle(N).zIndex)},[N]),g.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(FD,{scope:r,placedSide:W,onArrowChange:L,arrowX:G,arrowY:D,shouldHideArrow:oe,children:g.jsx(Oe.div,{"data-side":W,"data-align":M,...S,ref:C,style:{...S.style,animation:V?void 0:"none"}})})})});dC.displayName=Gg;var hC="PopperArrow",GD={top:"bottom",right:"left",bottom:"top",left:"right"},mC=w.forwardRef(function(t,r){const{__scopePopper:i,...l}=t,s=XD(hC,i),c=GD[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(YD,{...l,ref:r,style:{...l.style,display:"block"}})})});mC.displayName=hC;function WD(e){return e!==null}var ZD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:i,middlewareData:l}=t,c=l.arrow?.centerOffset!==0,f=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[d,m]=pC(r),p={start:"0%",center:"50%",end:"100%"}[m],x=(l.arrow?.x??0)+f/2,b=(l.arrow?.y??0)+h/2;let E="",S="";return d==="bottom"?(E=c?p:`${x}px`,S=`${-h}px`):d==="top"?(E=c?p:`${x}px`,S=`${i.floating.height+h}px`):d==="right"?(E=`${-h}px`,S=c?p:`${b}px`):d==="left"&&(E=`${i.floating.width+h}px`,S=c?p:`${b}px`),{data:{x:E,y:S}}}});function pC(e){const[t,r="center"]=e.split("-");return[t,r]}var KD=cC,QD=fC,JD=dC,ez=mC,Km="rovingFocusGroup.onEntryFocus",tz={bubbles:!1,cancelable:!0},Gs="RovingFocusGroup",[Ip,gC,nz]=oE(Gs),[rz,yC]=uo(Gs,[nz]),[oz,iz]=rz(Gs),xC=w.forwardRef((e,t)=>g.jsx(Ip.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Ip.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(lz,{...e,ref:t})})}));xC.displayName=Gs;var lz=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:l=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...p}=e,x=w.useRef(null),b=We(t,x),E=If(s),[S,_]=Mi({prop:c,defaultProp:f??null,onChange:h,caller:Gs}),[N,k]=w.useState(!1),C=Zt(d),A=gC(r),L=w.useRef(!1),[j,z]=w.useState(0);return w.useEffect(()=>{const P=x.current;if(P)return P.addEventListener(Km,C),()=>P.removeEventListener(Km,C)},[C]),g.jsx(oz,{scope:r,orientation:i,dir:E,loop:l,currentTabStopId:S,onItemFocus:w.useCallback(P=>_(P),[_]),onItemShiftTab:w.useCallback(()=>k(!0),[]),onFocusableItemAdd:w.useCallback(()=>z(P=>P+1),[]),onFocusableItemRemove:w.useCallback(()=>z(P=>P-1),[]),children:g.jsx(Oe.div,{tabIndex:N||j===0?-1:0,"data-orientation":i,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{L.current=!0}),onFocus:je(e.onFocus,P=>{const H=!L.current;if(P.target===P.currentTarget&&H&&!N){const X=new CustomEvent(Km,tz);if(P.currentTarget.dispatchEvent(X),!X.defaultPrevented){const q=A().filter(R=>R.focusable),F=q.find(R=>R.active),Y=q.find(R=>R.id===S),U=[F,Y,...q].filter(Boolean).map(R=>R.ref.current);wC(U,m)}}L.current=!1}),onBlur:je(e.onBlur,()=>k(!1))})})}),vC="RovingFocusGroupItem",bC=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:l=!1,tabStopId:s,children:c,...f}=e,h=Zo(),d=s||h,m=iz(vC,r),p=m.currentTabStopId===d,x=gC(r),{onFocusableItemAdd:b,onFocusableItemRemove:E,currentTabStopId:S}=m;return w.useEffect(()=>{if(i)return b(),()=>E()},[i,b,E]),g.jsx(Ip.ItemSlot,{scope:r,id:d,focusable:i,active:l,children:g.jsx(Oe.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...f,ref:t,onMouseDown:je(e.onMouseDown,_=>{i?m.onItemFocus(d):_.preventDefault()}),onFocus:je(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:je(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){m.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const N=cz(_,m.orientation,m.dir);if(N!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let C=x().filter(A=>A.focusable).map(A=>A.ref.current);if(N==="last")C.reverse();else if(N==="prev"||N==="next"){N==="prev"&&C.reverse();const A=C.indexOf(_.currentTarget);C=m.loop?uz(C,A+1):C.slice(A+1)}setTimeout(()=>wC(C))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:S!=null}):c})})});bC.displayName=vC;var az={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cz(e,t,r){const i=sz(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return az[i]}function wC(e,t=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}function uz(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var fz=xC,dz=bC;function Bp(e,[t,r]){return Math.min(r,Math.max(t,e))}function hz(e,t){return w.useReducer((r,i)=>t[r][i]??r,e)}var Wg="ScrollArea",[SC]=uo(Wg),[mz,Un]=SC(Wg),EC=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:i="hover",dir:l,scrollHideDelay:s=600,...c}=e,[f,h]=w.useState(null),[d,m]=w.useState(null),[p,x]=w.useState(null),[b,E]=w.useState(null),[S,_]=w.useState(null),[N,k]=w.useState(0),[C,A]=w.useState(0),[L,j]=w.useState(!1),[z,P]=w.useState(!1),H=We(t,q=>h(q)),X=If(l);return g.jsx(mz,{scope:r,type:i,dir:X,scrollHideDelay:s,scrollArea:f,viewport:d,onViewportChange:m,content:p,onContentChange:x,scrollbarX:b,onScrollbarXChange:E,scrollbarXEnabled:L,onScrollbarXEnabledChange:j,scrollbarY:S,onScrollbarYChange:_,scrollbarYEnabled:z,onScrollbarYEnabledChange:P,onCornerWidthChange:k,onCornerHeightChange:A,children:g.jsx(Oe.div,{dir:X,...c,ref:H,style:{position:"relative","--radix-scroll-area-corner-width":N+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});EC.displayName=Wg;var CC="ScrollAreaViewport",NC=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:i,nonce:l,...s}=e,c=Un(CC,r),f=w.useRef(null),h=We(t,f,c.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),g.jsx(Oe.div,{"data-radix-scroll-area-viewport":"",...s,ref:h,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});NC.displayName=CC;var Tr="ScrollAreaScrollbar",_C=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=Un(Tr,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=l,f=e.orientation==="horizontal";return w.useEffect(()=>(f?s(!0):c(!0),()=>{f?s(!1):c(!1)}),[f,s,c]),l.type==="hover"?g.jsx(pz,{...i,ref:t,forceMount:r}):l.type==="scroll"?g.jsx(gz,{...i,ref:t,forceMount:r}):l.type==="auto"?g.jsx(kC,{...i,ref:t,forceMount:r}):l.type==="always"?g.jsx(Zg,{...i,ref:t}):null});_C.displayName=Tr;var pz=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=Un(Tr,e.__scopeScrollArea),[s,c]=w.useState(!1);return w.useEffect(()=>{const f=l.scrollArea;let h=0;if(f){const d=()=>{window.clearTimeout(h),c(!0)},m=()=>{h=window.setTimeout(()=>c(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",d),f.addEventListener("pointerleave",m),()=>{window.clearTimeout(h),f.removeEventListener("pointerenter",d),f.removeEventListener("pointerleave",m)}}},[l.scrollArea,l.scrollHideDelay]),g.jsx(_r,{present:r||s,children:g.jsx(kC,{"data-state":s?"visible":"hidden",...i,ref:t})})}),gz=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=Un(Tr,e.__scopeScrollArea),s=e.orientation==="horizontal",c=Ff(()=>h("SCROLL_END"),100),[f,h]=hz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(f==="idle"){const d=window.setTimeout(()=>h("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(d)}},[f,l.scrollHideDelay,h]),w.useEffect(()=>{const d=l.viewport,m=s?"scrollLeft":"scrollTop";if(d){let p=d[m];const x=()=>{const b=d[m];p!==b&&(h("SCROLL"),c()),p=b};return d.addEventListener("scroll",x),()=>d.removeEventListener("scroll",x)}},[l.viewport,s,h,c]),g.jsx(_r,{present:r||f!=="hidden",children:g.jsx(Zg,{"data-state":f==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:je(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:je(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),kC=w.forwardRef((e,t)=>{const r=Un(Tr,e.__scopeScrollArea),{forceMount:i,...l}=e,[s,c]=w.useState(!1),f=e.orientation==="horizontal",h=Ff(()=>{if(r.viewport){const d=r.viewport.offsetWidth<r.viewport.scrollWidth,m=r.viewport.offsetHeight<r.viewport.scrollHeight;c(f?d:m)}},10);return Xl(r.viewport,h),Xl(r.content,h),g.jsx(_r,{present:i||s,children:g.jsx(Zg,{"data-state":s?"visible":"hidden",...l,ref:t})})}),Zg=w.forwardRef((e,t)=>{const{orientation:r="vertical",...i}=e,l=Un(Tr,e.__scopeScrollArea),s=w.useRef(null),c=w.useRef(0),[f,h]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=MC(f.viewport,f.content),m={...i,sizes:f,onSizesChange:h,hasThumb:d>0&&d<1,onThumbChange:x=>s.current=x,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:x=>c.current=x};function p(x,b){return Sz(x,c.current,f,b)}return r==="horizontal"?g.jsx(yz,{...m,ref:t,onThumbPositionChange:()=>{if(l.viewport&&s.current){const x=l.viewport.scrollLeft,b=hw(x,f,l.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{l.viewport&&(l.viewport.scrollLeft=x)},onDragScroll:x=>{l.viewport&&(l.viewport.scrollLeft=p(x,l.dir))}}):r==="vertical"?g.jsx(xz,{...m,ref:t,onThumbPositionChange:()=>{if(l.viewport&&s.current){const x=l.viewport.scrollTop,b=hw(x,f);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{l.viewport&&(l.viewport.scrollTop=x)},onDragScroll:x=>{l.viewport&&(l.viewport.scrollTop=p(x))}}):null}),yz=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:i,...l}=e,s=Un(Tr,e.__scopeScrollArea),[c,f]=w.useState(),h=w.useRef(null),d=We(t,h,s.onScrollbarXChange);return w.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),g.jsx(AC,{"data-orientation":"horizontal",...l,ref:d,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":qf(r)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(s.viewport){const x=s.viewport.scrollLeft+m.deltaX;e.onWheelScroll(x),DC(x,p)&&m.preventDefault()}},onResize:()=>{h.current&&s.viewport&&c&&i({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:yf(c.paddingLeft),paddingEnd:yf(c.paddingRight)}})}})}),xz=w.forwardRef((e,t)=>{const{sizes:r,onSizesChange:i,...l}=e,s=Un(Tr,e.__scopeScrollArea),[c,f]=w.useState(),h=w.useRef(null),d=We(t,h,s.onScrollbarYChange);return w.useEffect(()=>{h.current&&f(getComputedStyle(h.current))},[h]),g.jsx(AC,{"data-orientation":"vertical",...l,ref:d,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":qf(r)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(s.viewport){const x=s.viewport.scrollTop+m.deltaY;e.onWheelScroll(x),DC(x,p)&&m.preventDefault()}},onResize:()=>{h.current&&s.viewport&&c&&i({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:yf(c.paddingTop),paddingEnd:yf(c.paddingBottom)}})}})}),[vz,TC]=SC(Tr),AC=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:i,hasThumb:l,onThumbChange:s,onThumbPointerUp:c,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:d,onWheelScroll:m,onResize:p,...x}=e,b=Un(Tr,r),[E,S]=w.useState(null),_=We(t,H=>S(H)),N=w.useRef(null),k=w.useRef(""),C=b.viewport,A=i.content-i.viewport,L=Zt(m),j=Zt(h),z=Ff(p,10);function P(H){if(N.current){const X=H.clientX-N.current.left,q=H.clientY-N.current.top;d({x:X,y:q})}}return w.useEffect(()=>{const H=X=>{const q=X.target;E?.contains(q)&&L(X,A)};return document.addEventListener("wheel",H,{passive:!1}),()=>document.removeEventListener("wheel",H,{passive:!1})},[C,E,A,L]),w.useEffect(j,[i,j]),Xl(E,z),Xl(b.content,z),g.jsx(vz,{scope:r,scrollbar:E,hasThumb:l,onThumbChange:Zt(s),onThumbPointerUp:Zt(c),onThumbPositionChange:j,onThumbPointerDown:Zt(f),children:g.jsx(Oe.div,{...x,ref:_,style:{position:"absolute",...x.style},onPointerDown:je(e.onPointerDown,H=>{H.button===0&&(H.target.setPointerCapture(H.pointerId),N.current=E.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),P(H))}),onPointerMove:je(e.onPointerMove,P),onPointerUp:je(e.onPointerUp,H=>{const X=H.target;X.hasPointerCapture(H.pointerId)&&X.releasePointerCapture(H.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),N.current=null})})})}),gf="ScrollAreaThumb",RC=w.forwardRef((e,t)=>{const{forceMount:r,...i}=e,l=TC(gf,e.__scopeScrollArea);return g.jsx(_r,{present:r||l.hasThumb,children:g.jsx(bz,{ref:t,...i})})}),bz=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:i,...l}=e,s=Un(gf,r),c=TC(gf,r),{onThumbPositionChange:f}=c,h=We(t,p=>c.onThumbChange(p)),d=w.useRef(void 0),m=Ff(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const p=s.viewport;if(p){const x=()=>{if(m(),!d.current){const b=Ez(p,f);d.current=b,f()}};return f(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[s.viewport,m,f]),g.jsx(Oe.div,{"data-state":c.hasThumb?"visible":"hidden",...l,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:je(e.onPointerDownCapture,p=>{const b=p.target.getBoundingClientRect(),E=p.clientX-b.left,S=p.clientY-b.top;c.onThumbPointerDown({x:E,y:S})}),onPointerUp:je(e.onPointerUp,c.onThumbPointerUp)})});RC.displayName=gf;var Kg="ScrollAreaCorner",jC=w.forwardRef((e,t)=>{const r=Un(Kg,e.__scopeScrollArea),i=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&i?g.jsx(wz,{...e,ref:t}):null});jC.displayName=Kg;var wz=w.forwardRef((e,t)=>{const{__scopeScrollArea:r,...i}=e,l=Un(Kg,r),[s,c]=w.useState(0),[f,h]=w.useState(0),d=!!(s&&f);return Xl(l.scrollbarX,()=>{const m=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(m),h(m)}),Xl(l.scrollbarY,()=>{const m=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(m),c(m)}),d?g.jsx(Oe.div,{...i,ref:t,style:{width:s,height:f,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function yf(e){return e?parseInt(e,10):0}function MC(e,t){const r=e/t;return isNaN(r)?0:r}function qf(e){const t=MC(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-r)*t;return Math.max(i,18)}function Sz(e,t,r,i="ltr"){const l=qf(r),s=l/2,c=t||s,f=l-c,h=r.scrollbar.paddingStart+c,d=r.scrollbar.size-r.scrollbar.paddingEnd-f,m=r.content-r.viewport,p=i==="ltr"?[0,m]:[m*-1,0];return OC([h,d],p)(e)}function hw(e,t,r="ltr"){const i=qf(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-l,c=t.content-t.viewport,f=s-i,h=r==="ltr"?[0,c]:[c*-1,0],d=Bp(e,h);return OC([0,c],[0,f])(d)}function OC(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(r-e[0])}}function DC(e,t){return e>0&&e<t}var Ez=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},i=0;return(function l(){const s={left:e.scrollLeft,top:e.scrollTop},c=r.left!==s.left,f=r.top!==s.top;(c||f)&&t(),r=s,i=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(i)};function Ff(e,t){const r=Zt(e),i=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(i.current),[]),w.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(r,t)},[r,t])}function Xl(e,t){const r=Zt(t);Ut(()=>{let i=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(r)});return l.observe(e),()=>{window.cancelAnimationFrame(i),l.unobserve(e)}}},[e,r])}var Cz=EC,Nz=NC,_z=jC,kz=[" ","Enter","ArrowUp","ArrowDown"],Tz=[" ","Enter"],zi="Select",[Xf,Gf,Az]=oE(zi),[aa]=uo(zi,[Az,aC]),Wf=aC(),[Rz,ni]=aa(zi),[jz,Mz]=aa(zi),zC=e=>{const{__scopeSelect:t,children:r,open:i,defaultOpen:l,onOpenChange:s,value:c,defaultValue:f,onValueChange:h,dir:d,name:m,autoComplete:p,disabled:x,required:b,form:E}=e,S=Wf(t),[_,N]=w.useState(null),[k,C]=w.useState(null),[A,L]=w.useState(!1),j=If(d),[z,P]=Mi({prop:i,defaultProp:l??!1,onChange:s,caller:zi}),[H,X]=Mi({prop:c,defaultProp:f,onChange:h,caller:zi}),q=w.useRef(null),F=_?E||!!_.closest("form"):!0,[Y,O]=w.useState(new Set),U=Array.from(Y).map(R=>R.props.value).join(";");return g.jsx(KD,{...S,children:g.jsxs(Rz,{required:b,scope:t,trigger:_,onTriggerChange:N,valueNode:k,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:L,contentId:Zo(),value:H,onValueChange:X,open:z,onOpenChange:P,dir:j,triggerPointerDownPosRef:q,disabled:x,children:[g.jsx(Xf.Provider,{scope:t,children:g.jsx(jz,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(R=>{O(V=>new Set(V).add(R))},[]),onNativeOptionRemove:w.useCallback(R=>{O(V=>{const $=new Set(V);return $.delete(R),$})},[]),children:r})}),F?g.jsxs(rN,{"aria-hidden":!0,required:b,tabIndex:-1,name:m,autoComplete:p,value:H,onChange:R=>X(R.target.value),disabled:x,form:E,children:[H===void 0?g.jsx("option",{value:""}):null,Array.from(Y)]},U):null]})})};zC.displayName=zi;var LC="SelectTrigger",IC=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:i=!1,...l}=e,s=Wf(r),c=ni(LC,r),f=c.disabled||i,h=We(t,c.onTriggerChange),d=Gf(r),m=w.useRef("touch"),[p,x,b]=iN(S=>{const _=d().filter(C=>!C.disabled),N=_.find(C=>C.value===c.value),k=lN(_,S,N);k!==void 0&&c.onValueChange(k.value)}),E=S=>{f||(c.onOpenChange(!0),b()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return g.jsx(QD,{asChild:!0,...s,children:g.jsx(Oe.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":oN(c.value)?"":void 0,...l,ref:h,onClick:je(l.onClick,S=>{S.currentTarget.focus(),m.current!=="mouse"&&E(S)}),onPointerDown:je(l.onPointerDown,S=>{m.current=S.pointerType;const _=S.target;_.hasPointerCapture(S.pointerId)&&_.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:je(l.onKeyDown,S=>{const _=p.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(_&&S.key===" ")&&kz.includes(S.key)&&(E(),S.preventDefault())})})})});IC.displayName=LC;var BC="SelectValue",HC=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:l,children:s,placeholder:c="",...f}=e,h=ni(BC,r),{onValueNodeHasChildrenChange:d}=h,m=s!==void 0,p=We(t,h.onValueNodeChange);return Ut(()=>{d(m)},[d,m]),g.jsx(Oe.span,{...f,ref:p,style:{pointerEvents:"none"},children:oN(h.value)?g.jsx(g.Fragment,{children:c}):s})});HC.displayName=BC;var Oz="SelectIcon",PC=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,...l}=e;return g.jsx(Oe.span,{"aria-hidden":!0,...l,ref:t,children:i||"▼"})});PC.displayName=Oz;var Dz="SelectPortal",UC=e=>g.jsx(Og,{asChild:!0,...e});UC.displayName=Dz;var Li="SelectContent",VC=w.forwardRef((e,t)=>{const r=ni(Li,e.__scopeSelect),[i,l]=w.useState();if(Ut(()=>{l(new DocumentFragment)},[]),!r.open){const s=i;return s?Fs.createPortal(g.jsx($C,{scope:e.__scopeSelect,children:g.jsx(Xf.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),s):null}return g.jsx(YC,{...e,ref:t})});VC.displayName=Li;var Wn=10,[$C,ri]=aa(Li),zz="SelectContentImpl",Lz=ql("SelectContent.RemoveScroll"),YC=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:i="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:s,onPointerDownOutside:c,side:f,sideOffset:h,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:x,collisionPadding:b,sticky:E,hideWhenDetached:S,avoidCollisions:_,...N}=e,k=ni(Li,r),[C,A]=w.useState(null),[L,j]=w.useState(null),z=We(t,te=>A(te)),[P,H]=w.useState(null),[X,q]=w.useState(null),F=Gf(r),[Y,O]=w.useState(!1),U=w.useRef(!1);w.useEffect(()=>{if(C)return yE(C)},[C]),sE();const R=w.useCallback(te=>{const[ne,...se]=F().map(ge=>ge.ref.current),[he]=se.slice(-1),me=document.activeElement;for(const ge of te)if(ge===me||(ge?.scrollIntoView({block:"nearest"}),ge===ne&&L&&(L.scrollTop=0),ge===he&&L&&(L.scrollTop=L.scrollHeight),ge?.focus(),document.activeElement!==me))return},[F,L]),V=w.useCallback(()=>R([P,C]),[R,P,C]);w.useEffect(()=>{Y&&V()},[Y,V]);const{onOpenChange:$,triggerPointerDownPosRef:W}=k;w.useEffect(()=>{if(C){let te={x:0,y:0};const ne=he=>{te={x:Math.abs(Math.round(he.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(he.pageY)-(W.current?.y??0))}},se=he=>{te.x<=10&&te.y<=10?he.preventDefault():C.contains(he.target)||$(!1),document.removeEventListener("pointermove",ne),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",se,{capture:!0})}}},[C,$,W]),w.useEffect(()=>{const te=()=>$(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[$]);const[M,B]=iN(te=>{const ne=F().filter(me=>!me.disabled),se=ne.find(me=>me.ref.current===document.activeElement),he=lN(ne,te,se);he&&setTimeout(()=>he.ref.current.focus())}),G=w.useCallback((te,ne,se)=>{const he=!U.current&&!se;(k.value!==void 0&&k.value===ne||he)&&(H(te),he&&(U.current=!0))},[k.value]),D=w.useCallback(()=>C?.focus(),[C]),oe=w.useCallback((te,ne,se)=>{const he=!U.current&&!se;(k.value!==void 0&&k.value===ne||he)&&q(te)},[k.value]),K=i==="popper"?Hp:qC,J=K===Hp?{side:f,sideOffset:h,align:d,alignOffset:m,arrowPadding:p,collisionBoundary:x,collisionPadding:b,sticky:E,hideWhenDetached:S,avoidCollisions:_}:{};return g.jsx($C,{scope:r,content:C,viewport:L,onViewportChange:j,itemRefCallback:G,selectedItem:P,onItemLeave:D,itemTextRefCallback:oe,focusSelectedItem:V,selectedItemText:X,position:i,isPositioned:Y,searchRef:M,children:g.jsx(Dg,{as:Lz,allowPinchZoom:!0,children:g.jsx(Mg,{asChild:!0,trapped:k.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:je(l,te=>{k.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:g.jsx(jg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:g.jsx(K,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:te=>te.preventDefault(),...N,...J,onPlaced:()=>O(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:je(N.onKeyDown,te=>{const ne=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ne&&te.key.length===1&&B(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let he=F().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(te.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const me=te.target,ge=he.indexOf(me);he=he.slice(ge+1)}setTimeout(()=>R(he)),te.preventDefault()}})})})})})})});YC.displayName=zz;var Iz="SelectItemAlignedPosition",qC=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:i,...l}=e,s=ni(Li,r),c=ri(Li,r),[f,h]=w.useState(null),[d,m]=w.useState(null),p=We(t,z=>m(z)),x=Gf(r),b=w.useRef(!1),E=w.useRef(!0),{viewport:S,selectedItem:_,selectedItemText:N,focusSelectedItem:k}=c,C=w.useCallback(()=>{if(s.trigger&&s.valueNode&&f&&d&&S&&_&&N){const z=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),X=N.getBoundingClientRect();if(s.dir!=="rtl"){const me=X.left-P.left,ge=H.left-me,xe=z.left-ge,_e=z.width+xe,$e=Math.max(_e,P.width),Pe=window.innerWidth-Wn,st=Bp(ge,[Wn,Math.max(Wn,Pe-$e)]);f.style.minWidth=_e+"px",f.style.left=st+"px"}else{const me=P.right-X.right,ge=window.innerWidth-H.right-me,xe=window.innerWidth-z.right-ge,_e=z.width+xe,$e=Math.max(_e,P.width),Pe=window.innerWidth-Wn,st=Bp(ge,[Wn,Math.max(Wn,Pe-$e)]);f.style.minWidth=_e+"px",f.style.right=st+"px"}const q=x(),F=window.innerHeight-Wn*2,Y=S.scrollHeight,O=window.getComputedStyle(d),U=parseInt(O.borderTopWidth,10),R=parseInt(O.paddingTop,10),V=parseInt(O.borderBottomWidth,10),$=parseInt(O.paddingBottom,10),W=U+R+Y+$+V,M=Math.min(_.offsetHeight*5,W),B=window.getComputedStyle(S),G=parseInt(B.paddingTop,10),D=parseInt(B.paddingBottom,10),oe=z.top+z.height/2-Wn,K=F-oe,J=_.offsetHeight/2,te=_.offsetTop+J,ne=U+R+te,se=W-ne;if(ne<=oe){const me=q.length>0&&_===q[q.length-1].ref.current;f.style.bottom="0px";const ge=d.clientHeight-S.offsetTop-S.offsetHeight,xe=Math.max(K,J+(me?D:0)+ge+V),_e=ne+xe;f.style.height=_e+"px"}else{const me=q.length>0&&_===q[0].ref.current;f.style.top="0px";const xe=Math.max(oe,U+S.offsetTop+(me?G:0)+J)+se;f.style.height=xe+"px",S.scrollTop=ne-oe+S.offsetTop}f.style.margin=`${Wn}px 0`,f.style.minHeight=M+"px",f.style.maxHeight=F+"px",i?.(),requestAnimationFrame(()=>b.current=!0)}},[x,s.trigger,s.valueNode,f,d,S,_,N,s.dir,i]);Ut(()=>C(),[C]);const[A,L]=w.useState();Ut(()=>{d&&L(window.getComputedStyle(d).zIndex)},[d]);const j=w.useCallback(z=>{z&&E.current===!0&&(C(),k?.(),E.current=!1)},[C,k]);return g.jsx(Hz,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:b,onScrollButtonChange:j,children:g.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:g.jsx(Oe.div,{...l,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});qC.displayName=Iz;var Bz="SelectPopperPosition",Hp=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:i="start",collisionPadding:l=Wn,...s}=e,c=Wf(r);return g.jsx(JD,{...c,...s,ref:t,align:i,collisionPadding:l,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hp.displayName=Bz;var[Hz,Qg]=aa(Li,{}),Pp="SelectViewport",FC=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:i,...l}=e,s=ri(Pp,r),c=Qg(Pp,r),f=We(t,s.onViewportChange),h=w.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(Xf.Slot,{scope:r,children:g.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:je(l.onScroll,d=>{const m=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=c;if(x?.current&&p){const b=Math.abs(h.current-m.scrollTop);if(b>0){const E=window.innerHeight-Wn*2,S=parseFloat(p.style.minHeight),_=parseFloat(p.style.height),N=Math.max(S,_);if(N<E){const k=N+b,C=Math.min(E,k),A=k-C;p.style.height=C+"px",p.style.bottom==="0px"&&(m.scrollTop=A>0?A:0,p.style.justifyContent="flex-end")}}}h.current=m.scrollTop})})})]})});FC.displayName=Pp;var XC="SelectGroup",[Pz,Uz]=aa(XC),Vz=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Zo();return g.jsx(Pz,{scope:r,id:l,children:g.jsx(Oe.div,{role:"group","aria-labelledby":l,...i,ref:t})})});Vz.displayName=XC;var GC="SelectLabel",$z=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Uz(GC,r);return g.jsx(Oe.div,{id:l.id,...i,ref:t})});$z.displayName=GC;var xf="SelectItem",[Yz,WC]=aa(xf),ZC=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:i,disabled:l=!1,textValue:s,...c}=e,f=ni(xf,r),h=ri(xf,r),d=f.value===i,[m,p]=w.useState(s??""),[x,b]=w.useState(!1),E=We(t,k=>h.itemRefCallback?.(k,i,l)),S=Zo(),_=w.useRef("touch"),N=()=>{l||(f.onValueChange(i),f.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Yz,{scope:r,value:i,disabled:l,textId:S,isSelected:d,onItemTextChange:w.useCallback(k=>{p(C=>C||(k?.textContent??"").trim())},[]),children:g.jsx(Xf.ItemSlot,{scope:r,value:i,disabled:l,textValue:m,children:g.jsx(Oe.div,{role:"option","aria-labelledby":S,"data-highlighted":x?"":void 0,"aria-selected":d&&x,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...c,ref:E,onFocus:je(c.onFocus,()=>b(!0)),onBlur:je(c.onBlur,()=>b(!1)),onClick:je(c.onClick,()=>{_.current!=="mouse"&&N()}),onPointerUp:je(c.onPointerUp,()=>{_.current==="mouse"&&N()}),onPointerDown:je(c.onPointerDown,k=>{_.current=k.pointerType}),onPointerMove:je(c.onPointerMove,k=>{_.current=k.pointerType,l?h.onItemLeave?.():_.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(c.onPointerLeave,k=>{k.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:je(c.onKeyDown,k=>{h.searchRef?.current!==""&&k.key===" "||(Tz.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});ZC.displayName=xf;var ps="SelectItemText",KC=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:l,...s}=e,c=ni(ps,r),f=ri(ps,r),h=WC(ps,r),d=Mz(ps,r),[m,p]=w.useState(null),x=We(t,N=>p(N),h.onItemTextChange,N=>f.itemTextRefCallback?.(N,h.value,h.disabled)),b=m?.textContent,E=w.useMemo(()=>g.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:_}=d;return Ut(()=>(S(E),()=>_(E)),[S,_,E]),g.jsxs(g.Fragment,{children:[g.jsx(Oe.span,{id:h.textId,...s,ref:x}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Fs.createPortal(s.children,c.valueNode):null]})});KC.displayName=ps;var QC="SelectItemIndicator",JC=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return WC(QC,r).isSelected?g.jsx(Oe.span,{"aria-hidden":!0,...i,ref:t}):null});JC.displayName=QC;var Up="SelectScrollUpButton",eN=w.forwardRef((e,t)=>{const r=ri(Up,e.__scopeSelect),i=Qg(Up,e.__scopeSelect),[l,s]=w.useState(!1),c=We(t,i.onScrollButtonChange);return Ut(()=>{if(r.viewport&&r.isPositioned){let f=function(){const d=h.scrollTop>0;s(d)};const h=r.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),l?g.jsx(nN,{...e,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=r;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});eN.displayName=Up;var Vp="SelectScrollDownButton",tN=w.forwardRef((e,t)=>{const r=ri(Vp,e.__scopeSelect),i=Qg(Vp,e.__scopeSelect),[l,s]=w.useState(!1),c=We(t,i.onScrollButtonChange);return Ut(()=>{if(r.viewport&&r.isPositioned){let f=function(){const d=h.scrollHeight-h.clientHeight,m=Math.ceil(h.scrollTop)<d;s(m)};const h=r.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),l?g.jsx(nN,{...e,ref:c,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=r;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});tN.displayName=Vp;var nN=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:i,...l}=e,s=ri("SelectScrollButton",r),c=w.useRef(null),f=Gf(r),h=w.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return w.useEffect(()=>()=>h(),[h]),Ut(()=>{f().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),g.jsx(Oe.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:je(l.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(i,50))}),onPointerMove:je(l.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(i,50))}),onPointerLeave:je(l.onPointerLeave,()=>{h()})})}),qz="SelectSeparator",Fz=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return g.jsx(Oe.div,{"aria-hidden":!0,...i,ref:t})});Fz.displayName=qz;var $p="SelectArrow",Xz=w.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,l=Wf(r),s=ni($p,r),c=ri($p,r);return s.open&&c.position==="popper"?g.jsx(ez,{...l,...i,ref:t}):null});Xz.displayName=$p;var Gz="SelectBubbleInput",rN=w.forwardRef(({__scopeSelect:e,value:t,...r},i)=>{const l=w.useRef(null),s=We(i,l),c=Bg(t);return w.useEffect(()=>{const f=l.current;if(!f)return;const h=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&m){const p=new Event("change",{bubbles:!0});m.call(f,t),f.dispatchEvent(p)}},[c,t]),g.jsx(Oe.select,{...r,style:{...rE,...r.style},ref:s,defaultValue:t})});rN.displayName=Gz;function oN(e){return e===""||e===void 0}function iN(e){const t=Zt(e),r=w.useRef(""),i=w.useRef(0),l=w.useCallback(c=>{const f=r.current+c;t(f),(function h(d){r.current=d,window.clearTimeout(i.current),d!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(f)},[t]),s=w.useCallback(()=>{r.current="",window.clearTimeout(i.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(i.current),[]),[r,l,s]}function lN(e,t,r){const l=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let c=Wz(e,Math.max(s,0));l.length===1&&(c=c.filter(d=>d!==r));const h=c.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return h!==r?h:void 0}function Wz(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var Zz=zC,Kz=IC,Qz=HC,Jz=PC,e5=UC,t5=VC,n5=FC,r5=ZC,o5=KC,i5=JC,l5=eN,a5=tN,Zf="Switch",[s5]=uo(Zf),[c5,u5]=s5(Zf),aN=w.forwardRef((e,t)=>{const{__scopeSwitch:r,name:i,checked:l,defaultChecked:s,required:c,disabled:f,value:h="on",onCheckedChange:d,form:m,...p}=e,[x,b]=w.useState(null),E=We(t,C=>b(C)),S=w.useRef(!1),_=x?m||!!x.closest("form"):!0,[N,k]=Mi({prop:l,defaultProp:s??!1,onChange:d,caller:Zf});return g.jsxs(c5,{scope:r,checked:N,disabled:f,children:[g.jsx(Oe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":c,"data-state":fN(N),"data-disabled":f?"":void 0,disabled:f,value:h,...p,ref:E,onClick:je(e.onClick,C=>{k(A=>!A),_&&(S.current=C.isPropagationStopped(),S.current||C.stopPropagation())})}),_&&g.jsx(uN,{control:x,bubbles:!S.current,name:i,value:h,checked:N,required:c,disabled:f,form:m,style:{transform:"translateX(-100%)"}})]})});aN.displayName=Zf;var sN="SwitchThumb",cN=w.forwardRef((e,t)=>{const{__scopeSwitch:r,...i}=e,l=u5(sN,r);return g.jsx(Oe.span,{"data-state":fN(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t})});cN.displayName=sN;var f5="SwitchBubbleInput",uN=w.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:i=!0,...l},s)=>{const c=w.useRef(null),f=We(c,s),h=Bg(r),d=Hg(t);return w.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(p,"checked").set;if(h!==r&&b){const E=new Event("click",{bubbles:i});b.call(m,r),m.dispatchEvent(E)}},[h,r,i]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...l,tabIndex:-1,ref:f,style:{...l.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});uN.displayName=f5;function fN(e){return e?"checked":"unchecked"}var d5=aN,h5=cN,Kf="Tabs",[m5]=uo(Kf,[yC]),dN=yC(),[p5,Jg]=m5(Kf),hN=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,onValueChange:l,defaultValue:s,orientation:c="horizontal",dir:f,activationMode:h="automatic",...d}=e,m=If(f),[p,x]=Mi({prop:i,onChange:l,defaultProp:s??"",caller:Kf});return g.jsx(p5,{scope:r,baseId:Zo(),value:p,onValueChange:x,orientation:c,dir:m,activationMode:h,children:g.jsx(Oe.div,{dir:m,"data-orientation":c,...d,ref:t})})});hN.displayName=Kf;var mN="TabsList",pN=w.forwardRef((e,t)=>{const{__scopeTabs:r,loop:i=!0,...l}=e,s=Jg(mN,r),c=dN(r);return g.jsx(fz,{asChild:!0,...c,orientation:s.orientation,dir:s.dir,loop:i,children:g.jsx(Oe.div,{role:"tablist","aria-orientation":s.orientation,...l,ref:t})})});pN.displayName=mN;var gN="TabsTrigger",yN=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,disabled:l=!1,...s}=e,c=Jg(gN,r),f=dN(r),h=bN(c.baseId,i),d=wN(c.baseId,i),m=i===c.value;return g.jsx(dz,{asChild:!0,...f,focusable:!l,active:m,children:g.jsx(Oe.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...s,ref:t,onMouseDown:je(e.onMouseDown,p=>{!l&&p.button===0&&p.ctrlKey===!1?c.onValueChange(i):p.preventDefault()}),onKeyDown:je(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&c.onValueChange(i)}),onFocus:je(e.onFocus,()=>{const p=c.activationMode!=="manual";!m&&!l&&p&&c.onValueChange(i)})})})});yN.displayName=gN;var xN="TabsContent",vN=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:i,forceMount:l,children:s,...c}=e,f=Jg(xN,r),h=bN(f.baseId,i),d=wN(f.baseId,i),m=i===f.value,p=w.useRef(m);return w.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),g.jsx(_r,{present:l||m,children:({present:x})=>g.jsx(Oe.div,{"data-state":m?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":h,hidden:!x,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:x&&s})})});vN.displayName=xN;function bN(e,t){return`${e}-trigger-${t}`}function wN(e,t){return`${e}-content-${t}`}var g5=hN,y5=pN,x5=yN,v5=vN;function SN({className:e,children:t,...r}){return g.jsxs(Cz,{"data-slot":"scroll-area",className:ve("relative",e),...r,children:[g.jsx(Nz,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),g.jsx(b5,{}),g.jsx(_z,{})]})}function b5({className:e,orientation:t="vertical",...r}){return g.jsx(_C,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ve("flex touch-none p-px transition-colors select-none bg-[var(--scrollbar-track)]",t==="vertical"&&"h-full w-1.5 border-l border-l-transparent",t==="horizontal"&&"h-1.5 flex-col border-t border-t-transparent",e),...r,children:g.jsx(RC,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-[var(--scrollbar-thumb)] hover:bg-[var(--scrollbar-thumb-hover)] transition-colors"})})}const EN="cognetivy-onboarding-dismissed";function w5(){try{return localStorage.getItem(EN)==="true"}catch{return!1}}function S5(){try{localStorage.setItem(EN,"true")}catch{}}function E5(){const[e,t]=w.useState(w5),[r,i]=w.useState(!1),l=!e,s=l&&!r,c=w.useCallback(function(){i(!0)},[]),f=w.useCallback(function(){t(!0),i(!0),S5()},[]),h=w.useCallback(function(){i(!0)},[]);return{shouldShow:l,dismiss:c,dismissPermanently:f,open:s,closeForSession:h}}const C5=OE,N5=DE,_5=zE,k5=LE,T5=IE,A5=BE,R5=HE;function j5({className:e,children:t,showCloseButton:r=!0,...i}){return g.jsxs(N5,{children:[g.jsx(_5,{className:"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),g.jsxs(k5,{className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...i,children:[g.jsx("div",{className:"pr-8",children:t}),r&&g.jsxs(R5,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx("span",{className:"sr-only",children:"Close"}),g.jsx("span",{"aria-hidden":!0,className:"text-lg",children:"×"})]})]})]})}function M5({className:e,...t}){return g.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function O5({className:e,...t}){return g.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const CN=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();const D5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const z5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());const mw=e=>{const t=z5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var L5={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"};const I5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const B5=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:l="",children:s,iconNode:c,...f},h)=>w.createElement("svg",{ref:h,...L5,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:CN("lucide",l),...!s&&!I5(f)&&{"aria-hidden":"true"},...f},[...c.map(([d,m])=>w.createElement(d,m)),...Array.isArray(s)?s:[s]]));const zt=(e,t)=>{const r=w.forwardRef(({className:i,...l},s)=>w.createElement(B5,{ref:s,iconNode:t,className:CN(`lucide-${D5(mw(e))}`,`lucide-${e}`,i),...l}));return r.displayName=mw(e),r};const H5=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],P5=zt("arrow-down-to-line",H5);const U5=[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]],V5=zt("arrow-up-from-line",U5);const $5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ey=zt("check",$5);const Y5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ty=zt("chevron-down",Y5);const q5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],F5=zt("chevron-left",q5);const X5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pw=zt("chevron-right",X5);const G5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],W5=zt("chevron-up",G5);const Z5=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],K5=zt("circle-play",Z5);const Q5=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],J5=zt("clipboard",Q5);const e3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],NN=zt("copy",e3);const t3=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],vf=zt("database",t3);const n3=[["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"}]],_N=zt("external-link",n3);const r3=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],o3=zt("file-down",r3);const i3=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],l3=zt("git-branch",i3);const a3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],s3=zt("info",a3);const c3=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],u3=zt("list-checks",c3);const f3=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],d3=zt("plug",f3);const h3=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],m3=zt("sparkles",h3),p3=w.forwardRef(function({className:t,...r},i){return g.jsx(VE,{ref:i,className:ve("peer size-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:g.jsx(YE,{className:"flex items-center justify-center text-current",children:g.jsx(ey,{className:"size-2.5"})})})}),zu="You: ",Lu="Coding Agent: ",Qm=[{type:"you",text:"Create a workflow for competitor analysis: research from external sources, extract key points, then write a comparison report."},{type:"thinking"},{type:"ai",text:"I've created the workflow and set it as current. You'll see it in the Workflow tab in Studio."},{type:"you",text:"Start a run with input topic 'SaaS productivity tools'."},{type:"thinking"},{type:"ai",text:"Run started. Check the Runs tab in Studio to watch progress."},{type:"you",text:"Add a new version of this workflow that also pulls in pricing from their websites."},{type:"thinking"},{type:"ai",text:"New version is ready with the pricing step. Would you like me to run it?"}],g3=35,y3=400,x3=1200,v3=530;function b3(){return g.jsxs("span",{className:"inline-flex gap-0.5","aria-hidden":!0,children:[g.jsx("span",{className:"size-1.5 rounded-full bg-zinc-500 animate-bounce [animation-delay:0ms]"}),g.jsx("span",{className:"size-1.5 rounded-full bg-zinc-500 animate-bounce [animation-delay:150ms]"}),g.jsx("span",{className:"size-1.5 rounded-full bg-zinc-500 animate-bounce [animation-delay:300ms]"})]})}function w3(){const[e,t]=w.useState(0),[r,i]=w.useState(0),[l,s]=w.useState(!0),c=Qm[e],f=c&&(c.type==="you"||c.type==="ai"),h=f?(c.type==="you"?zu:Lu)+c.text:"",d=f&&r>=h.length;w.useEffect(function(){if(c){if(c.type==="thinking"){const E=setTimeout(()=>{t(S=>S+1),i(0)},x3);return()=>clearTimeout(E)}if(c.type==="you"||c.type==="ai"){const E=(c.type==="you"?zu:Lu)+c.text;if(r<E.length){const _=setTimeout(()=>i(N=>N+1),g3);return()=>clearTimeout(_)}const S=setTimeout(()=>{t(_=>_+1),i(0)},y3);return()=>clearTimeout(S)}}},[e,r,c]),w.useEffect(function(){const E=setInterval(()=>s(S=>!S),v3);return()=>clearInterval(E)},[]);const m=Qm.slice(0,e).filter(b=>b.type!=="thinking"),p=Qm[e],x=p&&(p.type==="you"||p.type==="ai");return g.jsxs("div",{className:"rounded-lg border border-border/80 bg-[#0d1117] overflow-hidden shadow-inner",role:"img","aria-label":"Simulated chat: you ask your coding agent to create a workflow, run it, and add a new version; the agent responds in plain language; workflows and runs appear in Studio.",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2.5 border-b-2 border-amber-500/50 bg-amber-500/20",children:[g.jsx("span",{className:"size-2.5 rounded-full bg-[#ff5f57]","aria-hidden":!0}),g.jsx("span",{className:"size-2.5 rounded-full bg-[#febc2e]","aria-hidden":!0}),g.jsx("span",{className:"size-2.5 rounded-full bg-[#28c840]","aria-hidden":!0}),g.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-amber-200/95 ml-1",children:"Simulation"}),g.jsx("span",{className:"text-xs font-medium text-amber-100/90",children:"Do not type here. Use your editor's chat to talk to your AI."})]}),g.jsx("div",{className:"p-5 min-h-[12rem] flex flex-col text-[13px] leading-relaxed font-sans",children:g.jsxs("div",{className:"flex flex-col min-h-0 flex-1 overflow-hidden",children:[g.jsxs("div",{className:"space-y-4 overflow-y-auto overflow-x-auto flex-1 min-h-0",children:[m.map((b,E)=>b.type==="you"?g.jsxs("div",{className:"space-y-0.5",children:[g.jsx("span",{className:"text-blue-400/95 font-medium",children:"You:"}),g.jsxs("span",{className:"text-zinc-300",children:[" ",b.text]})]},E):b.type==="ai"?g.jsxs("div",{className:"space-y-0.5",children:[g.jsx("span",{className:"text-emerald-400/95 font-medium",children:"Coding Agent:"}),g.jsxs("span",{className:"text-zinc-300",children:[" ",b.text]})]},E):null),x&&p&&(()=>{const b=p.type==="you"?zu:Lu,E=b.length,S=(p.type==="you"?zu+p.text:Lu+p.text).slice(0,r),_=r>E?S.slice(E):"",N=r<=E?S:b,k=p.type==="you"?"You:":"Coding Agent:",C=p.type==="you"?"text-blue-400/95":"text-emerald-400/95";return g.jsxs("div",{className:"space-y-0.5",children:[g.jsx("span",{className:`font-medium ${C}`,children:r<=E?N||b:k}),_&&g.jsxs("span",{className:"text-zinc-300",children:[" ",_]}),!d&&g.jsx("span",{className:l?"inline-block w-0.5 h-4 align-middle bg-emerald-400/90 ml-0.5":"inline-block w-0.5 h-4 align-middle bg-transparent ml-0.5","aria-hidden":!0})]})})()]}),p?.type==="thinking"&&g.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs pt-3 mt-2 border-t border-white/10 shrink-0",children:[g.jsx(b3,{}),g.jsx("span",{children:"Thinking…"})]})]})})]})}function S3({open:e,onOpenChange:t,onClose:r}){const[i,l]=w.useState(!1);function s(f){f||r(!1),t(f)}function c(){r(i),t(!1)}return g.jsx(C5,{open:e,onOpenChange:s,children:g.jsxs(j5,{className:"max-w-2xl gap-8 p-8",showCloseButton:!0,children:[g.jsxs(M5,{className:"space-y-2",children:[g.jsx(T5,{className:"text-xl font-semibold",children:"Get started with Cognetivy Studio"}),g.jsx(A5,{className:"text-muted-foreground text-sm",children:"This Studio shows your workflows and runs. To see data here, talk to the AI that already lives in your editor - Cursor, Claude Code, or another AI assistant - and ask it to create workflows and start runs."}),g.jsx("p",{className:"text-xs text-foreground font-medium pl-2.5 py-1 mt-2"})]}),g.jsxs("div",{className:"space-y-6",children:[g.jsxs("p",{className:"text-sm text-foreground/90",children:["In your editor's chat, ask ",g.jsx("strong",{children:"your"})," AI (Claude Code, Cursor, OpenClaw, etc.) to create a workflow, then start a run. Once it does, you'll see the workflow and runs here."]}),g.jsx(w3,{})]}),g.jsxs(O5,{className:"flex flex-col-reverse gap-4 sm:flex-row sm:justify-between sm:items-center pt-2",children:[g.jsxs("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:[g.jsx(p3,{checked:i,onCheckedChange:f=>l(f===!0),"aria-label":"Don't show this again"}),g.jsx("span",{children:"Don't show this again"})]}),g.jsx("button",{type:"button",onClick:c,className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:"Got it"})]})]})})}function kN({className:e,size:t="default",...r}){return g.jsx(d5,{"data-slot":"switch","data-size":t,className:ve("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...r,children:g.jsx(h5,{"data-slot":"switch-thumb",className:ve("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const E3="/api";async function Wt(e){const t=await fetch(`${E3}${e}`);if(!t.ok){const r=await t.json().catch(()=>({error:t.statusText}));throw new Error(r.error??t.statusText)}return t.json()}const TN=new Set(["citations","derived_from","reasoning"]),lt={getWorkspace:()=>Wt("/workspace"),getWorkflows:()=>Wt("/workflows"),getWorkflow:e=>Wt(`/workflows/${encodeURIComponent(e)}`),getWorkflowVersions:e=>Wt(`/workflows/${encodeURIComponent(e)}/versions`),getWorkflowVersion:(e,t,r)=>{const i=new URLSearchParams;r?.includePrompts===!1&&i.set("include_prompts","false");const l=i.toString();return Wt(`/workflows/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}${l?`?${l}`:""}`)},getWorkflowNodePrompt:(e,t,r)=>Wt(`/workflows/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}/nodes/${encodeURIComponent(r)}`),getWorkflowTemplates:()=>Wt("/workflow-templates"),getRuns:()=>Wt("/runs"),getRun:e=>Wt(`/runs/${encodeURIComponent(e)}`),getRunEvents:e=>Wt(`/runs/${encodeURIComponent(e)}/events`),getNodeResults:e=>Wt(`/runs/${encodeURIComponent(e)}/node-results`),getCollectionSchema:e=>Wt(`/workflows/${encodeURIComponent(e)}/collections/schema`),getCollectionKinds:e=>Wt(`/collections/${encodeURIComponent(e)}`),getCollections:(e,t)=>Wt(`/collections/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),getEntityData:(e,t)=>{const r=new URLSearchParams;t?.runId&&r.set("run_id",t.runId),t?.workflowId&&r.set("workflow_id",t.workflowId);const i=r.toString();return Wt(`/entities/${encodeURIComponent(e)}${i?`?${i}`:""}`)}},AN="cognetivy-selected-workflow-id",C3=2e3,RN=w.createContext(null);function N3(){try{return localStorage.getItem(AN)}catch{return null}}function _3(e){try{localStorage.setItem(AN,e)}catch{}}function k3({children:e}){const[t,r]=w.useState([]),[i,l]=w.useState(N3()),s=w.useCallback(async()=>{const d=await lt.getWorkflows();r(d),l(m=>m&&d.some(b=>b.workflow_id===m)?m:d.find(b=>b.current)?.workflow_id??d[0]?.workflow_id??null)},[]);w.useEffect(()=>{s().catch(()=>r([]));const d=setInterval(()=>{s().catch(()=>r([]))},C3);return()=>clearInterval(d)},[s]);const c=w.useCallback(d=>{l(d),_3(d)},[]),f=w.useMemo(()=>i?t.find(d=>d.workflow_id===i)??null:null,[t,i]),h={workflows:t,selectedWorkflowId:i,setSelectedWorkflowId:c,selectedWorkflow:f,reloadWorkflows:s};return g.jsx(RN.Provider,{value:h,children:e})}function sa(){const e=w.useContext(RN);if(!e)throw new Error("useWorkflowSelection must be used within WorkflowSelectionProvider");return e}function Ns({...e}){return g.jsx(Zz,{"data-slot":"select",...e})}function _s({...e}){return g.jsx(Qz,{"data-slot":"select-value",...e})}function ks({className:e,size:t="default",children:r,...i}){return g.jsxs(Kz,{"data-slot":"select-trigger","data-size":t,className:ve("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i,children:[r,g.jsx(Jz,{asChild:!0,children:g.jsx(ty,{className:"size-4 opacity-50"})})]})}function Ts({className:e,children:t,position:r="popper",align:i="start",sideOffset:l=4,collisionPadding:s=8,onCloseAutoFocus:c,...f}){return g.jsx(e5,{children:g.jsxs(t5,{"data-slot":"select-content",className:ve("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-hidden rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,align:i,sideOffset:l,collisionPadding:s,sticky:"partial",onCloseAutoFocus:h=>{h.preventDefault(),c?.(h)},...f,children:[g.jsx(T3,{}),g.jsx(n5,{className:ve("max-h-80 p-1 overscroll-contain",r==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(A3,{})]})})}function Wo({className:e,children:t,...r}){return g.jsxs(r5,{"data-slot":"select-item",className:ve("focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=checked]:font-medium [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(i5,{children:g.jsx(ey,{className:"size-4"})})}),g.jsx(o5,{children:t})]})}function T3({className:e,...t}){return g.jsx(l5,{"data-slot":"select-scroll-up-button",className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(W5,{className:"size-4"})})}function A3({className:e,...t}){return g.jsx(a5,{"data-slot":"select-scroll-down-button",className:ve("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(ty,{className:"size-4"})})}const jN="cognetivy-sidebar-open",R3=2e3,j3=[{to:"/",label:"Workflow",icon:l3},{to:"/runs",label:"Runs",icon:K5}];function M3(){try{return localStorage.getItem(jN)!=="false"}catch{return!0}}function O3(e){try{localStorage.setItem(jN,String(e))}catch{}}function D3(){const e=Nr(),{theme:t,setTheme:r}=HS(),{open:i,closeForSession:l,dismissPermanently:s}=E5(),{workflows:c,selectedWorkflowId:f,setSelectedWorkflowId:h,selectedWorkflow:d}=sa(),[m,p]=w.useState(null),[x,b]=w.useState([]),[E,S]=w.useState(null),[_,N]=w.useState(!0),[k,C]=w.useState(M3),A=x.filter(Y=>Y.status==="running").length;w.useEffect(()=>{lt.getWorkspace().then(S).catch(()=>S(null))},[]),w.useEffect(()=>{if(!f){p(null);return}const Y=f;function O(){lt.getCollectionSchema(Y).then(p).catch(()=>p(null))}O();const U=setInterval(O,R3);return()=>clearInterval(U)},[f]),w.useEffect(()=>{function Y(){lt.getRuns().then(b).catch(()=>b([]))}Y();const O=setInterval(Y,5e3);return()=>clearInterval(O)},[]);function L(){C(Y=>{const O=!Y;return O3(O),O})}const j=w.useMemo(()=>m?Object.keys(m.kinds):[],[m]);function z(Y){r(Y?"light":"dark")}function P(Y){h(Y)}function H(){N(Y=>!Y)}function X(Y){Y?s():l()}function q(Y){const O=Y.icon,U=e.pathname===Y.to||Y.to!=="/"&&e.pathname.startsWith(Y.to),R=Y.to==="/runs"&&A>0;return g.jsxs(pt,{to:Y.to,title:Y.label+(R?` (${A} running)`:""),className:ve("flex items-center rounded-md text-xs font-medium transition-colors",k?"gap-2 px-2.5 py-1.5 w-full":"p-2 justify-center",U?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[g.jsx(O,{className:"size-3.5 shrink-0"}),k&&g.jsxs(g.Fragment,{children:[Y.label,R&&g.jsxs("span",{className:"ml-auto text-amber-600 dark:text-amber-400 font-medium flex items-center gap-1",children:[g.jsx("span",{className:"size-1 rounded-full bg-amber-500 animate-pulse","aria-hidden":!0}),A]})]})]},Y.to)}function F(Y){return g.jsx(pt,{to:`/data/${encodeURIComponent(Y)}`,className:ve("block px-2 py-1 rounded-md text-xs font-medium transition-colors border-l-4",e.pathname===`/data/${Y}`?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),style:{borderLeftColor:xr(Y)},children:Y},Y)}return g.jsxs("div",{className:"flex h-screen bg-background",children:[g.jsx(S3,{open:i,onOpenChange:()=>{},onClose:X}),g.jsxs("aside",{className:ve("border-r border-border flex flex-col bg-sidebar shrink-0 min-h-0 transition-[width] duration-200",k?"w-48":"w-14"),children:[g.jsx("div",{className:"p-2.5 border-b border-border flex items-center gap-2 min-w-0",children:k?g.jsxs(g.Fragment,{children:[g.jsx("img",{src:"/favicon.png",alt:"",className:"h-10 w-10 rounded object-contain shrink-0","aria-hidden":!0}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("h1",{className:"font-semibold text-sm truncate",children:"Cognetivy Studio"}),g.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Read-only"}),E?.path&&g.jsx("p",{className:"text-[10px] text-muted-foreground truncate mt-0.5",title:E.path,children:E.path.split("/").slice(-2).join("/")||E.path})]})]}):g.jsx("img",{src:"/icon.jpg",alt:"Cognetivy",className:"h-8 w-8 rounded object-contain mx-auto","aria-hidden":!0})}),k&&g.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2 border-b border-border",children:[g.jsx("span",{className:"text-xs text-muted-foreground",children:"Dark"}),g.jsx(kN,{checked:t==="light",onCheckedChange:z}),g.jsx("span",{className:"text-xs text-muted-foreground",children:"Light"})]}),k&&c.length>0&&g.jsxs("div",{className:"px-2.5 py-2 border-b border-border",children:[g.jsx("div",{className:"text-[10px] text-muted-foreground mb-1",children:"Workflow"}),g.jsxs(Ns,{value:f??"",onValueChange:P,children:[g.jsx(ks,{className:"h-8 w-full text-xs",children:g.jsx(_s,{placeholder:"Select workflow"})}),g.jsx(Ts,{children:c.map(Y=>g.jsx(Wo,{value:Y.workflow_id,children:Y.name},Y.workflow_id))})]}),d?.description&&g.jsx("p",{className:"mt-1 text-[10px] text-muted-foreground line-clamp-2",children:d.description})]}),g.jsx(SN,{className:"flex-1 min-h-0",children:g.jsxs("nav",{className:ve("p-1.5 space-y-0.5",k&&"h-full flex flex-col",!k&&"flex flex-col items-center gap-1"),children:[j3.map(q),j.length>0&&g.jsx("div",{className:ve("pt-1",k&&"min-h-0 flex-1 flex flex-col",!k&&"w-full flex flex-col items-center"),children:k?g.jsxs("div",{className:"min-h-0 flex-1 flex flex-col",children:[g.jsxs("div",{className:"flex items-center gap-0.5 w-full",children:[g.jsx("button",{type:"button",onClick:H,className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":_?"Collapse collections":"Expand collections",children:_?g.jsx(ty,{className:"size-3 shrink-0"}):g.jsx(pw,{className:"size-3 shrink-0"})}),g.jsxs(pt,{to:"/collections",className:ve("flex items-center gap-2 flex-1 px-2 py-1.5 rounded-md text-xs font-medium transition-colors",e.pathname==="/collections"||e.pathname.startsWith("/data/")?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[g.jsx(vf,{className:"size-3.5 shrink-0"}),"Collections"]})]}),_&&g.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-border pl-2 pr-1 min-h-0 flex-1 max-h-[calc(100vh-16rem)] overflow-y-auto",children:j.map(F)})]}):j.length>0&&g.jsx(pt,{to:"/collections",title:"Collections",className:ve("p-2 rounded-md flex justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground",(e.pathname==="/collections"||e.pathname.startsWith("/data/"))&&"bg-accent text-accent-foreground"),children:g.jsx(vf,{className:"size-3.5"})})})]})}),g.jsx("button",{type:"button",onClick:L,className:"p-2 border-t border-border flex items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground rounded-none w-full","aria-label":k?"Collapse sidebar":"Expand sidebar",children:k?g.jsx(F5,{className:"size-4"}):g.jsx(pw,{className:"size-4"})})]}),g.jsx("main",{className:"flex-1 overflow-auto min-w-0",children:g.jsx(xR,{})})]})}function ca({items:e,className:t}){return e.length===0?null:g.jsx("nav",{"aria-label":"Breadcrumb",className:ve("flex items-center gap-1.5 text-xs text-muted-foreground",t),children:e.map((r,i)=>{const l=i===e.length-1;return g.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[i>0&&g.jsx("span",{className:"shrink-0 text-muted-foreground/70","aria-hidden":!0,children:"/"}),r.to&&!l?g.jsx(pt,{to:r.to,className:ve(En,"truncate","focus:outline-none focus:underline"),children:r.label}):g.jsx("span",{className:ve(l&&"font-medium text-foreground","truncate"),children:r.label})]},i)})})}function _n({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:ve("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function tr({className:e,...t}){return g.jsx("div",{"data-slot":"card-header",className:ve("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function nr({className:e,...t}){return g.jsx("div",{"data-slot":"card-title",className:ve("leading-none font-semibold",e),...t})}function kn({className:e,...t}){return g.jsx("div",{"data-slot":"card-content",className:ve("px-6",e),...t})}const ny=OE,z3=DE;function L3({className:e,...t}){return g.jsx(zE,{className:ve("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function ry({className:e,children:t,showCloseButton:r=!0,side:i="right",onOpenAutoFocus:l,...s}){const c=l??(f=>f.preventDefault());return g.jsxs(z3,{children:[g.jsx(L3,{}),g.jsxs(LE,{onOpenAutoFocus:c,className:ve("fixed z-50 flex h-full flex-col gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out",i==="right"&&"right-0 top-0 w-full max-w-md data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",i==="left"&&"left-0 top-0 w-full max-w-md data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",e),...s,children:[g.jsx("div",{className:"flex-1 overflow-y-auto p-6 pr-10",children:t}),r&&g.jsxs(HE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx("span",{className:"sr-only",children:"Close"}),g.jsx("span",{"aria-hidden":!0,className:"text-lg leading-none",children:"×"})]})]})]})}function bf({className:e,...t}){return g.jsx("div",{className:ve("flex flex-col space-y-1.5 text-left",e),...t})}const As=w.forwardRef(({className:e,...t},r)=>g.jsx(IE,{ref:r,className:ve("text-lg font-semibold",e),...t}));As.displayName="SheetTitle";const wf=w.forwardRef(({className:e,...t},r)=>g.jsx(BE,{ref:r,className:ve("text-sm text-muted-foreground",e),...t}));wf.displayName="SheetDescription";function At(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,i;r<e.length;r++)(i=At(e[r]))!==""&&(t+=(t&&" ")+i);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var I3={value:()=>{}};function Qf(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new tf(r)}function tf(e){this._=e}function B3(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",l=r.indexOf(".");if(l>=0&&(i=r.slice(l+1),r=r.slice(0,l)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}tf.prototype=Qf.prototype={constructor:tf,on:function(e,t){var r=this._,i=B3(e+"",r),l,s=-1,c=i.length;if(arguments.length<2){for(;++s<c;)if((l=(e=i[s]).type)&&(l=H3(r[l],e.name)))return l;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<c;)if(l=(e=i[s]).type)r[l]=gw(r[l],e.name,t);else if(t==null)for(l in r)r[l]=gw(r[l],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new tf(e)},call:function(e,t){if((l=arguments.length-2)>0)for(var r=new Array(l),i=0,l,s;i<l;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,l=s.length;i<l;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],l=0,s=i.length;l<s;++l)i[l].value.apply(t,r)}};function H3(e,t){for(var r=0,i=e.length,l;r<i;++r)if((l=e[r]).name===t)return l.value}function gw(e,t,r){for(var i=0,l=e.length;i<l;++i)if(e[i].name===t){e[i]=I3,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Yp="http://www.w3.org/1999/xhtml";const yw={svg:"http://www.w3.org/2000/svg",xhtml:Yp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jf(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),yw.hasOwnProperty(t)?{space:yw[t],local:e}:e}function P3(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Yp&&t.documentElement.namespaceURI===Yp?t.createElement(e):t.createElementNS(r,e)}}function U3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function MN(e){var t=Jf(e);return(t.local?U3:P3)(t)}function V3(){}function oy(e){return e==null?V3:function(){return this.querySelector(e)}}function $3(e){typeof e!="function"&&(e=oy(e));for(var t=this._groups,r=t.length,i=new Array(r),l=0;l<r;++l)for(var s=t[l],c=s.length,f=i[l]=new Array(c),h,d,m=0;m<c;++m)(h=s[m])&&(d=e.call(h,h.__data__,m,s))&&("__data__"in h&&(d.__data__=h.__data__),f[m]=d);return new Tn(i,this._parents)}function Y3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function q3(){return[]}function ON(e){return e==null?q3:function(){return this.querySelectorAll(e)}}function F3(e){return function(){return Y3(e.apply(this,arguments))}}function X3(e){typeof e=="function"?e=F3(e):e=ON(e);for(var t=this._groups,r=t.length,i=[],l=[],s=0;s<r;++s)for(var c=t[s],f=c.length,h,d=0;d<f;++d)(h=c[d])&&(i.push(e.call(h,h.__data__,d,c)),l.push(h));return new Tn(i,l)}function DN(e){return function(){return this.matches(e)}}function zN(e){return function(t){return t.matches(e)}}var G3=Array.prototype.find;function W3(e){return function(){return G3.call(this.children,e)}}function Z3(){return this.firstElementChild}function K3(e){return this.select(e==null?Z3:W3(typeof e=="function"?e:zN(e)))}var Q3=Array.prototype.filter;function J3(){return Array.from(this.children)}function eL(e){return function(){return Q3.call(this.children,e)}}function tL(e){return this.selectAll(e==null?J3:eL(typeof e=="function"?e:zN(e)))}function nL(e){typeof e!="function"&&(e=DN(e));for(var t=this._groups,r=t.length,i=new Array(r),l=0;l<r;++l)for(var s=t[l],c=s.length,f=i[l]=[],h,d=0;d<c;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new Tn(i,this._parents)}function LN(e){return new Array(e.length)}function rL(){return new Tn(this._enter||this._groups.map(LN),this._parents)}function Sf(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Sf.prototype={constructor:Sf,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 oL(e){return function(){return e}}function iL(e,t,r,i,l,s){for(var c=0,f,h=t.length,d=s.length;c<d;++c)(f=t[c])?(f.__data__=s[c],i[c]=f):r[c]=new Sf(e,s[c]);for(;c<h;++c)(f=t[c])&&(l[c]=f)}function lL(e,t,r,i,l,s,c){var f,h,d=new Map,m=t.length,p=s.length,x=new Array(m),b;for(f=0;f<m;++f)(h=t[f])&&(x[f]=b=c.call(h,h.__data__,f,t)+"",d.has(b)?l[f]=h:d.set(b,h));for(f=0;f<p;++f)b=c.call(e,s[f],f,s)+"",(h=d.get(b))?(i[f]=h,h.__data__=s[f],d.delete(b)):r[f]=new Sf(e,s[f]);for(f=0;f<m;++f)(h=t[f])&&d.get(x[f])===h&&(l[f]=h)}function aL(e){return e.__data__}function sL(e,t){if(!arguments.length)return Array.from(this,aL);var r=t?lL:iL,i=this._parents,l=this._groups;typeof e!="function"&&(e=oL(e));for(var s=l.length,c=new Array(s),f=new Array(s),h=new Array(s),d=0;d<s;++d){var m=i[d],p=l[d],x=p.length,b=cL(e.call(m,m&&m.__data__,d,i)),E=b.length,S=f[d]=new Array(E),_=c[d]=new Array(E),N=h[d]=new Array(x);r(m,p,S,_,N,b,t);for(var k=0,C=0,A,L;k<E;++k)if(A=S[k]){for(k>=C&&(C=k+1);!(L=_[C])&&++C<E;);A._next=L||null}}return c=new Tn(c,i),c._enter=f,c._exit=h,c}function cL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uL(){return new Tn(this._exit||this._groups.map(LN),this._parents)}function fL(e,t,r){var i=this.enter(),l=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(l=t(l),l&&(l=l.selection())),r==null?s.remove():r(s),i&&l?i.merge(l).order():l}function dL(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,l=r.length,s=i.length,c=Math.min(l,s),f=new Array(l),h=0;h<c;++h)for(var d=r[h],m=i[h],p=d.length,x=f[h]=new Array(p),b,E=0;E<p;++E)(b=d[E]||m[E])&&(x[E]=b);for(;h<l;++h)f[h]=r[h];return new Tn(f,this._parents)}function hL(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],l=i.length-1,s=i[l],c;--l>=0;)(c=i[l])&&(s&&c.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(c,s),s=c);return this}function mL(e){e||(e=pL);function t(p,x){return p&&x?e(p.__data__,x.__data__):!p-!x}for(var r=this._groups,i=r.length,l=new Array(i),s=0;s<i;++s){for(var c=r[s],f=c.length,h=l[s]=new Array(f),d,m=0;m<f;++m)(d=c[m])&&(h[m]=d);h.sort(t)}return new Tn(l,this._parents).order()}function pL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function yL(){return Array.from(this)}function xL(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],l=0,s=i.length;l<s;++l){var c=i[l];if(c)return c}return null}function vL(){let e=0;for(const t of this)++e;return e}function bL(){return!this.node()}function wL(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var l=t[r],s=0,c=l.length,f;s<c;++s)(f=l[s])&&e.call(f,f.__data__,s,l);return this}function SL(e){return function(){this.removeAttribute(e)}}function EL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function CL(e,t){return function(){this.setAttribute(e,t)}}function NL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _L(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function kL(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function TL(e,t){var r=Jf(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?EL:SL:typeof t=="function"?r.local?kL:_L:r.local?NL:CL)(r,t))}function IN(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function AL(e){return function(){this.style.removeProperty(e)}}function RL(e,t,r){return function(){this.style.setProperty(e,t,r)}}function jL(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function ML(e,t,r){return arguments.length>1?this.each((t==null?AL:typeof t=="function"?jL:RL)(e,t,r??"")):Gl(this.node(),e)}function Gl(e,t){return e.style.getPropertyValue(t)||IN(e).getComputedStyle(e,null).getPropertyValue(t)}function OL(e){return function(){delete this[e]}}function DL(e,t){return function(){this[e]=t}}function zL(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function LL(e,t){return arguments.length>1?this.each((t==null?OL:typeof t=="function"?zL:DL)(e,t)):this.node()[e]}function BN(e){return e.trim().split(/^|\s+/)}function iy(e){return e.classList||new HN(e)}function HN(e){this._node=e,this._names=BN(e.getAttribute("class")||"")}HN.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 PN(e,t){for(var r=iy(e),i=-1,l=t.length;++i<l;)r.add(t[i])}function UN(e,t){for(var r=iy(e),i=-1,l=t.length;++i<l;)r.remove(t[i])}function IL(e){return function(){PN(this,e)}}function BL(e){return function(){UN(this,e)}}function HL(e,t){return function(){(t.apply(this,arguments)?PN:UN)(this,e)}}function PL(e,t){var r=BN(e+"");if(arguments.length<2){for(var i=iy(this.node()),l=-1,s=r.length;++l<s;)if(!i.contains(r[l]))return!1;return!0}return this.each((typeof t=="function"?HL:t?IL:BL)(r,t))}function UL(){this.textContent=""}function VL(e){return function(){this.textContent=e}}function $L(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function YL(e){return arguments.length?this.each(e==null?UL:(typeof e=="function"?$L:VL)(e)):this.node().textContent}function qL(){this.innerHTML=""}function FL(e){return function(){this.innerHTML=e}}function XL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function GL(e){return arguments.length?this.each(e==null?qL:(typeof e=="function"?XL:FL)(e)):this.node().innerHTML}function WL(){this.nextSibling&&this.parentNode.appendChild(this)}function ZL(){return this.each(WL)}function KL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function QL(){return this.each(KL)}function JL(e){var t=typeof e=="function"?e:MN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function e4(){return null}function t4(e,t){var r=typeof e=="function"?e:MN(e),i=t==null?e4:typeof t=="function"?t:oy(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function n4(){var e=this.parentNode;e&&e.removeChild(this)}function r4(){return this.each(n4)}function o4(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function i4(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l4(e){return this.select(e?i4:o4)}function a4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function s4(e){return function(t){e.call(this,t,this.__data__)}}function c4(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function u4(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,l=t.length,s;r<l;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function f4(e,t,r){return function(){var i=this.__on,l,s=s4(t);if(i){for(var c=0,f=i.length;c<f;++c)if((l=i[c]).type===e.type&&l.name===e.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=s,l.options=r),l.value=t;return}}this.addEventListener(e.type,s,r),l={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(l):this.__on=[l]}}function d4(e,t,r){var i=c4(e+""),l,s=i.length,c;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,m;h<d;++h)for(l=0,m=f[h];l<s;++l)if((c=i[l]).type===m.type&&c.name===m.name)return m.value}return}for(f=t?f4:u4,l=0;l<s;++l)this.each(f(i[l],t,r));return this}function VN(e,t,r){var i=IN(e),l=i.CustomEvent;typeof l=="function"?l=new l(t,r):(l=i.document.createEvent("Event"),r?(l.initEvent(t,r.bubbles,r.cancelable),l.detail=r.detail):l.initEvent(t,!1,!1)),e.dispatchEvent(l)}function h4(e,t){return function(){return VN(this,e,t)}}function m4(e,t){return function(){return VN(this,e,t.apply(this,arguments))}}function p4(e,t){return this.each((typeof t=="function"?m4:h4)(e,t))}function*g4(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],l=0,s=i.length,c;l<s;++l)(c=i[l])&&(yield c)}var $N=[null];function Tn(e,t){this._groups=e,this._parents=t}function Ws(){return new Tn([[document.documentElement]],$N)}function y4(){return this}Tn.prototype=Ws.prototype={constructor:Tn,select:$3,selectAll:X3,selectChild:K3,selectChildren:tL,filter:nL,data:sL,enter:rL,exit:uL,join:fL,merge:dL,selection:y4,order:hL,sort:mL,call:gL,nodes:yL,node:xL,size:vL,empty:bL,each:wL,attr:TL,style:ML,property:LL,classed:PL,text:YL,html:GL,raise:ZL,lower:QL,append:JL,insert:t4,remove:r4,clone:l4,datum:a4,on:d4,dispatch:p4,[Symbol.iterator]:g4};function Sn(e){return typeof e=="string"?new Tn([[document.querySelector(e)]],[document.documentElement]):new Tn([[e]],$N)}function x4(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Zn(e,t){if(e=x4(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var l=t.getBoundingClientRect();return[e.clientX-l.left-t.clientLeft,e.clientY-l.top-t.clientTop]}}return[e.pageX,e.pageY]}const v4={passive:!1},Rs={capture:!0,passive:!1};function Jm(e){e.stopImmediatePropagation()}function Pl(e){e.preventDefault(),e.stopImmediatePropagation()}function YN(e){var t=e.document.documentElement,r=Sn(e).on("dragstart.drag",Pl,Rs);"onselectstart"in t?r.on("selectstart.drag",Pl,Rs):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function qN(e,t){var r=e.document.documentElement,i=Sn(e).on("dragstart.drag",null);t&&(i.on("click.drag",Pl,Rs),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Iu=e=>()=>e;function qp(e,{sourceEvent:t,subject:r,target:i,identifier:l,active:s,x:c,y:f,dx:h,dy:d,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:f,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:m}})}qp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function b4(e){return!e.ctrlKey&&!e.button}function w4(){return this.parentNode}function S4(e,t){return t??{x:e.x,y:e.y}}function E4(){return navigator.maxTouchPoints||"ontouchstart"in this}function FN(){var e=b4,t=w4,r=S4,i=E4,l={},s=Qf("start","drag","end"),c=0,f,h,d,m,p=0;function x(A){A.on("mousedown.drag",b).filter(i).on("touchstart.drag",_).on("touchmove.drag",N,v4).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(A,L){if(!(m||!e.call(this,A,L))){var j=C(this,t.call(this,A,L),A,L,"mouse");j&&(Sn(A.view).on("mousemove.drag",E,Rs).on("mouseup.drag",S,Rs),YN(A.view),Jm(A),d=!1,f=A.clientX,h=A.clientY,j("start",A))}}function E(A){if(Pl(A),!d){var L=A.clientX-f,j=A.clientY-h;d=L*L+j*j>p}l.mouse("drag",A)}function S(A){Sn(A.view).on("mousemove.drag mouseup.drag",null),qN(A.view,d),Pl(A),l.mouse("end",A)}function _(A,L){if(e.call(this,A,L)){var j=A.changedTouches,z=t.call(this,A,L),P=j.length,H,X;for(H=0;H<P;++H)(X=C(this,z,A,L,j[H].identifier,j[H]))&&(Jm(A),X("start",A,j[H]))}}function N(A){var L=A.changedTouches,j=L.length,z,P;for(z=0;z<j;++z)(P=l[L[z].identifier])&&(Pl(A),P("drag",A,L[z]))}function k(A){var L=A.changedTouches,j=L.length,z,P;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),z=0;z<j;++z)(P=l[L[z].identifier])&&(Jm(A),P("end",A,L[z]))}function C(A,L,j,z,P,H){var X=s.copy(),q=Zn(H||j,L),F,Y,O;if((O=r.call(A,new qp("beforestart",{sourceEvent:j,target:x,identifier:P,active:c,x:q[0],y:q[1],dx:0,dy:0,dispatch:X}),z))!=null)return F=O.x-q[0]||0,Y=O.y-q[1]||0,function U(R,V,$){var W=q,M;switch(R){case"start":l[P]=U,M=c++;break;case"end":delete l[P],--c;case"drag":q=Zn($||V,L),M=c;break}X.call(R,A,new qp(R,{sourceEvent:V,subject:O,target:x,identifier:P,active:M,x:q[0]+F,y:q[1]+Y,dx:q[0]-W[0],dy:q[1]-W[1],dispatch:X}),z)}}return x.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Iu(!!A),x):e},x.container=function(A){return arguments.length?(t=typeof A=="function"?A:Iu(A),x):t},x.subject=function(A){return arguments.length?(r=typeof A=="function"?A:Iu(A),x):r},x.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Iu(!!A),x):i},x.on=function(){var A=s.on.apply(s,arguments);return A===s?x:A},x.clickDistance=function(A){return arguments.length?(p=(A=+A)*A,x):Math.sqrt(p)},x}function ly(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function XN(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Zs(){}var js=.7,Ef=1/js,Ul="\\s*([+-]?\\d+)\\s*",Ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",C4=/^#([0-9a-f]{3,8})$/,N4=new RegExp(`^rgb\\(${Ul},${Ul},${Ul}\\)$`),_4=new RegExp(`^rgb\\(${wr},${wr},${wr}\\)$`),k4=new RegExp(`^rgba\\(${Ul},${Ul},${Ul},${Ms}\\)$`),T4=new RegExp(`^rgba\\(${wr},${wr},${wr},${Ms}\\)$`),A4=new RegExp(`^hsl\\(${Ms},${wr},${wr}\\)$`),R4=new RegExp(`^hsla\\(${Ms},${wr},${wr},${Ms}\\)$`),xw={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};ly(Zs,Ii,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vw,formatHex:vw,formatHex8:j4,formatHsl:M4,formatRgb:bw,toString:bw});function vw(){return this.rgb().formatHex()}function j4(){return this.rgb().formatHex8()}function M4(){return GN(this).formatHsl()}function bw(){return this.rgb().formatRgb()}function Ii(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=C4.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?ww(t):r===3?new sn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Bu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Bu(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=N4.exec(e))?new sn(t[1],t[2],t[3],1):(t=_4.exec(e))?new sn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=k4.exec(e))?Bu(t[1],t[2],t[3],t[4]):(t=T4.exec(e))?Bu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=A4.exec(e))?Cw(t[1],t[2]/100,t[3]/100,1):(t=R4.exec(e))?Cw(t[1],t[2]/100,t[3]/100,t[4]):xw.hasOwnProperty(e)?ww(xw[e]):e==="transparent"?new sn(NaN,NaN,NaN,0):null}function ww(e){return new sn(e>>16&255,e>>8&255,e&255,1)}function Bu(e,t,r,i){return i<=0&&(e=t=r=NaN),new sn(e,t,r,i)}function O4(e){return e instanceof Zs||(e=Ii(e)),e?(e=e.rgb(),new sn(e.r,e.g,e.b,e.opacity)):new sn}function Fp(e,t,r,i){return arguments.length===1?O4(e):new sn(e,t,r,i??1)}function sn(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ly(sn,Fp,XN(Zs,{brighter(e){return e=e==null?Ef:Math.pow(Ef,e),new sn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?js:Math.pow(js,e),new sn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sn(Ai(this.r),Ai(this.g),Ai(this.b),Cf(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:Sw,formatHex:Sw,formatHex8:D4,formatRgb:Ew,toString:Ew}));function Sw(){return`#${Ti(this.r)}${Ti(this.g)}${Ti(this.b)}`}function D4(){return`#${Ti(this.r)}${Ti(this.g)}${Ti(this.b)}${Ti((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ew(){const e=Cf(this.opacity);return`${e===1?"rgb(":"rgba("}${Ai(this.r)}, ${Ai(this.g)}, ${Ai(this.b)}${e===1?")":`, ${e})`}`}function Cf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ai(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ti(e){return e=Ai(e),(e<16?"0":"")+e.toString(16)}function Cw(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Qn(e,t,r,i)}function GN(e){if(e instanceof Qn)return new Qn(e.h,e.s,e.l,e.opacity);if(e instanceof Zs||(e=Ii(e)),!e)return new Qn;if(e instanceof Qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,l=Math.min(t,r,i),s=Math.max(t,r,i),c=NaN,f=s-l,h=(s+l)/2;return f?(t===s?c=(r-i)/f+(r<i)*6:r===s?c=(i-t)/f+2:c=(t-r)/f+4,f/=h<.5?s+l:2-s-l,c*=60):f=h>0&&h<1?0:c,new Qn(c,f,h,e.opacity)}function z4(e,t,r,i){return arguments.length===1?GN(e):new Qn(e,t,r,i??1)}function Qn(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ly(Qn,z4,XN(Zs,{brighter(e){return e=e==null?Ef:Math.pow(Ef,e),new Qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?js:Math.pow(js,e),new Qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,l=2*r-i;return new sn(ep(e>=240?e-240:e+120,l,i),ep(e,l,i),ep(e<120?e+240:e-120,l,i),this.opacity)},clamp(){return new Qn(Nw(this.h),Hu(this.s),Hu(this.l),Cf(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=Cf(this.opacity);return`${e===1?"hsl(":"hsla("}${Nw(this.h)}, ${Hu(this.s)*100}%, ${Hu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Nw(e){return e=(e||0)%360,e<0?e+360:e}function Hu(e){return Math.max(0,Math.min(1,e||0))}function ep(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ay=e=>()=>e;function L4(e,t){return function(r){return e+r*t}}function I4(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function B4(e){return(e=+e)==1?WN:function(t,r){return r-t?I4(t,r,e):ay(isNaN(t)?r:t)}}function WN(e,t){var r=t-e;return r?L4(e,r):ay(isNaN(e)?t:e)}const Nf=(function e(t){var r=B4(t);function i(l,s){var c=r((l=Fp(l)).r,(s=Fp(s)).r),f=r(l.g,s.g),h=r(l.b,s.b),d=WN(l.opacity,s.opacity);return function(m){return l.r=c(m),l.g=f(m),l.b=h(m),l.opacity=d(m),l+""}}return i.gamma=e,i})(1);function H4(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,i=t.slice(),l;return function(s){for(l=0;l<r;++l)i[l]=e[l]*(1-s)+t[l]*s;return i}}function P4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function U4(e,t){var r=t?t.length:0,i=e?Math.min(r,e.length):0,l=new Array(i),s=new Array(r),c;for(c=0;c<i;++c)l[c]=xs(e[c],t[c]);for(;c<r;++c)s[c]=t[c];return function(f){for(c=0;c<i;++c)s[c]=l[c](f);return s}}function V4(e,t){var r=new Date;return e=+e,t=+t,function(i){return r.setTime(e*(1-i)+t*i),r}}function pr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function $4(e,t){var r={},i={},l;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(l in t)l in e?r[l]=xs(e[l],t[l]):i[l]=t[l];return function(s){for(l in r)i[l]=r[l](s);return i}}var Xp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tp=new RegExp(Xp.source,"g");function Y4(e){return function(){return e}}function q4(e){return function(t){return e(t)+""}}function ZN(e,t){var r=Xp.lastIndex=tp.lastIndex=0,i,l,s,c=-1,f=[],h=[];for(e=e+"",t=t+"";(i=Xp.exec(e))&&(l=tp.exec(t));)(s=l.index)>r&&(s=t.slice(r,s),f[c]?f[c]+=s:f[++c]=s),(i=i[0])===(l=l[0])?f[c]?f[c]+=l:f[++c]=l:(f[++c]=null,h.push({i:c,x:pr(i,l)})),r=tp.lastIndex;return r<t.length&&(s=t.slice(r),f[c]?f[c]+=s:f[++c]=s),f.length<2?h[0]?q4(h[0].x):Y4(t):(t=h.length,function(d){for(var m=0,p;m<t;++m)f[(p=h[m]).i]=p.x(d);return f.join("")})}function xs(e,t){var r=typeof t,i;return t==null||r==="boolean"?ay(t):(r==="number"?pr:r==="string"?(i=Ii(t))?(t=i,Nf):ZN:t instanceof Ii?Nf:t instanceof Date?V4:P4(t)?H4:Array.isArray(t)?U4:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?$4:pr)(e,t)}var _w=180/Math.PI,Gp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function KN(e,t,r,i,l,s){var c,f,h;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(h=e*r+t*i)&&(r-=e*h,i-=t*h),(f=Math.sqrt(r*r+i*i))&&(r/=f,i/=f,h/=f),e*i<t*r&&(e=-e,t=-t,h=-h,c=-c),{translateX:l,translateY:s,rotate:Math.atan2(t,e)*_w,skewX:Math.atan(h)*_w,scaleX:c,scaleY:f}}var Pu;function F4(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Gp:KN(t.a,t.b,t.c,t.d,t.e,t.f)}function X4(e){return e==null||(Pu||(Pu=document.createElementNS("http://www.w3.org/2000/svg","g")),Pu.setAttribute("transform",e),!(e=Pu.transform.baseVal.consolidate()))?Gp:(e=e.matrix,KN(e.a,e.b,e.c,e.d,e.e,e.f))}function QN(e,t,r,i){function l(d){return d.length?d.pop()+" ":""}function s(d,m,p,x,b,E){if(d!==p||m!==x){var S=b.push("translate(",null,t,null,r);E.push({i:S-4,x:pr(d,p)},{i:S-2,x:pr(m,x)})}else(p||x)&&b.push("translate("+p+t+x+r)}function c(d,m,p,x){d!==m?(d-m>180?m+=360:m-d>180&&(d+=360),x.push({i:p.push(l(p)+"rotate(",null,i)-2,x:pr(d,m)})):m&&p.push(l(p)+"rotate("+m+i)}function f(d,m,p,x){d!==m?x.push({i:p.push(l(p)+"skewX(",null,i)-2,x:pr(d,m)}):m&&p.push(l(p)+"skewX("+m+i)}function h(d,m,p,x,b,E){if(d!==p||m!==x){var S=b.push(l(b)+"scale(",null,",",null,")");E.push({i:S-4,x:pr(d,p)},{i:S-2,x:pr(m,x)})}else(p!==1||x!==1)&&b.push(l(b)+"scale("+p+","+x+")")}return function(d,m){var p=[],x=[];return d=e(d),m=e(m),s(d.translateX,d.translateY,m.translateX,m.translateY,p,x),c(d.rotate,m.rotate,p,x),f(d.skewX,m.skewX,p,x),h(d.scaleX,d.scaleY,m.scaleX,m.scaleY,p,x),d=m=null,function(b){for(var E=-1,S=x.length,_;++E<S;)p[(_=x[E]).i]=_.x(b);return p.join("")}}}var G4=QN(F4,"px, ","px)","deg)"),W4=QN(X4,", ",")",")"),Z4=1e-12;function kw(e){return((e=Math.exp(e))+1/e)/2}function K4(e){return((e=Math.exp(e))-1/e)/2}function Q4(e){return((e=Math.exp(2*e))-1)/(e+1)}const nf=(function e(t,r,i){function l(s,c){var f=s[0],h=s[1],d=s[2],m=c[0],p=c[1],x=c[2],b=m-f,E=p-h,S=b*b+E*E,_,N;if(S<Z4)N=Math.log(x/d)/t,_=function(z){return[f+z*b,h+z*E,d*Math.exp(t*z*N)]};else{var k=Math.sqrt(S),C=(x*x-d*d+i*S)/(2*d*r*k),A=(x*x-d*d-i*S)/(2*x*r*k),L=Math.log(Math.sqrt(C*C+1)-C),j=Math.log(Math.sqrt(A*A+1)-A);N=(j-L)/t,_=function(z){var P=z*N,H=kw(L),X=d/(r*k)*(H*Q4(t*P+L)-K4(L));return[f+X*b,h+X*E,d*H/kw(t*P+L)]}}return _.duration=N*1e3*t/Math.SQRT2,_}return l.rho=function(s){var c=Math.max(.001,+s),f=c*c,h=f*f;return e(c,f,h)},l})(Math.SQRT2,2,4);var Wl=0,gs=0,cs=0,JN=1e3,_f,ys,kf=0,Bi=0,ed=0,Os=typeof performance=="object"&&performance.now?performance:Date,e_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sy(){return Bi||(e_(J4),Bi=Os.now()+ed)}function J4(){Bi=0}function Tf(){this._call=this._time=this._next=null}Tf.prototype=t_.prototype={constructor:Tf,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?sy():+r)+(t==null?0:+t),!this._next&&ys!==this&&(ys?ys._next=this:_f=this,ys=this),this._call=e,this._time=r,Wp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wp())}};function t_(e,t,r){var i=new Tf;return i.restart(e,t,r),i}function eI(){sy(),++Wl;for(var e=_f,t;e;)(t=Bi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wl}function Tw(){Bi=(kf=Os.now())+ed,Wl=gs=0;try{eI()}finally{Wl=0,nI(),Bi=0}}function tI(){var e=Os.now(),t=e-kf;t>JN&&(ed-=t,kf=e)}function nI(){for(var e,t=_f,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:_f=r);ys=e,Wp(i)}function Wp(e){if(!Wl){gs&&(gs=clearTimeout(gs));var t=e-Bi;t>24?(e<1/0&&(gs=setTimeout(Tw,e-Os.now()-ed)),cs&&(cs=clearInterval(cs))):(cs||(kf=Os.now(),cs=setInterval(tI,JN)),Wl=1,e_(Tw))}}function Aw(e,t,r){var i=new Tf;return t=t==null?0:+t,i.restart(l=>{i.stop(),e(l+t)},t,r),i}var rI=Qf("start","end","cancel","interrupt"),oI=[],n_=0,Rw=1,Zp=2,rf=3,jw=4,Kp=5,of=6;function td(e,t,r,i,l,s){var c=e.__transition;if(!c)e.__transition={};else if(r in c)return;iI(e,r,{name:t,index:i,group:l,on:rI,tween:oI,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:n_})}function cy(e,t){var r=lr(e,t);if(r.state>n_)throw new Error("too late; already scheduled");return r}function Ar(e,t){var r=lr(e,t);if(r.state>rf)throw new Error("too late; already running");return r}function lr(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function iI(e,t,r){var i=e.__transition,l;i[t]=r,r.timer=t_(s,0,r.time);function s(d){r.state=Rw,r.timer.restart(c,r.delay,r.time),r.delay<=d&&c(d-r.delay)}function c(d){var m,p,x,b;if(r.state!==Rw)return h();for(m in i)if(b=i[m],b.name===r.name){if(b.state===rf)return Aw(c);b.state===jw?(b.state=of,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete i[m]):+m<t&&(b.state=of,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete i[m])}if(Aw(function(){r.state===rf&&(r.state=jw,r.timer.restart(f,r.delay,r.time),f(d))}),r.state=Zp,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Zp){for(r.state=rf,l=new Array(x=r.tween.length),m=0,p=-1;m<x;++m)(b=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(l[++p]=b);l.length=p+1}}function f(d){for(var m=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(h),r.state=Kp,1),p=-1,x=l.length;++p<x;)l[p].call(e,m);r.state===Kp&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=of,r.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function lf(e,t){var r=e.__transition,i,l,s=!0,c;if(r){t=t==null?null:t+"";for(c in r){if((i=r[c]).name!==t){s=!1;continue}l=i.state>Zp&&i.state<Kp,i.state=of,i.timer.stop(),i.on.call(l?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[c]}s&&delete e.__transition}}function lI(e){return this.each(function(){lf(this,e)})}function aI(e,t){var r,i;return function(){var l=Ar(this,e),s=l.tween;if(s!==r){i=r=s;for(var c=0,f=i.length;c<f;++c)if(i[c].name===t){i=i.slice(),i.splice(c,1);break}}l.tween=i}}function sI(e,t,r){var i,l;if(typeof r!="function")throw new Error;return function(){var s=Ar(this,e),c=s.tween;if(c!==i){l=(i=c).slice();for(var f={name:t,value:r},h=0,d=l.length;h<d;++h)if(l[h].name===t){l[h]=f;break}h===d&&l.push(f)}s.tween=l}}function cI(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=lr(this.node(),r).tween,l=0,s=i.length,c;l<s;++l)if((c=i[l]).name===e)return c.value;return null}return this.each((t==null?aI:sI)(r,e,t))}function uy(e,t,r){var i=e._id;return e.each(function(){var l=Ar(this,i);(l.value||(l.value={}))[t]=r.apply(this,arguments)}),function(l){return lr(l,i).value[t]}}function r_(e,t){var r;return(typeof t=="number"?pr:t instanceof Ii?Nf:(r=Ii(t))?(t=r,Nf):ZN)(e,t)}function uI(e){return function(){this.removeAttribute(e)}}function fI(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dI(e,t,r){var i,l=r+"",s;return function(){var c=this.getAttribute(e);return c===l?null:c===i?s:s=t(i=c,r)}}function hI(e,t,r){var i,l=r+"",s;return function(){var c=this.getAttributeNS(e.space,e.local);return c===l?null:c===i?s:s=t(i=c,r)}}function mI(e,t,r){var i,l,s;return function(){var c,f=r(this),h;return f==null?void this.removeAttribute(e):(c=this.getAttribute(e),h=f+"",c===h?null:c===i&&h===l?s:(l=h,s=t(i=c,f)))}}function pI(e,t,r){var i,l,s;return function(){var c,f=r(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),h=f+"",c===h?null:c===i&&h===l?s:(l=h,s=t(i=c,f)))}}function gI(e,t){var r=Jf(e),i=r==="transform"?W4:r_;return this.attrTween(e,typeof t=="function"?(r.local?pI:mI)(r,i,uy(this,"attr."+e,t)):t==null?(r.local?fI:uI)(r):(r.local?hI:dI)(r,i,t))}function yI(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function xI(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function vI(e,t){var r,i;function l(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&xI(e,s)),r}return l._value=t,l}function bI(e,t){var r,i;function l(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&yI(e,s)),r}return l._value=t,l}function wI(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=Jf(e);return this.tween(r,(i.local?vI:bI)(i,t))}function SI(e,t){return function(){cy(this,e).delay=+t.apply(this,arguments)}}function EI(e,t){return t=+t,function(){cy(this,e).delay=t}}function CI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?SI:EI)(t,e)):lr(this.node(),t).delay}function NI(e,t){return function(){Ar(this,e).duration=+t.apply(this,arguments)}}function _I(e,t){return t=+t,function(){Ar(this,e).duration=t}}function kI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?NI:_I)(t,e)):lr(this.node(),t).duration}function TI(e,t){if(typeof t!="function")throw new Error;return function(){Ar(this,e).ease=t}}function AI(e){var t=this._id;return arguments.length?this.each(TI(t,e)):lr(this.node(),t).ease}function RI(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ar(this,e).ease=r}}function jI(e){if(typeof e!="function")throw new Error;return this.each(RI(this._id,e))}function MI(e){typeof e!="function"&&(e=DN(e));for(var t=this._groups,r=t.length,i=new Array(r),l=0;l<r;++l)for(var s=t[l],c=s.length,f=i[l]=[],h,d=0;d<c;++d)(h=s[d])&&e.call(h,h.__data__,d,s)&&f.push(h);return new co(i,this._parents,this._name,this._id)}function OI(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,l=r.length,s=Math.min(i,l),c=new Array(i),f=0;f<s;++f)for(var h=t[f],d=r[f],m=h.length,p=c[f]=new Array(m),x,b=0;b<m;++b)(x=h[b]||d[b])&&(p[b]=x);for(;f<i;++f)c[f]=t[f];return new co(c,this._parents,this._name,this._id)}function DI(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function zI(e,t,r){var i,l,s=DI(t)?cy:Ar;return function(){var c=s(this,e),f=c.on;f!==i&&(l=(i=f).copy()).on(t,r),c.on=l}}function LI(e,t){var r=this._id;return arguments.length<2?lr(this.node(),r).on.on(e):this.each(zI(r,e,t))}function II(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function BI(){return this.on("end.remove",II(this._id))}function HI(e){var t=this._name,r=this._id;typeof e!="function"&&(e=oy(e));for(var i=this._groups,l=i.length,s=new Array(l),c=0;c<l;++c)for(var f=i[c],h=f.length,d=s[c]=new Array(h),m,p,x=0;x<h;++x)(m=f[x])&&(p=e.call(m,m.__data__,x,f))&&("__data__"in m&&(p.__data__=m.__data__),d[x]=p,td(d[x],t,r,x,d,lr(m,r)));return new co(s,this._parents,t,r)}function PI(e){var t=this._name,r=this._id;typeof e!="function"&&(e=ON(e));for(var i=this._groups,l=i.length,s=[],c=[],f=0;f<l;++f)for(var h=i[f],d=h.length,m,p=0;p<d;++p)if(m=h[p]){for(var x=e.call(m,m.__data__,p,h),b,E=lr(m,r),S=0,_=x.length;S<_;++S)(b=x[S])&&td(b,t,r,S,x,E);s.push(x),c.push(m)}return new co(s,c,t,r)}var UI=Ws.prototype.constructor;function VI(){return new UI(this._groups,this._parents)}function $I(e,t){var r,i,l;return function(){var s=Gl(this,e),c=(this.style.removeProperty(e),Gl(this,e));return s===c?null:s===r&&c===i?l:l=t(r=s,i=c)}}function o_(e){return function(){this.style.removeProperty(e)}}function YI(e,t,r){var i,l=r+"",s;return function(){var c=Gl(this,e);return c===l?null:c===i?s:s=t(i=c,r)}}function qI(e,t,r){var i,l,s;return function(){var c=Gl(this,e),f=r(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),Gl(this,e))),c===h?null:c===i&&h===l?s:(l=h,s=t(i=c,f))}}function FI(e,t){var r,i,l,s="style."+t,c="end."+s,f;return function(){var h=Ar(this,e),d=h.on,m=h.value[s]==null?f||(f=o_(t)):void 0;(d!==r||l!==m)&&(i=(r=d).copy()).on(c,l=m),h.on=i}}function XI(e,t,r){var i=(e+="")=="transform"?G4:r_;return t==null?this.styleTween(e,$I(e,i)).on("end.style."+e,o_(e)):typeof t=="function"?this.styleTween(e,qI(e,i,uy(this,"style."+e,t))).each(FI(this._id,e)):this.styleTween(e,YI(e,i,t),r).on("end.style."+e,null)}function GI(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function WI(e,t,r){var i,l;function s(){var c=t.apply(this,arguments);return c!==l&&(i=(l=c)&&GI(e,c,r)),i}return s._value=t,s}function ZI(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,WI(e,t,r??""))}function KI(e){return function(){this.textContent=e}}function QI(e){return function(){var t=e(this);this.textContent=t??""}}function JI(e){return this.tween("text",typeof e=="function"?QI(uy(this,"text",e)):KI(e==null?"":e+""))}function e6(e){return function(t){this.textContent=e.call(this,t)}}function t6(e){var t,r;function i(){var l=e.apply(this,arguments);return l!==r&&(t=(r=l)&&e6(l)),t}return i._value=e,i}function n6(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,t6(e))}function r6(){for(var e=this._name,t=this._id,r=i_(),i=this._groups,l=i.length,s=0;s<l;++s)for(var c=i[s],f=c.length,h,d=0;d<f;++d)if(h=c[d]){var m=lr(h,t);td(h,e,r,d,c,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new co(i,this._parents,e,r)}function o6(){var e,t,r=this,i=r._id,l=r.size();return new Promise(function(s,c){var f={value:c},h={value:function(){--l===0&&s()}};r.each(function(){var d=Ar(this,i),m=d.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),l===0&&s()})}var i6=0;function co(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function i_(){return++i6}var eo=Ws.prototype;co.prototype={constructor:co,select:HI,selectAll:PI,selectChild:eo.selectChild,selectChildren:eo.selectChildren,filter:MI,merge:OI,selection:VI,transition:r6,call:eo.call,nodes:eo.nodes,node:eo.node,size:eo.size,empty:eo.empty,each:eo.each,on:LI,attr:gI,attrTween:wI,style:XI,styleTween:ZI,text:JI,textTween:n6,remove:BI,tween:cI,delay:CI,duration:kI,ease:AI,easeVarying:jI,end:o6,[Symbol.iterator]:eo[Symbol.iterator]};function l6(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var a6={time:null,delay:0,duration:250,ease:l6};function s6(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function c6(e){var t,r;e instanceof co?(t=e._id,e=e._name):(t=i_(),(r=a6).time=sy(),e=e==null?null:e+"");for(var i=this._groups,l=i.length,s=0;s<l;++s)for(var c=i[s],f=c.length,h,d=0;d<f;++d)(h=c[d])&&td(h,e,t,d,c,r||s6(h,t));return new co(i,this._parents,e,t)}Ws.prototype.interrupt=lI;Ws.prototype.transition=c6;const Uu=e=>()=>e;function u6(e,{sourceEvent:t,target:r,transform:i,dispatch:l}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:l}})}function no(e,t,r){this.k=e,this.x=t,this.y=r}no.prototype={constructor:no,scale:function(e){return e===1?this:new no(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new no(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 nd=new no(1,0,0);l_.prototype=no.prototype;function l_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return nd;return e.__zoom}function np(e){e.stopImmediatePropagation()}function us(e){e.preventDefault(),e.stopImmediatePropagation()}function f6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function d6(){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 Mw(){return this.__zoom||nd}function h6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function m6(){return navigator.maxTouchPoints||"ontouchstart"in this}function p6(e,t,r){var i=e.invertX(t[0][0])-r[0][0],l=e.invertX(t[1][0])-r[1][0],s=e.invertY(t[0][1])-r[0][1],c=e.invertY(t[1][1])-r[1][1];return e.translate(l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l),c>s?(s+c)/2:Math.min(0,s)||Math.max(0,c))}function a_(){var e=f6,t=d6,r=p6,i=h6,l=m6,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,h=nf,d=Qf("start","zoom","end"),m,p,x,b=500,E=150,S=0,_=10;function N(O){O.property("__zoom",Mw).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",X).filter(l).on("touchstart.zoom",q).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(O,U,R,V){var $=O.selection?O.selection():O;$.property("__zoom",Mw),O!==$?L(O,U,R,V):$.interrupt().each(function(){j(this,arguments).event(V).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},N.scaleBy=function(O,U,R,V){N.scaleTo(O,function(){var $=this.__zoom.k,W=typeof U=="function"?U.apply(this,arguments):U;return $*W},R,V)},N.scaleTo=function(O,U,R,V){N.transform(O,function(){var $=t.apply(this,arguments),W=this.__zoom,M=R==null?A($):typeof R=="function"?R.apply(this,arguments):R,B=W.invert(M),G=typeof U=="function"?U.apply(this,arguments):U;return r(C(k(W,G),M,B),$,c)},R,V)},N.translateBy=function(O,U,R,V){N.transform(O,function(){return r(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),c)},null,V)},N.translateTo=function(O,U,R,V,$){N.transform(O,function(){var W=t.apply(this,arguments),M=this.__zoom,B=V==null?A(W):typeof V=="function"?V.apply(this,arguments):V;return r(nd.translate(B[0],B[1]).scale(M.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof R=="function"?-R.apply(this,arguments):-R),W,c)},V,$)};function k(O,U){return U=Math.max(s[0],Math.min(s[1],U)),U===O.k?O:new no(U,O.x,O.y)}function C(O,U,R){var V=U[0]-R[0]*O.k,$=U[1]-R[1]*O.k;return V===O.x&&$===O.y?O:new no(O.k,V,$)}function A(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function L(O,U,R,V){O.on("start.zoom",function(){j(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).event(V).end()}).tween("zoom",function(){var $=this,W=arguments,M=j($,W).event(V),B=t.apply($,W),G=R==null?A(B):typeof R=="function"?R.apply($,W):R,D=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),oe=$.__zoom,K=typeof U=="function"?U.apply($,W):U,J=h(oe.invert(G).concat(D/oe.k),K.invert(G).concat(D/K.k));return function(te){if(te===1)te=K;else{var ne=J(te),se=D/ne[2];te=new no(se,G[0]-ne[0]*se,G[1]-ne[1]*se)}M.zoom(null,te)}})}function j(O,U,R){return!R&&O.__zooming||new z(O,U)}function z(O,U){this.that=O,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,U),this.taps=0}z.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,U){return this.mouse&&O!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var U=Sn(this.that).datum();d.call(O,this.that,new u6(O,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:d}),U)}};function P(O,...U){if(!e.apply(this,arguments))return;var R=j(this,U).event(O),V=this.__zoom,$=Math.max(s[0],Math.min(s[1],V.k*Math.pow(2,i.apply(this,arguments)))),W=Zn(O);if(R.wheel)(R.mouse[0][0]!==W[0]||R.mouse[0][1]!==W[1])&&(R.mouse[1]=V.invert(R.mouse[0]=W)),clearTimeout(R.wheel);else{if(V.k===$)return;R.mouse=[W,V.invert(W)],lf(this),R.start()}us(O),R.wheel=setTimeout(M,E),R.zoom("mouse",r(C(k(V,$),R.mouse[0],R.mouse[1]),R.extent,c));function M(){R.wheel=null,R.end()}}function H(O,...U){if(x||!e.apply(this,arguments))return;var R=O.currentTarget,V=j(this,U,!0).event(O),$=Sn(O.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",D,!0),W=Zn(O,R),M=O.clientX,B=O.clientY;YN(O.view),np(O),V.mouse=[W,this.__zoom.invert(W)],lf(this),V.start();function G(oe){if(us(oe),!V.moved){var K=oe.clientX-M,J=oe.clientY-B;V.moved=K*K+J*J>S}V.event(oe).zoom("mouse",r(C(V.that.__zoom,V.mouse[0]=Zn(oe,R),V.mouse[1]),V.extent,c))}function D(oe){$.on("mousemove.zoom mouseup.zoom",null),qN(oe.view,V.moved),us(oe),V.event(oe).end()}}function X(O,...U){if(e.apply(this,arguments)){var R=this.__zoom,V=Zn(O.changedTouches?O.changedTouches[0]:O,this),$=R.invert(V),W=R.k*(O.shiftKey?.5:2),M=r(C(k(R,W),V,$),t.apply(this,U),c);us(O),f>0?Sn(this).transition().duration(f).call(L,M,V,O):Sn(this).call(N.transform,M,V,O)}}function q(O,...U){if(e.apply(this,arguments)){var R=O.touches,V=R.length,$=j(this,U,O.changedTouches.length===V).event(O),W,M,B,G;for(np(O),M=0;M<V;++M)B=R[M],G=Zn(B,this),G=[G,this.__zoom.invert(G),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==G[2]&&($.touch1=G,$.taps=0):($.touch0=G,W=!0,$.taps=1+!!m);m&&(m=clearTimeout(m)),W&&($.taps<2&&(p=G[0],m=setTimeout(function(){m=null},b)),lf(this),$.start())}}function F(O,...U){if(this.__zooming){var R=j(this,U).event(O),V=O.changedTouches,$=V.length,W,M,B,G;for(us(O),W=0;W<$;++W)M=V[W],B=Zn(M,this),R.touch0&&R.touch0[2]===M.identifier?R.touch0[0]=B:R.touch1&&R.touch1[2]===M.identifier&&(R.touch1[0]=B);if(M=R.that.__zoom,R.touch1){var D=R.touch0[0],oe=R.touch0[1],K=R.touch1[0],J=R.touch1[1],te=(te=K[0]-D[0])*te+(te=K[1]-D[1])*te,ne=(ne=J[0]-oe[0])*ne+(ne=J[1]-oe[1])*ne;M=k(M,Math.sqrt(te/ne)),B=[(D[0]+K[0])/2,(D[1]+K[1])/2],G=[(oe[0]+J[0])/2,(oe[1]+J[1])/2]}else if(R.touch0)B=R.touch0[0],G=R.touch0[1];else return;R.zoom("touch",r(C(M,B,G),R.extent,c))}}function Y(O,...U){if(this.__zooming){var R=j(this,U).event(O),V=O.changedTouches,$=V.length,W,M;for(np(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),W=0;W<$;++W)M=V[W],R.touch0&&R.touch0[2]===M.identifier?delete R.touch0:R.touch1&&R.touch1[2]===M.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&&(M=Zn(M,this),Math.hypot(p[0]-M[0],p[1]-M[1])<_)){var B=Sn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return N.wheelDelta=function(O){return arguments.length?(i=typeof O=="function"?O:Uu(+O),N):i},N.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Uu(!!O),N):e},N.touchable=function(O){return arguments.length?(l=typeof O=="function"?O:Uu(!!O),N):l},N.extent=function(O){return arguments.length?(t=typeof O=="function"?O:Uu([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),N):t},N.scaleExtent=function(O){return arguments.length?(s[0]=+O[0],s[1]=+O[1],N):[s[0],s[1]]},N.translateExtent=function(O){return arguments.length?(c[0][0]=+O[0][0],c[1][0]=+O[1][0],c[0][1]=+O[0][1],c[1][1]=+O[1][1],N):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},N.constrain=function(O){return arguments.length?(r=O,N):r},N.duration=function(O){return arguments.length?(f=+O,N):f},N.interpolate=function(O){return arguments.length?(h=O,N):h},N.on=function(){var O=d.on.apply(d,arguments);return O===d?N:O},N.clickDistance=function(O){return arguments.length?(S=(O=+O)*O,N):Math.sqrt(S)},N.tapDistance=function(O){return arguments.length?(_=+O,N):_},N}const Er={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:r,targetHandle:i})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:i}", 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."},Ds=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],s_=["Enter"," ","Escape"],c_={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Zl;(function(e){e.Strict="strict",e.Loose="loose"})(Zl||(Zl={}));var Ri;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ri||(Ri={}));var zs;(function(e){e.Partial="partial",e.Full="full"})(zs||(zs={}));const u_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Go;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Go||(Go={}));var Ls;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ls||(Ls={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));const Ow={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function f_(e){return e===null?null:e?"valid":"invalid"}const d_=e=>"id"in e&&"source"in e&&"target"in e,g6=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fy=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ks=(e,t=[0,0])=>{const{width:r,height:i}=fo(e),l=e.origin??t,s=r*l[0],c=i*l[1];return{x:e.position.x-s,y:e.position.y-c}},y6=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((i,l)=>{const s=typeof l=="string";let c=!t.nodeLookup&&!s?l:void 0;t.nodeLookup&&(c=s?t.nodeLookup.get(l):fy(l)?l:t.nodeLookup.get(l.id));const f=c?Af(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return rd(i,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return od(r)},Qs=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return e.forEach(l=>{(t.filter===void 0||t.filter(l))&&(r=rd(r,Af(l)),i=!0)}),i?od(r):{x:0,y:0,width:0,height:0}},dy=(e,t,[r,i,l]=[0,0,1],s=!1,c=!1)=>{const f={...ec(t,[r,i,l]),width:t.width/l,height:t.height/l},h=[];for(const d of e.values()){const{measured:m,selectable:p=!0,hidden:x=!1}=d;if(c&&!p||x)continue;const b=m.width??d.width??d.initialWidth??null,E=m.height??d.height??d.initialHeight??null,S=Is(f,Ql(d)),_=(b??0)*(E??0),N=s&&S>0;(!d.internals.handleBounds||N||S>=_||d.dragging)&&h.push(d)}return h},x6=(e,t)=>{const r=new Set;return e.forEach(i=>{r.add(i.id)}),t.filter(i=>r.has(i.source)||r.has(i.target))};function v6(e,t){const r=new Map,i=t?.nodes?new Set(t.nodes.map(l=>l.id)):null;return e.forEach(l=>{l.measured.width&&l.measured.height&&(t?.includeHiddenNodes||!l.hidden)&&(!i||i.has(l.id))&&r.set(l.id,l)}),r}async function b6({nodes:e,width:t,height:r,panZoom:i,minZoom:l,maxZoom:s},c){if(e.size===0)return Promise.resolve(!0);const f=v6(e,c),h=Qs(f),d=hy(h,t,r,c?.minZoom??l,c?.maxZoom??s,c?.padding??.1);return await i.setViewport(d,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function h_({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:i=[0,0],nodeExtent:l,onError:s}){const c=r.get(e),f=c.parentId?r.get(c.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},m=c.origin??i;let p=c.extent||l;if(c.extent==="parent"&&!c.expandParent)if(!f)s?.("005",Er.error005());else{const b=f.measured.width,E=f.measured.height;b&&E&&(p=[[h,d],[h+b,d+E]])}else f&&Jl(c.extent)&&(p=[[c.extent[0][0]+h,c.extent[0][1]+d],[c.extent[1][0]+h,c.extent[1][1]+d]]);const x=Jl(p)?Hi(t,p,c.measured):t;return(c.measured.width===void 0||c.measured.height===void 0)&&s?.("015",Er.error015()),{position:{x:x.x-h+(c.measured.width??0)*m[0],y:x.y-d+(c.measured.height??0)*m[1]},positionAbsolute:x}}async function w6({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:i,onBeforeDelete:l}){const s=new Set(e.map(x=>x.id)),c=[];for(const x of r){if(x.deletable===!1)continue;const b=s.has(x.id),E=!b&&x.parentId&&c.find(S=>S.id===x.parentId);(b||E)&&c.push(x)}const f=new Set(t.map(x=>x.id)),h=i.filter(x=>x.deletable!==!1),m=x6(c,h);for(const x of h)f.has(x.id)&&!m.find(E=>E.id===x.id)&&m.push(x);if(!l)return{edges:m,nodes:c};const p=await l({nodes:c,edges:m});return typeof p=="boolean"?p?{edges:m,nodes:c}:{edges:[],nodes:[]}:p}const Kl=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),Hi=(e={x:0,y:0},t,r)=>({x:Kl(e.x,t[0][0],t[1][0]-(r?.width??0)),y:Kl(e.y,t[0][1],t[1][1]-(r?.height??0))});function m_(e,t,r){const{width:i,height:l}=fo(r),{x:s,y:c}=r.internals.positionAbsolute;return Hi(e,[[s,c],[s+i,c+l]],t)}const Dw=(e,t,r)=>e<t?Kl(Math.abs(e-t),1,t)/t:e>r?-Kl(Math.abs(e-r),1,t)/t:0,p_=(e,t,r=15,i=40)=>{const l=Dw(e.x,i,t.width-i)*r,s=Dw(e.y,i,t.height-i)*r;return[l,s]},rd=(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)}),Qp=({x:e,y:t,width:r,height:i})=>({x:e,y:t,x2:e+r,y2:t+i}),od=({x:e,y:t,x2:r,y2:i})=>({x:e,y:t,width:r-e,height:i-t}),Ql=(e,t=[0,0])=>{const{x:r,y:i}=fy(e)?e.internals.positionAbsolute:Ks(e,t);return{x:r,y:i,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Af=(e,t=[0,0])=>{const{x:r,y:i}=fy(e)?e.internals.positionAbsolute:Ks(e,t);return{x:r,y:i,x2:r+(e.measured?.width??e.width??e.initialWidth??0),y2:i+(e.measured?.height??e.height??e.initialHeight??0)}},g_=(e,t)=>od(rd(Qp(e),Qp(t))),Is=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*i)},zw=e=>Jn(e.width)&&Jn(e.height)&&Jn(e.x)&&Jn(e.y),Jn=e=>!isNaN(e)&&isFinite(e),S6=(e,t)=>{},Js=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ec=({x:e,y:t},[r,i,l],s=!1,c=[1,1])=>{const f={x:(e-r)/l,y:(t-i)/l};return s?Js(f,c):f},Rf=({x:e,y:t},[r,i,l])=>({x:e*l+r,y:t*l+i});function Ol(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function E6(e,t,r){if(typeof e=="string"||typeof e=="number"){const i=Ol(e,r),l=Ol(e,t);return{top:i,right:l,bottom:i,left:l,x:l*2,y:i*2}}if(typeof e=="object"){const i=Ol(e.top??e.y??0,r),l=Ol(e.bottom??e.y??0,r),s=Ol(e.left??e.x??0,t),c=Ol(e.right??e.x??0,t);return{top:i,right:c,bottom:l,left:s,x:s+c,y:i+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function C6(e,t,r,i,l,s){const{x:c,y:f}=Rf(e,[t,r,i]),{x:h,y:d}=Rf({x:e.x+e.width,y:e.y+e.height},[t,r,i]),m=l-h,p=s-d;return{left:Math.floor(c),top:Math.floor(f),right:Math.floor(m),bottom:Math.floor(p)}}const hy=(e,t,r,i,l,s)=>{const c=E6(s,t,r),f=(t-c.x)/e.width,h=(r-c.y)/e.height,d=Math.min(f,h),m=Kl(d,i,l),p=e.x+e.width/2,x=e.y+e.height/2,b=t/2-p*m,E=r/2-x*m,S=C6(e,b,E,m,t,r),_={left:Math.min(S.left-c.left,0),top:Math.min(S.top-c.top,0),right:Math.min(S.right-c.right,0),bottom:Math.min(S.bottom-c.bottom,0)};return{x:b-_.left+_.right,y:E-_.top+_.bottom,zoom:m}},Bs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Jl(e){return e!=null&&e!=="parent"}function fo(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function y_(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function x_(e,t={width:0,height:0},r,i,l){const s={...e},c=i.get(r);if(c){const f=c.origin||l;s.x+=c.internals.positionAbsolute.x-(t.width??0)*f[0],s.y+=c.internals.positionAbsolute.y-(t.height??0)*f[1]}return s}function Lw(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function N6(){let e,t;return{promise:new Promise((i,l)=>{e=i,t=l}),resolve:e,reject:t}}function _6(e){return{...c_,...e||{}}}function vs(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:i,containerBounds:l}){const{x:s,y:c}=er(e),f=ec({x:s-(l?.left??0),y:c-(l?.top??0)},i),{x:h,y:d}=r?Js(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const my=e=>({width:e.offsetWidth,height:e.offsetHeight}),v_=e=>e?.getRootNode?.()||window?.document,k6=["INPUT","SELECT","TEXTAREA"];function b_(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:k6.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const w_=e=>"clientX"in e,er=(e,t)=>{const r=w_(e),i=r?e.clientX:e.touches?.[0].clientX,l=r?e.clientY:e.touches?.[0].clientY;return{x:i-(t?.left??0),y:l-(t?.top??0)}},Iw=(e,t,r,i,l)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(c=>{const f=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:l,position:c.getAttribute("data-handlepos"),x:(f.left-r.left)/i,y:(f.top-r.top)/i,...my(c)}})};function S_({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:f}){const h=e*.125+l*.375+c*.375+r*.125,d=t*.125+s*.375+f*.375+i*.125,m=Math.abs(h-e),p=Math.abs(d-t);return[h,d,m,p]}function Vu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Bw({pos:e,x1:t,y1:r,x2:i,y2:l,c:s}){switch(e){case Ce.Left:return[t-Vu(t-i,s),r];case Ce.Right:return[t+Vu(i-t,s),r];case Ce.Top:return[t,r-Vu(r-l,s)];case Ce.Bottom:return[t,r+Vu(l-r,s)]}}function E_({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:i,targetY:l,targetPosition:s=Ce.Top,curvature:c=.25}){const[f,h]=Bw({pos:r,x1:e,y1:t,x2:i,y2:l,c}),[d,m]=Bw({pos:s,x1:i,y1:l,x2:e,y2:t,c}),[p,x,b,E]=S_({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:m});return[`M${e},${t} C${f},${h} ${d},${m} ${i},${l}`,p,x,b,E]}function C_({sourceX:e,sourceY:t,targetX:r,targetY:i}){const l=Math.abs(r-e)/2,s=r<e?r+l:r-l,c=Math.abs(i-t)/2,f=i<t?i+c:i-c;return[s,f,l,c]}function T6({sourceNode:e,targetNode:t,selected:r=!1,zIndex:i=0,elevateOnSelect:l=!1,zIndexMode:s="basic"}){if(s==="manual")return i;const c=l&&r?i+1e3:i,f=Math.max(e.parentId||l&&e.selected?e.internals.z:0,t.parentId||l&&t.selected?t.internals.z:0);return c+f}function A6({sourceNode:e,targetNode:t,width:r,height:i,transform:l}){const s=rd(Af(e),Af(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const c={x:-l[0]/l[2],y:-l[1]/l[2],width:r/l[2],height:i/l[2]};return Is(c,od(s))>0}const R6=({source:e,sourceHandle:t,target:r,targetHandle:i})=>`xy-edge__${e}${t||""}-${r}${i||""}`,j6=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),M6=(e,t,r={})=>{if(!e.source||!e.target)return t;const i=r.getEdgeId||R6;let l;return d_(e)?l={...e}:l={...e,id:i(e)},j6(l,t)?t:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,t.concat(l))};function N_({sourceX:e,sourceY:t,targetX:r,targetY:i}){const[l,s,c,f]=C_({sourceX:e,sourceY:t,targetX:r,targetY:i});return[`M ${e},${t}L ${r},${i}`,l,s,c,f]}const Hw={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},O6=({source:e,sourcePosition:t=Ce.Bottom,target:r})=>t===Ce.Left||t===Ce.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},Pw=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function D6({source:e,sourcePosition:t=Ce.Bottom,target:r,targetPosition:i=Ce.Top,center:l,offset:s,stepPosition:c}){const f=Hw[t],h=Hw[i],d={x:e.x+f.x*s,y:e.y+f.y*s},m={x:r.x+h.x*s,y:r.y+h.y*s},p=O6({source:d,sourcePosition:t,target:m}),x=p.x!==0?"x":"y",b=p[x];let E=[],S,_;const N={x:0,y:0},k={x:0,y:0},[,,C,A]=C_({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(f[x]*h[x]===-1){x==="x"?(S=l.x??d.x+(m.x-d.x)*c,_=l.y??(d.y+m.y)/2):(S=l.x??(d.x+m.x)/2,_=l.y??d.y+(m.y-d.y)*c);const j=[{x:S,y:d.y},{x:S,y:m.y}],z=[{x:d.x,y:_},{x:m.x,y:_}];f[x]===b?E=x==="x"?j:z:E=x==="x"?z:j}else{const j=[{x:d.x,y:m.y}],z=[{x:m.x,y:d.y}];if(x==="x"?E=f.x===b?z:j:E=f.y===b?j:z,t===i){const F=Math.abs(e[x]-r[x]);if(F<=s){const Y=Math.min(s-1,s-F);f[x]===b?N[x]=(d[x]>e[x]?-1:1)*Y:k[x]=(m[x]>r[x]?-1:1)*Y}}if(t!==i){const F=x==="x"?"y":"x",Y=f[x]===h[F],O=d[F]>m[F],U=d[F]<m[F];(f[x]===1&&(!Y&&O||Y&&U)||f[x]!==1&&(!Y&&U||Y&&O))&&(E=x==="x"?j:z)}const P={x:d.x+N.x,y:d.y+N.y},H={x:m.x+k.x,y:m.y+k.y},X=Math.max(Math.abs(P.x-E[0].x),Math.abs(H.x-E[0].x)),q=Math.max(Math.abs(P.y-E[0].y),Math.abs(H.y-E[0].y));X>=q?(S=(P.x+H.x)/2,_=E[0].y):(S=E[0].x,_=(P.y+H.y)/2)}return[[e,{x:d.x+N.x,y:d.y+N.y},...E,{x:m.x+k.x,y:m.y+k.y},r],S,_,C,A]}function z6(e,t,r,i){const l=Math.min(Pw(e,t)/2,Pw(t,r)/2,i),{x:s,y:c}=t;if(e.x===s&&s===r.x||e.y===c&&c===r.y)return`L${s} ${c}`;if(e.y===c){const d=e.x<r.x?-1:1,m=e.y<r.y?1:-1;return`L ${s+l*d},${c}Q ${s},${c} ${s},${c+l*m}`}const f=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${s},${c+l*h}Q ${s},${c} ${s+l*f},${c}`}function Jp({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:i,targetY:l,targetPosition:s=Ce.Top,borderRadius:c=5,centerX:f,centerY:h,offset:d=20,stepPosition:m=.5}){const[p,x,b,E,S]=D6({source:{x:e,y:t},sourcePosition:r,target:{x:i,y:l},targetPosition:s,center:{x:f,y:h},offset:d,stepPosition:m});return[p.reduce((N,k,C)=>{let A="";return C>0&&C<p.length-1?A=z6(p[C-1],k,p[C+1],c):A=`${C===0?"M":"L"}${k.x} ${k.y}`,N+=A,N},""),x,b,E,S]}function Uw(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function L6(e){const{sourceNode:t,targetNode:r}=e;if(!Uw(t)||!Uw(r))return null;const i=t.internals.handleBounds||Vw(t.handles),l=r.internals.handleBounds||Vw(r.handles),s=$w(i?.source??[],e.sourceHandle),c=$w(e.connectionMode===Zl.Strict?l?.target??[]:(l?.target??[]).concat(l?.source??[]),e.targetHandle);if(!s||!c)return e.onError?.("008",Er.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=s?.position||Ce.Bottom,h=c?.position||Ce.Top,d=Pi(t,s,f),m=Pi(r,c,h);return{sourceX:d.x,sourceY:d.y,targetX:m.x,targetY:m.y,sourcePosition:f,targetPosition:h}}function Vw(e){if(!e)return null;const t=[],r=[];for(const i of e)i.width=i.width??1,i.height=i.height??1,i.type==="source"?t.push(i):i.type==="target"&&r.push(i);return{source:t,target:r}}function Pi(e,t,r=Ce.Left,i=!1){const l=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:c,height:f}=t??fo(e);if(i)return{x:l+c/2,y:s+f/2};switch(t?.position??r){case Ce.Top:return{x:l+c/2,y:s};case Ce.Right:return{x:l+c,y:s+f/2};case Ce.Bottom:return{x:l+c/2,y:s+f};case Ce.Left:return{x:l,y:s+f/2}}}function $w(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function eg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function I6(e,{id:t,defaultColor:r,defaultMarkerStart:i,defaultMarkerEnd:l}){const s=new Set;return e.reduce((c,f)=>([f.markerStart||i,f.markerEnd||l].forEach(h=>{if(h&&typeof h=="object"){const d=eg(h,t);s.has(d)||(c.push({id:d,color:h.color||r,...h}),s.add(d))}}),c),[]).sort((c,f)=>c.id.localeCompare(f.id))}const __=1e3,B6=10,py={nodeOrigin:[0,0],nodeExtent:Ds,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},H6={...py,checkEquality:!0};function gy(e,t){const r={...e};for(const i in t)t[i]!==void 0&&(r[i]=t[i]);return r}function P6(e,t,r){const i=gy(py,r);for(const l of e.values())if(l.parentId)xy(l,e,t,i);else{const s=Ks(l,i.nodeOrigin),c=Jl(l.extent)?l.extent:i.nodeExtent,f=Hi(s,c,fo(l));l.internals.positionAbsolute=f}}function U6(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const r=[],i=[];for(const l of e.handles){const s={id:l.id,width:l.width??1,height:l.height??1,nodeId:e.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?r.push(s):l.type==="target"&&i.push(s)}return{source:r,target:i}}function yy(e){return e==="manual"}function tg(e,t,r,i={}){const l=gy(H6,i),s={i:0},c=new Map(t),f=l?.elevateNodesOnSelect&&!yy(l.zIndexMode)?__:0;let h=e.length>0;t.clear(),r.clear();for(const d of e){let m=c.get(d.id);if(l.checkEquality&&d===m?.internals.userNode)t.set(d.id,m);else{const p=Ks(d,l.nodeOrigin),x=Jl(d.extent)?d.extent:l.nodeExtent,b=Hi(p,x,fo(d));m={...l.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:b,handleBounds:U6(d,m),z:k_(d,f,l.zIndexMode),userNode:d}},t.set(d.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(h=!1),d.parentId&&xy(m,t,r,i,s)}return h}function V6(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function xy(e,t,r,i,l){const{elevateNodesOnSelect:s,nodeOrigin:c,nodeExtent:f,zIndexMode:h}=gy(py,i),d=e.parentId,m=t.get(d);if(!m){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}V6(e,r),l&&!m.parentId&&m.internals.rootParentIndex===void 0&&h==="auto"&&(m.internals.rootParentIndex=++l.i,m.internals.z=m.internals.z+l.i*B6),l&&m.internals.rootParentIndex!==void 0&&(l.i=m.internals.rootParentIndex);const p=s&&!yy(h)?__:0,{x,y:b,z:E}=$6(e,m,c,f,p,h),{positionAbsolute:S}=e.internals,_=x!==S.x||b!==S.y;(_||E!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:_?{x,y:b}:S,z:E}})}function k_(e,t,r){const i=Jn(e.zIndex)?e.zIndex:0;return yy(r)?i:i+(e.selected?t:0)}function $6(e,t,r,i,l,s){const{x:c,y:f}=t.internals.positionAbsolute,h=fo(e),d=Ks(e,r),m=Jl(e.extent)?Hi(d,e.extent,h):d;let p=Hi({x:c+m.x,y:f+m.y},i,h);e.extent==="parent"&&(p=m_(p,h,t));const x=k_(e,l,s),b=t.internals.z??0;return{x:p.x,y:p.y,z:b>=x?b+1:x}}function vy(e,t,r,i=[0,0]){const l=[],s=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const h=s.get(c.parentId)?.expandedRect??Ql(f),d=g_(h,c.rect);s.set(c.parentId,{expandedRect:d,parent:f})}return s.size>0&&s.forEach(({expandedRect:c,parent:f},h)=>{const d=f.internals.positionAbsolute,m=fo(f),p=f.origin??i,x=c.x<d.x?Math.round(Math.abs(d.x-c.x)):0,b=c.y<d.y?Math.round(Math.abs(d.y-c.y)):0,E=Math.max(m.width,Math.round(c.width)),S=Math.max(m.height,Math.round(c.height)),_=(E-m.width)*p[0],N=(S-m.height)*p[1];(x>0||b>0||_||N)&&(l.push({id:h,type:"position",position:{x:f.position.x-x+_,y:f.position.y-b+N}}),r.get(h)?.forEach(k=>{e.some(C=>C.id===k.id)||l.push({id:k.id,type:"position",position:{x:k.position.x+x,y:k.position.y+b}})})),(m.width<c.width||m.height<c.height||x||b)&&l.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(x?p[0]*x-_:0),height:S+(b?p[1]*b-N:0)}})}),l}function Y6(e,t,r,i,l,s,c){const f=i?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],m=window.getComputedStyle(f),{m22:p}=new window.DOMMatrixReadOnly(m.transform),x=[];for(const b of e.values()){const E=t.get(b.id);if(!E)continue;if(E.hidden){t.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const S=my(b.nodeElement),_=E.measured.width!==S.width||E.measured.height!==S.height;if(!!(S.width&&S.height&&(_||!E.internals.handleBounds||b.force))){const k=b.nodeElement.getBoundingClientRect(),C=Jl(E.extent)?E.extent:s;let{positionAbsolute:A}=E.internals;E.parentId&&E.extent==="parent"?A=m_(A,S,t.get(E.parentId)):C&&(A=Hi(A,C,S));const L={...E,measured:S,internals:{...E.internals,positionAbsolute:A,handleBounds:{source:Iw("source",b.nodeElement,k,p,E.id),target:Iw("target",b.nodeElement,k,p,E.id)}}};t.set(E.id,L),E.parentId&&xy(L,t,r,{nodeOrigin:l,zIndexMode:c}),h=!0,_&&(d.push({id:E.id,type:"dimensions",dimensions:S}),E.expandParent&&E.parentId&&x.push({id:E.id,parentId:E.parentId,rect:Ql(L,l)}))}}if(x.length>0){const b=vy(x,t,r,l);d.push(...b)}return{changes:d,updatedInternals:h}}async function q6({delta:e,panZoom:t,transform:r,translateExtent:i,width:l,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const c=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[l,s]],i),f=!!c&&(c.x!==r[0]||c.y!==r[1]||c.k!==r[2]);return Promise.resolve(f)}function Yw(e,t,r,i,l,s){let c=l;const f=i.get(c)||new Map;i.set(c,f.set(r,t)),c=`${l}-${e}`;const h=i.get(c)||new Map;if(i.set(c,h.set(r,t)),s){c=`${l}-${e}-${s}`;const d=i.get(c)||new Map;i.set(c,d.set(r,t))}}function T_(e,t,r){e.clear(),t.clear();for(const i of r){const{source:l,target:s,sourceHandle:c=null,targetHandle:f=null}=i,h={edgeId:i.id,source:l,target:s,sourceHandle:c,targetHandle:f},d=`${l}-${c}--${s}-${f}`,m=`${s}-${f}--${l}-${c}`;Yw("source",h,m,e,l,c),Yw("target",h,d,e,s,f),t.set(i.id,i)}}function A_(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:A_(r,t):!1}function qw(e,t,r){let i=e;do{if(i?.matches?.(t))return!0;if(i===r)return!1;i=i?.parentElement}while(i);return!1}function F6(e,t,r,i){const l=new Map;for(const[s,c]of e)if((c.selected||c.id===i)&&(!c.parentId||!A_(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const f=e.get(s);f&&l.set(s,{id:s,position:f.position||{x:0,y:0},distance:{x:r.x-f.internals.positionAbsolute.x,y:r.y-f.internals.positionAbsolute.y},extent:f.extent,parentId:f.parentId,origin:f.origin,expandParent:f.expandParent,internals:{positionAbsolute:f.internals.positionAbsolute||{x:0,y:0}},measured:{width:f.measured.width??0,height:f.measured.height??0}})}return l}function rp({nodeId:e,dragItems:t,nodeLookup:r,dragging:i=!0}){const l=[];for(const[c,f]of t){const h=r.get(c)?.internals.userNode;h&&l.push({...h,position:f.position,dragging:i})}if(!e)return[l[0],l];const s=r.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:i}:l[0],l]}function X6({dragItems:e,snapGrid:t,x:r,y:i}){const l=e.values().next().value;if(!l)return null;const s={x:r-l.distance.x,y:i-l.distance.y},c=Js(s,t);return{x:c.x-s.x,y:c.y-s.y}}function G6({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:i,onDragStop:l}){let s={x:null,y:null},c=0,f=new Map,h=!1,d={x:0,y:0},m=null,p=!1,x=null,b=!1,E=!1,S=null;function _({noDragClassName:k,handleSelector:C,domNode:A,isSelectable:L,nodeId:j,nodeClickDistance:z=0}){x=Sn(A);function P({x:F,y:Y}){const{nodeLookup:O,nodeExtent:U,snapGrid:R,snapToGrid:V,nodeOrigin:$,onNodeDrag:W,onSelectionDrag:M,onError:B,updateNodePositions:G}=t();s={x:F,y:Y};let D=!1;const oe=f.size>1,K=oe&&U?Qp(Qs(f)):null,J=oe&&V?X6({dragItems:f,snapGrid:R,x:F,y:Y}):null;for(const[te,ne]of f){if(!O.has(te))continue;let se={x:F-ne.distance.x,y:Y-ne.distance.y};V&&(se=J?{x:Math.round(se.x+J.x),y:Math.round(se.y+J.y)}:Js(se,R));let he=null;if(oe&&U&&!ne.extent&&K){const{positionAbsolute:xe}=ne.internals,_e=xe.x-K.x+U[0][0],$e=xe.x+ne.measured.width-K.x2+U[1][0],Pe=xe.y-K.y+U[0][1],st=xe.y+ne.measured.height-K.y2+U[1][1];he=[[_e,Pe],[$e,st]]}const{position:me,positionAbsolute:ge}=h_({nodeId:te,nextPosition:se,nodeLookup:O,nodeExtent:he||U,nodeOrigin:$,onError:B});D=D||ne.position.x!==me.x||ne.position.y!==me.y,ne.position=me,ne.internals.positionAbsolute=ge}if(E=E||D,!!D&&(G(f,!0),S&&(i||W||!j&&M))){const[te,ne]=rp({nodeId:j,dragItems:f,nodeLookup:O});i?.(S,f,te,ne),W?.(S,te,ne),j||M?.(S,ne)}}async function H(){if(!m)return;const{transform:F,panBy:Y,autoPanSpeed:O,autoPanOnNodeDrag:U}=t();if(!U){h=!1,cancelAnimationFrame(c);return}const[R,V]=p_(d,m,O);(R!==0||V!==0)&&(s.x=(s.x??0)-R/F[2],s.y=(s.y??0)-V/F[2],await Y({x:R,y:V})&&P(s)),c=requestAnimationFrame(H)}function X(F){const{nodeLookup:Y,multiSelectionActive:O,nodesDraggable:U,transform:R,snapGrid:V,snapToGrid:$,selectNodesOnDrag:W,onNodeDragStart:M,onSelectionDragStart:B,unselectNodesAndEdges:G}=t();p=!0,(!W||!L)&&!O&&j&&(Y.get(j)?.selected||G()),L&&W&&j&&e?.(j);const D=vs(F.sourceEvent,{transform:R,snapGrid:V,snapToGrid:$,containerBounds:m});if(s=D,f=F6(Y,U,D,j),f.size>0&&(r||M||!j&&B)){const[oe,K]=rp({nodeId:j,dragItems:f,nodeLookup:Y});r?.(F.sourceEvent,f,oe,K),M?.(F.sourceEvent,oe,K),j||B?.(F.sourceEvent,K)}}const q=FN().clickDistance(z).on("start",F=>{const{domNode:Y,nodeDragThreshold:O,transform:U,snapGrid:R,snapToGrid:V}=t();m=Y?.getBoundingClientRect()||null,b=!1,E=!1,S=F.sourceEvent,O===0&&X(F),s=vs(F.sourceEvent,{transform:U,snapGrid:R,snapToGrid:V,containerBounds:m}),d=er(F.sourceEvent,m)}).on("drag",F=>{const{autoPanOnNodeDrag:Y,transform:O,snapGrid:U,snapToGrid:R,nodeDragThreshold:V,nodeLookup:$}=t(),W=vs(F.sourceEvent,{transform:O,snapGrid:U,snapToGrid:R,containerBounds:m});if(S=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||j&&!$.has(j))&&(b=!0),!b){if(!h&&Y&&p&&(h=!0,H()),!p){const M=er(F.sourceEvent,m),B=M.x-d.x,G=M.y-d.y;Math.sqrt(B*B+G*G)>V&&X(F)}(s.x!==W.xSnapped||s.y!==W.ySnapped)&&f&&p&&(d=er(F.sourceEvent,m),P(W))}}).on("end",F=>{if(!(!p||b)&&(h=!1,p=!1,cancelAnimationFrame(c),f.size>0)){const{nodeLookup:Y,updateNodePositions:O,onNodeDragStop:U,onSelectionDragStop:R}=t();if(E&&(O(f,!1),E=!1),l||U||!j&&R){const[V,$]=rp({nodeId:j,dragItems:f,nodeLookup:Y,dragging:!1});l?.(F.sourceEvent,f,V,$),U?.(F.sourceEvent,V,$),j||R?.(F.sourceEvent,$)}}}).filter(F=>{const Y=F.target;return!F.button&&(!k||!qw(Y,`.${k}`,A))&&(!C||qw(Y,C,A))});x.call(q)}function N(){x?.on(".drag",null)}return{update:_,destroy:N}}function W6(e,t,r){const i=[],l={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const s of t.values())Is(l,Ql(s))>0&&i.push(s);return i}const Z6=250;function K6(e,t,r,i){let l=[],s=1/0;const c=W6(e,r,t+Z6);for(const f of c){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(i.nodeId===d.nodeId&&i.type===d.type&&i.id===d.id)continue;const{x:m,y:p}=Pi(f,d,d.position,!0),x=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(p-e.y,2));x>t||(x<s?(l=[{...d,x:m,y:p}],s=x):x===s&&l.push({...d,x:m,y:p}))}}if(!l.length)return null;if(l.length>1){const f=i.type==="source"?"target":"source";return l.find(h=>h.type===f)??l[0]}return l[0]}function R_(e,t,r,i,l,s=!1){const c=i.get(e);if(!c)return null;const f=l==="strict"?c.internals.handleBounds?.[t]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],h=(r?f?.find(d=>d.id===r):f?.[0])??null;return h&&s?{...h,...Pi(c,h,h.position,!0)}:h}function j_(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Q6(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const M_=()=>!0;function J6(e,{connectionMode:t,connectionRadius:r,handleId:i,nodeId:l,edgeUpdaterType:s,isTarget:c,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:m,flowId:p,panBy:x,cancelConnection:b,onConnectStart:E,onConnect:S,onConnectEnd:_,isValidConnection:N=M_,onReconnectEnd:k,updateConnection:C,getTransform:A,getFromHandle:L,autoPanSpeed:j,dragThreshold:z=1,handleDomNode:P}){const H=v_(e.target);let X=0,q;const{x:F,y:Y}=er(e),O=j_(s,P),U=f?.getBoundingClientRect();let R=!1;if(!U||!O)return;const V=R_(l,O,i,h,t);if(!V)return;let $=er(e,U),W=!1,M=null,B=!1,G=null;function D(){if(!m||!U)return;const[me,ge]=p_($,U,j);x({x:me,y:ge}),X=requestAnimationFrame(D)}const oe={...V,nodeId:l,type:O,position:V.position},K=h.get(l);let te={inProgress:!0,isValid:null,from:Pi(K,oe,Ce.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:K,to:$,toHandle:null,toPosition:Ow[oe.position],toNode:null,pointer:$};function ne(){R=!0,C(te),E?.(e,{nodeId:l,handleId:i,handleType:O})}z===0&&ne();function se(me){if(!R){const{x:st,y:fn}=er(me),Vt=st-F,Kt=fn-Y;if(!(Vt*Vt+Kt*Kt>z*z))return;ne()}if(!L()||!oe){he(me);return}const ge=A();$=er(me,U),q=K6(ec($,ge,!1,[1,1]),r,h,oe),W||(D(),W=!0);const xe=O_(me,{handle:q,connectionMode:t,fromNodeId:l,fromHandleId:i,fromType:c?"target":"source",isValidConnection:N,doc:H,lib:d,flowId:p,nodeLookup:h});G=xe.handleDomNode,M=xe.connection,B=Q6(!!q,xe.isValid);const _e=h.get(l),$e=_e?Pi(_e,oe,Ce.Left,!0):te.from,Pe={...te,from:$e,isValid:B,to:xe.toHandle&&B?Rf({x:xe.toHandle.x,y:xe.toHandle.y},ge):$,toHandle:xe.toHandle,toPosition:B&&xe.toHandle?xe.toHandle.position:Ow[oe.position],toNode:xe.toHandle?h.get(xe.toHandle.nodeId):null,pointer:$};C(Pe),te=Pe}function he(me){if(!("touches"in me&&me.touches.length>0)){if(R){(q||G)&&M&&B&&S?.(M);const{inProgress:ge,...xe}=te,_e={...xe,toPosition:te.toHandle?te.toPosition:null};_?.(me,_e),s&&k?.(me,_e)}b(),cancelAnimationFrame(X),W=!1,B=!1,M=null,G=null,H.removeEventListener("mousemove",se),H.removeEventListener("mouseup",he),H.removeEventListener("touchmove",se),H.removeEventListener("touchend",he)}}H.addEventListener("mousemove",se),H.addEventListener("mouseup",he),H.addEventListener("touchmove",se),H.addEventListener("touchend",he)}function O_(e,{handle:t,connectionMode:r,fromNodeId:i,fromHandleId:l,fromType:s,doc:c,lib:f,flowId:h,isValidConnection:d=M_,nodeLookup:m}){const p=s==="target",x=t?c.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:b,y:E}=er(e),S=c.elementFromPoint(b,E),_=S?.classList.contains(`${f}-flow__handle`)?S:x,N={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const k=j_(void 0,_),C=_.getAttribute("data-nodeid"),A=_.getAttribute("data-handleid"),L=_.classList.contains("connectable"),j=_.classList.contains("connectableend");if(!C||!k)return N;const z={source:p?C:i,sourceHandle:p?A:l,target:p?i:C,targetHandle:p?l:A};N.connection=z;const H=L&&j&&(r===Zl.Strict?p&&k==="source"||!p&&k==="target":C!==i||A!==l);N.isValid=H&&d(z),N.toHandle=R_(C,k,A,m,r,!0)}return N}const ng={onPointerDown:J6,isValid:O_};function eB({domNode:e,panZoom:t,getTransform:r,getViewScale:i}){const l=Sn(e);function s({translateExtent:f,width:h,height:d,zoomStep:m=1,pannable:p=!0,zoomable:x=!0,inversePan:b=!1}){const E=C=>{if(C.sourceEvent.type!=="wheel"||!t)return;const A=r(),L=C.sourceEvent.ctrlKey&&Bs()?10:1,j=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*m,z=A[2]*Math.pow(2,j*L);t.scaleTo(z)};let S=[0,0];const _=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(S=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},N=C=>{const A=r();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const L=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],j=[L[0]-S[0],L[1]-S[1]];S=L;const z=i()*Math.max(A[2],Math.log(A[2]))*(b?-1:1),P={x:A[0]-j[0]*z,y:A[1]-j[1]*z},H=[[0,0],[h,d]];t.setViewportConstrained({x:P.x,y:P.y,zoom:A[2]},H,f)},k=a_().on("start",_).on("zoom",p?N:null).on("zoom.wheel",x?E:null);l.call(k,{})}function c(){l.on("zoom",null)}return{update:s,destroy:c,pointer:Zn}}const id=e=>({x:e.x,y:e.y,zoom:e.k}),op=({x:e,y:t,zoom:r})=>nd.translate(e,t).scale(r),Ll=(e,t)=>e.target.closest(`.${t}`),D_=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),tB=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ip=(e,t=0,r=tB,i=()=>{})=>{const l=typeof t=="number"&&t>0;return l||i(),l?e.transition().duration(t).ease(r).on("end",i):e},z_=e=>{const t=e.ctrlKey&&Bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function nB({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:i,panOnScrollMode:l,panOnScrollSpeed:s,zoomOnPinch:c,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return m=>{if(Ll(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const p=r.property("__zoom").k||1;if(m.ctrlKey&&c){const _=Zn(m),N=z_(m),k=p*Math.pow(2,N);i.scaleTo(r,k,_,m);return}const x=m.deltaMode===1?20:1;let b=l===Ri.Vertical?0:m.deltaX*x,E=l===Ri.Horizontal?0:m.deltaY*x;!Bs()&&m.shiftKey&&l!==Ri.Vertical&&(b=m.deltaY*x,E=0),i.translateBy(r,-(b/p)*s,-(E/p)*s,{internal:!0});const S=id(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(m,S),e.panScrollTimeout=setTimeout(()=>{d?.(m,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(m,S))}}function rB({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(i,l){const s=i.type==="wheel",c=!t&&s&&!i.ctrlKey,f=Ll(i,e);if(i.ctrlKey&&s&&f&&i.preventDefault(),c||f)return null;i.preventDefault(),r.call(this,i,l)}}function oB({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return i=>{if(i.sourceEvent?.internal)return;const l=id(i.transform);e.mouseButton=i.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=l,i.sourceEvent?.type==="mousedown"&&t(!0),r&&r?.(i.sourceEvent,l)}}function iB({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:i,onPanZoom:l}){return s=>{e.usedRightMouseButton=!!(r&&D_(t,e.mouseButton??0)),s.sourceEvent?.sync||i([s.transform.x,s.transform.y,s.transform.k]),l&&!s.sourceEvent?.internal&&l?.(s.sourceEvent,id(s.transform))}}function lB({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:i,onPanZoomEnd:l,onPaneContextMenu:s}){return c=>{if(!c.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&D_(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&s(c.sourceEvent),e.usedRightMouseButton=!1,i(!1),l)){const f=id(c.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{l?.(c.sourceEvent,f)},r?150:0)}}}function aB({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:i,panOnScroll:l,zoomOnDoubleClick:s,userSelectionActive:c,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:m}){return p=>{const x=e||t,b=r&&p.ctrlKey,E=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Ll(p,`${d}-flow__node`)||Ll(p,`${d}-flow__edge`)))return!0;if(!i&&!x&&!l&&!s&&!r||c||m&&!E||Ll(p,f)&&E||Ll(p,h)&&(!E||l&&E&&!e)||!r&&p.ctrlKey&&E)return!1;if(!r&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!x&&!l&&!b&&E||!i&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(i)&&!i.includes(p.button)&&p.type==="mousedown")return!1;const S=Array.isArray(i)&&i.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||E)&&S}}function sB({domNode:e,minZoom:t,maxZoom:r,translateExtent:i,viewport:l,onPanZoom:s,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),p=a_().scaleExtent([t,r]).translateExtent(i),x=Sn(e).call(p);k({x:l.x,y:l.y,zoom:Kl(l.zoom,t,r)},[[0,0],[m.width,m.height]],i);const b=x.on("wheel.zoom"),E=x.on("dblclick.zoom");p.wheelDelta(z_);function S(q,F){return x?new Promise(Y=>{p?.interpolate(F?.interpolate==="linear"?xs:nf).transform(ip(x,F?.duration,F?.ease,()=>Y(!0)),q)}):Promise.resolve(!1)}function _({noWheelClassName:q,noPanClassName:F,onPaneContextMenu:Y,userSelectionActive:O,panOnScroll:U,panOnDrag:R,panOnScrollMode:V,panOnScrollSpeed:$,preventScrolling:W,zoomOnPinch:M,zoomOnScroll:B,zoomOnDoubleClick:G,zoomActivationKeyPressed:D,lib:oe,onTransformChange:K,connectionInProgress:J,paneClickDistance:te,selectionOnDrag:ne}){O&&!d.isZoomingOrPanning&&N();const se=U&&!D&&!O;p.clickDistance(ne?1/0:!Jn(te)||te<0?0:te);const he=se?nB({zoomPanValues:d,noWheelClassName:q,d3Selection:x,d3Zoom:p,panOnScrollMode:V,panOnScrollSpeed:$,zoomOnPinch:M,onPanZoomStart:c,onPanZoom:s,onPanZoomEnd:f}):rB({noWheelClassName:q,preventScrolling:W,d3ZoomHandler:b});if(x.on("wheel.zoom",he,{passive:!1}),!O){const ge=oB({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:c});p.on("start",ge);const xe=iB({zoomPanValues:d,panOnDrag:R,onPaneContextMenu:!!Y,onPanZoom:s,onTransformChange:K});p.on("zoom",xe);const _e=lB({zoomPanValues:d,panOnDrag:R,panOnScroll:U,onPaneContextMenu:Y,onPanZoomEnd:f,onDraggingChange:h});p.on("end",_e)}const me=aB({zoomActivationKeyPressed:D,panOnDrag:R,zoomOnScroll:B,panOnScroll:U,zoomOnDoubleClick:G,zoomOnPinch:M,userSelectionActive:O,noPanClassName:F,noWheelClassName:q,lib:oe,connectionInProgress:J});p.filter(me),G?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function N(){p.on("zoom",null)}async function k(q,F,Y){const O=op(q),U=p?.constrain()(O,F,Y);return U&&await S(U),new Promise(R=>R(U))}async function C(q,F){const Y=op(q);return await S(Y,F),new Promise(O=>O(Y))}function A(q){if(x){const F=op(q),Y=x.property("__zoom");(Y.k!==q.zoom||Y.x!==q.x||Y.y!==q.y)&&p?.transform(x,F,null,{sync:!0})}}function L(){const q=x?l_(x.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}function j(q,F){return x?new Promise(Y=>{p?.interpolate(F?.interpolate==="linear"?xs:nf).scaleTo(ip(x,F?.duration,F?.ease,()=>Y(!0)),q)}):Promise.resolve(!1)}function z(q,F){return x?new Promise(Y=>{p?.interpolate(F?.interpolate==="linear"?xs:nf).scaleBy(ip(x,F?.duration,F?.ease,()=>Y(!0)),q)}):Promise.resolve(!1)}function P(q){p?.scaleExtent(q)}function H(q){p?.translateExtent(q)}function X(q){const F=!Jn(q)||q<0?0:q;p?.clickDistance(F)}return{update:_,destroy:N,setViewport:C,setViewportConstrained:k,getViewport:L,scaleTo:j,scaleBy:z,setScaleExtent:P,setTranslateExtent:H,syncViewport:A,setClickDistance:X}}var ea;(function(e){e.Line="line",e.Handle="handle"})(ea||(ea={}));function cB({width:e,prevWidth:t,height:r,prevHeight:i,affectsX:l,affectsY:s}){const c=e-t,f=r-i,h=[c>0?1:c<0?-1:0,f>0?1:f<0?-1:0];return c&&l&&(h[0]=h[0]*-1),f&&s&&(h[1]=h[1]*-1),h}function Fw(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),i=e.includes("left"),l=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:i,affectsY:l}}function Yo(e,t){return Math.max(0,t-e)}function qo(e,t){return Math.max(0,e-t)}function $u(e,t,r){return Math.max(0,t-e,e-r)}function Xw(e,t){return e?!t:t}function uB(e,t,r,i,l,s,c,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:m,isVertical:p}=t,x=m&&p,{xSnapped:b,ySnapped:E}=r,{minWidth:S,maxWidth:_,minHeight:N,maxHeight:k}=i,{x:C,y:A,width:L,height:j,aspectRatio:z}=e;let P=Math.floor(m?b-e.pointerX:0),H=Math.floor(p?E-e.pointerY:0);const X=L+(h?-P:P),q=j+(d?-H:H),F=-s[0]*L,Y=-s[1]*j;let O=$u(X,S,_),U=$u(q,N,k);if(c){let $=0,W=0;h&&P<0?$=Yo(C+P+F,c[0][0]):!h&&P>0&&($=qo(C+X+F,c[1][0])),d&&H<0?W=Yo(A+H+Y,c[0][1]):!d&&H>0&&(W=qo(A+q+Y,c[1][1])),O=Math.max(O,$),U=Math.max(U,W)}if(f){let $=0,W=0;h&&P>0?$=qo(C+P,f[0][0]):!h&&P<0&&($=Yo(C+X,f[1][0])),d&&H>0?W=qo(A+H,f[0][1]):!d&&H<0&&(W=Yo(A+q,f[1][1])),O=Math.max(O,$),U=Math.max(U,W)}if(l){if(m){const $=$u(X/z,N,k)*z;if(O=Math.max(O,$),c){let W=0;!h&&!d||h&&!d&&x?W=qo(A+Y+X/z,c[1][1])*z:W=Yo(A+Y+(h?P:-P)/z,c[0][1])*z,O=Math.max(O,W)}if(f){let W=0;!h&&!d||h&&!d&&x?W=Yo(A+X/z,f[1][1])*z:W=qo(A+(h?P:-P)/z,f[0][1])*z,O=Math.max(O,W)}}if(p){const $=$u(q*z,S,_)/z;if(U=Math.max(U,$),c){let W=0;!h&&!d||d&&!h&&x?W=qo(C+q*z+F,c[1][0])/z:W=Yo(C+(d?H:-H)*z+F,c[0][0])/z,U=Math.max(U,W)}if(f){let W=0;!h&&!d||d&&!h&&x?W=Yo(C+q*z,f[1][0])/z:W=qo(C+(d?H:-H)*z,f[0][0])/z,U=Math.max(U,W)}}}H=H+(H<0?U:-U),P=P+(P<0?O:-O),l&&(x?X>q*z?H=(Xw(h,d)?-P:P)/z:P=(Xw(h,d)?-H:H)*z:m?(H=P/z,d=h):(P=H*z,h=d));const R=h?C+P:C,V=d?A+H:A;return{width:L+(h?-P:P),height:j+(d?-H:H),x:s[0]*P*(h?-1:1)+R,y:s[1]*H*(d?-1:1)+V}}const L_={width:0,height:0,x:0,y:0},fB={...L_,pointerX:0,pointerY:0,aspectRatio:1};function dB(e){return[[0,0],[e.measured.width,e.measured.height]]}function hB(e,t,r){const i=t.position.x+e.position.x,l=t.position.y+e.position.y,s=e.measured.width??0,c=e.measured.height??0,f=r[0]*s,h=r[1]*c;return[[i-f,l-h],[i+s-f,l+c-h]]}function mB({domNode:e,nodeId:t,getStoreItems:r,onChange:i,onEnd:l}){const s=Sn(e);let c={controlDirection:Fw("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:d,boundaries:m,keepAspectRatio:p,resizeDirection:x,onResizeStart:b,onResize:E,onResizeEnd:S,shouldResize:_}){let N={...L_},k={...fB};c={boundaries:m,resizeDirection:x,keepAspectRatio:p,controlDirection:Fw(d)};let C,A=null,L=[],j,z,P,H=!1;const X=FN().on("start",q=>{const{nodeLookup:F,transform:Y,snapGrid:O,snapToGrid:U,nodeOrigin:R,paneDomNode:V}=r();if(C=F.get(t),!C)return;A=V?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:W}=vs(q.sourceEvent,{transform:Y,snapGrid:O,snapToGrid:U,containerBounds:A});N={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},k={...N,pointerX:$,pointerY:W,aspectRatio:N.width/N.height},j=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(j=F.get(C.parentId),z=j&&C.extent==="parent"?dB(j):void 0),L=[],P=void 0;for(const[M,B]of F)if(B.parentId===t&&(L.push({id:M,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const G=hB(B,C,B.origin??R);P?P=[[Math.min(G[0][0],P[0][0]),Math.min(G[0][1],P[0][1])],[Math.max(G[1][0],P[1][0]),Math.max(G[1][1],P[1][1])]]:P=G}b?.(q,{...N})}).on("drag",q=>{const{transform:F,snapGrid:Y,snapToGrid:O,nodeOrigin:U}=r(),R=vs(q.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:O,containerBounds:A}),V=[];if(!C)return;const{x:$,y:W,width:M,height:B}=N,G={},D=C.origin??U,{width:oe,height:K,x:J,y:te}=uB(k,c.controlDirection,R,c.boundaries,c.keepAspectRatio,D,z,P),ne=oe!==M,se=K!==B,he=J!==$&&ne,me=te!==W&&se;if(!he&&!me&&!ne&&!se)return;if((he||me||D[0]===1||D[1]===1)&&(G.x=he?J:N.x,G.y=me?te:N.y,N.x=G.x,N.y=G.y,L.length>0)){const $e=J-$,Pe=te-W;for(const st of L)st.position={x:st.position.x-$e+D[0]*(oe-M),y:st.position.y-Pe+D[1]*(K-B)},V.push(st)}if((ne||se)&&(G.width=ne&&(!c.resizeDirection||c.resizeDirection==="horizontal")?oe:N.width,G.height=se&&(!c.resizeDirection||c.resizeDirection==="vertical")?K:N.height,N.width=G.width,N.height=G.height),j&&C.expandParent){const $e=D[0]*(G.width??0);G.x&&G.x<$e&&(N.x=$e,k.x=k.x-(G.x-$e));const Pe=D[1]*(G.height??0);G.y&&G.y<Pe&&(N.y=Pe,k.y=k.y-(G.y-Pe))}const ge=cB({width:N.width,prevWidth:M,height:N.height,prevHeight:B,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),xe={...N,direction:ge};_?.(q,xe)!==!1&&(H=!0,E?.(q,xe),i(G,V))}).on("end",q=>{H&&(S?.(q,{...N}),l?.({...N}),H=!1)});s.call(X)}function h(){s.on(".drag",null)}return{update:f,destroy:h}}var lp={exports:{}},ap={};var Gw;function pB(){if(Gw)return ap;Gw=1;var e=Vs(),t=kO();function r(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:r,l=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,f=e.useMemo,h=e.useDebugValue;return ap.useSyncExternalStoreWithSelector=function(d,m,p,x,b){var E=s(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=f(function(){function N(j){if(!k){if(k=!0,C=j,j=x(j),b!==void 0&&S.hasValue){var z=S.value;if(b(z,j))return A=z}return A=j}if(z=A,i(C,j))return z;var P=x(j);return b!==void 0&&b(z,P)?(C=j,z):(C=j,A=P)}var k=!1,C,A,L=p===void 0?null:p;return[function(){return N(m())},L===null?void 0:function(){return N(L())}]},[m,p,x,b]);var _=l(d,E[0],E[1]);return c(function(){S.hasValue=!0,S.value=_},[_]),h(_),_},ap}var Ww;function gB(){return Ww||(Ww=1,lp.exports=pB()),lp.exports}var yB=gB();const xB=Us(yB),vB={},Zw=e=>{let t;const r=new Set,i=(m,p)=>{const x=typeof m=="function"?m(t):m;if(!Object.is(x,t)){const b=t;t=p??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(E=>E(t,b))}},l=()=>t,h={setState:i,getState:l,getInitialState:()=>d,subscribe:m=>(r.add(m),()=>r.delete(m)),destroy:()=>{(vB?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(i,l,h);return h},bB=e=>e?Zw(e):Zw,{useDebugValue:wB}=to,{useSyncExternalStoreWithSelector:SB}=xB,EB=e=>e;function I_(e,t=EB,r){const i=SB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return wB(i),i}const Kw=(e,t)=>{const r=bB(e),i=(l,s=t)=>I_(r,l,s);return Object.assign(i,r),i},CB=(e,t)=>e?Kw(e,t):Kw;function ht(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[i,l]of e)if(!Object.is(l,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const i of r)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const ld=w.createContext(null),NB=ld.Provider,B_=Er.error001();function Fe(e,t){const r=w.useContext(ld);if(r===null)throw new Error(B_);return I_(r,e,t)}function mt(){const e=w.useContext(ld);if(e===null)throw new Error(B_);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Qw={display:"none"},_B={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},H_="react-flow__node-desc",P_="react-flow__edge-desc",kB="react-flow__aria-live",TB=e=>e.ariaLiveMessage,AB=e=>e.ariaLabelConfig;function RB({rfId:e}){const t=Fe(TB);return g.jsx("div",{id:`${kB}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_B,children:t})}function jB({rfId:e,disableKeyboardA11y:t}){const r=Fe(AB);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${H_}-${e}`,style:Qw,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${P_}-${e}`,style:Qw,children:r["edge.a11yDescription.default"]}),!t&&g.jsx(RB,{rfId:e})]})}const ad=w.forwardRef(({position:e="top-left",children:t,className:r,style:i,...l},s)=>{const c=`${e}`.split("-");return g.jsx("div",{className:At(["react-flow__panel",r,...c]),style:i,ref:s,...l,children:t})});ad.displayName="Panel";function MB({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:g.jsx(ad,{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:g.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const OB=e=>{const t=[],r=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&r.push(i);return{selectedNodes:t,selectedEdges:r}},Yu=e=>e.id;function DB(e,t){return ht(e.selectedNodes.map(Yu),t.selectedNodes.map(Yu))&&ht(e.selectedEdges.map(Yu),t.selectedEdges.map(Yu))}function zB({onSelectionChange:e}){const t=mt(),{selectedNodes:r,selectedEdges:i}=Fe(OB,DB);return w.useEffect(()=>{const l={nodes:r,edges:i};e?.(l),t.getState().onSelectionChangeHandlers.forEach(s=>s(l))},[r,i,e]),null}const LB=e=>!!e.onSelectionChangeHandlers;function IB({onSelectionChange:e}){const t=Fe(LB);return e||t?g.jsx(zB,{onSelectionChange:e}):null}const U_=[0,0],BB={x:0,y:0,zoom:1},HB=["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"],Jw=[...HB,"rfId"],PB=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}),e1={translateExtent:Ds,nodeOrigin:U_,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function UB(e){const{setNodes:t,setEdges:r,setMinZoom:i,setMaxZoom:l,setTranslateExtent:s,setNodeExtent:c,reset:f,setDefaultNodesAndEdges:h}=Fe(PB,ht),d=mt();w.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{m.current=e1,f()}),[]);const m=w.useRef(e1);return w.useEffect(()=>{for(const p of Jw){const x=e[p],b=m.current[p];x!==b&&(typeof e[p]>"u"||(p==="nodes"?t(x):p==="edges"?r(x):p==="minZoom"?i(x):p==="maxZoom"?l(x):p==="translateExtent"?s(x):p==="nodeExtent"?c(x):p==="ariaLabelConfig"?d.setState({ariaLabelConfig:_6(x)}):p==="fitView"?d.setState({fitViewQueued:x}):p==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[p]:x})))}m.current=e},Jw.map(p=>e[p])),null}function t1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function VB(e){const[t,r]=w.useState(e==="system"?null:e);return w.useEffect(()=>{if(e!=="system"){r(e);return}const i=t1(),l=()=>r(i?.matches?"dark":"light");return l(),i?.addEventListener("change",l),()=>{i?.removeEventListener("change",l)}},[e]),t!==null?t:t1()?.matches?"dark":"light"}const n1=typeof document<"u"?document:null;function Hs(e=null,t={target:n1,actInsideInputWithModifier:!0}){const[r,i]=w.useState(!1),l=w.useRef(!1),s=w.useRef(new Set([])),[c,f]=w.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),m=d.reduce((p,x)=>p.concat(...x),[]);return[d,m]}return[[],[]]},[e]);return w.useEffect(()=>{const h=t?.target??n1,d=t?.actInsideInputWithModifier??!0;if(e!==null){const m=b=>{if(l.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!l.current||l.current&&!d)&&b_(b))return!1;const S=o1(b.code,f);if(s.current.add(b[S]),r1(c,s.current,!1)){const _=b.composedPath?.()?.[0]||b.target,N=_?.nodeName==="BUTTON"||_?.nodeName==="A";t.preventDefault!==!1&&(l.current||!N)&&b.preventDefault(),i(!0)}},p=b=>{const E=o1(b.code,f);r1(c,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(b[E]),b.key==="Meta"&&s.current.clear(),l.current=!1},x=()=>{s.current.clear(),i(!1)};return h?.addEventListener("keydown",m),h?.addEventListener("keyup",p),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",m),h?.removeEventListener("keyup",p),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,i]),r}function r1(e,t,r){return e.filter(i=>r||i.length===t.size).some(i=>i.every(l=>t.has(l)))}function o1(e,t){return t.includes(e)?"code":"key"}const $B=()=>{const e=mt();return w.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:i}=e.getState();return i?i.scaleTo(t,{duration:r?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[i,l,s],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??i,y:t.y??l,zoom:t.zoom??s},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,i]=e.getState().transform;return{x:t,y:r,zoom:i}},setCenter:async(t,r,i)=>e.getState().setCenter(t,r,i),fitBounds:async(t,r)=>{const{width:i,height:l,minZoom:s,maxZoom:c,panZoom:f}=e.getState(),h=hy(t,i,l,s,c,r?.padding??.1);return f?(await f.setViewport(h,{duration:r?.duration,ease:r?.ease,interpolate:r?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:i,snapGrid:l,snapToGrid:s,domNode:c}=e.getState();if(!c)return t;const{x:f,y:h}=c.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},m=r.snapGrid??l,p=r.snapToGrid??s;return ec(d,i,p,m)},flowToScreenPosition:t=>{const{transform:r,domNode:i}=e.getState();if(!i)return t;const{x:l,y:s}=i.getBoundingClientRect(),c=Rf(t,r);return{x:c.x+l,y:c.y+s}}}),[])};function V_(e,t){const r=[],i=new Map,l=[];for(const s of e)if(s.type==="add"){l.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const c=i.get(s.id);c?c.push(s):i.set(s.id,[s])}for(const s of t){const c=i.get(s.id);if(!c){r.push(s);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){r.push({...c[0].item});continue}const f={...s};for(const h of c)YB(h,f);r.push(f)}return l.length&&l.forEach(s=>{s.index!==void 0?r.splice(s.index,0,{...s.item}):r.push({...s.item})}),r}function YB(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 $_(e,t){return V_(e,t)}function Y_(e,t){return V_(e,t)}function ki(e,t){return{id:e,type:"select",selected:t}}function Il(e,t=new Set,r=!1){const i=[];for(const[l,s]of e){const c=t.has(l);!(s.selected===void 0&&!c)&&s.selected!==c&&(r&&(s.selected=c),i.push(ki(s.id,c)))}return i}function i1({items:e=[],lookup:t}){const r=[],i=new Map(e.map(l=>[l.id,l]));for(const[l,s]of e.entries()){const c=t.get(s.id),f=c?.internals?.userNode??c;f!==void 0&&f!==s&&r.push({id:s.id,item:s,type:"replace"}),f===void 0&&r.push({item:s,type:"add",index:l})}for(const[l]of t)i.get(l)===void 0&&r.push({id:l,type:"remove"});return r}function l1(e){return{id:e.id,type:"remove"}}const a1=e=>g6(e),qB=e=>d_(e);function q_(e){return w.forwardRef(e)}const FB=typeof window<"u"?w.useLayoutEffect:w.useEffect;function s1(e){const[t,r]=w.useState(BigInt(0)),[i]=w.useState(()=>XB(()=>r(l=>l+BigInt(1))));return FB(()=>{const l=i.get();l.length&&(e(l),i.reset())},[t]),i}function XB(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const F_=w.createContext(null);function GB({children:e}){const t=mt(),r=w.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:m,onNodesChange:p,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:E}=t.getState();let S=h;for(const N of f)S=typeof N=="function"?N(S):N;let _=i1({items:S,lookup:x});for(const N of E.values())_=N(_);m&&d(S),_.length>0?p?.(_):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:k,setNodes:C}=t.getState();N&&C(k)})},[]),i=s1(r),l=w.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:m,onEdgesChange:p,edgeLookup:x}=t.getState();let b=h;for(const E of f)b=typeof E=="function"?E(b):E;m?d(b):p&&p(i1({items:b,lookup:x}))},[]),s=s1(l),c=w.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return g.jsx(F_.Provider,{value:c,children:e})}function WB(){const e=w.useContext(F_);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const ZB=e=>!!e.panZoom;function sd(){const e=$B(),t=mt(),r=WB(),i=Fe(ZB),l=w.useMemo(()=>{const s=p=>t.getState().nodeLookup.get(p),c=p=>{r.nodeQueue.push(p)},f=p=>{r.edgeQueue.push(p)},h=p=>{const{nodeLookup:x,nodeOrigin:b}=t.getState(),E=a1(p)?p:x.get(p.id),S=E.parentId?x_(E.position,E.measured,E.parentId,x,b):E.position,_={...E,position:S,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return Ql(_)},d=(p,x,b={replace:!1})=>{c(E=>E.map(S=>{if(S.id===p){const _=typeof x=="function"?x(S):x;return b.replace&&a1(_)?_:{...S,..._}}return S}))},m=(p,x,b={replace:!1})=>{f(E=>E.map(S=>{if(S.id===p){const _=typeof x=="function"?x(S):x;return b.replace&&qB(_)?_:{...S,..._}}return S}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>s(p)?.internals.userNode,getInternalNode:s,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(x=>({...x}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:c,setEdges:f,addNodes:p=>{const x=Array.isArray(p)?p:[p];r.nodeQueue.push(b=>[...b,...x])},addEdges:p=>{const x=Array.isArray(p)?p:[p];r.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:p=[],edges:x=[],transform:b}=t.getState(),[E,S,_]=b;return{nodes:p.map(N=>({...N})),edges:x.map(N=>({...N})),viewport:{x:E,y:S,zoom:_}}},deleteElements:async({nodes:p=[],edges:x=[]})=>{const{nodes:b,edges:E,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:N,triggerEdgeChanges:k,onDelete:C,onBeforeDelete:A}=t.getState(),{nodes:L,edges:j}=await w6({nodesToRemove:p,edgesToRemove:x,nodes:b,edges:E,onBeforeDelete:A}),z=j.length>0,P=L.length>0;if(z){const H=j.map(l1);_?.(j),k(H)}if(P){const H=L.map(l1);S?.(L),N(H)}return(P||z)&&C?.({nodes:L,edges:j}),{deletedNodes:L,deletedEdges:j}},getIntersectingNodes:(p,x=!0,b)=>{const E=zw(p),S=E?p:h(p),_=b!==void 0;return S?(b||t.getState().nodes).filter(N=>{const k=t.getState().nodeLookup.get(N.id);if(k&&!E&&(N.id===p.id||!k.internals.positionAbsolute))return!1;const C=Ql(_?N:k),A=Is(C,S);return x&&A>0||A>=C.width*C.height||A>=S.width*S.height}):[]},isNodeIntersecting:(p,x,b=!0)=>{const S=zw(p)?p:h(p);if(!S)return!1;const _=Is(S,x);return b&&_>0||_>=x.width*x.height||_>=S.width*S.height},updateNode:d,updateNodeData:(p,x,b={replace:!1})=>{d(p,E=>{const S=typeof x=="function"?x(E):x;return b.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},b)},updateEdge:m,updateEdgeData:(p,x,b={replace:!1})=>{m(p,E=>{const S=typeof x=="function"?x(E):x;return b.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},b)},getNodesBounds:p=>{const{nodeLookup:x,nodeOrigin:b}=t.getState();return y6(p,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:p,id:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}-${p}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}${p?x?`-${p}-${x}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const x=t.getState().fitViewResolver??N6();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:x}),r.nodeQueue.push(b=>[...b]),x.promise}}},[]);return w.useMemo(()=>({...l,...e,viewportInitialized:i}),[i])}const c1=e=>e.selected,KB=typeof window<"u"?window:void 0;function QB({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=mt(),{deleteElements:i}=sd(),l=Hs(e,{actInsideInputWithModifier:!1}),s=Hs(t,{target:KB});w.useEffect(()=>{if(l){const{edges:c,nodes:f}=r.getState();i({nodes:f.filter(c1),edges:c.filter(c1)}),r.setState({nodesSelectionActive:!1})}},[l]),w.useEffect(()=>{r.setState({multiSelectionActive:s})},[s])}function JB(e){const t=mt();w.useEffect(()=>{const r=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const i=my(e.current);(i.height===0||i.width===0)&&t.getState().onError?.("004",Er.error004()),t.setState({width:i.width||500,height:i.height||500})};if(e.current){r(),window.addEventListener("resize",r);const i=new ResizeObserver(()=>r());return i.observe(e.current),()=>{window.removeEventListener("resize",r),i&&e.current&&i.unobserve(e.current)}}},[])}const cd={position:"absolute",width:"100%",height:"100%",top:0,left:0},eH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function tH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:s=Ri.Free,zoomOnDoubleClick:c=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:m,maxZoom:p,zoomActivationKeyCode:x,preventScrolling:b=!0,children:E,noWheelClassName:S,noPanClassName:_,onViewportChange:N,isControlledViewport:k,paneClickDistance:C,selectionOnDrag:A}){const L=mt(),j=w.useRef(null),{userSelectionActive:z,lib:P,connectionInProgress:H}=Fe(eH,ht),X=Hs(x),q=w.useRef();JB(j);const F=w.useCallback(Y=>{N?.({x:Y[0],y:Y[1],zoom:Y[2]}),k||L.setState({transform:Y})},[N,k]);return w.useEffect(()=>{if(j.current){q.current=sB({domNode:j.current,minZoom:m,maxZoom:p,translateExtent:d,viewport:h,onDraggingChange:R=>L.setState(V=>V.paneDragging===R?V:{paneDragging:R}),onPanZoomStart:(R,V)=>{const{onViewportChangeStart:$,onMoveStart:W}=L.getState();W?.(R,V),$?.(V)},onPanZoom:(R,V)=>{const{onViewportChange:$,onMove:W}=L.getState();W?.(R,V),$?.(V)},onPanZoomEnd:(R,V)=>{const{onViewportChangeEnd:$,onMoveEnd:W}=L.getState();W?.(R,V),$?.(V)}});const{x:Y,y:O,zoom:U}=q.current.getViewport();return L.setState({panZoom:q.current,transform:[Y,O,U],domNode:j.current.closest(".react-flow")}),()=>{q.current?.destroy()}}},[]),w.useEffect(()=>{q.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:i,panOnScrollSpeed:l,panOnScrollMode:s,zoomOnDoubleClick:c,panOnDrag:f,zoomActivationKeyPressed:X,preventScrolling:b,noPanClassName:_,userSelectionActive:z,noWheelClassName:S,lib:P,onTransformChange:F,connectionInProgress:H,selectionOnDrag:A,paneClickDistance:C})},[e,t,r,i,l,s,c,f,X,b,_,z,S,P,F,H,A,C]),g.jsx("div",{className:"react-flow__renderer",ref:j,style:cd,children:E})}const nH=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function rH(){const{userSelectionActive:e,userSelectionRect:t}=Fe(nH,ht);return e&&t?g.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 sp=(e,t)=>r=>{r.target===t.current&&e?.(r)},oH=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function iH({isSelecting:e,selectionKeyPressed:t,selectionMode:r=zs.Full,panOnDrag:i,paneClickDistance:l,selectionOnDrag:s,onSelectionStart:c,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:m,onPaneMouseEnter:p,onPaneMouseMove:x,onPaneMouseLeave:b,children:E}){const S=mt(),{userSelectionActive:_,elementsSelectable:N,dragging:k,connectionInProgress:C}=Fe(oH,ht),A=N&&(e||_),L=w.useRef(null),j=w.useRef(),z=w.useRef(new Set),P=w.useRef(new Set),H=w.useRef(!1),X=$=>{if(H.current||C){H.current=!1;return}h?.($),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},q=$=>{if(Array.isArray(i)&&i?.includes(2)){$.preventDefault();return}d?.($)},F=m?$=>m($):void 0,Y=$=>{H.current&&($.stopPropagation(),H.current=!1)},O=$=>{const{domNode:W}=S.getState();if(j.current=W?.getBoundingClientRect(),!j.current)return;const M=$.target===L.current;if(!M&&!!$.target.closest(".nokey")||!e||!(s&&M||t)||$.button!==0||!$.isPrimary)return;$.target?.setPointerCapture?.($.pointerId),H.current=!1;const{x:D,y:oe}=er($.nativeEvent,j.current);S.setState({userSelectionRect:{width:0,height:0,startX:D,startY:oe,x:D,y:oe}}),M||($.stopPropagation(),$.preventDefault())},U=$=>{const{userSelectionRect:W,transform:M,nodeLookup:B,edgeLookup:G,connectionLookup:D,triggerNodeChanges:oe,triggerEdgeChanges:K,defaultEdgeOptions:J,resetSelectedElements:te}=S.getState();if(!j.current||!W)return;const{x:ne,y:se}=er($.nativeEvent,j.current),{startX:he,startY:me}=W;if(!H.current){const Pe=t?0:l;if(Math.hypot(ne-he,se-me)<=Pe)return;te(),c?.($)}H.current=!0;const ge={startX:he,startY:me,x:ne<he?ne:he,y:se<me?se:me,width:Math.abs(ne-he),height:Math.abs(se-me)},xe=z.current,_e=P.current;z.current=new Set(dy(B,ge,M,r===zs.Partial,!0).map(Pe=>Pe.id)),P.current=new Set;const $e=J?.selectable??!0;for(const Pe of z.current){const st=D.get(Pe);if(st)for(const{edgeId:fn}of st.values()){const Vt=G.get(fn);Vt&&(Vt.selectable??$e)&&P.current.add(fn)}}if(!Lw(xe,z.current)){const Pe=Il(B,z.current,!0);oe(Pe)}if(!Lw(_e,P.current)){const Pe=Il(G,P.current);K(Pe)}S.setState({userSelectionRect:ge,userSelectionActive:!0,nodesSelectionActive:!1})},R=$=>{$.button===0&&($.target?.releasePointerCapture?.($.pointerId),!_&&$.target===L.current&&S.getState().userSelectionRect&&X?.($),S.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(f?.($),S.setState({nodesSelectionActive:z.current.size>0})))},V=i===!0||Array.isArray(i)&&i.includes(0);return g.jsxs("div",{className:At(["react-flow__pane",{draggable:V,dragging:k,selection:e}]),onClick:A?void 0:sp(X,L),onContextMenu:sp(q,L),onWheel:sp(F,L),onPointerEnter:A?void 0:p,onPointerMove:A?U:x,onPointerUp:A?R:void 0,onPointerDownCapture:A?O:void 0,onClickCapture:A?Y:void 0,onPointerLeave:b,ref:L,style:cd,children:[E,g.jsx(rH,{})]})}function rg({id:e,store:t,unselect:r=!1,nodeRef:i}){const{addSelectedNodes:l,unselectNodesAndEdges:s,multiSelectionActive:c,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",Er.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(r||d.selected&&c)&&(s({nodes:[d],edges:[]}),requestAnimationFrame(()=>i?.current?.blur())):l([e])}function X_({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:i,nodeId:l,isSelectable:s,nodeClickDistance:c}){const f=mt(),[h,d]=w.useState(!1),m=w.useRef();return w.useEffect(()=>{m.current=G6({getStoreItems:()=>f.getState(),onNodeMouseDown:p=>{rg({id:p,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),w.useEffect(()=>{if(!(t||!e.current||!m.current))return m.current.update({noDragClassName:r,handleSelector:i,domNode:e.current,isSelectable:s,nodeId:l,nodeClickDistance:c}),()=>{m.current?.destroy()}},[r,i,t,s,e,l,c]),h}const lH=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function G_(){const e=mt();return w.useCallback(r=>{const{nodeExtent:i,snapToGrid:l,snapGrid:s,nodesDraggable:c,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:m}=e.getState(),p=new Map,x=lH(c),b=l?s[0]:5,E=l?s[1]:5,S=r.direction.x*b*r.factor,_=r.direction.y*E*r.factor;for(const[,N]of d){if(!x(N))continue;let k={x:N.internals.positionAbsolute.x+S,y:N.internals.positionAbsolute.y+_};l&&(k=Js(k,s));const{position:C,positionAbsolute:A}=h_({nodeId:N.id,nextPosition:k,nodeLookup:d,nodeExtent:i,nodeOrigin:m,onError:f});N.position=C,N.internals.positionAbsolute=A,p.set(N.id,N)}h(p)},[])}const by=w.createContext(null),aH=by.Provider;by.Consumer;const W_=()=>w.useContext(by),sH=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),cH=(e,t,r)=>i=>{const{connectionClickStartHandle:l,connectionMode:s,connection:c}=i,{fromHandle:f,toHandle:h,isValid:d}=c,m=h?.nodeId===e&&h?.id===t&&h?.type===r;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===r,connectingTo:m,clickConnecting:l?.nodeId===e&&l?.id===t&&l?.type===r,isPossibleEndHandle:s===Zl.Strict?f?.type!==r:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!l,valid:m&&d}};function uH({type:e="source",position:t=Ce.Top,isValidConnection:r,isConnectable:i=!0,isConnectableStart:l=!0,isConnectableEnd:s=!0,id:c,onConnect:f,children:h,className:d,onMouseDown:m,onTouchStart:p,...x},b){const E=c||null,S=e==="target",_=mt(),N=W_(),{connectOnClick:k,noPanClassName:C,rfId:A}=Fe(sH,ht),{connectingFrom:L,connectingTo:j,clickConnecting:z,isPossibleEndHandle:P,connectionInProcess:H,clickConnectionInProcess:X,valid:q}=Fe(cH(N,E,e),ht);N||_.getState().onError?.("010",Er.error010());const F=U=>{const{defaultEdgeOptions:R,onConnect:V,hasDefaultEdges:$}=_.getState(),W={...R,...U};if($){const{edges:M,setEdges:B}=_.getState();B(M6(W,M))}V?.(W),f?.(W)},Y=U=>{if(!N)return;const R=w_(U.nativeEvent);if(l&&(R&&U.button===0||!R)){const V=_.getState();ng.onPointerDown(U.nativeEvent,{handleDomNode:U.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:S,handleId:E,nodeId:N,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:(...$)=>_.getState().onConnectEnd?.(...$),updateConnection:V.updateConnection,onConnect:F,isValidConnection:r||((...$)=>_.getState().isValidConnection?.(...$)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}R?m?.(U):p?.(U)},O=U=>{const{onClickConnectStart:R,onClickConnectEnd:V,connectionClickStartHandle:$,connectionMode:W,isValidConnection:M,lib:B,rfId:G,nodeLookup:D,connection:oe}=_.getState();if(!N||!$&&!l)return;if(!$){R?.(U.nativeEvent,{nodeId:N,handleId:E,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:N,type:e,id:E}});return}const K=v_(U.target),J=r||M,{connection:te,isValid:ne}=ng.isValid(U.nativeEvent,{handle:{nodeId:N,id:E,type:e},connectionMode:W,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:J,flowId:G,doc:K,lib:B,nodeLookup:D});ne&&te&&F(te);const se=structuredClone(oe);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,V?.(U,se),_.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":E,"data-nodeid":N,"data-handlepos":t,"data-id":`${A}-${N}-${E}-${e}`,className:At(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,d,{source:!S,target:S,connectable:i,connectablestart:l,connectableend:s,clickconnecting:z,connectingfrom:L,connectingto:j,valid:q,connectionindicator:i&&(!H||P)&&(H||X?s:l)}]),onMouseDown:Y,onTouchStart:Y,onClick:k?O:void 0,ref:b,...x,children:h})}const ei=w.memo(q_(uH));function fH({data:e,isConnectable:t,sourcePosition:r=Ce.Bottom}){return g.jsxs(g.Fragment,{children:[e?.label,g.jsx(ei,{type:"source",position:r,isConnectable:t})]})}function dH({data:e,isConnectable:t,targetPosition:r=Ce.Top,sourcePosition:i=Ce.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(ei,{type:"target",position:r,isConnectable:t}),e?.label,g.jsx(ei,{type:"source",position:i,isConnectable:t})]})}function hH(){return null}function mH({data:e,isConnectable:t,targetPosition:r=Ce.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(ei,{type:"target",position:r,isConnectable:t}),e?.label]})}const jf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},u1={input:fH,default:dH,output:mH,group:hH};function pH(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const gH=e=>{const{width:t,height:r,x:i,y:l}=Qs(e.nodeLookup,{filter:s=>!!s.selected});return{width:Jn(t)?t:null,height:Jn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${i}px,${l}px)`}};function yH({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const i=mt(),{width:l,height:s,transformString:c,userSelectionActive:f}=Fe(gH,ht),h=G_(),d=w.useRef(null);w.useEffect(()=>{r||d.current?.focus({preventScroll:!0})},[r]);const m=!f&&l!==null&&s!==null;if(X_({nodeRef:d,disabled:!m}),!m)return null;const p=e?b=>{const E=i.getState().nodes.filter(S=>S.selected);e(b,E)}:void 0,x=b=>{Object.prototype.hasOwnProperty.call(jf,b.key)&&(b.preventDefault(),h({direction:jf[b.key],factor:b.shiftKey?4:1}))};return g.jsx("div",{className:At(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:g.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:r?void 0:-1,onKeyDown:r?void 0:x,style:{width:l,height:s}})})}const f1=typeof window<"u"?window:void 0,xH=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Z_({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:c,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:m,selectionMode:p,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:E,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:N,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:A,panOnScrollSpeed:L,panOnScrollMode:j,zoomOnDoubleClick:z,panOnDrag:P,defaultViewport:H,translateExtent:X,minZoom:q,maxZoom:F,preventScrolling:Y,onSelectionContextMenu:O,noWheelClassName:U,noPanClassName:R,disableKeyboardA11y:V,onViewportChange:$,isControlledViewport:W}){const{nodesSelectionActive:M,userSelectionActive:B}=Fe(xH,ht),G=Hs(d,{target:f1}),D=Hs(S,{target:f1}),oe=D||P,K=D||A,J=m&&oe!==!0,te=G||B||J;return QB({deleteKeyCode:h,multiSelectionKeyCode:E}),g.jsx(tH,{onPaneContextMenu:s,elementsSelectable:N,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:K,panOnScrollSpeed:L,panOnScrollMode:j,zoomOnDoubleClick:z,panOnDrag:!G&&oe,defaultViewport:H,translateExtent:X,minZoom:q,maxZoom:F,zoomActivationKeyCode:_,preventScrolling:Y,noWheelClassName:U,noPanClassName:R,onViewportChange:$,isControlledViewport:W,paneClickDistance:f,selectionOnDrag:J,children:g.jsxs(iH,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:s,onPaneScroll:c,panOnDrag:oe,isSelecting:!!te,selectionMode:p,selectionKeyPressed:G,paneClickDistance:f,selectionOnDrag:J,children:[e,M&&g.jsx(yH,{onSelectionContextMenu:O,noPanClassName:R,disableKeyboardA11y:V})]})})}Z_.displayName="FlowRenderer";const vH=w.memo(Z_),bH=e=>t=>e?dy(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function wH(e){return Fe(w.useCallback(bH(e),[e]),ht)}const SH=e=>e.updateNodeInternals;function EH(){const e=Fe(SH),[t]=w.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const i=new Map;r.forEach(l=>{const s=l.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:l.target,force:!0})}),e(i)}));return w.useEffect(()=>()=>{t?.disconnect()},[t]),t}function CH({node:e,nodeType:t,hasDimensions:r,resizeObserver:i}){const l=mt(),s=w.useRef(null),c=w.useRef(null),f=w.useRef(e.sourcePosition),h=w.useRef(e.targetPosition),d=w.useRef(t),m=r&&!!e.internals.handleBounds;return w.useEffect(()=>{s.current&&!e.hidden&&(!m||c.current!==s.current)&&(c.current&&i?.unobserve(c.current),i?.observe(s.current),c.current=s.current)},[m,e.hidden]),w.useEffect(()=>()=>{c.current&&(i?.unobserve(c.current),c.current=null)},[]),w.useEffect(()=>{if(s.current){const p=d.current!==t,x=f.current!==e.sourcePosition,b=h.current!==e.targetPosition;(p||x||b)&&(d.current=t,f.current=e.sourcePosition,h.current=e.targetPosition,l.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function NH({id:e,onClick:t,onMouseEnter:r,onMouseMove:i,onMouseLeave:l,onContextMenu:s,onDoubleClick:c,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:m,resizeObserver:p,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:E,rfId:S,nodeTypes:_,nodeClickDistance:N,onError:k}){const{node:C,internals:A,isParent:L}=Fe(ne=>{const se=ne.nodeLookup.get(e),he=ne.parentLookup.has(e);return{node:se,internals:se.internals,isParent:he}},ht);let j=C.type||"default",z=_?.[j]||u1[j];z===void 0&&(k?.("003",Er.error003(j)),j="default",z=_?.default||u1.default);const P=!!(C.draggable||f&&typeof C.draggable>"u"),H=!!(C.selectable||h&&typeof C.selectable>"u"),X=!!(C.connectable||d&&typeof C.connectable>"u"),q=!!(C.focusable||m&&typeof C.focusable>"u"),F=mt(),Y=y_(C),O=CH({node:C,nodeType:j,hasDimensions:Y,resizeObserver:p}),U=X_({nodeRef:O,disabled:C.hidden||!P,noDragClassName:x,handleSelector:C.dragHandle,nodeId:e,isSelectable:H,nodeClickDistance:N}),R=G_();if(C.hidden)return null;const V=fo(C),$=pH(C),W=H||P||t||r||i||l,M=r?ne=>r(ne,{...A.userNode}):void 0,B=i?ne=>i(ne,{...A.userNode}):void 0,G=l?ne=>l(ne,{...A.userNode}):void 0,D=s?ne=>s(ne,{...A.userNode}):void 0,oe=c?ne=>c(ne,{...A.userNode}):void 0,K=ne=>{const{selectNodesOnDrag:se,nodeDragThreshold:he}=F.getState();H&&(!se||!P||he>0)&&rg({id:e,store:F,nodeRef:O}),t&&t(ne,{...A.userNode})},J=ne=>{if(!(b_(ne.nativeEvent)||E)){if(s_.includes(ne.key)&&H){const se=ne.key==="Escape";rg({id:e,store:F,unselect:se,nodeRef:O})}else if(P&&C.selected&&Object.prototype.hasOwnProperty.call(jf,ne.key)){ne.preventDefault();const{ariaLabelConfig:se}=F.getState();F.setState({ariaLiveMessage:se["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~A.positionAbsolute.x,y:~~A.positionAbsolute.y})}),R({direction:jf[ne.key],factor:ne.shiftKey?4:1})}}},te=()=>{if(E||!O.current?.matches(":focus-visible"))return;const{transform:ne,width:se,height:he,autoPanOnNodeFocus:me,setCenter:ge}=F.getState();if(!me)return;dy(new Map([[e,C]]),{x:0,y:0,width:se,height:he},ne,!0).length>0||ge(C.position.x+V.width/2,C.position.y+V.height/2,{zoom:ne[2]})};return g.jsx("div",{className:At(["react-flow__node",`react-flow__node-${j}`,{[b]:P},C.className,{selected:C.selected,selectable:H,parent:L,draggable:P,dragging:U}]),ref:O,style:{zIndex:A.z,transform:`translate(${A.positionAbsolute.x}px,${A.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:Y?"visible":"hidden",...C.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:B,onMouseLeave:G,onContextMenu:D,onClick:K,onDoubleClick:oe,onKeyDown:q?J:void 0,tabIndex:q?0:void 0,onFocus:q?te:void 0,role:C.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${H_}-${S}`,"aria-label":C.ariaLabel,...C.domAttributes,children:g.jsx(aH,{value:e,children:g.jsx(z,{id:e,data:C.data,type:j,positionAbsoluteX:A.positionAbsolute.x,positionAbsoluteY:A.positionAbsolute.y,selected:C.selected??!1,selectable:H,draggable:P,deletable:C.deletable??!0,isConnectable:X,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:U,dragHandle:C.dragHandle,zIndex:A.z,parentId:C.parentId,...V})})})}var _H=w.memo(NH);const kH=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function K_(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:i,elementsSelectable:l,onError:s}=Fe(kH,ht),c=wH(e.onlyRenderVisibleElements),f=EH();return g.jsx("div",{className:"react-flow__nodes",style:cd,children:c.map(h=>g.jsx(_H,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:f,nodesDraggable:t,nodesConnectable:r,nodesFocusable:i,elementsSelectable:l,nodeClickDistance:e.nodeClickDistance,onError:s},h))})}K_.displayName="NodeRenderer";const TH=w.memo(K_);function AH(e){return Fe(w.useCallback(r=>{if(!e)return r.edges.map(l=>l.id);const i=[];if(r.width&&r.height)for(const l of r.edges){const s=r.nodeLookup.get(l.source),c=r.nodeLookup.get(l.target);s&&c&&A6({sourceNode:s,targetNode:c,width:r.width,height:r.height,transform:r.transform})&&i.push(l.id)}return i},[e]),ht)}const RH=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return g.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},jH=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return g.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},d1={[Ls.Arrow]:RH,[Ls.ArrowClosed]:jH};function MH(e){const t=mt();return w.useMemo(()=>Object.prototype.hasOwnProperty.call(d1,e)?d1[e]:(t.getState().onError?.("009",Er.error009(e)),null),[e])}const OH=({id:e,type:t,color:r,width:i=12.5,height:l=12.5,markerUnits:s="strokeWidth",strokeWidth:c,orient:f="auto-start-reverse"})=>{const h=MH(t);return h?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:f,refX:"0",refY:"0",children:g.jsx(h,{color:r,strokeWidth:c})}):null},Q_=({defaultColor:e,rfId:t})=>{const r=Fe(s=>s.edges),i=Fe(s=>s.defaultEdgeOptions),l=w.useMemo(()=>I6(r,{id:t,defaultColor:e,defaultMarkerStart:i?.markerStart,defaultMarkerEnd:i?.markerEnd}),[r,i,t,e]);return l.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:l.map(s=>g.jsx(OH,{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};Q_.displayName="MarkerDefinitions";var DH=w.memo(Q_);function J_({x:e,y:t,label:r,labelStyle:i,labelShowBg:l=!0,labelBgStyle:s,labelBgPadding:c=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...m}){const[p,x]=w.useState({x:1,y:0,width:0,height:0}),b=At(["react-flow__edge-textwrapper",d]),E=w.useRef(null);return w.useEffect(()=>{if(E.current){const S=E.current.getBBox();x({x:S.x,y:S.y,width:S.width,height:S.height})}},[r]),r?g.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:b,visibility:p.width?"visible":"hidden",...m,children:[l&&g.jsx("rect",{width:p.width+2*c[0],x:-c[0],y:-c[1],height:p.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:f,ry:f}),g.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:E,style:i,children:r}),h]}):null}J_.displayName="EdgeText";const zH=w.memo(J_);function ud({path:e,labelX:t,labelY:r,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...m}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...m,d:e,fill:"none",className:At(["react-flow__edge-path",m.className])}),d?g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,i&&Jn(t)&&Jn(r)?g.jsx(zH,{x:t,y:r,label:i,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function h1({pos:e,x1:t,y1:r,x2:i,y2:l}){return e===Ce.Left||e===Ce.Right?[.5*(t+i),r]:[t,.5*(r+l)]}function e2({sourceX:e,sourceY:t,sourcePosition:r=Ce.Bottom,targetX:i,targetY:l,targetPosition:s=Ce.Top}){const[c,f]=h1({pos:r,x1:e,y1:t,x2:i,y2:l}),[h,d]=h1({pos:s,x1:i,y1:l,x2:e,y2:t}),[m,p,x,b]=S_({sourceX:e,sourceY:t,targetX:i,targetY:l,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${c},${f} ${h},${d} ${i},${l}`,m,p,x,b]}function t2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,sourcePosition:c,targetPosition:f,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,interactionWidth:N})=>{const[k,C,A]=e2({sourceX:r,sourceY:i,sourcePosition:c,targetX:l,targetY:s,targetPosition:f}),L=e.isInternal?void 0:t;return g.jsx(ud,{id:L,path:k,labelX:C,labelY:A,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,interactionWidth:N})})}const LH=t2({isInternal:!1}),n2=t2({isInternal:!0});LH.displayName="SimpleBezierEdge";n2.displayName="SimpleBezierEdgeInternal";function r2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:x,sourcePosition:b=Ce.Bottom,targetPosition:E=Ce.Top,markerEnd:S,markerStart:_,pathOptions:N,interactionWidth:k})=>{const[C,A,L]=Jp({sourceX:r,sourceY:i,sourcePosition:b,targetX:l,targetY:s,targetPosition:E,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),j=e.isInternal?void 0:t;return g.jsx(ud,{id:j,path:C,labelX:A,labelY:L,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:x,markerEnd:S,markerStart:_,interactionWidth:k})})}const o2=r2({isInternal:!1}),i2=r2({isInternal:!0});o2.displayName="SmoothStepEdge";i2.displayName="SmoothStepEdgeInternal";function l2(e){return w.memo(({id:t,...r})=>{const i=e.isInternal?void 0:t;return g.jsx(o2,{...r,id:i,pathOptions:w.useMemo(()=>({borderRadius:0,offset:r.pathOptions?.offset}),[r.pathOptions?.offset])})})}const IH=l2({isInternal:!1}),a2=l2({isInternal:!0});IH.displayName="StepEdge";a2.displayName="StepEdgeInternal";function s2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:x,markerEnd:b,markerStart:E,interactionWidth:S})=>{const[_,N,k]=N_({sourceX:r,sourceY:i,targetX:l,targetY:s}),C=e.isInternal?void 0:t;return g.jsx(ud,{id:C,path:_,labelX:N,labelY:k,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:p,style:x,markerEnd:b,markerStart:E,interactionWidth:S})})}const BH=s2({isInternal:!1}),c2=s2({isInternal:!0});BH.displayName="StraightEdge";c2.displayName="StraightEdgeInternal";function u2(e){return w.memo(({id:t,sourceX:r,sourceY:i,targetX:l,targetY:s,sourcePosition:c=Ce.Bottom,targetPosition:f=Ce.Top,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,pathOptions:N,interactionWidth:k})=>{const[C,A,L]=E_({sourceX:r,sourceY:i,sourcePosition:c,targetX:l,targetY:s,targetPosition:f,curvature:N?.curvature}),j=e.isInternal?void 0:t;return g.jsx(ud,{id:j,path:C,labelX:A,labelY:L,label:h,labelStyle:d,labelShowBg:m,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:_,interactionWidth:k})})}const HH=u2({isInternal:!1}),f2=u2({isInternal:!0});HH.displayName="BezierEdge";f2.displayName="BezierEdgeInternal";const m1={default:f2,straight:c2,step:a2,smoothstep:i2,simplebezier:n2},p1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},PH=(e,t,r)=>r===Ce.Left?e-t:r===Ce.Right?e+t:e,UH=(e,t,r)=>r===Ce.Top?e-t:r===Ce.Bottom?e+t:e,g1="react-flow__edgeupdater";function y1({position:e,centerX:t,centerY:r,radius:i=10,onMouseDown:l,onMouseEnter:s,onMouseOut:c,type:f}){return g.jsx("circle",{onMouseDown:l,onMouseEnter:s,onMouseOut:c,className:At([g1,`${g1}-${f}`]),cx:PH(t,i,e),cy:UH(r,i,e),r:i,stroke:"transparent",fill:"transparent"})}function VH({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:i,sourceY:l,targetX:s,targetY:c,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:m,onReconnectEnd:p,setReconnecting:x,setUpdateHover:b}){const E=mt(),S=(A,L)=>{if(A.button!==0)return;const{autoPanOnConnect:j,domNode:z,connectionMode:P,connectionRadius:H,lib:X,onConnectStart:q,cancelConnection:F,nodeLookup:Y,rfId:O,panBy:U,updateConnection:R}=E.getState(),V=L.type==="target",$=(B,G)=>{x(!1),p?.(B,r,L.type,G)},W=B=>d?.(r,B),M=(B,G)=>{x(!0),m?.(A,r,L.type),q?.(B,G)};ng.onPointerDown(A.nativeEvent,{autoPanOnConnect:j,connectionMode:P,connectionRadius:H,domNode:z,handleId:L.id,nodeId:L.nodeId,nodeLookup:Y,isTarget:V,edgeUpdaterType:L.type,lib:X,flowId:O,cancelConnection:F,panBy:U,isValidConnection:(...B)=>E.getState().isValidConnection?.(...B)??!0,onConnect:W,onConnectStart:M,onConnectEnd:(...B)=>E.getState().onConnectEnd?.(...B),onReconnectEnd:$,updateConnection:R,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:A.currentTarget})},_=A=>S(A,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),N=A=>S(A,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),k=()=>b(!0),C=()=>b(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx(y1,{position:f,centerX:i,centerY:l,radius:t,onMouseDown:_,onMouseEnter:k,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&g.jsx(y1,{position:h,centerX:s,centerY:c,radius:t,onMouseDown:N,onMouseEnter:k,onMouseOut:C,type:"target"})]})}function $H({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:i,onClick:l,onDoubleClick:s,onContextMenu:c,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:m,onReconnect:p,onReconnectStart:x,onReconnectEnd:b,rfId:E,edgeTypes:S,noPanClassName:_,onError:N,disableKeyboardA11y:k}){let C=Fe(ge=>ge.edgeLookup.get(e));const A=Fe(ge=>ge.defaultEdgeOptions);C=A?{...A,...C}:C;let L=C.type||"default",j=S?.[L]||m1[L];j===void 0&&(N?.("011",Er.error011(L)),L="default",j=S?.default||m1.default);const z=!!(C.focusable||t&&typeof C.focusable>"u"),P=typeof p<"u"&&(C.reconnectable||r&&typeof C.reconnectable>"u"),H=!!(C.selectable||i&&typeof C.selectable>"u"),X=w.useRef(null),[q,F]=w.useState(!1),[Y,O]=w.useState(!1),U=mt(),{zIndex:R,sourceX:V,sourceY:$,targetX:W,targetY:M,sourcePosition:B,targetPosition:G}=Fe(w.useCallback(ge=>{const xe=ge.nodeLookup.get(C.source),_e=ge.nodeLookup.get(C.target);if(!xe||!_e)return{zIndex:C.zIndex,...p1};const $e=L6({id:e,sourceNode:xe,targetNode:_e,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:ge.connectionMode,onError:N});return{zIndex:T6({selected:C.selected,zIndex:C.zIndex,sourceNode:xe,targetNode:_e,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...$e||p1}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),ht),D=w.useMemo(()=>C.markerStart?`url('#${eg(C.markerStart,E)}')`:void 0,[C.markerStart,E]),oe=w.useMemo(()=>C.markerEnd?`url('#${eg(C.markerEnd,E)}')`:void 0,[C.markerEnd,E]);if(C.hidden||V===null||$===null||W===null||M===null)return null;const K=ge=>{const{addSelectedEdges:xe,unselectNodesAndEdges:_e,multiSelectionActive:$e}=U.getState();H&&(U.setState({nodesSelectionActive:!1}),C.selected&&$e?(_e({nodes:[],edges:[C]}),X.current?.blur()):xe([e])),l&&l(ge,C)},J=s?ge=>{s(ge,{...C})}:void 0,te=c?ge=>{c(ge,{...C})}:void 0,ne=f?ge=>{f(ge,{...C})}:void 0,se=h?ge=>{h(ge,{...C})}:void 0,he=d?ge=>{d(ge,{...C})}:void 0,me=ge=>{if(!k&&s_.includes(ge.key)&&H){const{unselectNodesAndEdges:xe,addSelectedEdges:_e}=U.getState();ge.key==="Escape"?(X.current?.blur(),xe({edges:[C]})):_e([e])}};return g.jsx("svg",{style:{zIndex:R},children:g.jsxs("g",{className:At(["react-flow__edge",`react-flow__edge-${L}`,C.className,_,{selected:C.selected,animated:C.animated,inactive:!H&&!l,updating:q,selectable:H}]),onClick:K,onDoubleClick:J,onContextMenu:te,onMouseEnter:ne,onMouseMove:se,onMouseLeave:he,onKeyDown:z?me:void 0,tabIndex:z?0:void 0,role:C.ariaRole??(z?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":z?`${P_}-${E}`:void 0,ref:X,...C.domAttributes,children:[!Y&&g.jsx(j,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:H,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:V,sourceY:$,targetX:W,targetY:M,sourcePosition:B,targetPosition:G,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:D,markerEnd:oe,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),P&&g.jsx(VH,{edge:C,isReconnectable:P,reconnectRadius:m,onReconnect:p,onReconnectStart:x,onReconnectEnd:b,sourceX:V,sourceY:$,targetX:W,targetY:M,sourcePosition:B,targetPosition:G,setUpdateHover:F,setReconnecting:O})]})})}var YH=w.memo($H);const qH=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function d2({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:i,noPanClassName:l,onReconnect:s,onEdgeContextMenu:c,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:m,reconnectRadius:p,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:E,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:N,elementsSelectable:k,onError:C}=Fe(qH,ht),A=AH(t);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(DH,{defaultColor:e,rfId:r}),A.map(L=>g.jsx(YH,{id:L,edgesFocusable:_,edgesReconnectable:N,elementsSelectable:k,noPanClassName:l,onReconnect:s,onContextMenu:c,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:m,reconnectRadius:p,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:E,rfId:r,onError:C,edgeTypes:i,disableKeyboardA11y:S},L))]})}d2.displayName="EdgeRenderer";const FH=w.memo(d2),XH=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function GH({children:e}){const t=Fe(XH);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WH(e){const t=sd(),r=w.useRef(!1);w.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const ZH=e=>e.panZoom?.syncViewport;function KH(e){const t=Fe(ZH),r=mt();return w.useEffect(()=>{e&&(t?.(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function QH(e){return e.connection.inProgress?{...e.connection,to:ec(e.connection.to,e.transform)}:{...e.connection}}function JH(e){return QH}function eP(e){const t=JH();return Fe(t,ht)}const tP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function nP({containerStyle:e,style:t,type:r,component:i}){const{nodesConnectable:l,width:s,height:c,isValid:f,inProgress:h}=Fe(tP,ht);return!(s&&l&&h)?null:g.jsx("svg",{style:e,width:s,height:c,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:At(["react-flow__connection",f_(f)]),children:g.jsx(h2,{style:t,type:r,CustomComponent:i,isValid:f})})})}const h2=({style:e,type:t=Go.Bezier,CustomComponent:r,isValid:i})=>{const{inProgress:l,from:s,fromNode:c,fromHandle:f,fromPosition:h,to:d,toNode:m,toHandle:p,toPosition:x,pointer:b}=eP();if(!l)return;if(r)return g.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:f,fromX:s.x,fromY:s.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:f_(i),toNode:m,toHandle:p,pointer:b});let E="";const S={sourceX:s.x,sourceY:s.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(t){case Go.Bezier:[E]=E_(S);break;case Go.SimpleBezier:[E]=e2(S);break;case Go.Step:[E]=Jp({...S,borderRadius:0});break;case Go.SmoothStep:[E]=Jp(S);break;default:[E]=N_(S)}return g.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};h2.displayName="ConnectionLine";const rP={};function x1(e=rP){w.useRef(e),mt(),w.useEffect(()=>{},[e])}function oP(){mt(),w.useRef(!1),w.useEffect(()=>{},[])}function m2({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:s,onEdgeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:m,onSelectionContextMenu:p,onSelectionStart:x,onSelectionEnd:b,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:N,selectionKeyCode:k,selectionOnDrag:C,selectionMode:A,multiSelectionKeyCode:L,panActivationKeyCode:j,zoomActivationKeyCode:z,deleteKeyCode:P,onlyRenderVisibleElements:H,elementsSelectable:X,defaultViewport:q,translateExtent:F,minZoom:Y,maxZoom:O,preventScrolling:U,defaultMarkerColor:R,zoomOnScroll:V,zoomOnPinch:$,panOnScroll:W,panOnScrollSpeed:M,panOnScrollMode:B,zoomOnDoubleClick:G,panOnDrag:D,onPaneClick:oe,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:te,onPaneScroll:ne,onPaneContextMenu:se,paneClickDistance:he,nodeClickDistance:me,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:_e,onEdgeMouseLeave:$e,reconnectRadius:Pe,onReconnect:st,onReconnectStart:fn,onReconnectEnd:Vt,noDragClassName:Kt,noWheelClassName:Vn,noPanClassName:Rr,disableKeyboardA11y:jr,nodeExtent:Rt,rfId:ho,viewport:ce,onViewportChange:ye}){return x1(e),x1(t),oP(),WH(r),KH(ce),g.jsx(vH,{onPaneClick:oe,onPaneMouseEnter:K,onPaneMouseMove:J,onPaneMouseLeave:te,onPaneContextMenu:se,onPaneScroll:ne,paneClickDistance:he,deleteKeyCode:P,selectionKeyCode:k,selectionOnDrag:C,selectionMode:A,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:L,panActivationKeyCode:j,zoomActivationKeyCode:z,elementsSelectable:X,zoomOnScroll:V,zoomOnPinch:$,zoomOnDoubleClick:G,panOnScroll:W,panOnScrollSpeed:M,panOnScrollMode:B,panOnDrag:D,defaultViewport:q,translateExtent:F,minZoom:Y,maxZoom:O,onSelectionContextMenu:p,preventScrolling:U,noDragClassName:Kt,noWheelClassName:Vn,noPanClassName:Rr,disableKeyboardA11y:jr,onViewportChange:ye,isControlledViewport:!!ce,children:g.jsxs(GH,{children:[g.jsx(FH,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:c,onReconnect:st,onReconnectStart:fn,onReconnectEnd:Vt,onlyRenderVisibleElements:H,onEdgeContextMenu:ge,onEdgeMouseEnter:xe,onEdgeMouseMove:_e,onEdgeMouseLeave:$e,reconnectRadius:Pe,defaultMarkerColor:R,noPanClassName:Rr,disableKeyboardA11y:jr,rfId:ho}),g.jsx(nP,{style:S,type:E,component:_,containerStyle:N}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(TH,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:m,nodeClickDistance:me,onlyRenderVisibleElements:H,noPanClassName:Rr,noDragClassName:Kt,disableKeyboardA11y:jr,nodeExtent:Rt,rfId:ho}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}m2.displayName="GraphView";const iP=w.memo(m2),v1=({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,width:l,height:s,fitView:c,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:m,nodeExtent:p,zIndexMode:x="basic"}={})=>{const b=new Map,E=new Map,S=new Map,_=new Map,N=i??t??[],k=r??e??[],C=m??[0,0],A=p??Ds;T_(S,_,N);const L=tg(k,b,E,{nodeOrigin:C,nodeExtent:A,zIndexMode:x});let j=[0,0,1];if(c&&l&&s){const z=Qs(b,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:P,y:H,zoom:X}=hy(z,l,s,h,d,f?.padding??.1);j=[P,H,X]}return{rfId:"1",width:l??0,height:s??0,transform:j,nodes:k,nodesInitialized:L,nodeLookup:b,parentLookup:E,edges:N,edgeLookup:_,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:Ds,nodeExtent:A,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Zl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,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:c??!1,fitViewOptions:f,fitViewResolver:null,connection:{...u_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:S6,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:c_,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},lP=({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,width:l,height:s,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:m,nodeExtent:p,zIndexMode:x})=>CB((b,E)=>{async function S(){const{nodeLookup:_,panZoom:N,fitViewOptions:k,fitViewResolver:C,width:A,height:L,minZoom:j,maxZoom:z}=E();N&&(await b6({nodes:_,width:A,height:L,panZoom:N,minZoom:j,maxZoom:z},k),C?.resolve(!0),b({fitViewResolver:null}))}return{...v1({nodes:e,edges:t,width:l,height:s,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:m,nodeExtent:p,defaultNodes:r,defaultEdges:i,zIndexMode:x}),setNodes:_=>{const{nodeLookup:N,parentLookup:k,nodeOrigin:C,elevateNodesOnSelect:A,fitViewQueued:L,zIndexMode:j}=E(),z=tg(_,N,k,{nodeOrigin:C,nodeExtent:p,elevateNodesOnSelect:A,checkEquality:!0,zIndexMode:j});L&&z?(S(),b({nodes:_,nodesInitialized:z,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:_,nodesInitialized:z})},setEdges:_=>{const{connectionLookup:N,edgeLookup:k}=E();T_(N,k,_),b({edges:_})},setDefaultNodesAndEdges:(_,N)=>{if(_){const{setNodes:k}=E();k(_),b({hasDefaultNodes:!0})}if(N){const{setEdges:k}=E();k(N),b({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:N,nodeLookup:k,parentLookup:C,domNode:A,nodeOrigin:L,nodeExtent:j,debug:z,fitViewQueued:P,zIndexMode:H}=E(),{changes:X,updatedInternals:q}=Y6(_,k,C,A,L,j,H);q&&(P6(k,C,{nodeOrigin:L,nodeExtent:j,zIndexMode:H}),P?(S(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),X?.length>0&&(z&&console.log("React Flow: trigger node changes",X),N?.(X)))},updateNodePositions:(_,N=!1)=>{const k=[];let C=[];const{nodeLookup:A,triggerNodeChanges:L,connection:j,updateConnection:z,onNodesChangeMiddlewareMap:P}=E();for(const[H,X]of _){const q=A.get(H),F=!!(q?.expandParent&&q?.parentId&&X?.position),Y={id:H,type:"position",position:F?{x:Math.max(0,X.position.x),y:Math.max(0,X.position.y)}:X.position,dragging:N};if(q&&j.inProgress&&j.fromNode.id===q.id){const O=Pi(q,j.fromHandle,Ce.Left,!0);z({...j,from:O})}F&&q.parentId&&k.push({id:H,parentId:q.parentId,rect:{...X.internals.positionAbsolute,width:X.measured.width??0,height:X.measured.height??0}}),C.push(Y)}if(k.length>0){const{parentLookup:H,nodeOrigin:X}=E(),q=vy(k,A,H,X);C.push(...q)}for(const H of P.values())C=H(C);L(C)},triggerNodeChanges:_=>{const{onNodesChange:N,setNodes:k,nodes:C,hasDefaultNodes:A,debug:L}=E();if(_?.length){if(A){const j=$_(_,C);k(j)}L&&console.log("React Flow: trigger node changes",_),N?.(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:N,setEdges:k,edges:C,hasDefaultEdges:A,debug:L}=E();if(_?.length){if(A){const j=Y_(_,C);k(j)}L&&console.log("React Flow: trigger edge changes",_),N?.(_)}},addSelectedNodes:_=>{const{multiSelectionActive:N,edgeLookup:k,nodeLookup:C,triggerNodeChanges:A,triggerEdgeChanges:L}=E();if(N){const j=_.map(z=>ki(z,!0));A(j);return}A(Il(C,new Set([..._]),!0)),L(Il(k))},addSelectedEdges:_=>{const{multiSelectionActive:N,edgeLookup:k,nodeLookup:C,triggerNodeChanges:A,triggerEdgeChanges:L}=E();if(N){const j=_.map(z=>ki(z,!0));L(j);return}L(Il(k,new Set([..._]))),A(Il(C,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:N}={})=>{const{edges:k,nodes:C,nodeLookup:A,triggerNodeChanges:L,triggerEdgeChanges:j}=E(),z=_||C,P=N||k,H=[];for(const q of z){if(!q.selected)continue;const F=A.get(q.id);F&&(F.selected=!1),H.push(ki(q.id,!1))}const X=[];for(const q of P)q.selected&&X.push(ki(q.id,!1));L(H),j(X)},setMinZoom:_=>{const{panZoom:N,maxZoom:k}=E();N?.setScaleExtent([_,k]),b({minZoom:_})},setMaxZoom:_=>{const{panZoom:N,minZoom:k}=E();N?.setScaleExtent([k,_]),b({maxZoom:_})},setTranslateExtent:_=>{E().panZoom?.setTranslateExtent(_),b({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:N,triggerNodeChanges:k,triggerEdgeChanges:C,elementsSelectable:A}=E();if(!A)return;const L=N.reduce((z,P)=>P.selected?[...z,ki(P.id,!1)]:z,[]),j=_.reduce((z,P)=>P.selected?[...z,ki(P.id,!1)]:z,[]);k(L),C(j)},setNodeExtent:_=>{const{nodes:N,nodeLookup:k,parentLookup:C,nodeOrigin:A,elevateNodesOnSelect:L,nodeExtent:j,zIndexMode:z}=E();_[0][0]===j[0][0]&&_[0][1]===j[0][1]&&_[1][0]===j[1][0]&&_[1][1]===j[1][1]||(tg(N,k,C,{nodeOrigin:A,nodeExtent:_,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:z}),b({nodeExtent:_}))},panBy:_=>{const{transform:N,width:k,height:C,panZoom:A,translateExtent:L}=E();return q6({delta:_,panZoom:A,transform:N,translateExtent:L,width:k,height:C})},setCenter:async(_,N,k)=>{const{width:C,height:A,maxZoom:L,panZoom:j}=E();if(!j)return Promise.resolve(!1);const z=typeof k?.zoom<"u"?k.zoom:L;return await j.setViewport({x:C/2-_*z,y:A/2-N*z,zoom:z},{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...u_}})},updateConnection:_=>{b({connection:_})},reset:()=>b({...v1()})}},Object.is);function p2({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:i,initialWidth:l,initialHeight:s,initialMinZoom:c,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:m,nodeExtent:p,zIndexMode:x,children:b}){const[E]=w.useState(()=>lP({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,width:l,height:s,fitView:d,minZoom:c,maxZoom:f,fitViewOptions:h,nodeOrigin:m,nodeExtent:p,zIndexMode:x}));return g.jsx(NB,{value:E,children:g.jsx(GB,{children:b})})}function aP({children:e,nodes:t,edges:r,defaultNodes:i,defaultEdges:l,width:s,height:c,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:m,nodeOrigin:p,nodeExtent:x,zIndexMode:b}){return w.useContext(ld)?g.jsx(g.Fragment,{children:e}):g.jsx(p2,{initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:l,initialWidth:s,initialHeight:c,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:m,nodeOrigin:p,nodeExtent:x,zIndexMode:b,children:e})}const sP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function cP({nodes:e,edges:t,defaultNodes:r,defaultEdges:i,className:l,nodeTypes:s,edgeTypes:c,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:m,onMoveStart:p,onMoveEnd:x,onConnect:b,onConnectStart:E,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:N,onNodeMouseEnter:k,onNodeMouseMove:C,onNodeMouseLeave:A,onNodeContextMenu:L,onNodeDoubleClick:j,onNodeDragStart:z,onNodeDrag:P,onNodeDragStop:H,onNodesDelete:X,onEdgesDelete:q,onDelete:F,onSelectionChange:Y,onSelectionDragStart:O,onSelectionDrag:U,onSelectionDragStop:R,onSelectionContextMenu:V,onSelectionStart:$,onSelectionEnd:W,onBeforeDelete:M,connectionMode:B,connectionLineType:G=Go.Bezier,connectionLineStyle:D,connectionLineComponent:oe,connectionLineContainerStyle:K,deleteKeyCode:J="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ne=!1,selectionMode:se=zs.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:me=Bs()?"Meta":"Control",zoomActivationKeyCode:ge=Bs()?"Meta":"Control",snapToGrid:xe,snapGrid:_e,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:Pe,nodesDraggable:st,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:Kt,nodeOrigin:Vn=U_,edgesFocusable:Rr,edgesReconnectable:jr,elementsSelectable:Rt=!0,defaultViewport:ho=BB,minZoom:ce=.5,maxZoom:ye=2,translateExtent:ke=Ds,preventScrolling:Le=!0,nodeExtent:qe,defaultMarkerColor:Xt="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:Lt=!0,panOnScroll:vt=!1,panOnScrollSpeed:$t=.5,panOnScrollMode:Qe=Ri.Free,zoomOnDoubleClick:ar=!0,panOnDrag:dn=!0,onPaneClick:xd,onPaneMouseEnter:Yi,onPaneMouseMove:qi,onPaneMouseLeave:Fi,onPaneScroll:Mr,onPaneContextMenu:Xi,paneClickDistance:ii=1,nodeClickDistance:vd=0,children:rc,onReconnect:da,onReconnectStart:li,onReconnectEnd:bd,onEdgeContextMenu:oc,onEdgeDoubleClick:ic,onEdgeMouseEnter:lc,onEdgeMouseMove:ha,onEdgeMouseLeave:ma,reconnectRadius:ac=10,onNodesChange:sc,onEdgesChange:sr,noDragClassName:jt="nodrag",noWheelClassName:Yt="nowheel",noPanClassName:Or="nopan",fitView:Gi,fitViewOptions:cc,connectOnClick:wd,attributionPosition:uc,proOptions:ai,defaultEdgeOptions:pa,elevateNodesOnSelect:mo=!0,elevateEdgesOnSelect:po=!1,disableKeyboardA11y:go=!1,autoPanOnConnect:yo,autoPanOnNodeDrag:Et,autoPanSpeed:fc,connectionRadius:dc,isValidConnection:Dr,onError:xo,style:Sd,id:ga,nodeDragThreshold:hc,connectionDragThreshold:Ed,viewport:Wi,onViewportChange:Zi,width:Yn,height:Qt,colorMode:mc="light",debug:Cd,onScroll:Ki,ariaLabelConfig:pc,zIndexMode:si="basic",...Nd},Jt){const ci=ga||"1",gc=VB(mc),ya=w.useCallback(zr=>{zr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ki?.(zr)},[Ki]);return g.jsx("div",{"data-testid":"rf__wrapper",...Nd,onScroll:ya,style:{...Sd,...sP},ref:Jt,className:At(["react-flow",l,gc]),id:ga,role:"application",children:g.jsxs(aP,{nodes:e,edges:t,width:Yn,height:Qt,fitView:Gi,fitViewOptions:cc,minZoom:ce,maxZoom:ye,nodeOrigin:Vn,nodeExtent:qe,zIndexMode:si,children:[g.jsx(iP,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:k,onNodeMouseMove:C,onNodeMouseLeave:A,onNodeContextMenu:L,onNodeDoubleClick:j,nodeTypes:s,edgeTypes:c,connectionLineType:G,connectionLineStyle:D,connectionLineComponent:oe,connectionLineContainerStyle:K,selectionKeyCode:te,selectionOnDrag:ne,selectionMode:se,deleteKeyCode:J,multiSelectionKeyCode:me,panActivationKeyCode:he,zoomActivationKeyCode:ge,onlyRenderVisibleElements:$e,defaultViewport:ho,translateExtent:ke,minZoom:ce,maxZoom:ye,preventScrolling:Le,zoomOnScroll:$n,zoomOnPinch:Lt,zoomOnDoubleClick:ar,panOnScroll:vt,panOnScrollSpeed:$t,panOnScrollMode:Qe,panOnDrag:dn,onPaneClick:xd,onPaneMouseEnter:Yi,onPaneMouseMove:qi,onPaneMouseLeave:Fi,onPaneScroll:Mr,onPaneContextMenu:Xi,paneClickDistance:ii,nodeClickDistance:vd,onSelectionContextMenu:V,onSelectionStart:$,onSelectionEnd:W,onReconnect:da,onReconnectStart:li,onReconnectEnd:bd,onEdgeContextMenu:oc,onEdgeDoubleClick:ic,onEdgeMouseEnter:lc,onEdgeMouseMove:ha,onEdgeMouseLeave:ma,reconnectRadius:ac,defaultMarkerColor:Xt,noDragClassName:jt,noWheelClassName:Yt,noPanClassName:Or,rfId:ci,disableKeyboardA11y:go,nodeExtent:qe,viewport:Wi,onViewportChange:Zi}),g.jsx(UB,{nodes:e,edges:t,defaultNodes:r,defaultEdges:i,onConnect:b,onConnectStart:E,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:N,nodesDraggable:st,autoPanOnNodeFocus:fn,nodesConnectable:Vt,nodesFocusable:Kt,edgesFocusable:Rr,edgesReconnectable:jr,elementsSelectable:Rt,elevateNodesOnSelect:mo,elevateEdgesOnSelect:po,minZoom:ce,maxZoom:ye,nodeExtent:qe,onNodesChange:sc,onEdgesChange:sr,snapToGrid:xe,snapGrid:_e,connectionMode:B,translateExtent:ke,connectOnClick:wd,defaultEdgeOptions:pa,fitView:Gi,fitViewOptions:cc,onNodesDelete:X,onEdgesDelete:q,onDelete:F,onNodeDragStart:z,onNodeDrag:P,onNodeDragStop:H,onSelectionDrag:U,onSelectionDragStart:O,onSelectionDragStop:R,onMove:m,onMoveStart:p,onMoveEnd:x,noPanClassName:Or,nodeOrigin:Vn,rfId:ci,autoPanOnConnect:yo,autoPanOnNodeDrag:Et,autoPanSpeed:fc,onError:xo,connectionRadius:dc,isValidConnection:Dr,selectNodesOnDrag:Pe,nodeDragThreshold:hc,connectionDragThreshold:Ed,onBeforeDelete:M,debug:Cd,ariaLabelConfig:pc,zIndexMode:si}),g.jsx(IB,{onSelectionChange:Y}),rc,g.jsx(MB,{proOptions:ai,position:uc}),g.jsx(jB,{rfId:ci,disableKeyboardA11y:go})]})})}var uP=q_(cP);function fP(e){const[t,r]=w.useState(e),i=w.useCallback(l=>r(s=>$_(l,s)),[]);return[t,r,i]}function dP(e){const[t,r]=w.useState(e),i=w.useCallback(l=>r(s=>Y_(l,s)),[]);return[t,r,i]}function hP({dimensions:e,lineWidth:t,variant:r,className:i}){return g.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:At(["react-flow__background-pattern",r,i])})}function mP({radius:e,className:t}){return g.jsx("circle",{cx:e,cy:e,r:e,className:At(["react-flow__background-pattern","dots",t])})}var oo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(oo||(oo={}));const pP={[oo.Dots]:1,[oo.Lines]:1,[oo.Cross]:6},gP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function g2({id:e,variant:t=oo.Dots,gap:r=20,size:i,lineWidth:l=1,offset:s=0,color:c,bgColor:f,style:h,className:d,patternClassName:m}){const p=w.useRef(null),{transform:x,patternId:b}=Fe(gP,ht),E=i||pP[t],S=t===oo.Dots,_=t===oo.Cross,N=Array.isArray(r)?r:[r,r],k=[N[0]*x[2]||1,N[1]*x[2]||1],C=E*x[2],A=Array.isArray(s)?s:[s,s],L=_?[C,C]:k,j=[A[0]*x[2]||1+L[0]/2,A[1]*x[2]||1+L[1]/2],z=`${b}${e||""}`;return g.jsxs("svg",{className:At(["react-flow__background",d]),style:{...h,...cd,"--xy-background-color-props":f,"--xy-background-pattern-color-props":c},ref:p,"data-testid":"rf__background",children:[g.jsx("pattern",{id:z,x:x[0]%k[0],y:x[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:S?g.jsx(mP,{radius:C/2,className:m}):g.jsx(hP,{dimensions:L,lineWidth:l,variant:t,className:m})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${z})`})]})}g2.displayName="Background";const yP=w.memo(g2);function xP(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function vP(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function bP(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.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 wP(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 SP(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.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 qu({children:e,className:t,...r}){return g.jsx("button",{type:"button",className:At(["react-flow__controls-button",t]),...r,children:e})}const EP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function y2({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:i=!0,fitViewOptions:l,onZoomIn:s,onZoomOut:c,onFitView:f,onInteractiveChange:h,className:d,children:m,position:p="bottom-left",orientation:x="vertical","aria-label":b}){const E=mt(),{isInteractive:S,minZoomReached:_,maxZoomReached:N,ariaLabelConfig:k}=Fe(EP,ht),{zoomIn:C,zoomOut:A,fitView:L}=sd(),j=()=>{C(),s?.()},z=()=>{A(),c?.()},P=()=>{L(l),f?.()},H=()=>{E.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),h?.(!S)},X=x==="horizontal"?"horizontal":"vertical";return g.jsxs(ad,{className:At(["react-flow__controls",X,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":b??k["controls.ariaLabel"],children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(qu,{onClick:j,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:N,children:g.jsx(xP,{})}),g.jsx(qu,{onClick:z,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:_,children:g.jsx(vP,{})})]}),r&&g.jsx(qu,{className:"react-flow__controls-fitview",onClick:P,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:g.jsx(bP,{})}),i&&g.jsx(qu,{className:"react-flow__controls-interactive",onClick:H,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:S?g.jsx(SP,{}):g.jsx(wP,{})}),m]})}y2.displayName="Controls";const CP=w.memo(y2);function NP({id:e,x:t,y:r,width:i,height:l,style:s,color:c,strokeColor:f,strokeWidth:h,className:d,borderRadius:m,shapeRendering:p,selected:x,onClick:b}){const{background:E,backgroundColor:S}=s||{},_=c||E||S;return g.jsx("rect",{className:At(["react-flow__minimap-node",{selected:x},d]),x:t,y:r,rx:m,ry:m,width:i,height:l,style:{fill:_,stroke:f,strokeWidth:h},shapeRendering:p,onClick:b?N=>b(N,e):void 0})}const _P=w.memo(NP),kP=e=>e.nodes.map(t=>t.id),cp=e=>e instanceof Function?e:()=>e;function TP({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:s=_P,onClick:c}){const f=Fe(kP,ht),h=cp(t),d=cp(e),m=cp(r),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:f.map(x=>g.jsx(RP,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:l,NodeComponent:s,onClick:c,shapeRendering:p},x))})}function AP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:i,nodeBorderRadius:l,nodeStrokeWidth:s,shapeRendering:c,NodeComponent:f,onClick:h}){const{node:d,x:m,y:p,width:x,height:b}=Fe(E=>{const S=E.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const _=S.internals.userNode,{x:N,y:k}=S.internals.positionAbsolute,{width:C,height:A}=fo(_);return{node:_,x:N,y:k,width:C,height:A}},ht);return!d||d.hidden||!y_(d)?null:g.jsx(f,{x:m,y:p,width:x,height:b,style:d.style,selected:!!d.selected,className:i(d),color:t(d),borderRadius:l,strokeColor:r(d),strokeWidth:s,shapeRendering:c,onClick:h,id:d.id})}const RP=w.memo(AP);var jP=w.memo(TP);const MP=200,OP=150,DP=e=>!e.hidden,zP=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?g_(Qs(e.nodeLookup,{filter:DP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},LP="react-flow__minimap-desc";function x2({style:e,className:t,nodeStrokeColor:r,nodeColor:i,nodeClassName:l="",nodeBorderRadius:s=5,nodeStrokeWidth:c,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:m,maskStrokeWidth:p,position:x="bottom-right",onClick:b,onNodeClick:E,pannable:S=!1,zoomable:_=!1,ariaLabel:N,inversePan:k,zoomStep:C=1,offsetScale:A=5}){const L=mt(),j=w.useRef(null),{boundingRect:z,viewBB:P,rfId:H,panZoom:X,translateExtent:q,flowWidth:F,flowHeight:Y,ariaLabelConfig:O}=Fe(zP,ht),U=e?.width??MP,R=e?.height??OP,V=z.width/U,$=z.height/R,W=Math.max(V,$),M=W*U,B=W*R,G=A*W,D=z.x-(M-z.width)/2-G,oe=z.y-(B-z.height)/2-G,K=M+G*2,J=B+G*2,te=`${LP}-${H}`,ne=w.useRef(0),se=w.useRef();ne.current=W,w.useEffect(()=>{if(j.current&&X)return se.current=eB({domNode:j.current,panZoom:X,getTransform:()=>L.getState().transform,getViewScale:()=>ne.current}),()=>{se.current?.destroy()}},[X]),w.useEffect(()=>{se.current?.update({translateExtent:q,width:F,height:Y,inversePan:k,pannable:S,zoomStep:C,zoomable:_})},[S,_,k,C,q,F,Y]);const he=b?xe=>{const[_e,$e]=se.current?.pointer(xe)||[0,0];b(xe,{x:_e,y:$e})}:void 0,me=E?w.useCallback((xe,_e)=>{const $e=L.getState().nodeLookup.get(_e).internals.userNode;E(xe,$e)},[]):void 0,ge=N??O["minimap.ariaLabel"];return g.jsx(ad,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*W:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:At(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:U,height:R,viewBox:`${D} ${oe} ${K} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:j,onClick:he,children:[ge&&g.jsx("title",{id:te,children:ge}),g.jsx(jP,{onClick:me,nodeColor:i,nodeStrokeColor:r,nodeBorderRadius:s,nodeClassName:l,nodeStrokeWidth:c,nodeComponent:f}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${D-G},${oe-G}h${K+G*2}v${J+G*2}h${-K-G*2}z
62
+ M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}x2.displayName="MiniMap";w.memo(x2);const IP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,BP={[ea.Line]:"right",[ea.Handle]:"bottom-right"};function HP({nodeId:e,position:t,variant:r=ea.Handle,className:i,style:l=void 0,children:s,color:c,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:x,autoScale:b=!0,shouldResize:E,onResizeStart:S,onResize:_,onResizeEnd:N}){const k=W_(),C=typeof e=="string"?e:k,A=mt(),L=w.useRef(null),j=r===ea.Handle,z=Fe(w.useCallback(IP(j&&b),[j,b]),ht),P=w.useRef(null),H=t??BP[r];w.useEffect(()=>{if(!(!L.current||!C))return P.current||(P.current=mB({domNode:L.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:q,transform:F,snapGrid:Y,snapToGrid:O,nodeOrigin:U,domNode:R}=A.getState();return{nodeLookup:q,transform:F,snapGrid:Y,snapToGrid:O,nodeOrigin:U,paneDomNode:R}},onChange:(q,F)=>{const{triggerNodeChanges:Y,nodeLookup:O,parentLookup:U,nodeOrigin:R}=A.getState(),V=[],$={x:q.x,y:q.y},W=O.get(C);if(W&&W.expandParent&&W.parentId){const M=W.origin??R,B=q.width??W.measured.width??0,G=q.height??W.measured.height??0,D={id:W.id,parentId:W.parentId,rect:{width:B,height:G,...x_({x:q.x??W.position.x,y:q.y??W.position.y},{width:B,height:G},W.parentId,O,M)}},oe=vy([D],O,U,R);V.push(...oe),$.x=q.x?Math.max(M[0]*B,q.x):void 0,$.y=q.y?Math.max(M[1]*G,q.y):void 0}if($.x!==void 0&&$.y!==void 0){const M={id:C,type:"position",position:{...$}};V.push(M)}if(q.width!==void 0&&q.height!==void 0){const B={id:C,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};V.push(B)}for(const M of F){const B={...M,type:"position"};V.push(B)}Y(V)},onEnd:({width:q,height:F})=>{const Y={id:C,type:"dimensions",resizing:!1,dimensions:{width:q,height:F}};A.getState().triggerNodeChanges([Y])}})),P.current.update({controlPosition:H,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:m},keepAspectRatio:p,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:N,shouldResize:E}),()=>{P.current?.destroy()}},[H,f,h,d,m,p,S,_,N,E]);const X=H.split("-");return g.jsx("div",{className:At(["react-flow__resize-control","nodrag",...X,r,i]),ref:L,style:{...l,scale:z,...c&&{[j?"backgroundColor":"borderColor"]:c}},children:s})}w.memo(HP);const b1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,w1=US,v2=(e,t)=>r=>{var i;if(t?.variants==null)return w1(e,r?.class,r?.className);const{variants:l,defaultVariants:s}=t,c=Object.keys(l).map(d=>{const m=r?.[d],p=s?.[d];if(m===null)return null;const x=b1(m)||b1(p);return l[d][x]}),f=r&&Object.entries(r).reduce((d,m)=>{let[p,x]=m;return x===void 0||(d[p]=x),d},{}),h=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,m)=>{let{class:p,className:x,...b}=m;return Object.entries(b).every(E=>{let[S,_]=E;return Array.isArray(_)?_.includes({...s,...f}[S]):{...s,...f}[S]===_})?[...d,p,x]:d},[]);return w1(e,c,h,r?.class,r?.className)},PP=v2("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Kn({className:e,variant:t="default",asChild:r=!1,...i}){const l=r?Gj:"span";return g.jsx(l,{"data-slot":"badge","data-variant":t,className:ve(PP({variant:t}),e),...i})}function S1(e){return e.length===0?"-":e.join(", ")}function b2(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}function UP(e){const{data:t}=e,r=t,i=r.stepStatus,l=r.changeStatus,s=i??l,c=r.type==="HUMAN_IN_THE_LOOP",f=r.requiredMcps??[],h=r.requiredSkills??[],d=f.length===0?" - ":f.join(", "),m=h.length===0?" - ":h.join(", ");return g.jsxs("div",{className:ve("rounded-2xl border-2 bg-card shadow-md hover:shadow-xl transition-all duration-150 min-w-[220px] cursor-pointer w-max max-w-[380px] overflow-hidden","hover:scale-[1.02] hover:-translate-y-0.5 ring-2 ring-primary/15","px-4 py-3 space-y-3",c&&"border-violet-500/60 bg-violet-500/5 dark:bg-violet-500/10",i==="completed"&&"border-emerald-500/70 bg-emerald-500/10 dark:bg-emerald-500/15",i==="running"&&"border-amber-500/70 bg-amber-500/10 dark:bg-amber-500/15 animate-pulse",i==="pending"&&"border-border bg-muted/30",!i&&l==="added"&&"border-green-500 bg-green-500/10 dark:bg-green-500/15",!i&&l==="changed"&&"border-amber-500 bg-amber-500/10 dark:bg-amber-500/15",!i&&l==="removed"&&"border-red-500/80 bg-red-500/10 dark:bg-red-500/15 opacity-70 border-dashed",!s&&"border-primary/30"),children:[g.jsx(ei,{type:"target",position:Ce.Top}),g.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[g.jsx("h3",{className:"font-semibold text-sm text-foreground break-words leading-tight",children:b2(r.nodeId)}),g.jsx(Kn,{variant:c?"default":"secondary",className:ve("text-[10px] font-medium shrink-0",c&&"bg-violet-600 hover:bg-violet-600 text-white"),children:r.type.replace(/_/g," ")})]}),g.jsxs("div",{className:"rounded-lg border border-border/70 bg-muted/40 px-3 py-2 space-y-2",children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx(P5,{className:"size-3.5 shrink-0 mt-0.5 text-muted-foreground","aria-hidden":!0}),g.jsxs("div",{className:"min-w-0 break-words",children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Input"}),g.jsx("div",{className:"text-xs font-medium text-foreground break-words mt-0.5",children:S1(r.input??[])})]})]}),g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsx(V5,{className:"size-3.5 shrink-0 mt-0.5 text-muted-foreground","aria-hidden":!0}),g.jsxs("div",{className:"min-w-0 break-words",children:[g.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-semibold",children:"Output"}),g.jsx("div",{className:"text-xs font-medium text-foreground break-words mt-0.5",children:S1(r.output??[])})]})]})]}),g.jsx("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 dark:bg-primary/10 px-3 py-2 min-h-[40px] flex items-center",children:g.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-medium text-foreground min-w-0 flex-1 flex-wrap",children:[g.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 break-words",children:[g.jsx(m3,{className:"size-3 text-primary shrink-0","aria-hidden":!0}),g.jsx("span",{className:"text-muted-foreground uppercase tracking-wider font-semibold shrink-0",children:"Skills"}),g.jsx("span",{className:"break-words",children:m})]}),g.jsx("span",{className:"text-border shrink-0","aria-hidden":!0,children:"·"}),g.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 break-words",children:[g.jsx(d3,{className:"size-3 text-primary shrink-0","aria-hidden":!0}),g.jsx("span",{className:"text-muted-foreground uppercase tracking-wider font-semibold shrink-0",children:"MCPs"}),g.jsx("span",{className:"break-words",children:d})]})]})}),i&&g.jsx("div",{className:"pt-0.5",children:g.jsx("span",{className:ve("inline-block text-xs font-semibold px-2.5 py-1 rounded-md",i==="completed"&&"bg-emerald-500/25 text-emerald-800 dark:text-emerald-200",i==="running"&&"bg-amber-500/25 text-amber-800 dark:text-amber-200",i==="pending"&&"bg-muted text-muted-foreground"),children:i})}),g.jsx(ei,{type:"source",position:Ce.Bottom})]})}const VP=w.memo(UP);function $P(e){const t=e.data,r=xr(t.kind);return g.jsxs("div",{className:ve("relative px-3 py-3 w-[180px] rounded-xl border-2 shadow-md text-sm cursor-pointer transition-all duration-150","hover:shadow-lg hover:scale-[1.03] hover:-translate-y-0.5",t.collected?"bg-emerald-500/10 border-emerald-500/70 ring-2 ring-emerald-500/25":"bg-card border-primary/45 ring-2 ring-primary/20"),style:{borderColor:t.collected?void 0:r},children:[g.jsx(ei,{type:"target",position:Ce.Top}),g.jsx(ei,{type:"source",position:Ce.Bottom}),g.jsx("div",{className:"absolute left-2 right-2 -top-2 h-4 rounded-full border bg-background",style:{borderColor:r}}),g.jsx("div",{className:"absolute left-2 right-2 -bottom-2 h-4 rounded-full border bg-background",style:{borderColor:r}}),g.jsxs("div",{className:"flex items-center gap-1.5 justify-center",children:[g.jsx(vf,{className:"size-3 text-muted-foreground","aria-hidden":!0}),g.jsxs("span",{className:"font-semibold truncate",title:t.kind,children:[t.label,t.collected?" ✓":""]})]})]})}const YP=w.memo($P),E1=320,C1=120,N1=120,qP=82;function FP(e){const{nodeIds:t,edges:r}=e,i={};t.forEach(m=>i[m]=[]);const l={},s={};r.forEach(m=>{m.from.startsWith("node:")&&t.has(m.from)&&(s[m.from]||(s[m.from]=[]),s[m.from].push(m.to)),m.to.startsWith("node:")&&t.has(m.to)&&(l[m.from]||(l[m.from]=[]),l[m.from].push(m.to))}),Object.keys(l).forEach(m=>{const p=l[m];Object.entries(s).filter(([,b])=>b.includes(m)).map(([b])=>b).forEach(b=>{p.forEach(E=>{b!==E&&i[E].push(b)})})});const c={};[...t].forEach(m=>c[m]=0);const f=t.size+1;let h=0,d=!0;for(;d&&h<f;){d=!1,h++;for(const m of t){const p=i[m]??[],x=p.map(E=>c[E]??0),b=p.length===0?0:Math.max(...x)+1;c[m]!==b&&(c[m]=b,d=!0)}}return c}function XP(e){const{vertices:t,rowByVertex:r}=e,i=new Map(t.map(m=>[m.id,m])),l={};t.forEach(m=>{const p=r[m.id]??0;l[p]||(l[p]=[]),l[p].push(m.id)});const s=Object.keys(l).map(Number).sort((m,p)=>m-p).map(m=>{const p=l[m];return p.sort((x,b)=>x.localeCompare(b,"en",{sensitivity:"base"})),p}),c=Math.max(...s.map(m=>m.length),1),h=(c*E1+(c-1)*N1)/2,d=new Map;return s.forEach((m,p)=>{const b=m.every(N=>i.get(N)?.type==="collection")?GP+WP:E1+N1,E=(m.length-1)*b,S=h-E/2,_=p*(C1+qP)+C1/2;m.forEach((N,k)=>{const C=S+k*b;d.set(N,{id:N,x:C,y:_,row:p,colInRow:k})})}),{positions:d,rows:s}}const GP=100,WP=119;function ZP(e){const t={};for(const r of e){const i=Xj(r.data);i&&(r.type==="step_started"&&(t[i]="running"),r.type==="step_completed"&&(t[i]="completed"))}return t}function w2(e,t,r){const i=new Set(e.nodes.map(k=>`node:${k.id}`)),l=[];for(const k of e.nodes){for(const C of k.input_collections??[])l.push({from:`collection:${C}`,to:`node:${k.id}`});for(const C of k.output_collections??[])l.push({from:`node:${k.id}`,to:`collection:${C}`})}const s=FP({nodeIds:i,edges:l}),c=Math.max(0,...Object.values(s)),f=[],h=[],d=[];for(let k=0;k<=c;k++){const C=e.nodes.filter(j=>(s[`node:${j.id}`]??0)===k);d[k]=C;const A=new Set,L=new Set;for(const j of C){for(const z of j.input_collections??[])A.add(z);for(const z of j.output_collections??[])L.add(z)}f[k]=A,h[k]=L}const m=[],p={},x=[];for(const k of e.nodes){const C=`node:${k.id}`,A=s[C]??0;m.push({id:C,type:"node"}),p[C]=2*A+1}for(let k=0;k<=c;k++){const C=d[k],A=f[k],L=h[k];if(k===0)for(const P of A){const H=`collection:${P}:row0`;m.push({id:H,type:"collection"}),p[H]=0;for(const X of C)(X.input_collections??[]).includes(P)&&x.push({from:H,to:`node:${X.id}`})}const j=2*k+2,z=new Set([...L]);if(k<c)for(const P of f[k+1])z.add(P);for(const P of z){const H=`collection:${P}:row${j}`;m.push({id:H,type:"collection"}),p[H]=j;for(const X of C)(X.output_collections??[]).includes(P)&&x.push({from:`node:${X.id}`,to:H});if(k<c)for(const X of d[k+1])(X.input_collections??[]).includes(P)&&x.push({from:H,to:`node:${X.id}`})}}const{positions:b}=XP({vertices:m,rowByVertex:p});function E(k){const C=k.match(/^collection:(.+):row\d+$/);return C?C[1]:k.replace(/^collection:/,"")}const S=m.filter(k=>k.type==="collection").map(k=>{const C=b.get(k.id),A=E(k.id),L={kind:A,label:A,collected:!!r?.has(A)};return{id:k.id,type:"collection",position:C?{x:C.x,y:C.y}:{x:0,y:0},data:L}}),_=e.nodes.map(k=>{const C=`node:${k.id}`,A=b.get(C),L={label:k.id,nodeId:k.id,type:k.type,input:k.input_collections??[],output:k.output_collections??[],requiredMcps:k.required_mcps??[],requiredSkills:k.required_skills??[]};return t&&t[k.id]&&(L.stepStatus=t[k.id]),{id:C,type:"workflow",position:A?{x:A.x,y:A.y}:{x:0,y:0},data:L}}),N=x.map(k=>({id:`${k.from}->${k.to}`,source:k.from,target:k.to}));return{nodes:[...S,..._],edges:N}}const KP=2e3;function ta({value:e,className:t,truncateLength:r}){const[i,l]=w.useState(!1),s=w.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{l(!0),setTimeout(()=>l(!1),KP)})},[e]),c=r&&e.length>r?`${e.slice(0,r)}…`:e;return g.jsxs("span",{className:ve("inline-flex items-center gap-1 min-w-0",t),title:e,children:[g.jsx("span",{className:"truncate font-mono text-inherit",children:c}),g.jsx("button",{type:"button",onClick:s,className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-1 focus:ring-ring","aria-label":i?"Copied":"Copy ID",title:i?"Copied":"Copy ID",children:i?g.jsx(ey,{className:"size-3.5 text-green-600 dark:text-green-400","aria-hidden":!0}):g.jsx(NN,{className:"size-3.5","aria-hidden":!0})})]})}function QP(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const JP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,e8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t8={};function _1(e,t){return(t8.jsx?e8:JP).test(e)}const n8=/[ \t\n\f\r]/g;function r8(e){return typeof e=="object"?e.type==="text"?k1(e.value):!1:k1(e)}function k1(e){return e.replace(n8,"")===""}class tc{constructor(t,r,i){this.normal=r,this.property=t,i&&(this.space=i)}}tc.prototype.normal={};tc.prototype.property={};tc.prototype.space=void 0;function S2(e,t){const r={},i={};for(const l of e)Object.assign(r,l.property),Object.assign(i,l.normal);return new tc(r,i,t)}function og(e){return e.toLowerCase()}class un{constructor(t,r){this.attribute=r,this.property=t}}un.prototype.attribute="";un.prototype.booleanish=!1;un.prototype.boolean=!1;un.prototype.commaOrSpaceSeparated=!1;un.prototype.commaSeparated=!1;un.prototype.defined=!1;un.prototype.mustUseProperty=!1;un.prototype.number=!1;un.prototype.overloadedBoolean=!1;un.prototype.property="";un.prototype.spaceSeparated=!1;un.prototype.space=void 0;let o8=0;const ze=$i(),Tt=$i(),ig=$i(),pe=$i(),it=$i(),Vl=$i(),bn=$i();function $i(){return 2**++o8}const lg=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Tt,commaOrSpaceSeparated:bn,commaSeparated:Vl,number:pe,overloadedBoolean:ig,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),up=Object.keys(lg);class wy extends un{constructor(t,r,i,l){let s=-1;if(super(t,r),T1(this,"space",l),typeof i=="number")for(;++s<up.length;){const c=up[s];T1(this,up[s],(i&lg[c])===lg[c])}}}wy.prototype.defined=!0;function T1(e,t,r){r&&(e[t]=r)}function ua(e){const t={},r={};for(const[i,l]of Object.entries(e.properties)){const s=new wy(i,e.transform(e.attributes||{},i),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,r[og(i)]=i,r[og(s.attribute)]=i}return new tc(t,r,e.space)}const E2=ua({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:it,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:pe,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:it,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Tt,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function C2(e,t){return t in e?e[t]:t}function N2(e,t){return C2(e,t.toLowerCase())}const i8=ua({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vl,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:it,autoFocus:ze,autoPlay:ze,blocking:it,capture:null,charSet:null,checked:ze,cite:null,className:it,cols:pe,colSpan:null,content:null,contentEditable:Tt,controls:ze,controlsList:it,coords:pe|Vl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:ig,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:it,height:pe,hidden:ig,high:pe,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:it,itemRef:it,itemScope:ze,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:pe,pattern:null,ping:it,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:it,required:ze,reversed:ze,rows:pe,rowSpan:pe,sandbox:it,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Tt,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Tt,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:N2}),l8=ua({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:bn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:it,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Vl,g2:Vl,glyphName:Vl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bn,rev:bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bn,requiredFeatures:bn,requiredFonts:bn,requiredFormats:bn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:C2}),_2=ua({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),k2=ua({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:N2}),T2=ua({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),a8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},s8=/[A-Z]/g,A1=/-[a-z]/g,c8=/^data[-\w.:]+$/i;function u8(e,t){const r=og(t);let i=t,l=un;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&c8.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(A1,d8);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!A1.test(s)){let c=s.replace(s8,f8);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=wy}return new l(i,t)}function f8(e){return"-"+e.toLowerCase()}function d8(e){return e.charAt(1).toUpperCase()}const h8=S2([E2,i8,_2,k2,T2],"html"),Sy=S2([E2,l8,_2,k2,T2],"svg");function m8(e){return e.join(" ").trim()}var Dl={},fp,R1;function p8(){if(R1)return fp;R1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
63
+ `,d="/",m="*",p="",x="comment",b="declaration";function E(_,N){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];N=N||{};var k=1,C=1;function A(O){var U=O.match(t);U&&(k+=U.length);var R=O.lastIndexOf(h);C=~R?O.length-R:C+O.length}function L(){var O={line:k,column:C};return function(U){return U.position=new j(O),H(),U}}function j(O){this.start=O,this.end={line:k,column:C},this.source=N.source}j.prototype.content=_;function z(O){var U=new Error(N.source+":"+k+":"+C+": "+O);if(U.reason=O,U.filename=N.source,U.line=k,U.column=C,U.source=_,!N.silent)throw U}function P(O){var U=O.exec(_);if(U){var R=U[0];return A(R),_=_.slice(R.length),U}}function H(){P(r)}function X(O){var U;for(O=O||[];U=q();)U!==!1&&O.push(U);return O}function q(){var O=L();if(!(d!=_.charAt(0)||m!=_.charAt(1))){for(var U=2;p!=_.charAt(U)&&(m!=_.charAt(U)||d!=_.charAt(U+1));)++U;if(U+=2,p===_.charAt(U-1))return z("End of comment missing");var R=_.slice(2,U-2);return C+=2,A(R),_=_.slice(U),C+=2,O({type:x,comment:R})}}function F(){var O=L(),U=P(i);if(U){if(q(),!P(l))return z("property missing ':'");var R=P(s),V=O({type:b,property:S(U[0].replace(e,p)),value:R?S(R[0].replace(e,p)):p});return P(c),V}}function Y(){var O=[];X(O);for(var U;U=F();)U!==!1&&(O.push(U),X(O));return O}return H(),Y()}function S(_){return _?_.replace(f,p):p}return fp=E,fp}var j1;function g8(){if(j1)return Dl;j1=1;var e=Dl&&Dl.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Dl,"__esModule",{value:!0}),Dl.default=r;const t=e(p8());function r(i,l){let s=null;if(!i||typeof i!="string")return s;const c=(0,t.default)(i),f=typeof l=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;f?l(d,m,h):m&&(s=s||{},s[d]=m)}),s}return Dl}var fs={},M1;function y8(){if(M1)return fs;M1=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(d){return!d||r.test(d)||e.test(d)},c=function(d,m){return m.toUpperCase()},f=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),s(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(l,f):d=d.replace(i,f),d.replace(t,c))};return fs.camelCase=h,fs}var ds,O1;function x8(){if(O1)return ds;O1=1;var e=ds&&ds.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(g8()),r=y8();function i(l,s){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,h){f&&h&&(c[(0,r.camelCase)(f,s)]=h)}),c}return i.default=i,ds=i,ds}var v8=x8();const b8=Us(v8),A2=R2("end"),Ey=R2("start");function R2(e){return t;function t(r){const i=r&&r.position&&r.position[e]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function w8(e){const t=Ey(e),r=A2(e);if(t&&r)return{start:t,end:r}}function bs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?D1(e.position):"start"in e||"end"in e?D1(e):"line"in e||"column"in e?ag(e):""}function ag(e){return z1(e&&e.line)+":"+z1(e&&e.column)}function D1(e){return ag(e&&e.start)+"-"+ag(e&&e.end)}function z1(e){return e&&typeof e=="number"?e:1}class Ft extends Error{constructor(t,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let l="",s={},c=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?l=t:!s.cause&&t&&(c=!0,l=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){const h=i.indexOf(":");h===-1?s.ruleId=i:(s.source=i.slice(0,h),s.ruleId=i.slice(h+1))}if(!s.place&&s.ancestors&&s.ancestors){const h=s.ancestors[s.ancestors.length-1];h&&(s.place=h.position)}const f=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=bs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=c&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ft.prototype.file="";Ft.prototype.name="";Ft.prototype.reason="";Ft.prototype.message="";Ft.prototype.stack="";Ft.prototype.column=void 0;Ft.prototype.line=void 0;Ft.prototype.ancestors=void 0;Ft.prototype.cause=void 0;Ft.prototype.fatal=void 0;Ft.prototype.place=void 0;Ft.prototype.ruleId=void 0;Ft.prototype.source=void 0;const Cy={}.hasOwnProperty,S8=new Map,E8=/[A-Z]/g,C8=new Set(["table","tbody","thead","tfoot","tr"]),N8=new Set(["td","th"]),j2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let i;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=D8(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=O8(r,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Sy:h8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=M2(l,e,void 0);return s&&typeof s!="string"?s:l.create(e,l.Fragment,{children:s||void 0},void 0)}function M2(e,t,r){if(t.type==="element")return k8(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return T8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return R8(e,t,r);if(t.type==="mdxjsEsm")return A8(e,t);if(t.type==="root")return j8(e,t,r);if(t.type==="text")return M8(e,t)}function k8(e,t,r){const i=e.schema;let l=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=Sy,e.schema=l),e.ancestors.push(t);const s=D2(e,t.tagName,!1),c=z8(e,t);let f=_y(e,t);return C8.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!r8(h):!0})),O2(e,c,s,t),Ny(c,f),e.ancestors.pop(),e.schema=i,e.create(t,s,c,r)}function T8(e,t){if(t.data&&t.data.estree&&e.evaluater){const i=t.data.estree.body[0];return i.type,e.evaluater.evaluateExpression(i.expression)}Ps(e,t.position)}function A8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ps(e,t.position)}function R8(e,t,r){const i=e.schema;let l=i;t.name==="svg"&&i.space==="html"&&(l=Sy,e.schema=l),e.ancestors.push(t);const s=t.name===null?e.Fragment:D2(e,t.name,!0),c=L8(e,t),f=_y(e,t);return O2(e,c,s,t),Ny(c,f),e.ancestors.pop(),e.schema=i,e.create(t,s,c,r)}function j8(e,t,r){const i={};return Ny(i,_y(e,t)),e.create(t,e.Fragment,i,r)}function M8(e,t){return t.value}function O2(e,t,r,i){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=i)}function Ny(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function O8(e,t,r){return i;function i(l,s,c,f){const d=Array.isArray(c.children)?r:t;return f?d(s,c,f):d(s,c)}}function D8(e,t){return r;function r(i,l,s,c){const f=Array.isArray(s.children),h=Ey(i);return t(l,s,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function z8(e,t){const r={};let i,l;for(l in t.properties)if(l!=="children"&&Cy.call(t.properties,l)){const s=I8(e,l,t.properties[l]);if(s){const[c,f]=s;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&N8.has(t.tagName)?i=f:r[c]=f}}if(i){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function L8(e,t){const r={};for(const i of t.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&e.evaluater){const s=i.data.estree.body[0];s.type;const c=s.expression;c.type;const f=c.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else Ps(e,t.position);else{const l=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&e.evaluater){const f=i.value.data.estree.body[0];f.type,s=e.evaluater.evaluateExpression(f.expression)}else Ps(e,t.position);else s=i.value===null?!0:i.value;r[l]=s}return r}function _y(e,t){const r=[];let i=-1;const l=e.passKeys?new Map:S8;for(;++i<t.children.length;){const s=t.children[i];let c;if(e.passKeys){const h=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(h){const d=l.get(h)||0;c=h+"-"+d,l.set(h,d+1)}}const f=M2(e,s,c);f!==void 0&&r.push(f)}return r}function I8(e,t,r){const i=u8(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?QP(r):m8(r)),i.property==="style"){let l=typeof r=="object"?r:B8(e,String(r));return e.stylePropertyNameCase==="css"&&(l=H8(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&i.space?a8[i.property]||i.property:i.attribute,r]}}function B8(e,t){try{return b8(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Ft("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=j2+"#cannot-parse-style-attribute",l}}function D2(e,t,r){let i;if(!r)i={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let s=-1,c;for(;++s<l.length;){const f=_1(l[s])?{type:"Identifier",name:l[s]}:{type:"Literal",value:l[s]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(s&&f.type==="Literal"),optional:!1}:f}i=c}else i=_1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(i.type==="Literal"){const l=i.value;return Cy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(i);Ps(e)}function Ps(e,t){const r=new Ft("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=j2+"#cannot-handle-mdx-estrees-without-createevaluater",r}function H8(e){const t={};let r;for(r in e)Cy.call(e,r)&&(t[P8(r)]=e[r]);return t}function P8(e){let t=e.replace(E8,U8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function U8(e){return"-"+e.toLowerCase()}const dp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},V8={};function $8(e,t){const r=V8,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return z2(e,i,l)}function z2(e,t,r){if(Y8(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return L1(e.children,t,r)}return Array.isArray(e)?L1(e,t,r):""}function L1(e,t,r){const i=[];let l=-1;for(;++l<e.length;)i[l]=z2(e[l],t,r);return i.join("")}function Y8(e){return!!(e&&typeof e=="object")}const I1=document.createElement("i");function ky(e){const t="&"+e+";";I1.innerHTML=t;const r=I1.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Cr(e,t,r,i){const l=e.length;let s=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,r=r>0?r:0,i.length<1e4)c=Array.from(i),c.unshift(t,r),e.splice(...c);else for(r&&e.splice(t,r);s<i.length;)c=i.slice(s,s+1e4),c.unshift(t,0),e.splice(...c),s+=1e4,t+=1e4}function Bn(e,t){return e.length>0?(Cr(e,e.length,0,t),e):t}const B1={}.hasOwnProperty;function q8(e){const t={};let r=-1;for(;++r<e.length;)F8(t,e[r]);return t}function F8(e,t){let r;for(r in t){const l=(B1.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let c;if(s)for(c in s){B1.call(l,c)||(l[c]=[]);const f=s[c];X8(l[c],Array.isArray(f)?f:f?[f]:[])}}}function X8(e,t){let r=-1;const i=[];for(;++r<t.length;)(t[r].add==="after"?e:i).push(t[r]);Cr(e,0,0,i)}function L2(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function $l(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yr=oi(/[A-Za-z]/),Cn=oi(/[\dA-Za-z]/),G8=oi(/[#-'*+\--9=?A-Z^-~]/);function sg(e){return e!==null&&(e<32||e===127)}const cg=oi(/\d/),W8=oi(/[\dA-Fa-f]/),Z8=oi(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function cn(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const K8=oi(new RegExp("\\p{P}|\\p{S}","u")),Q8=oi(/\s/);function oi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function fa(e){const t=[];let r=-1,i=0,l=0;for(;++r<e.length;){const s=e.charCodeAt(r);let c="";if(s===37&&Cn(e.charCodeAt(r+1))&&Cn(e.charCodeAt(r+2)))l=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(c=String.fromCharCode(s));else if(s>55295&&s<57344){const f=e.charCodeAt(r+1);s<56320&&f>56319&&f<57344?(c=String.fromCharCode(s,f),l=1):c="�"}else c=String.fromCharCode(s);c&&(t.push(e.slice(i,r),encodeURIComponent(c)),i=r+l+1,c=""),l&&(r+=l,l=0)}return t.join("")+e.slice(i)}function at(e,t,r,i){const l=i?i-1:Number.POSITIVE_INFINITY;let s=0;return c;function c(h){return Ke(h)?(e.enter(r),f(h)):t(h)}function f(h){return Ke(h)&&s++<l?(e.consume(h),f):(e.exit(r),t(h))}}const J8={tokenize:eU};function eU(e){const t=e.attempt(this.parser.constructs.contentInitial,i,l);let r;return t;function i(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),at(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),s(f)}function s(f){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ae(f)?(e.consume(f),e.exit("chunkText"),s):(e.consume(f),c)}}const tU={tokenize:nU},H1={tokenize:rU};function nU(e){const t=this,r=[];let i=0,l,s,c;return f;function f(C){if(i<r.length){const A=r[i];return t.containerState=A[1],e.attempt(A[0].continuation,h,d)(C)}return d(C)}function h(C){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&k();const A=t.events.length;let L=A,j;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){j=t.events[L][1].end;break}N(i);let z=A;for(;z<t.events.length;)t.events[z][1].end={...j},z++;return Cr(t.events,L+1,0,t.events.slice(A)),t.events.length=z,d(C)}return f(C)}function d(C){if(i===r.length){if(!l)return x(C);if(l.currentConstruct&&l.currentConstruct.concrete)return E(C);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(H1,m,p)(C)}function m(C){return l&&k(),N(i),x(C)}function p(C){return t.parser.lazy[t.now().line]=i!==r.length,c=t.now().offset,E(C)}function x(C){return t.containerState={},e.attempt(H1,b,E)(C)}function b(C){return i++,r.push([t.currentConstruct,t.containerState]),x(C)}function E(C){if(C===null){l&&k(),N(0),e.consume(C);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:s}),S(C)}function S(C){if(C===null){_(e.exit("chunkFlow"),!0),N(0),e.consume(C);return}return Ae(C)?(e.consume(C),_(e.exit("chunkFlow")),i=0,t.interrupt=void 0,f):(e.consume(C),S)}function _(C,A){const L=t.sliceStream(C);if(A&&L.push(null),C.previous=s,s&&(s.next=C),s=C,l.defineSkip(C.start),l.write(L),t.parser.lazy[C.start.line]){let j=l.events.length;for(;j--;)if(l.events[j][1].start.offset<c&&(!l.events[j][1].end||l.events[j][1].end.offset>c))return;const z=t.events.length;let P=z,H,X;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(H){X=t.events[P][1].end;break}H=!0}for(N(i),j=z;j<t.events.length;)t.events[j][1].end={...X},j++;Cr(t.events,P+1,0,t.events.slice(z)),t.events.length=j}}function N(C){let A=r.length;for(;A-- >C;){const L=r[A];t.containerState=L[1],L[0].exit.call(t,e)}r.length=C}function k(){l.write([null]),s=void 0,l=void 0,t.containerState._closeFlow=void 0}}function rU(e,t,r){return at(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function P1(e){if(e===null||cn(e)||Q8(e))return 1;if(K8(e))return 2}function Ty(e,t,r){const i=[];let l=-1;for(;++l<e.length;){const s=e[l].resolveAll;s&&!i.includes(s)&&(t=s(t,r),i.push(s))}return t}const ug={name:"attention",resolveAll:oU,tokenize:iU};function oU(e,t){let r=-1,i,l,s,c,f,h,d,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(i=r;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[i][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[i][1].end.offset-e[i][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const p={...e[i][1].end},x={...e[r][1].start};U1(p,-h),U1(x,h),c={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},s={type:h>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[r][1].start}},l={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[i][1].end={...c.start},e[r][1].start={...f.end},d=[],e[i][1].end.offset-e[i][1].start.offset&&(d=Bn(d,[["enter",e[i][1],t],["exit",e[i][1],t]])),d=Bn(d,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",s,t]]),d=Bn(d,Ty(t.parser.constructs.insideSpan.null,e.slice(i+1,r),t)),d=Bn(d,[["exit",s,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,d=Bn(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,Cr(e,i-1,r-i+3,d),r=i+d.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function iU(e,t){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=P1(i);let s;return c;function c(h){return s=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===s)return e.consume(h),f;const d=e.exit("attentionSequence"),m=P1(h),p=!m||m===2&&l||r.includes(h),x=!l||l===2&&m||r.includes(i);return d._open=!!(s===42?p:p&&(l||!x)),d._close=!!(s===42?x:x&&(m||!p)),t(h)}}function U1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const lU={name:"autolink",tokenize:aU};function aU(e,t,r){let i=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(b){return yr(b)?(e.consume(b),c):b===64?r(b):d(b)}function c(b){return b===43||b===45||b===46||Cn(b)?(i=1,f(b)):d(b)}function f(b){return b===58?(e.consume(b),i=0,h):(b===43||b===45||b===46||Cn(b))&&i++<32?(e.consume(b),f):(i=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||sg(b)?r(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),m):G8(b)?(e.consume(b),d):r(b)}function m(b){return Cn(b)?p(b):r(b)}function p(b){return b===46?(e.consume(b),i=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||Cn(b))&&i++<63){const E=b===45?x:p;return e.consume(b),E}return r(b)}}const fd={partial:!0,tokenize:sU};function sU(e,t,r){return i;function i(s){return Ke(s)?at(e,l,"linePrefix")(s):l(s)}function l(s){return s===null||Ae(s)?t(s):r(s)}}const I2={continuation:{tokenize:uU},exit:fU,name:"blockQuote",tokenize:cU};function cU(e,t,r){const i=this;return l;function l(c){if(c===62){const f=i.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),s}return r(c)}function s(c){return Ke(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function uU(e,t,r){const i=this;return l;function l(c){return Ke(c)?at(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):s(c)}function s(c){return e.attempt(I2,t,r)(c)}}function fU(e){e.exit("blockQuote")}const B2={name:"characterEscape",tokenize:dU};function dU(e,t,r){return i;function i(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),l}function l(s){return Z8(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const H2={name:"characterReference",tokenize:hU};function hU(e,t,r){const i=this;let l=0,s,c;return f;function f(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,c=Cn,m(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,c=W8,m):(e.enter("characterReferenceValue"),s=7,c=cg,m(p))}function m(p){if(p===59&&l){const x=e.exit("characterReferenceValue");return c===Cn&&!ky(i.sliceSerialize(x))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(p)&&l++<s?(e.consume(p),m):r(p)}}const V1={partial:!0,tokenize:pU},$1={concrete:!0,name:"codeFenced",tokenize:mU};function mU(e,t,r){const i=this,l={partial:!0,tokenize:L};let s=0,c=0,f;return h;function h(j){return d(j)}function d(j){const z=i.events[i.events.length-1];return s=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,f=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(j)}function m(j){return j===f?(c++,e.consume(j),m):c<3?r(j):(e.exit("codeFencedFenceSequence"),Ke(j)?at(e,p,"whitespace")(j):p(j))}function p(j){return j===null||Ae(j)?(e.exit("codeFencedFence"),i.interrupt?t(j):e.check(V1,S,A)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(j)):Ke(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,b,"whitespace")(j)):j===96&&j===f?r(j):(e.consume(j),x)}function b(j){return j===null||Ae(j)?p(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(j))}function E(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(j)):j===96&&j===f?r(j):(e.consume(j),E)}function S(j){return e.attempt(l,A,_)(j)}function _(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),N}function N(j){return s>0&&Ke(j)?at(e,k,"linePrefix",s+1)(j):k(j)}function k(j){return j===null||Ae(j)?e.check(V1,S,A)(j):(e.enter("codeFlowValue"),C(j))}function C(j){return j===null||Ae(j)?(e.exit("codeFlowValue"),k(j)):(e.consume(j),C)}function A(j){return e.exit("codeFenced"),t(j)}function L(j,z,P){let H=0;return X;function X(U){return j.enter("lineEnding"),j.consume(U),j.exit("lineEnding"),q}function q(U){return j.enter("codeFencedFence"),Ke(U)?at(j,F,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===f?(j.enter("codeFencedFenceSequence"),Y(U)):P(U)}function Y(U){return U===f?(H++,j.consume(U),Y):H>=c?(j.exit("codeFencedFenceSequence"),Ke(U)?at(j,O,"whitespace")(U):O(U)):P(U)}function O(U){return U===null||Ae(U)?(j.exit("codeFencedFence"),z(U)):P(U)}}}function pU(e,t,r){const i=this;return l;function l(c){return c===null?r(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s)}function s(c){return i.parser.lazy[i.now().line]?r(c):t(c)}}const hp={name:"codeIndented",tokenize:yU},gU={partial:!0,tokenize:xU};function yU(e,t,r){const i=this;return l;function l(d){return e.enter("codeIndented"),at(e,s,"linePrefix",5)(d)}function s(d){const m=i.events[i.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?c(d):r(d)}function c(d){return d===null?h(d):Ae(d)?e.attempt(gU,c,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Ae(d)?(e.exit("codeFlowValue"),c(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function xU(e,t,r){const i=this;return l;function l(c){return i.parser.lazy[i.now().line]?r(c):Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):at(e,s,"linePrefix",5)(c)}function s(c){const f=i.events[i.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ae(c)?l(c):r(c)}}const vU={name:"codeText",previous:wU,resolve:bU,tokenize:SU};function bU(e){let t=e.length-4,r=3,i,l;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=r;++i<t;)if(e[i][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(i=r-1,t++;++i<=t;)l===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(l=i):(i===t||e[i][1].type==="lineEnding")&&(e[l][1].type="codeTextData",i!==l+2&&(e[l][1].end=e[i-1][1].end,e.splice(l+2,i-l-2),t-=i-l-2,i=l+2),l=void 0);return e}function wU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function SU(e,t,r){let i=0,l,s;return c;function c(p){return e.enter("codeText"),e.enter("codeTextSequence"),f(p)}function f(p){return p===96?(e.consume(p),i++,f):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?r(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(s=e.enter("codeTextSequence"),l=0,m(p)):Ae(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||Ae(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function m(p){return p===96?(e.consume(p),l++,m):l===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",d(p))}}class EU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,r,i){const l=r||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&hs(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),hs(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),hs(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);hs(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);hs(this.left,r.reverse())}}}function hs(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function P2(e){const t={};let r=-1,i,l,s,c,f,h,d;const m=new EU(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(i=m.get(r),r&&i[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=i[1]._tokenizer.events,s=0,s<h.length&&h[s][1].type==="lineEndingBlank"&&(s+=2),s<h.length&&h[s][1].type==="content"))for(;++s<h.length&&h[s][1].type!=="content";)h[s][1].type==="chunkText"&&(h[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,CU(m,r)),r=t[r],d=!0);else if(i[1]._container){for(s=r,l=void 0;s--;)if(c=m.get(s),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=s);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(i[1].end={...m.get(l)[1].start},f=m.slice(l,r),f.unshift(i),m.splice(l,r-l+1,f))}}return Cr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function CU(e,t){const r=e.get(t)[1],i=e.get(t)[2];let l=t-1;const s=[];let c=r._tokenizer;c||(c=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],d={};let m,p,x=-1,b=r,E=0,S=0;const _=[S];for(;b;){for(;e.get(++l)[1]!==b;);s.push(l),b._tokenizer||(m=i.sliceStream(b),b.next||m.push(null),p&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(m),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=r;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(S=x+1,_.push(S),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):_.pop(),x=_.length;x--;){const N=f.slice(_[x],_[x+1]),k=s.pop();h.push([k,k+N.length-1]),e.splice(k,2,N)}for(h.reverse(),x=-1;++x<h.length;)d[E+h[x][0]]=E+h[x][1],E+=h[x][1]-h[x][0]-1;return d}const NU={resolve:kU,tokenize:TU},_U={partial:!0,tokenize:AU};function kU(e){return P2(e),e}function TU(e,t){let r;return i;function i(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?s(f):Ae(f)?e.check(_U,c,s)(f):(e.consume(f),l)}function s(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function AU(e,t,r){const i=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),at(e,s,"linePrefix")}function s(c){if(c===null||Ae(c))return r(c);const f=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(i.parser.constructs.flow,r,t)(c)}}function U2(e,t,r,i,l,s,c,f,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return p;function p(N){return N===60?(e.enter(i),e.enter(l),e.enter(s),e.consume(N),e.exit(s),x):N===null||N===32||N===41||sg(N)?r(N):(e.enter(i),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(N))}function x(N){return N===62?(e.enter(s),e.consume(N),e.exit(s),e.exit(l),e.exit(i),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(N))}function b(N){return N===62?(e.exit("chunkString"),e.exit(f),x(N)):N===null||N===60||Ae(N)?r(N):(e.consume(N),N===92?E:b)}function E(N){return N===60||N===62||N===92?(e.consume(N),b):b(N)}function S(N){return!m&&(N===null||N===41||cn(N))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(i),t(N)):m<d&&N===40?(e.consume(N),m++,S):N===41?(e.consume(N),m--,S):N===null||N===32||N===40||sg(N)?r(N):(e.consume(N),N===92?_:S)}function _(N){return N===40||N===41||N===92?(e.consume(N),S):S(N)}}function V2(e,t,r,i,l,s){const c=this;let f=0,h;return d;function d(b){return e.enter(i),e.enter(l),e.consume(b),e.exit(l),e.enter(s),m}function m(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?r(b):b===93?(e.exit(s),e.enter(l),e.consume(b),e.exit(l),e.exit(i),t):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||Ae(b)||f++>999?(e.exit("chunkString"),m(b)):(e.consume(b),h||(h=!Ke(b)),b===92?x:p)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,p):p(b)}}function $2(e,t,r,i,l,s){let c;return f;function f(x){return x===34||x===39||x===40?(e.enter(i),e.enter(l),e.consume(x),e.exit(l),c=x===40?41:x,h):r(x)}function h(x){return x===c?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),t):(e.enter(s),d(x))}function d(x){return x===c?(e.exit(s),h(c)):x===null?r(x):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),at(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===c||x===null||Ae(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?p:m)}function p(x){return x===c||x===92?(e.consume(x),m):m(x)}}function ws(e,t){let r;return i;function i(l){return Ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),r=!0,i):Ke(l)?at(e,i,r?"linePrefix":"lineSuffix")(l):t(l)}}const RU={name:"definition",tokenize:MU},jU={partial:!0,tokenize:OU};function MU(e,t,r){const i=this;let l;return s;function s(b){return e.enter("definition"),c(b)}function c(b){return V2.call(i,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=$l(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):r(b)}function h(b){return cn(b)?ws(e,d)(b):d(b)}function d(b){return U2(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(jU,p,p)(b)}function p(b){return Ke(b)?at(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Ae(b)?(e.exit("definition"),i.parser.defined.push(l),t(b)):r(b)}}function OU(e,t,r){return i;function i(f){return cn(f)?ws(e,l)(f):r(f)}function l(f){return $2(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function s(f){return Ke(f)?at(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ae(f)?t(f):r(f)}}const DU={name:"hardBreakEscape",tokenize:zU};function zU(e,t,r){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),l}function l(s){return Ae(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const LU={name:"headingAtx",resolve:IU,tokenize:BU};function IU(e,t){let r=e.length-2,i=3,l,s;return e[i][1].type==="whitespace"&&(i+=2),r-2>i&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&e[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(l={type:"atxHeadingText",start:e[i][1].start,end:e[r][1].end},s={type:"chunkText",start:e[i][1].start,end:e[r][1].end,contentType:"text"},Cr(e,i,r-i+1,[["enter",l,t],["enter",s,t],["exit",s,t],["exit",l,t]])),e}function BU(e,t,r){let i=0;return l;function l(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),c(m)}function c(m){return m===35&&i++<6?(e.consume(m),c):m===null||cn(m)?(e.exit("atxHeadingSequence"),f(m)):r(m)}function f(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Ae(m)?(e.exit("atxHeading"),t(m)):Ke(m)?at(e,f,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),f(m))}function d(m){return m===null||m===35||cn(m)?(e.exit("atxHeadingText"),f(m)):(e.consume(m),d)}}const HU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Y1=["pre","script","style","textarea"],PU={concrete:!0,name:"htmlFlow",resolveTo:$U,tokenize:YU},UU={partial:!0,tokenize:FU},VU={partial:!0,tokenize:qU};function $U(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YU(e,t,r){const i=this;let l,s,c,f,h;return d;function d(D){return m(D)}function m(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),x):D===47?(e.consume(D),s=!0,S):D===63?(e.consume(D),l=3,i.interrupt?t:M):yr(D)?(e.consume(D),c=String.fromCharCode(D),_):r(D)}function x(D){return D===45?(e.consume(D),l=2,b):D===91?(e.consume(D),l=5,f=0,E):yr(D)?(e.consume(D),l=4,i.interrupt?t:M):r(D)}function b(D){return D===45?(e.consume(D),i.interrupt?t:M):r(D)}function E(D){const oe="CDATA[";return D===oe.charCodeAt(f++)?(e.consume(D),f===oe.length?i.interrupt?t:F:E):r(D)}function S(D){return yr(D)?(e.consume(D),c=String.fromCharCode(D),_):r(D)}function _(D){if(D===null||D===47||D===62||cn(D)){const oe=D===47,K=c.toLowerCase();return!oe&&!s&&Y1.includes(K)?(l=1,i.interrupt?t(D):F(D)):HU.includes(c.toLowerCase())?(l=6,oe?(e.consume(D),N):i.interrupt?t(D):F(D)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(D):s?k(D):C(D))}return D===45||Cn(D)?(e.consume(D),c+=String.fromCharCode(D),_):r(D)}function N(D){return D===62?(e.consume(D),i.interrupt?t:F):r(D)}function k(D){return Ke(D)?(e.consume(D),k):X(D)}function C(D){return D===47?(e.consume(D),X):D===58||D===95||yr(D)?(e.consume(D),A):Ke(D)?(e.consume(D),C):X(D)}function A(D){return D===45||D===46||D===58||D===95||Cn(D)?(e.consume(D),A):L(D)}function L(D){return D===61?(e.consume(D),j):Ke(D)?(e.consume(D),L):C(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?r(D):D===34||D===39?(e.consume(D),h=D,z):Ke(D)?(e.consume(D),j):P(D)}function z(D){return D===h?(e.consume(D),h=null,H):D===null||Ae(D)?r(D):(e.consume(D),z)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||cn(D)?L(D):(e.consume(D),P)}function H(D){return D===47||D===62||Ke(D)?C(D):r(D)}function X(D){return D===62?(e.consume(D),q):r(D)}function q(D){return D===null||Ae(D)?F(D):Ke(D)?(e.consume(D),q):r(D)}function F(D){return D===45&&l===2?(e.consume(D),R):D===60&&l===1?(e.consume(D),V):D===62&&l===4?(e.consume(D),B):D===63&&l===3?(e.consume(D),M):D===93&&l===5?(e.consume(D),W):Ae(D)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(UU,G,Y)(D)):D===null||Ae(D)?(e.exit("htmlFlowData"),Y(D)):(e.consume(D),F)}function Y(D){return e.check(VU,O,G)(D)}function O(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return D===null||Ae(D)?Y(D):(e.enter("htmlFlowData"),F(D))}function R(D){return D===45?(e.consume(D),M):F(D)}function V(D){return D===47?(e.consume(D),c="",$):F(D)}function $(D){if(D===62){const oe=c.toLowerCase();return Y1.includes(oe)?(e.consume(D),B):F(D)}return yr(D)&&c.length<8?(e.consume(D),c+=String.fromCharCode(D),$):F(D)}function W(D){return D===93?(e.consume(D),M):F(D)}function M(D){return D===62?(e.consume(D),B):D===45&&l===2?(e.consume(D),M):F(D)}function B(D){return D===null||Ae(D)?(e.exit("htmlFlowData"),G(D)):(e.consume(D),B)}function G(D){return e.exit("htmlFlow"),t(D)}}function qU(e,t,r){const i=this;return l;function l(c){return Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):r(c)}function s(c){return i.parser.lazy[i.now().line]?r(c):t(c)}}function FU(e,t,r){return i;function i(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(fd,t,r)}}const XU={name:"htmlText",tokenize:GU};function GU(e,t,r){const i=this;let l,s,c;return f;function f(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),d):M===47?(e.consume(M),L):M===63?(e.consume(M),C):yr(M)?(e.consume(M),P):r(M)}function d(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),s=0,E):yr(M)?(e.consume(M),k):r(M)}function m(M){return M===45?(e.consume(M),b):r(M)}function p(M){return M===null?r(M):M===45?(e.consume(M),x):Ae(M)?(c=p,V(M)):(e.consume(M),p)}function x(M){return M===45?(e.consume(M),b):p(M)}function b(M){return M===62?R(M):M===45?x(M):p(M)}function E(M){const B="CDATA[";return M===B.charCodeAt(s++)?(e.consume(M),s===B.length?S:E):r(M)}function S(M){return M===null?r(M):M===93?(e.consume(M),_):Ae(M)?(c=S,V(M)):(e.consume(M),S)}function _(M){return M===93?(e.consume(M),N):S(M)}function N(M){return M===62?R(M):M===93?(e.consume(M),N):S(M)}function k(M){return M===null||M===62?R(M):Ae(M)?(c=k,V(M)):(e.consume(M),k)}function C(M){return M===null?r(M):M===63?(e.consume(M),A):Ae(M)?(c=C,V(M)):(e.consume(M),C)}function A(M){return M===62?R(M):C(M)}function L(M){return yr(M)?(e.consume(M),j):r(M)}function j(M){return M===45||Cn(M)?(e.consume(M),j):z(M)}function z(M){return Ae(M)?(c=z,V(M)):Ke(M)?(e.consume(M),z):R(M)}function P(M){return M===45||Cn(M)?(e.consume(M),P):M===47||M===62||cn(M)?H(M):r(M)}function H(M){return M===47?(e.consume(M),R):M===58||M===95||yr(M)?(e.consume(M),X):Ae(M)?(c=H,V(M)):Ke(M)?(e.consume(M),H):R(M)}function X(M){return M===45||M===46||M===58||M===95||Cn(M)?(e.consume(M),X):q(M)}function q(M){return M===61?(e.consume(M),F):Ae(M)?(c=q,V(M)):Ke(M)?(e.consume(M),q):H(M)}function F(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),l=M,Y):Ae(M)?(c=F,V(M)):Ke(M)?(e.consume(M),F):(e.consume(M),O)}function Y(M){return M===l?(e.consume(M),l=void 0,U):M===null?r(M):Ae(M)?(c=Y,V(M)):(e.consume(M),Y)}function O(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||cn(M)?H(M):(e.consume(M),O)}function U(M){return M===47||M===62||cn(M)?H(M):r(M)}function R(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):r(M)}function V(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),$}function $(M){return Ke(M)?at(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):W(M)}function W(M){return e.enter("htmlTextData"),c(M)}}const Ay={name:"labelEnd",resolveAll:QU,resolveTo:JU,tokenize:e9},WU={tokenize:t9},ZU={tokenize:n9},KU={tokenize:r9};function QU(e){let t=-1;const r=[];for(;++t<e.length;){const i=e[t][1];if(r.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",t+=l}}return e.length!==r.length&&Cr(e,0,e.length,r),e}function JU(e,t){let r=e.length,i=0,l,s,c,f;for(;r--;)if(l=e[r][1],s){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(s=r,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(c=r);const h={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[c][1].end}},m={type:"labelText",start:{...e[s+i+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=Bn(f,e.slice(s+1,s+i+3)),f=Bn(f,[["enter",m,t]]),f=Bn(f,Ty(t.parser.constructs.insideSpan.null,e.slice(s+i+4,c-3),t)),f=Bn(f,[["exit",m,t],e[c-2],e[c-1],["exit",d,t]]),f=Bn(f,e.slice(c+1)),f=Bn(f,[["exit",h,t]]),Cr(e,s,e.length,f),e}function e9(e,t,r){const i=this;let l=i.events.length,s,c;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){s=i.events[l][1];break}return f;function f(x){return s?s._inactive?p(x):(c=i.parser.defined.includes($l(i.sliceSerialize({start:s.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):r(x)}function h(x){return x===40?e.attempt(WU,m,c?m:p)(x):x===91?e.attempt(ZU,m,c?d:p)(x):c?m(x):p(x)}function d(x){return e.attempt(KU,m,p)(x)}function m(x){return t(x)}function p(x){return s._balanced=!0,r(x)}}function t9(e,t,r){return i;function i(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),l}function l(p){return cn(p)?ws(e,s)(p):s(p)}function s(p){return p===41?m(p):U2(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function c(p){return cn(p)?ws(e,h)(p):m(p)}function f(p){return r(p)}function h(p){return p===34||p===39||p===40?$2(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return cn(p)?ws(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function n9(e,t,r){const i=this;return l;function l(f){return V2.call(i,e,s,c,"reference","referenceMarker","referenceString")(f)}function s(f){return i.parser.defined.includes($l(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(f):r(f)}function c(f){return r(f)}}function r9(e,t,r){return i;function i(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),l}function l(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):r(s)}}const o9={name:"labelStartImage",resolveAll:Ay.resolveAll,tokenize:i9};function i9(e,t,r){const i=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),s}function s(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):r(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(f):t(f)}}const l9={name:"labelStartLink",resolveAll:Ay.resolveAll,tokenize:a9};function a9(e,t,r){const i=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),s}function s(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):t(c)}}const mp={name:"lineEnding",tokenize:s9};function s9(e,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),at(e,t,"linePrefix")}}const af={name:"thematicBreak",tokenize:c9};function c9(e,t,r){let i=0,l;return s;function s(d){return e.enter("thematicBreak"),c(d)}function c(d){return l=d,f(d)}function f(d){return d===l?(e.enter("thematicBreakSequence"),h(d)):i>=3&&(d===null||Ae(d))?(e.exit("thematicBreak"),t(d)):r(d)}function h(d){return d===l?(e.consume(d),i++,h):(e.exit("thematicBreakSequence"),Ke(d)?at(e,f,"whitespace")(d):f(d))}}const an={continuation:{tokenize:h9},exit:p9,name:"list",tokenize:d9},u9={partial:!0,tokenize:g9},f9={partial:!0,tokenize:m9};function d9(e,t,r){const i=this,l=i.events[i.events.length-1];let s=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(b){const E=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:cg(b)){if(i.containerState.type||(i.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(af,r,d)(b):d(b);if(!i.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return r(b)}function h(b){return cg(b)&&++c<10?(e.consume(b),h):(!i.interrupt||c<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):r(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,e.check(fd,i.interrupt?r:m,e.attempt(u9,x,p))}function m(b){return i.containerState.initialBlankLine=!0,s++,x(b)}function p(b){return Ke(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):r(b)}function x(b){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function h9(e,t,r){const i=this;return i.containerState._closeFlow=void 0,e.check(fd,l,s);function l(f){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,at(e,t,"listItemIndent",i.containerState.size+1)(f)}function s(f){return i.containerState.furtherBlankLines||!Ke(f)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,c(f)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(f9,t,c)(f))}function c(f){return i.containerState._closeFlow=!0,i.interrupt=void 0,at(e,e.attempt(an,t,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function m9(e,t,r){const i=this;return at(e,l,"listItemIndent",i.containerState.size+1);function l(s){const c=i.events[i.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===i.containerState.size?t(s):r(s)}}function p9(e){e.exit(this.containerState.type)}function g9(e,t,r){const i=this;return at(e,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(s){const c=i.events[i.events.length-1];return!Ke(s)&&c&&c[1].type==="listItemPrefixWhitespace"?t(s):r(s)}}const q1={name:"setextUnderline",resolveTo:y9,tokenize:x9};function y9(e,t){let r=e.length,i,l,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const c={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",s?(e.splice(l,0,["enter",c,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=c,e.push(["exit",c,t]),e}function x9(e,t,r){const i=this;let l;return s;function s(d){let m=i.events.length,p;for(;m--;)if(i.events[m][1].type!=="lineEnding"&&i.events[m][1].type!=="linePrefix"&&i.events[m][1].type!=="content"){p=i.events[m][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),l=d,c(d)):r(d)}function c(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===l?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),Ke(d)?at(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Ae(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const v9={tokenize:b9};function b9(e){const t=this,r=e.attempt(fd,i,e.attempt(this.parser.constructs.flowInitial,l,at(e,e.attempt(this.parser.constructs.flow,l,e.attempt(NU,l)),"linePrefix")));return r;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function l(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const w9={resolveAll:q2()},S9=Y2("string"),E9=Y2("text");function Y2(e){return{resolveAll:q2(e==="text"?C9:void 0),tokenize:t};function t(r){const i=this,l=this.parser.constructs[e],s=r.attempt(l,c,f);return c;function c(m){return d(m)?s(m):f(m)}function f(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return d(m)?(r.exit("data"),s(m)):(r.consume(m),h)}function d(m){if(m===null)return!0;const p=l[m];let x=-1;if(p)for(;++x<p.length;){const b=p[x];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function q2(e){return t;function t(r,i){let l=-1,s;for(;++l<=r.length;)s===void 0?r[l]&&r[l][1].type==="data"&&(s=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==s+2&&(r[s][1].end=r[l-1][1].end,r.splice(s+2,l-s-2),l=s+2),s=void 0);return e?e(r,i):r}}function C9(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let s=l.length,c=-1,f=0,h;for(;s--;){const d=l[s];if(typeof d=="string"){for(c=d.length;d.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(d===-2)h=!0,f++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(f=0),f){const d={type:r===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?c:i.start._bufferIndex+c,_index:i.start._index+s,line:i.end.line,column:i.end.column-f,offset:i.end.offset-f},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const N9={42:an,43:an,45:an,48:an,49:an,50:an,51:an,52:an,53:an,54:an,55:an,56:an,57:an,62:I2},_9={91:RU},k9={[-2]:hp,[-1]:hp,32:hp},T9={35:LU,42:af,45:[q1,af],60:PU,61:q1,95:af,96:$1,126:$1},A9={38:H2,92:B2},R9={[-5]:mp,[-4]:mp,[-3]:mp,33:o9,38:H2,42:ug,60:[lU,XU],91:l9,92:[DU,B2],93:Ay,95:ug,96:vU},j9={null:[ug,w9]},M9={null:[42,95]},O9={null:[]},D9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:M9,contentInitial:_9,disable:O9,document:N9,flow:T9,flowInitial:k9,insideSpan:j9,string:A9,text:R9},Symbol.toStringTag,{value:"Module"}));function z9(e,t,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},s=[];let c=[],f=[];const h={attempt:z(L),check:z(j),consume:k,enter:C,exit:A,interrupt:z(j,{interrupt:!0})},d={code:null,containerState:{},defineSkip:S,events:[],now:E,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:p};let m=t.tokenize.call(d,h);return t.resolveAll&&s.push(t),d;function p(q){return c=Bn(c,q),_(),c[c.length-1]!==null?[]:(P(t,0),d.events=Ty(s,d.events,d),d.events)}function x(q,F){return I9(b(q),F)}function b(q){return L9(c,q)}function E(){const{_bufferIndex:q,_index:F,line:Y,column:O,offset:U}=i;return{_bufferIndex:q,_index:F,line:Y,column:O,offset:U}}function S(q){l[q.line]=q.column,X()}function _(){let q;for(;i._index<c.length;){const F=c[i._index];if(typeof F=="string")for(q=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===q&&i._bufferIndex<F.length;)N(F.charCodeAt(i._bufferIndex));else N(F)}}function N(q){m=m(q)}function k(q){Ae(q)?(i.line++,i.column=1,i.offset+=q===-3?2:1,X()):q!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===c[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=q}function C(q,F){const Y=F||{};return Y.type=q,Y.start=E(),d.events.push(["enter",Y,d]),f.push(Y),Y}function A(q){const F=f.pop();return F.end=E(),d.events.push(["exit",F,d]),F}function L(q,F){P(q,F.from)}function j(q,F){F.restore()}function z(q,F){return Y;function Y(O,U,R){let V,$,W,M;return Array.isArray(O)?G(O):"tokenize"in O?G([O]):B(O);function B(J){return te;function te(ne){const se=ne!==null&&J[ne],he=ne!==null&&J.null,me=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(he)?he:he?[he]:[]];return G(me)(ne)}}function G(J){return V=J,$=0,J.length===0?R:D(J[$])}function D(J){return te;function te(ne){return M=H(),W=J,J.partial||(d.currentConstruct=J),J.name&&d.parser.constructs.disable.null.includes(J.name)?K():J.tokenize.call(F?Object.assign(Object.create(d),F):d,h,oe,K)(ne)}}function oe(J){return q(W,M),U}function K(J){return M.restore(),++$<V.length?D(V[$]):R}}}function P(q,F){q.resolveAll&&!s.includes(q)&&s.push(q),q.resolve&&Cr(d.events,F,d.events.length-F,q.resolve(d.events.slice(F),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function H(){const q=E(),F=d.previous,Y=d.currentConstruct,O=d.events.length,U=Array.from(f);return{from:O,restore:R};function R(){i=q,d.previous=F,d.currentConstruct=Y,d.events.length=O,f=U,X()}}function X(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function L9(e,t){const r=t.start._index,i=t.start._bufferIndex,l=t.end._index,s=t.end._bufferIndex;let c;if(r===l)c=[e[r].slice(i,s)];else{if(c=e.slice(r,l),i>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(i):c.shift()}s>0&&c.push(e[l].slice(0,s))}return c}function I9(e,t){let r=-1;const i=[];let l;for(;++r<e.length;){const s=e[r];let c;if(typeof s=="string")c=s;else switch(s){case-5:{c="\r";break}case-4:{c=`
64
+ `;break}case-3:{c=`\r
65
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(s)}l=s===-2,i.push(c)}return i.join("")}function B9(e){const i={constructs:q8([D9,...(e||{}).extensions||[]]),content:l(J8),defined:[],document:l(tU),flow:l(v9),lazy:{},string:l(S9),text:l(E9)};return i;function l(s){return c;function c(f){return z9(i,s,f)}}}function H9(e){for(;!P2(e););return e}const F1=/[\0\t\n\r]/g;function P9(){let e=1,t="",r=!0,i;return l;function l(s,c,f){const h=[];let d,m,p,x,b;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(c||void 0).decode(s)),p=0,t="",r&&(s.charCodeAt(0)===65279&&p++,r=void 0);p<s.length;){if(F1.lastIndex=p,d=F1.exec(s),x=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(x),!d){t=s.slice(p);break}if(b===10&&p===x&&i)h.push(-3),i=void 0;else switch(i&&(h.push(-5),i=void 0),p<x&&(h.push(s.slice(p,x)),e+=x-p),b){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:i=!0,e=1}p=x+1}return f&&(i&&h.push(-5),t&&h.push(t),h.push(null)),h}}const U9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V9(e){return e.replace(U9,$9)}function $9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),s=l===120||l===88;return L2(r.slice(s?2:1),s?16:10)}return ky(r)||e}const F2={}.hasOwnProperty;function Y9(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),q9(r)(H9(B9(r).document().write(P9()(e,t,!0))))}function q9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Vt),autolinkProtocol:H,autolinkEmail:H,atxHeading:s($e),blockQuote:s(he),characterEscape:H,characterReference:H,codeFenced:s(me),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:s(me,c),codeText:s(ge,c),codeTextData:H,data:H,codeFlowValue:H,definition:s(xe),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:s(_e),hardBreakEscape:s(Pe),hardBreakTrailing:s(Pe),htmlFlow:s(st,c),htmlFlowData:H,htmlText:s(st,c),htmlTextData:H,image:s(fn),label:c,link:s(Vt),listItem:s(Vn),listItemValue:x,listOrdered:s(Kt,p),listUnordered:s(Kt),paragraph:s(Rr),reference:D,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:s($e),strong:s(jr),thematicBreak:s(ho)},exit:{atxHeading:h(),atxHeadingSequence:L,autolink:h(),autolinkEmail:se,autolinkProtocol:ne,blockQuote:h(),characterEscapeValue:X,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:J,characterReference:te,codeFenced:h(_),codeFencedFence:S,codeFencedFenceInfo:b,codeFencedFenceMeta:E,codeFlowValue:X,codeIndented:h(N),codeText:h(U),codeTextData:X,data:X,definition:h(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:C,emphasis:h(),hardBreakEscape:h(F),hardBreakTrailing:h(F),htmlFlow:h(Y),htmlFlowData:X,htmlText:h(O),htmlTextData:X,image:h(V),label:W,labelText:$,lineEnding:q,link:h(R),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:oe,resourceDestinationString:M,resourceTitleString:B,resource:G,setextHeading:h(P),setextHeadingLineSequence:z,setextHeadingText:j,strong:h(),thematicBreak:h()}};X2(t,(e||{}).mdastExtensions||[]);const r={};return i;function i(ce){let ye={type:"root",children:[]};const ke={stack:[ye],tokenStack:[],config:t,enter:f,exit:d,buffer:c,resume:m,data:r},Le=[];let qe=-1;for(;++qe<ce.length;)if(ce[qe][1].type==="listOrdered"||ce[qe][1].type==="listUnordered")if(ce[qe][0]==="enter")Le.push(qe);else{const Xt=Le.pop();qe=l(ce,Xt,qe)}for(qe=-1;++qe<ce.length;){const Xt=t[ce[qe][0]];F2.call(Xt,ce[qe][1].type)&&Xt[ce[qe][1].type].call(Object.assign({sliceSerialize:ce[qe][2].sliceSerialize},ke),ce[qe][1])}if(ke.tokenStack.length>0){const Xt=ke.tokenStack[ke.tokenStack.length-1];(Xt[1]||X1).call(ke,void 0,Xt[0])}for(ye.position={start:Fo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Fo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<t.transforms.length;)ye=t.transforms[qe](ye)||ye;return ye}function l(ce,ye,ke){let Le=ye-1,qe=-1,Xt=!1,$n,Lt,vt,$t;for(;++Le<=ke;){const Qe=ce[Le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?qe++:qe--,$t=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&($n&&!$t&&!qe&&!vt&&(vt=Le),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!qe&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||qe===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if($n){let ar=Le;for(Lt=void 0;ar--;){const dn=ce[ar];if(dn[1].type==="lineEnding"||dn[1].type==="lineEndingBlank"){if(dn[0]==="exit")continue;Lt&&(ce[Lt][1].type="lineEndingBlank",Xt=!0),dn[1].type="lineEnding",Lt=ar}else if(!(dn[1].type==="linePrefix"||dn[1].type==="blockQuotePrefix"||dn[1].type==="blockQuotePrefixWhitespace"||dn[1].type==="blockQuoteMarker"||dn[1].type==="listItemIndent"))break}vt&&(!Lt||vt<Lt)&&($n._spread=!0),$n.end=Object.assign({},Lt?ce[Lt][1].start:Qe[1].end),ce.splice(Lt||Le,0,["exit",$n,Qe[2]]),Le++,ke++}if(Qe[1].type==="listItemPrefix"){const ar={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};$n=ar,ce.splice(Le,0,["enter",ar,Qe[2]]),Le++,ke++,vt=void 0,$t=!0}}}return ce[ye][1]._spread=Xt,ke}function s(ce,ye){return ke;function ke(Le){f.call(this,ce(Le),Le),ye&&ye.call(this,Le)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ce,ye,ke){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([ye,ke||void 0]),ce.position={start:Fo(ye.start),end:void 0}}function h(ce){return ye;function ye(ke){ce&&ce.call(this,ke),d.call(this,ke)}}function d(ce,ye){const ke=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==ce.type&&(ye?ye.call(this,ce,Le[0]):(Le[1]||X1).call(this,ce,Le[0]));else throw new Error("Cannot close `"+ce.type+"` ("+bs({start:ce.start,end:ce.end})+"): it’s not open");ke.position.end=Fo(ce.end)}function m(){return $8(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function x(ce){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ce}function E(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ce}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce.replace(/(\r?\n|\r)$/g,"")}function k(ce){const ye=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ye,ke.identifier=$l(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ce}function A(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ce}function L(ce){const ye=this.stack[this.stack.length-1];if(!ye.depth){const ke=this.sliceSerialize(ce).length;ye.depth=ke}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function z(ce){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function H(ce){const ke=this.stack[this.stack.length-1].children;let Le=ke[ke.length-1];(!Le||Le.type!=="text")&&(Le=Rt(),Le.position={start:Fo(ce.start),end:void 0},ke.push(Le)),this.stack.push(Le)}function X(ce){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ce),ye.position.end=Fo(ce.end)}function q(ce){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=ye.children[ye.children.length-1];ke.position.end=Fo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(H.call(this,ce),X.call(this,ce))}function F(){this.data.atHardBreak=!0}function Y(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce}function O(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce}function U(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ce}function R(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ye,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function V(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ye,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function $(ce){const ye=this.sliceSerialize(ce),ke=this.stack[this.stack.length-2];ke.label=V9(ye),ke.identifier=$l(ye).toLowerCase()}function W(){const ce=this.stack[this.stack.length-1],ye=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Le=ce.children;ke.children=Le}else ke.alt=ye}function M(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ce}function B(){const ce=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ce}function G(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function oe(ce){const ye=this.resume(),ke=this.stack[this.stack.length-1];ke.label=ye,ke.identifier=$l(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function K(ce){this.data.characterReferenceType=ce.type}function J(ce){const ye=this.sliceSerialize(ce),ke=this.data.characterReferenceType;let Le;ke?(Le=L2(ye,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=ky(ye);const qe=this.stack[this.stack.length-1];qe.value+=Le}function te(ce){const ye=this.stack.pop();ye.position.end=Fo(ce.end)}function ne(ce){X.call(this,ce);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ce)}function se(ce){X.call(this,ce);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ce)}function he(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function ge(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _e(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function st(){return{type:"html",value:""}}function fn(){return{type:"image",title:null,url:"",alt:null}}function Vt(){return{type:"link",title:null,url:"",children:[]}}function Kt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function Vn(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Rr(){return{type:"paragraph",children:[]}}function jr(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function ho(){return{type:"thematicBreak"}}}function Fo(e){return{line:e.line,column:e.column,offset:e.offset}}function X2(e,t){let r=-1;for(;++r<t.length;){const i=t[r];Array.isArray(i)?X2(e,i):F9(e,i)}}function F9(e,t){let r;for(r in t)if(F2.call(t,r))switch(r){case"canContainEols":{const i=t[r];i&&e[r].push(...i);break}case"transforms":{const i=t[r];i&&e[r].push(...i);break}case"enter":case"exit":{const i=t[r];i&&Object.assign(e[r],i);break}}}function X1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bs({start:t.start,end:t.end})+") is still open")}function X9(e){const t=this;t.parser=r;function r(i){return Y9(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function G9(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function W9(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
66
+ `}]}function Z9(e,t){const r=t.value?t.value+`
67
+ `:"",i={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(i.className=["language-"+l[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:r}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function K9(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Q9(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function J9(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=fa(i.toLowerCase()),s=e.footnoteOrder.indexOf(i);let c,f=e.footnoteCounts.get(i);f===void 0?(f=0,e.footnoteOrder.push(i),c=e.footnoteOrder.length):c=s+1,f+=1,e.footnoteCounts.set(i,f);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function eV(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function tV(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function G2(e,t){const r=t.referenceType;let i="]";if(r==="collapsed"?i+="[]":r==="full"&&(i+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+i}];const l=e.all(t),s=l[0];s&&s.type==="text"?s.value="["+s.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=i:l.push({type:"text",value:i}),l}function nV(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return G2(e,t);const l={src:fa(i.url||""),alt:t.alt};i.title!==null&&i.title!==void 0&&(l.title=i.title);const s={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,s),e.applyData(t,s)}function rV(e,t){const r={src:fa(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function oV(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const i={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,i),e.applyData(t,i)}function iV(e,t){const r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return G2(e,t);const l={href:fa(i.url||"")};i.title!==null&&i.title!==void 0&&(l.title=i.title);const s={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function lV(e,t){const r={href:fa(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function aV(e,t,r){const i=e.all(t),l=r?sV(r):W2(t),s={},c=[];if(typeof t.checked=="boolean"){const m=i[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},i.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let f=-1;for(;++f<i.length;){const m=i[f];(l||f!==0||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
68
+ `}),m.type==="element"&&m.tagName==="p"&&!l?c.push(...m.children):c.push(m)}const h=i[i.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
69
+ `});const d={type:"element",tagName:"li",properties:s,children:c};return e.patch(t,d),e.applyData(t,d)}function sV(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let i=-1;for(;!t&&++i<r.length;)t=W2(r[i])}return t}function W2(e){const t=e.spread;return t??e.children.length>1}function cV(e,t){const r={},i=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++l<i.length;){const c=i[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function uV(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fV(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function dV(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hV(e,t){const r=e.all(t),i=r.shift(),l=[];if(i){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([i],!0)};e.patch(t.children[0],c),l.push(c)}if(r.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=Ey(t.children[1]),h=A2(t.children[t.children.length-1]);f&&h&&(c.position={start:f,end:h}),l.push(c)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,s),e.applyData(t,s)}function mV(e,t,r){const i=r?r.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",c=r&&r.type==="table"?r.align:void 0,f=c?c.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const p=t.children[h],x={},b=c?c[h]:void 0;b&&(x.align=b);let E={type:"element",tagName:s,properties:x,children:[]};p&&(E.children=e.all(p),e.patch(p,E),E=e.applyData(p,E)),d.push(E)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function pV(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const G1=9,W1=32;function gV(e){const t=String(e),r=/\r?\n|\r/g;let i=r.exec(t),l=0;const s=[];for(;i;)s.push(Z1(t.slice(l,i.index),l>0,!0),i[0]),l=i.index+i[0].length,i=r.exec(t);return s.push(Z1(t.slice(l),l>0,!1)),s.join("")}function Z1(e,t,r){let i=0,l=e.length;if(t){let s=e.codePointAt(i);for(;s===G1||s===W1;)i++,s=e.codePointAt(i)}if(r){let s=e.codePointAt(l-1);for(;s===G1||s===W1;)l--,s=e.codePointAt(l-1)}return l>i?e.slice(i,l):""}function yV(e,t){const r={type:"text",value:gV(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function xV(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const vV={blockquote:G9,break:W9,code:Z9,delete:K9,emphasis:Q9,footnoteReference:J9,heading:eV,html:tV,imageReference:nV,image:rV,inlineCode:oV,linkReference:iV,link:lV,listItem:aV,list:cV,paragraph:uV,root:fV,strong:dV,table:hV,tableCell:pV,tableRow:mV,text:yV,thematicBreak:xV,toml:Fu,yaml:Fu,definition:Fu,footnoteDefinition:Fu};function Fu(){}const Z2=-1,dd=0,Ss=1,Mf=2,Ry=3,jy=4,My=5,Oy=6,K2=7,Q2=8,K1=typeof self=="object"?self:globalThis,bV=(e,t)=>{const r=(l,s)=>(e.set(s,l),l),i=l=>{if(e.has(l))return e.get(l);const[s,c]=t[l];switch(s){case dd:case Z2:return r(c,l);case Ss:{const f=r([],l);for(const h of c)f.push(i(h));return f}case Mf:{const f=r({},l);for(const[h,d]of c)f[i(h)]=i(d);return f}case Ry:return r(new Date(c),l);case jy:{const{source:f,flags:h}=c;return r(new RegExp(f,h),l)}case My:{const f=r(new Map,l);for(const[h,d]of c)f.set(i(h),i(d));return f}case Oy:{const f=r(new Set,l);for(const h of c)f.add(i(h));return f}case K2:{const{name:f,message:h}=c;return r(new K1[f](h),l)}case Q2:return r(BigInt(c),l);case"BigInt":return r(Object(BigInt(c)),l);case"ArrayBuffer":return r(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return r(new DataView(f),c)}}return r(new K1[s](c),l)};return i},Q1=e=>bV(new Map,e)(0),zl="",{toString:wV}={},{keys:SV}=Object,ms=e=>{const t=typeof e;if(t!=="object"||!e)return[dd,t];const r=wV.call(e).slice(8,-1);switch(r){case"Array":return[Ss,zl];case"Object":return[Mf,zl];case"Date":return[Ry,zl];case"RegExp":return[jy,zl];case"Map":return[My,zl];case"Set":return[Oy,zl];case"DataView":return[Ss,r]}return r.includes("Array")?[Ss,r]:r.includes("Error")?[K2,r]:[Mf,r]},Xu=([e,t])=>e===dd&&(t==="function"||t==="symbol"),EV=(e,t,r,i)=>{const l=(c,f)=>{const h=i.push(c)-1;return r.set(f,h),h},s=c=>{if(r.has(c))return r.get(c);let[f,h]=ms(c);switch(f){case dd:{let m=c;switch(h){case"bigint":f=Q2,m=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return l([Z2],c)}return l([f,m],c)}case Ss:{if(h){let x=c;return h==="DataView"?x=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(c)),l([h,[...x]],c)}const m=[],p=l([f,m],c);for(const x of c)m.push(s(x));return p}case Mf:{if(h)switch(h){case"BigInt":return l([h,c.toString()],c);case"Boolean":case"Number":case"String":return l([h,c.valueOf()],c)}if(t&&"toJSON"in c)return s(c.toJSON());const m=[],p=l([f,m],c);for(const x of SV(c))(e||!Xu(ms(c[x])))&&m.push([s(x),s(c[x])]);return p}case Ry:return l([f,c.toISOString()],c);case jy:{const{source:m,flags:p}=c;return l([f,{source:m,flags:p}],c)}case My:{const m=[],p=l([f,m],c);for(const[x,b]of c)(e||!(Xu(ms(x))||Xu(ms(b))))&&m.push([s(x),s(b)]);return p}case Oy:{const m=[],p=l([f,m],c);for(const x of c)(e||!Xu(ms(x)))&&m.push(s(x));return p}}const{message:d}=c;return l([f,{name:h,message:d}],c)};return s},J1=(e,{json:t,lossy:r}={})=>{const i=[];return EV(!(t||r),!!t,new Map,i)(e),i},Of=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Q1(J1(e,t)):structuredClone(e):(e,t)=>Q1(J1(e,t));function CV(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function NV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function _V(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||CV,i=e.options.footnoteBackLabel||NV,l=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const m=e.all(d),p=String(d.identifier).toUpperCase(),x=fa(p.toLowerCase());let b=0;const E=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++b<=S;){E.length>0&&E.push({type:"text",value:" "});let k=typeof r=="string"?r:r(h,b);typeof k=="string"&&(k={type:"text",value:k}),E.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(h,b),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const _=m[m.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const k=_.children[_.children.length-1];k&&k.type==="text"?k.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...E)}else m.push(...E);const N={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(m,!0)};e.patch(d,N),f.push(N)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Of(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
70
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
71
+ `}]}}const J2=(function(e){if(e==null)return RV;if(typeof e=="function")return hd(e);if(typeof e=="object")return Array.isArray(e)?kV(e):TV(e);if(typeof e=="string")return AV(e);throw new Error("Expected function, string, or object as test")});function kV(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=J2(e[r]);return hd(i);function i(...l){let s=-1;for(;++s<t.length;)if(t[s].apply(this,l))return!0;return!1}}function TV(e){const t=e;return hd(r);function r(i){const l=i;let s;for(s in e)if(l[s]!==t[s])return!1;return!0}}function AV(e){return hd(t);function t(r){return r&&r.type===e}}function hd(e){return t;function t(r,i,l){return!!(jV(r)&&e.call(this,r,typeof i=="number"?i:void 0,l||void 0))}}function RV(){return!0}function jV(e){return e!==null&&typeof e=="object"&&"type"in e}const ek=[],MV=!0,eS=!1,OV="skip";function DV(e,t,r,i){let l;typeof t=="function"&&typeof r!="function"?(i=r,r=t):l=t;const s=J2(l),c=i?-1:1;f(e,void 0,[])();function f(h,d,m){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=ek,E,S,_;if((!t||s(h,d,m[m.length-1]||void 0))&&(b=zV(r(h,m)),b[0]===eS))return b;if("children"in h&&h.children){const N=h;if(N.children&&b[0]!==OV)for(S=(i?N.children.length:-1)+c,_=m.concat(N);S>-1&&S<N.children.length;){const k=N.children[S];if(E=f(k,S,_)(),E[0]===eS)return E;S=typeof E[1]=="number"?E[1]:S+c}}return b}}}function zV(e){return Array.isArray(e)?e:typeof e=="number"?[MV,e]:e==null?ek:[e]}function tk(e,t,r,i){let l,s,c;typeof t=="function"&&typeof r!="function"?(s=void 0,c=t,l=r):(s=t,c=r,l=i),DV(e,s,f,l);function f(h,d){const m=d[d.length-1],p=m?m.children.indexOf(h):void 0;return c(h,p,m)}}const fg={}.hasOwnProperty,LV={};function IV(e,t){const r=t||LV,i=new Map,l=new Map,s=new Map,c={...vV,...r.handlers},f={all:d,applyData:HV,definitionById:i,footnoteById:l,footnoteCounts:s,footnoteOrder:[],handlers:c,one:h,options:r,patch:BV,wrap:UV};return tk(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?i:l,x=String(m.identifier).toUpperCase();p.has(x)||p.set(x,m)}}),f;function h(m,p){const x=m.type,b=f.handlers[x];if(fg.call(f.handlers,x)&&b)return b(f,m,p);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in m){const{children:S,..._}=m,N=Of(_);return N.children=f.all(m),N}return Of(m)}return(f.options.unknownHandler||PV)(f,m,p)}function d(m){const p=[];if("children"in m){const x=m.children;let b=-1;for(;++b<x.length;){const E=f.one(x[b],m);if(E){if(b&&x[b-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=tS(E.value)),!Array.isArray(E)&&E.type==="element")){const S=E.children[0];S&&S.type==="text"&&(S.value=tS(S.value))}Array.isArray(E)?p.push(...E):p.push(E)}}}return p}}function BV(e,t){e.position&&(t.position=w8(e))}function HV(e,t){let r=t;if(e&&e.data){const i=e.data.hName,l=e.data.hChildren,s=e.data.hProperties;if(typeof i=="string")if(r.type==="element")r.tagName=i;else{const c="children"in r?r.children:[r];r={type:"element",tagName:i,properties:{},children:c}}r.type==="element"&&s&&Object.assign(r.properties,Of(s)),"children"in r&&r.children&&l!==null&&l!==void 0&&(r.children=l)}return r}function PV(e,t){const r=t.data||{},i="value"in t&&!(fg.call(r,"hProperties")||fg.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function UV(e,t){const r=[];let i=-1;for(t&&r.push({type:"text",value:`
72
+ `});++i<e.length;)i&&r.push({type:"text",value:`
73
+ `}),r.push(e[i]);return t&&e.length>0&&r.push({type:"text",value:`
74
+ `}),r}function tS(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function nS(e,t){const r=IV(e,t),i=r.one(e,void 0),l=_V(r),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return l&&s.children.push({type:"text",value:`
75
+ `},l),s}function VV(e,t){return e&&"run"in e?async function(r,i){const l=nS(r,{file:i,...t});await e.run(l,i)}:function(r,i){return nS(r,{file:i,...e||t})}}function rS(e){if(e)throw e}var pp,oS;function $V(){if(oS)return pp;oS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},s=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},c=function(d,m){r&&m.name==="__proto__"?r(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},f=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(i)return i(d,m).value}else return;return d[m]};return pp=function h(){var d,m,p,x,b,E,S=arguments[0],_=1,N=arguments.length,k=!1;for(typeof S=="boolean"&&(k=S,S=arguments[1]||{},_=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});_<N;++_)if(d=arguments[_],d!=null)for(m in d)p=f(S,m),x=f(d,m),S!==x&&(k&&x&&(s(x)||(b=l(x)))?(b?(b=!1,E=p&&l(p)?p:[]):E=p&&s(p)?p:{},c(S,{name:m,newValue:h(k,E,x)})):typeof x<"u"&&c(S,{name:m,newValue:x}));return S},pp}var YV=$V();const gp=Us(YV);function dg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qV(){const e=[],t={run:r,use:i};return t;function r(...l){let s=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(h,...d){const m=e[++s];let p=-1;if(h){c(h);return}for(;++p<l.length;)(d[p]===null||d[p]===void 0)&&(d[p]=l[p]);l=d,m?FV(m,f)(...d):c(null,...d)}}function i(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function FV(e,t){let r;return i;function i(...c){const f=e.length>c.length;let h;f&&c.push(l);try{h=e.apply(this,c)}catch(d){const m=d;if(f&&r)throw m;return l(m)}f||(h&&h.then&&typeof h.then=="function"?h.then(s,l):h instanceof Error?l(h):s(h))}function l(c,...f){r||(r=!0,t(c,...f))}function s(c){l(null,c)}}const mr={basename:XV,dirname:GV,extname:WV,join:ZV,sep:"/"};function XV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nc(e);let r=0,i=-1,l=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(s){r=l+1;break}}else i<0&&(s=!0,i=l+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(s){r=l+1;break}}else c<0&&(s=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(i=l):(f=-1,i=c));return r===i?i=c:i<0&&(i=e.length),e.slice(r,i)}function GV(e){if(nc(e),e.length===0)return".";let t=-1,r=e.length,i;for(;--r;)if(e.codePointAt(r)===47){if(i){t=r;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function WV(e){nc(e);let t=e.length,r=-1,i=0,l=-1,s=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){i=t+1;break}continue}r<0&&(c=!0,r=t+1),f===46?l<0?l=t:s!==1&&(s=1):l>-1&&(s=-1)}return l<0||r<0||s===0||s===1&&l===r-1&&l===i+1?"":e.slice(l,r)}function ZV(...e){let t=-1,r;for(;++t<e.length;)nc(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":KV(r)}function KV(e){nc(e);const t=e.codePointAt(0)===47;let r=QV(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function QV(e,t){let r="",i=0,l=-1,s=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||s===1))if(l!==c-1&&s===2){if(r.length<2||i!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",i=0):(r=r.slice(0,h),i=r.length-1-r.lastIndexOf("/")),l=c,s=0;continue}}else if(r.length>0){r="",i=0,l=c,s=0;continue}}t&&(r=r.length>0?r+"/..":"..",i=2)}else r.length>0?r+="/"+e.slice(l+1,c):r=e.slice(l+1,c),i=c-l-1;l=c,s=0}else f===46&&s>-1?s++:s=-1}return r}function nc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const JV={cwd:e$};function e$(){return"/"}function hg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function t$(e){if(typeof e=="string")e=new URL(e);else if(!hg(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return n$(e)}function n$(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const i=t.codePointAt(r+2);if(i===70||i===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const yp=["history","path","basename","stem","extname","dirname"];class nk{constructor(t){let r;t?hg(t)?r={path:t}:typeof t=="string"||r$(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":JV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<yp.length;){const s=yp[i];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let l;for(l in r)yp.includes(l)||(this[l]=r[l])}get basename(){return typeof this.path=="string"?mr.basename(this.path):void 0}set basename(t){vp(t,"basename"),xp(t,"basename"),this.path=mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?mr.dirname(this.path):void 0}set dirname(t){iS(this.basename,"dirname"),this.path=mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?mr.extname(this.path):void 0}set extname(t){if(xp(t,"extname"),iS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){hg(t)&&(t=t$(t)),vp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?mr.basename(this.path,this.extname):void 0}set stem(t){vp(t,"stem"),xp(t,"stem"),this.path=mr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,i){const l=this.message(t,r,i);throw l.fatal=!0,l}info(t,r,i){const l=this.message(t,r,i);return l.fatal=void 0,l}message(t,r,i){const l=new Ft(t,r,i);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xp(e,t){if(e&&e.includes(mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+mr.sep+"`")}function vp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function iS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function r$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o$=(function(e){const i=this.constructor.prototype,l=i[e],s=function(){return l.apply(s,arguments)};return Object.setPrototypeOf(s,i),s}),i$={}.hasOwnProperty;class Dy extends o${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=qV()}copy(){const t=new Dy;let r=-1;for(;++r<this.attachers.length;){const i=this.attachers[r];t.use(...i)}return t.data(gp(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Sp("data",this.frozen),this.namespace[t]=r,this):i$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Sp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const l=r.call(t,...i);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Gu(t),i=this.parser||this.Parser;return bp("parse",i),i(String(r),r)}process(t,r){const i=this;return this.freeze(),bp("process",this.parser||this.Parser),wp("process",this.compiler||this.Compiler),r?l(void 0,r):new Promise(l);function l(s,c){const f=Gu(t),h=i.parse(f);i.run(h,f,function(m,p,x){if(m||!p||!x)return d(m);const b=p,E=i.stringify(b,x);s$(E)?x.value=E:x.result=E,d(m,x)});function d(m,p){m||!p?c(m):s?s(p):r(void 0,p)}}}processSync(t){let r=!1,i;return this.freeze(),bp("processSync",this.parser||this.Parser),wp("processSync",this.compiler||this.Compiler),this.process(t,l),aS("processSync","process",r),i;function l(s,c){r=!0,rS(s),i=c}}run(t,r,i){lS(t),this.freeze();const l=this.transformers;return!i&&typeof r=="function"&&(i=r,r=void 0),i?s(void 0,i):new Promise(s);function s(c,f){const h=Gu(r);l.run(t,h,d);function d(m,p,x){const b=p||t;m?f(m):c?c(b):i(void 0,b,x)}}}runSync(t,r){let i=!1,l;return this.run(t,r,s),aS("runSync","run",i),l;function s(c,f){rS(c),l=f,i=!0}}stringify(t,r){this.freeze();const i=Gu(r),l=this.compiler||this.Compiler;return wp("stringify",l),lS(t),l(t,i)}use(t,...r){const i=this.attachers,l=this.namespace;if(Sp("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;h(m,p)}else c(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function c(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(d.plugins),d.settings&&(l.settings=gp(!0,l.settings,d.settings))}function f(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];s(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let p=-1,x=-1;for(;++p<i.length;)if(i[p][0]===d){x=p;break}if(x===-1)i.push([d,...m]);else if(m.length>0){let[b,...E]=m;const S=i[x][1];dg(S)&&dg(b)&&(b=gp(!0,S,b)),i[x]=[d,b,...E]}}}}const l$=new Dy().freeze();function bp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function wp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lS(e){if(!dg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aS(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gu(e){return a$(e)?e:new nk(e)}function a$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s$(e){return typeof e=="string"||c$(e)}function c$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const u$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",sS=[],cS={allowDangerousHtml:!0},f$=/^(https?|ircs?|mailto|xmpp)$/i,d$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function h$(e){const t=m$(e),r=p$(e);return g$(t.runSync(t.parse(r),r),e)}function m$(e){const t=e.rehypePlugins||sS,r=e.remarkPlugins||sS,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cS}:cS;return l$().use(X9).use(r).use(VV,i).use(t)}function p$(e){const t=e.children||"",r=new nk;return typeof t=="string"&&(r.value=t),r}function g$(e,t){const r=t.allowedElements,i=t.allowElement,l=t.components,s=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||y$;for(const m of d$)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+u$+m.id,void 0);return tk(e,d),_8(e,{Fragment:g.Fragment,components:l,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function d(m,p,x){if(m.type==="raw"&&x&&typeof p=="number")return c?x.children.splice(p,1):x.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let b;for(b in dp)if(Object.hasOwn(dp,b)&&Object.hasOwn(m.properties,b)){const E=m.properties[b],S=dp[b];(S===null||S.includes(m.tagName))&&(m.properties[b]=h(String(E||""),b,m))}}if(m.type==="element"){let b=r?!r.includes(m.tagName):s?s.includes(m.tagName):!1;if(!b&&i&&typeof p=="number"&&(b=!i(m,p,x)),b&&x&&typeof p=="number")return f&&m.children?x.children.splice(p,1,...m.children):x.children.splice(p,1),p}}}function y$(e){const t=e.indexOf(":"),r=e.indexOf("?"),i=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||r!==-1&&t>r||i!==-1&&t>i||f$.test(e.slice(0,t))?e:""}const x$=new Set(["idea_summary","why_now_thesis","description","excerpt","reliability_reason","importance_reason","summary","content","body","notes"]);function v$(e){return x$.has(e)||e.endsWith("_reason")||e.endsWith("_summary")}function b$(e){if(!e||typeof e!="string")return!1;const t=e.trim(),r=t.includes("\\n")&&!t.includes(`
76
+ `)?t.replace(/\\n/g,`
77
+ `):t;if(!r)return!1;if(r.includes("```")||/^#{1,6}\s+/.test(r)||/^\s*>\s+/.test(r)||/^\s*[-*+]\s+/.test(r)||/^\s*\d+\.\s+/.test(r))return!0;const i=[/^#{1,6}\s+/m,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/^\s*>\s+/m];return!!(r.includes(`
78
+ `)&&i.some(l=>l.test(r))||/\[[^\]]+\]\([^)]+\)/.test(r)||/\*\*[^*]+\*\*/.test(r)||/_([^_]+)_/.test(r))}function md(e,t){return typeof t=="string"&&(v$(e)||b$(t))}function w$(e,t){return t.length===0?e:e.replace(/\[(\d+)\]/g,(r,i)=>{const l=parseInt(i,10),s=t[l-1];if(!s)return`[${i}]`;const c=s.url??`#source-${s.id}`,f=s.label?` "${s.label.replace(/"/g,'\\"')}"`:"";return`[${i}](${c}${f})`})}function Ui({content:e,className:t,sourceRefs:r=[]}){if(!e||typeof e!="string")return null;const i=e.includes("\\n")&&!e.includes(`
79
+ `)?e.replace(/\\n/g,`
80
+ `):e,l=r.length>0?w$(i,r):i;return g.jsx("div",{className:ve("rich-text text-sm space-y-2",t),children:g.jsx(h$,{components:{p:({children:s})=>g.jsx("p",{className:"my-1.5",children:s}),ul:({children:s})=>g.jsx("ul",{className:"list-disc list-inside my-1.5 space-y-0.5",children:s}),ol:({children:s})=>g.jsx("ol",{className:"list-decimal list-inside my-1.5 space-y-0.5",children:s}),li:({children:s})=>g.jsx("li",{className:"my-0.5",children:s}),h1:({children:s})=>g.jsx("h1",{className:"font-semibold mt-4 mb-2 text-base first:mt-0",children:s}),h2:({children:s})=>g.jsx("h2",{className:"font-semibold mt-4 mb-2 text-base",children:s}),h3:({children:s})=>g.jsx("h3",{className:"font-semibold mt-3 mb-1.5 text-sm",children:s}),strong:({children:s})=>g.jsx("strong",{className:"font-semibold",children:s}),em:({children:s})=>g.jsx("em",{className:"italic",children:s}),code:({children:s})=>g.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs",children:s}),pre:({children:s})=>g.jsx("pre",{className:"bg-muted p-2 rounded overflow-x-auto text-xs my-2",children:s}),blockquote:({children:s})=>g.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 my-2 text-muted-foreground",children:s}),a:({href:s,children:c})=>g.jsx("a",{href:s,target:s?.startsWith("#")?void 0:"_blank",rel:s?.startsWith("#")?void 0:"noopener noreferrer",className:"text-primary hover:underline source-ref",children:c})},children:l})})}const S$={workflow:VP,collection:YP},E$=[],C$=[];function N$({workflow:e,workflowId:t,versionId:r,events:i,onStepClick:l,onCollectionClick:s,collectedKinds:c,nodeResults:f,readOnly:h=!0,nodesDraggable:d=!1,showControls:m=!0,showBackground:p=!1,className:x="",nodesOverride:b,edgesOverride:E,runsVersionForLink:S}){const[_,N]=w.useState(null),k=w.useRef(null),{fitView:C}=sd(),A=w.useMemo(()=>new Set(c??[]),[c]);w.useEffect(()=>{let K=!1;const J=setTimeout(()=>{if(K)return;const te=i?ZP(i):void 0;N(w2(e,te,A))},0);return()=>{K=!0,clearTimeout(J)}},[e,i,A]);const L=b??(_?_.nodes:E$),j=E??(_?_.edges:C$),[z,P,H]=fP(L),[X,q,F]=dP(j);w.useEffect(()=>{P(L),q(j)},[L,j,P,q]),w.useEffect(()=>{if(!z.length)return;const K=setTimeout(()=>{C({padding:.35,duration:250,minZoom:.15,maxZoom:1.2})},80);return()=>clearTimeout(K)},[z.length,X.length,C]);const Y=d||!h,[O,U]=w.useState(null),[R,V]=w.useState({}),[$,W]=w.useState({}),{theme:M}=HS();w.useEffect(()=>{if(!O||!t||!r)return;const J=O.data?.nodeId;!J||O.type!=="workflow"||J in R||(W(te=>({...te,[J]:!0})),lt.getWorkflowNodePrompt(t,r,J).then(te=>{V(ne=>({...ne,[J]:te})),W(ne=>({...ne,[J]:!1}))}).catch(()=>W(te=>({...te,[J]:!1}))))},[O,t,r,R]);function B(K,J){const te=J.data;if(J.type==="collection"){const se=te.kind;if(se&&s){s(se),U(null);return}}U(J);const ne=te.nodeId??void 0;ne&&l?.(ne)}function G(K){K||U(null)}function D(K){return!f||f.length===0?null:f.find(J=>J.node_id===K)??null}function oe(K){if(K.type==="collection"){const ne=K.data;return g.jsxs(g.Fragment,{children:[g.jsxs(bf,{children:[g.jsxs(As,{className:"text-base",children:["Collection: ",ne.kind]}),g.jsxs(wf,{className:"sr-only",children:["Collection details: ",ne.kind]}),g.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:g.jsx(ta,{value:ne.kind})})]}),g.jsx("div",{className:"space-y-4 pt-4",children:g.jsx(pt,{to:`/data/${encodeURIComponent(ne.kind)}`,className:`text-sm font-medium ${En}`,children:"View data →"})})]})}const J=K.data,te=D(J.nodeId);return g.jsxs(g.Fragment,{children:[g.jsxs(bf,{children:[g.jsx(As,{className:"text-base",children:b2(J.nodeId)}),g.jsxs(wf,{className:"sr-only",children:["Workflow node details: ",J.nodeId]}),g.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:g.jsx(ta,{value:J.nodeId})})]}),g.jsxs("div",{className:"space-y-4 pt-4",children:[g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Node result"}),te?g.jsxs("div",{className:"mt-1 rounded-md border border-border bg-muted/20 p-2 space-y-2",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"text-xs text-muted-foreground",children:"Status"}),g.jsx("span",{className:"text-xs font-medium",children:te.status})]}),g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"text-xs text-muted-foreground",children:"Started"}),g.jsx("span",{className:"text-xs",children:ji(te.started_at)})]}),te.completed_at&&g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"text-xs text-muted-foreground",children:"Completed"}),g.jsx("span",{className:"text-xs",children:ji(te.completed_at)})]}),te.output&&g.jsx("div",{className:"pt-2 border-t border-border",children:g.jsx(Ui,{content:te.output,className:"prose prose-sm dark:prose-invert max-w-none"})})]}):g.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"No node result yet."})]}),(()=>{const ne=(t&&r&&R[J.nodeId]?.prompt)??(t&&r&&R[J.nodeId]?.description)??J.description;return t&&r&&$[J.nodeId]?g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Prompt"}),g.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Loading…"})]}):ne?g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Prompt"}),g.jsx(Ui,{content:ne,className:"text-sm text-foreground mt-1 leading-relaxed prose prose-sm dark:prose-invert max-w-none [&_p]:mt-0 [&_p:first-child]:mt-0"}),g.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Prompts work best when long and specific: goal, constraints, and format."})]}):null})(),t&&r&&R[J.nodeId]?.minimum_rows!=null&&g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Minimum rows"}),g.jsxs("p",{className:"text-sm mt-0.5",children:["Produce at least ",R[J.nodeId].minimum_rows," items"]})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Input collections"}),(J.input??[]).length===0?g.jsx("p",{className:"font-mono text-sm",children:"-"}):g.jsx("div",{className:"flex flex-wrap gap-1.5",children:(J.input??[]).map(ne=>g.jsx("button",{type:"button",className:`text-xs font-mono px-2 py-1 rounded border hover:brightness-95 cursor-pointer transition-colors ${s?En:""}`,style:{borderColor:xr(ne),backgroundColor:`${xr(ne)}22`},onClick:()=>{s&&(s(ne),U(null))},children:ne},`in-${ne}`))})]}),g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Output collections"}),(J.output??[]).length===0?g.jsx("p",{className:"font-mono text-sm",children:"-"}):g.jsx("div",{className:"flex flex-wrap gap-1.5",children:(J.output??[]).map(ne=>g.jsx("button",{type:"button",className:`text-xs font-mono px-2 py-1 rounded border hover:brightness-95 cursor-pointer transition-colors ${s?En:""}`,style:{borderColor:xr(ne),backgroundColor:`${xr(ne)}22`},onClick:()=>{s&&(s(ne),U(null))},children:ne},`out-${ne}`))})]}),(()=>{const ne=(t&&r&&R[J.nodeId]?.required_mcps)??J.requiredMcps,se=(t&&r&&R[J.nodeId]?.required_skills)??J.requiredSkills,he=Array.isArray(ne)?ne:[],me=Array.isArray(se)?se:[];return he.length===0&&me.length===0?null:g.jsxs(g.Fragment,{children:[me.length>0&&g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Required skills"}),g.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:me.map(ge=>g.jsx(Kn,{variant:"outline",className:"font-mono text-xs",children:ge},ge))})]}),he.length>0&&g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Required MCPs"}),g.jsx("div",{className:"flex flex-wrap gap-1 mt-0.5",children:he.map(ge=>g.jsx(Kn,{variant:"secondary",className:"font-mono text-xs",children:ge},ge))})]})]})})(),J.stepStatus&&g.jsxs("div",{children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Status"}),g.jsx("p",{className:"mt-0.5",children:J.stepStatus})]}),S&&g.jsx("div",{className:"pt-4 border-t border-border",children:g.jsxs(pt,{to:`/runs?version=${encodeURIComponent(S)}`,className:`text-sm font-medium ${En}`,children:["View runs (",S,")"]})})]})]})}return g.jsxs(g.Fragment,{children:[g.jsxs(uP,{nodes:z,edges:X,onNodesChange:H,onInit:K=>{k.current=K,setTimeout(()=>{K.fitView({padding:.35,duration:200,minZoom:.15,maxZoom:1.2})},60)},onEdgesChange:F,onNodeClick:B,nodeTypes:S$,nodesDraggable:Y,nodesConnectable:!h,elementsSelectable:!0,defaultEdgeOptions:{type:"smoothstep",markerEnd:{type:Ls.ArrowClosed}},nodeOrigin:[.5,.5],fitView:!0,fitViewOptions:{padding:.5,duration:0,minZoom:.15},minZoom:.15,proOptions:{hideAttribution:!0},className:ve(x||"bg-muted/20",M==="dark"&&"dark"),children:[p&&g.jsx(yP,{variant:oo.Dots}),m&&g.jsx(CP,{showInteractive:!1})]}),g.jsx(ny,{open:!!O,onOpenChange:G,children:g.jsx(ry,{side:"right",className:"w-full max-w-md",children:O&&oe(O)})})]})}function rk(e){return g.jsx(p2,{children:g.jsx("div",{className:"relative w-full h-full min-h-[200px]",children:g.jsx(N$,{...e})})})}function uS(e){return`${e.id}|${e.type}|${(e.input_collections??[]).join(",")}|${(e.output_collections??[]).join(",")}|${e.prompt??""}|${e.description??""}`}function _$(e,t){const r=[],i=[],l=[],s=new Map(e.nodes.map(d=>[d.id,d])),c=new Map(t.nodes.map(d=>[d.id,d]));for(const d of c.keys())s.has(d)?uS(s.get(d))!==uS(c.get(d))&&l.push(d):r.push(d);for(const d of s.keys())c.has(d)||i.push(d);return{nodesAdded:r,nodesRemoved:i,nodesChanged:l,edgesAdded:[],edgesRemoved:[]}}const k$=2e3;function fS(){const{selectedWorkflowId:e,setSelectedWorkflowId:t,selectedWorkflow:r}=sa(),[i,l]=qs(),s=i.get("workflow_id"),c=i.get("version_id"),[f,h]=w.useState(null),[d,m]=w.useState([]),[p,x]=w.useState(c),[b,E]=w.useState(null),[S,_]=w.useState(null),[N,k]=w.useState(!1),[C,A]=w.useState({}),[L,j]=w.useState(null),[z,P]=w.useState(null);w.useEffect(()=>{s&&s!==e&&t(s)},[s,e,t]);const H=w.useCallback(async()=>{try{if(!e)return;const R=await lt.getWorkflow(e),V=await lt.getWorkflowVersions(e);h(R),m(V);const $=c??R.current_version_id,M=V.some(B=>B.version_id===$)?$:V[0]?.version_id??null;x(M),P(null)}catch(R){P(R instanceof Error?R.message:String(R))}},[e,c]);w.useEffect(()=>{H();const R=setInterval(H,k$);return()=>clearInterval(R)},[H]),w.useEffect(()=>{if(!e||!p){E(null);return}lt.getWorkflowVersion(e,p).then(E).catch(()=>E(null))},[e,p]),w.useEffect(()=>{if(!e){A({});return}lt.getCollectionSchema(e).then(R=>A(R.kinds??{})).catch(()=>A({}))},[e]),w.useEffect(()=>{if(!e||!p||d.length===0){_(null);return}const R=d.findIndex($=>$.version_id===p);if(R<=0){_(null),k(!1);return}const V=d[R-1].version_id;lt.getWorkflowVersion(e,V).then(_).catch(()=>_(null))},[e,p,d]);const X=w.useMemo(()=>!S||!b?null:_$(S,b),[S,b]),q=w.useMemo(()=>{if(!X||!b||!S||!N)return;const R=S.nodes.filter(B=>X.nodesRemoved.includes(B.id)),V={...b,nodes:[...b.nodes,...R]},{nodes:$,edges:W}=w2(V);return{nodes:$.map(B=>{if(B.type!=="workflow")return B;const G=B.data.nodeId;let D;return X.nodesAdded.includes(G)?D="added":X.nodesChanged.includes(G)?D="changed":X.nodesRemoved.includes(G)&&(D="removed"),{...B,data:{...B.data,changeStatus:D}}}),edges:W}},[X,b,S,N]),F=f?.current_version_id??null;function Y(R){x(R),l(V=>{const $=new URLSearchParams(V);return e&&$.set("workflow_id",e),$.set("version_id",R),$})}const O=w.useMemo(()=>d.map(R=>R.version_id),[d]);function U(R){return g.jsxs(Wo,{value:R.version_id,children:[R.version_id,R.version_id===F&&g.jsx("span",{className:"ml-1.5 text-muted-foreground font-normal",children:"(current)"})]},R.version_id)}return z?g.jsx("div",{className:"p-3",children:g.jsxs(_n,{className:"border-destructive",children:[g.jsx(tr,{children:g.jsx(nr,{children:"Error"})}),g.jsx(kn,{children:g.jsx("p",{className:"text-sm text-muted-foreground",children:z})})]})}):g.jsxs("div",{className:"h-full flex flex-col",children:[g.jsxs("div",{className:"px-3 py-1.5 border-b border-border flex flex-wrap items-center gap-2 text-sm",children:[g.jsx(ca,{items:[{label:"Workflow"}]}),r?.name&&g.jsx("span",{className:"text-xs text-muted-foreground",children:r.name}),O.length>0&&g.jsxs(Ns,{value:p??F??"",onValueChange:Y,children:[g.jsx(ks,{className:"w-[140px] h-8 text-xs rounded-md border bg-background",children:g.jsx(_s,{placeholder:"Version"})}),g.jsx(Ts,{children:d.map(U)})]}),p&&g.jsxs(pt,{to:`/runs?version=${encodeURIComponent(p)}`,className:`text-xs font-medium ${En}`,children:["Runs (",p,")"]}),X&&g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-xs text-muted-foreground",children:"Show changes"}),g.jsx(kN,{checked:N,onCheckedChange:k}),g.jsxs("div",{className:"relative group",children:[g.jsx(s3,{className:"size-3.5 text-muted-foreground cursor-default"}),g.jsxs("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 hidden group-hover:block z-50 w-56 rounded-md border border-border bg-popover px-3 py-2 text-xs text-popover-foreground shadow-md",children:[g.jsx("p",{className:"mb-2 text-muted-foreground",children:"Highlights what changed between this version and the previous one."}),g.jsxs("div",{className:"space-y-1",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"size-2.5 rounded-sm shrink-0 bg-green-500/80 border border-green-500"}),"Added node"]}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"size-2.5 rounded-sm shrink-0 bg-amber-500/80 border border-amber-500"}),"Edited node"]}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"size-2.5 rounded-sm shrink-0 bg-red-500/30 border border-red-500/80 border-dashed"}),"Removed node"]})]})]})]})]})]}),g.jsxs("div",{className:"px-3 pt-2 pb-1 border-b border-border bg-muted/10",children:[g.jsx("div",{className:"text-sm font-semibold",children:f?.name??r?.name??"Workflow"}),f?.description&&g.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:f.description})]}),g.jsx("div",{className:"flex-1 min-h-0",children:b?g.jsx(rk,{workflow:b,workflowId:e??void 0,versionId:p??void 0,runsVersionForLink:p??void 0,nodesOverride:q?.nodes,edgesOverride:q?.edges,onCollectionClick:R=>j(R),readOnly:!0,showControls:!0,showBackground:!0,className:"bg-muted/30"}):g.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No workflow selected"})}),g.jsx(ny,{open:!!L,onOpenChange:R=>!R&&j(null),children:g.jsxs(ry,{side:"right",className:"w-full max-w-md",children:[g.jsxs(bf,{children:[g.jsxs(As,{className:"text-base",children:["Collection schema: ",L]}),g.jsx(wf,{className:"sr-only",children:"Collection schema details"})]}),g.jsx("div",{className:"pt-4 space-y-3 text-sm",children:L?(()=>{const R=C[L],V=R?.item_schema??{},$=V.properties??{},W=new Set(V.required??[]),M=Object.entries($);return g.jsxs(g.Fragment,{children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-1",children:"Name"}),g.jsx("div",{children:R?.name??"-"})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-1",children:"Description"}),g.jsx("div",{className:"text-muted-foreground",children:R?.description??"-"})]}),g.jsxs("div",{children:[g.jsx("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-2",children:"Fields"}),M.length===0?g.jsx("div",{className:"rounded-md border border-border bg-muted/20 p-2 text-xs text-muted-foreground",children:"No explicit properties defined."}):g.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:g.jsx("div",{className:"max-h-[50vh] overflow-y-auto",children:M.map(([B,G])=>g.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-2 border-b last:border-b-0 border-border px-3 py-2",children:[g.jsxs("div",{children:[g.jsx("div",{className:"font-medium text-sm",children:B}),g.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[G.type??"any",G.description?` • ${String(G.description)}`:""]})]}),W.has(B)?g.jsx("span",{className:"self-start rounded-full border border-emerald-500/40 bg-emerald-500/10 px-2 py-0.5 text-[10px] font-semibold text-emerald-700 dark:text-emerald-300",children:"required"}):g.jsx("span",{className:"self-start rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:"optional"})]},B))})})]})]})})():null})]})})]})}function pd({className:e,...t}){return g.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0 overflow-x-auto",children:g.jsx("table",{"data-slot":"table",className:ve("w-full caption-bottom text-sm",e),...t})})}function gd({className:e,...t}){return g.jsx("thead",{"data-slot":"table-header",className:ve("[&_tr]:border-b",e),...t})}function yd({className:e,...t}){return g.jsx("tbody",{"data-slot":"table-body",className:ve("[&_tr:last-child]:border-0",e),...t})}function io({className:e,...t}){return g.jsx("tr",{"data-slot":"table-row",className:ve("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function St({className:e,...t}){return g.jsx("th",{"data-slot":"table-head",className:ve("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function xt({className:e,...t}){return g.jsx("td",{"data-slot":"table-cell",className:ve("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const T$=3e3,Ep="",Cp="";function A$(){const[e,t]=qs(),{selectedWorkflowId:r,selectedWorkflow:i}=sa(),l=e.get("version")??Ep,s=e.get("status")??Cp,[c,f]=w.useState([]),[h,d]=w.useState(null),m=zf(),p=w.useMemo(()=>r?c.filter(A=>A.workflow_id===r):c,[c,r]),x=w.useMemo(()=>p.filter(A=>!(l&&A.workflow_version_id!==l||s&&A.status!==s)),[p,l,s]),b=w.useMemo(()=>Array.from(new Set(p.map(A=>A.workflow_version_id))).sort(),[p]),E=w.useMemo(()=>Array.from(new Set(c.map(A=>A.status))).sort(),[c]);function S(A){t(L=>{const j=new URLSearchParams(L);return A===Ep?j.delete("version"):j.set("version",A),j})}function _(A){t(L=>{const j=new URLSearchParams(L);return A===Cp?j.delete("status"):j.set("status",A),j})}const N=w.useCallback(async()=>{try{const A=await lt.getRuns();f(A),d(null)}catch(A){d(A instanceof Error?A.message:String(A))}},[]);if(w.useEffect(()=>{N();const A=setInterval(N,T$);return()=>clearInterval(A)},[N]),h)return g.jsx("div",{className:"p-3",children:g.jsxs(_n,{className:"border-destructive",children:[g.jsx(tr,{children:g.jsx(nr,{children:"Error"})}),g.jsx(kn,{children:g.jsx("p",{className:"text-sm text-muted-foreground",children:h})})]})});function k(){const A=["name","run_id","workflow_id","workflow_version_id","status","created_at"],L=["Name","ID","Workflow","Version","Status","Created"];uf(x.map(j=>({name:j.name??"",run_id:j.run_id,workflow_id:j.workflow_id,workflow_version_id:j.workflow_version_id,status:j.status,created_at:j.created_at})),A,L,"runs.csv")}const C=c.filter(A=>A.status==="running").length;return g.jsxs("div",{className:"p-3",children:[g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-1.5 py-0.5",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx(ca,{items:[{label:"Runs"}]}),i?.name&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:["Workflow: ",g.jsx("span",{className:"font-medium text-foreground/80",children:i.name})]}),C>0&&g.jsxs("span",{className:"text-xs font-medium text-amber-600 dark:text-amber-400 flex items-center gap-1",children:[g.jsx("span",{className:"size-1.5 rounded-full bg-amber-500 animate-pulse","aria-hidden":!0}),C," running"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(Ns,{value:l||"all",onValueChange:A=>S(A==="all"?Ep:A),children:[g.jsx(ks,{size:"sm",className:"w-[180px]",children:g.jsx(_s,{placeholder:"Workflow version"})}),g.jsxs(Ts,{children:[g.jsx(Wo,{value:"all",children:"All versions"}),b.map(A=>g.jsx(Wo,{value:A,children:A},A))]})]}),g.jsxs(Ns,{value:s||"all",onValueChange:A=>_(A==="all"?Cp:A),children:[g.jsx(ks,{size:"sm",className:"w-[140px]",children:g.jsx(_s,{placeholder:"Status"})}),g.jsxs(Ts,{children:[g.jsx(Wo,{value:"all",children:"All statuses"}),E.map(A=>g.jsx(Wo,{value:A,children:A},A))]})]})]})]}),g.jsx("div",{className:"flex items-center gap-2",children:x.length>0&&g.jsx("button",{type:"button",onClick:k,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})})]}),g.jsx(_n,{children:g.jsx(kn,{className:"p-0 text-sm",children:g.jsxs(pd,{children:[g.jsx(gd,{children:g.jsxs(io,{children:[g.jsx(St,{className:"w-8 min-w-8 text-center",children:"#"}),g.jsx(St,{className:"min-w-[120px]",children:"Name"}),g.jsx(St,{className:"min-w-[180px]",children:"ID"}),g.jsx(St,{className:"min-w-[80px]",children:"Version"}),g.jsx(St,{className:"min-w-[80px]",children:"Status"}),g.jsx(St,{className:"min-w-[140px] whitespace-nowrap",children:"Created"})]})}),g.jsxs(yd,{children:[x.length===0&&g.jsx(io,{children:g.jsx(xt,{colSpan:6,className:"text-center text-muted-foreground",children:c.length===0?"No runs yet":"No runs match filter"})}),x.map((A,L)=>g.jsxs(io,{className:["cursor-pointer hover:bg-muted/50",A.status==="running"?"bg-amber-500/5 dark:bg-amber-500/10":""].join(" "),onClick:()=>m(`/runs/${encodeURIComponent(A.run_id)}`),children:[g.jsx(xt,{className:"text-xs text-muted-foreground text-center align-top w-8 min-w-8 py-1.5",children:L+1}),g.jsx(xt,{className:"align-top py-1.5",children:g.jsx("div",{className:"text-sm font-semibold whitespace-normal break-words line-clamp-2 overflow-hidden",children:A.name??"-"})}),g.jsx(xt,{className:"max-w-[200px] align-top py-1.5",children:g.jsx(ta,{value:A.run_id,truncateLength:24})}),g.jsx(xt,{className:"align-top py-1.5 text-sm",children:A.workflow_version_id}),g.jsx(xt,{className:"align-top py-1.5",children:g.jsx(Kn,{variant:A.status==="running"?"default":"secondary",children:A.status})}),g.jsx(xt,{className:"text-muted-foreground text-sm whitespace-nowrap align-top py-1.5",children:ji(A.created_at)})]},A.run_id))]})]})})})]})}function R$({className:e,orientation:t="horizontal",...r}){return g.jsx(g5,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ve("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...r})}const j$=v2("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function M$({className:e,variant:t="default",...r}){return g.jsx(y5,{"data-slot":"tabs-list","data-variant":t,className:ve(j$({variant:t}),e),...r})}function O$({className:e,...t}){return g.jsx(x5,{"data-slot":"tabs-trigger",className:ve("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function D$({className:e,...t}){return g.jsx(v5,{"data-slot":"tabs-content",className:ve("flex-1 outline-none",e),...t})}function Yl(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(Yl).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function z$({data:e}){const t=e.themes??[],r=e.signals??{},i=e.ideas_count,l=e.sources_count,s=e.learnings??[],c=e.output,f=e.stored_in,h=e.step??e.step_id??e.node_id,d=e.status,m=[];return i!=null&&m.push(`${i} ideas`),l!=null&&m.push(`${l} sources`),g.jsxs("div",{className:"space-y-1.5 text-xs",children:[h&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Step:"})," ",h,d&&d!=="step_completed"&&g.jsxs("span",{className:"ml-1.5 text-muted-foreground",children:["(",d,")"]})]}),t.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Themes:"})," ",t.join(", ")]}),Object.keys(r).length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Signals:"}),g.jsx("ul",{className:"list-disc list-inside mt-0.5 ml-1",children:Object.entries(r).map(([p,x])=>g.jsxs("li",{children:[g.jsxs("span",{className:"font-medium",children:[p,":"]})," ",Yl(x)]},p))})]}),m.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Produced:"})," ",m.join(", ")]}),s.length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Learnings:"}),g.jsx("ul",{className:"list-disc list-inside mt-0.5 ml-1",children:s.map((p,x)=>g.jsx("li",{children:Yl(p)},x))})]}),c!=null&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Output:"})," ",typeof c=="object"?g.jsx("pre",{className:"mt-0.5 p-1.5 bg-muted rounded text-[10px] overflow-x-auto max-h-24 overflow-y-auto",children:JSON.stringify(c,null,2)}):Yl(c)]}),f&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Stored in:"})," ",f]})]})}function L$({data:e}){const t=e.step??e.step_id??e.node_id,r=e.constraint,i=e.context;return g.jsxs("div",{className:"space-y-1 text-xs",children:[t&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Step:"})," ",t]}),r&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Constraint:"})," ",r]}),i!=null&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Context:"})," ",Yl(i)]})]})}function I$({data:e}){const t=e.workflow_version,r=e.input;return g.jsxs("div",{className:"space-y-1 text-xs",children:[t&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Version:"})," ",t]}),r&&Object.keys(r).length>0&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Input:"})," ",Object.entries(r).map(([i,l])=>`${i}: ${Yl(l)}`).join("; ")]})]})}function B$({data:e}){const t=e.ideas_count,r=e.status,i=e.message;return g.jsxs("div",{className:"space-y-1 text-xs",children:[r&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Status:"})," ",r]}),t!=null&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Ideas:"})," ",t]}),i&&g.jsxs("div",{children:[g.jsx("span",{className:"text-muted-foreground font-medium",children:"Message:"})," ",i]})]})}function H$({data:e}){const t=Object.keys(e);if(t.length===0)return g.jsx("span",{className:"text-muted-foreground italic",children:"-"});const r=[],i=e.step??e.step_id??e.node_id;i!=null&&r.push(`step: ${String(i)}`),e.status!=null&&r.push(String(e.status)),e.message!=null&&r.push(String(e.message).slice(0,60));const l=t.filter(s=>!["step","step_id","node_id","status","message"].includes(s));return l.length>0&&r.push(l.join(", ")),g.jsx("span",{className:"text-sm",children:r.join(" · ")||t.join(", ")})}function P$({type:e,data:t}){if(Object.keys(t).length===0)return g.jsx("span",{className:"text-muted-foreground italic",children:"-"});let i;switch(e){case"step_completed":i=g.jsx(z$,{data:t});break;case"step_started":i=g.jsx(L$,{data:t});break;case"run_started":i=g.jsx(I$,{data:t});break;case"run_completed":i=g.jsx(B$,{data:t});break;default:i=g.jsx(H$,{data:t})}return g.jsxs("div",{className:"space-y-1",children:[i,g.jsxs("details",{className:"text-xs",children:[g.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground py-0.5",children:"Raw data"}),g.jsx("pre",{className:"mt-0.5 p-1.5 bg-muted rounded text-[10px] overflow-x-auto max-h-40 overflow-y-auto",children:JSON.stringify(t,null,2)})]})]})}function mg(e){const t=e.created_by_node_id;return t&&t.trim()?t:null}function U$(e){const t=new Set(["id","created_at",...TN]),r=new Set;for(const i of e)for(const l of Object.keys(i))t.has(l)||r.add(l);return Array.from(r)}function pg(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(pg).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function V$(e,t){if(!t.trim())return!0;const r=t.trim().toLowerCase();for(const i of Object.values(e)){if(i==null)continue;if((typeof i=="string"?i:JSON.stringify(i)).toLowerCase().includes(r))return!0}return!1}function $$(e,t,r,i){const l=t.id??String(r);if(i)return`/runs/${encodeURIComponent(i)}/collections/${encodeURIComponent(e)}/items/${encodeURIComponent(l)}`;const s=t.run_id?`?run_id=${encodeURIComponent(String(t.run_id))}`:"";return`/data/${encodeURIComponent(e)}/items/${encodeURIComponent(l)}${s}`}function Y$({kind:e,items:t,workflow:r,runId:i,stepFilter:l,searchQuery:s}){const[c,f]=w.useState(null),h=w.useCallback(b=>{f(E=>E===b?null:b)},[]),d=t??[],m=d.filter(b=>!(l!=null&&l!==""&&mg(b)!==l||s!=null&&!V$(b,s)));if(d.length===0)return g.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",e," yet."]});const p=U$(m),x=!!r;return g.jsxs(pd,{children:[g.jsx(gd,{children:g.jsxs(io,{children:[g.jsx(St,{className:"w-16 text-right",children:"Actions"}),g.jsx(St,{className:"w-8 min-w-8 text-center",children:"#"}),g.jsx(St,{className:"min-w-[120px]",children:"Added"}),x&&g.jsx(St,{className:"min-w-[140px]",children:"Created by node"}),p.map(b=>g.jsx(St,{className:"capitalize min-w-[120px]",children:b.replace(/_/g," ")},b))]})}),g.jsx(yd,{children:m.map((b,E)=>{const S=x?mg(b):null,_=$$(e,b,E,i),N=b.id??`row-${E}`,k=c===N;return g.jsxs(io,{className:ve("cursor-pointer hover:bg-muted/50",k&&"bg-muted/30"),onClick:()=>h(N),children:[g.jsx(xt,{className:"text-right align-top py-1.5 w-16",onClick:C=>C.stopPropagation(),children:g.jsx("div",{className:"flex items-center justify-end",children:g.jsx("a",{href:_,onClick:C=>C.stopPropagation(),className:"p-1.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted inline-flex",title:"Go to collection item","aria-label":"Go to collection item",children:g.jsx(_N,{className:"size-3.5"})})})}),g.jsx(xt,{className:"text-xs text-muted-foreground text-center align-top py-1.5 w-8",children:E+1}),g.jsx(xt,{className:"text-xs text-muted-foreground whitespace-nowrap align-top py-1.5",children:ji(b.created_at)}),x&&g.jsx(xt,{className:"text-xs text-muted-foreground whitespace-nowrap align-top py-1.5",children:S?g.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-[11px]",children:S.replace(/_/g," ")}):"-"}),p.map(C=>{const A=b[C],L=md(C,A),j=!k;return g.jsx(xt,{className:"text-sm min-w-[120px] max-w-[500px] align-top py-1.5",children:g.jsx("div",{className:ve("whitespace-normal break-words",j&&"line-clamp-2 overflow-hidden"),children:C==="url"?g.jsx("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:`${En} break-all`,onClick:z=>z.stopPropagation(),children:pg(A)}):L?g.jsx(Ui,{content:A,className:ve("text-xs",j&&"line-clamp-2")}):pg(A)})},C)})]},N)})})]})}const q$=200,F$=600,X$=300;function G$(e,t,r,i){try{const l=localStorage.getItem(e);if(l){const s=Number(l);if(!Number.isNaN(s)&&s>=r&&s<=i)return s}}catch{}return t}function W$(e,t){try{localStorage.setItem(e,String(t))}catch{}}function Z$(e,t,r,i){if(e!=null&&typeof window<"u"){const l=Math.floor(window.innerWidth*e);return Math.min(i,Math.max(r,l))}return t}function K$({defaultWidth:e=X$,defaultFraction:t,minWidth:r=q$,maxWidth:i=F$,storageKey:l,left:s,right:c,className:f}){const h=Z$(t,e,r,i),d=l?G$(l,h,r,i):h,[m,p]=w.useState(d),[x,b]=w.useState(!1),E=w.useRef(null),S=w.useRef(m);S.current=m;const _=w.useCallback(N=>{N.preventDefault(),b(!0)},[]);return w.useEffect(()=>{if(!x)return;function N(C){if(!E.current)return;const A=E.current.getBoundingClientRect(),L=C.clientX-A.left,j=Math.min(i,Math.max(r,L));S.current=j,p(j)}function k(){l&&W$(l,S.current),b(!1)}return document.addEventListener("mousemove",N),document.addEventListener("mouseup",k),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",k),document.body.style.cursor="",document.body.style.userSelect=""}},[x,r,i,l]),g.jsxs("div",{ref:E,className:ve("flex h-full min-h-0",f),children:[g.jsx("div",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:`${m}px`},children:s}),g.jsx("div",{role:"separator","aria-orientation":"vertical","aria-valuenow":m,onMouseDown:_,className:ve("w-1 shrink-0 cursor-col-resize hover:bg-primary/30 transition-colors flex items-center justify-center group",x&&"bg-primary/50"),children:g.jsx("div",{className:ve("w-0.5 h-8 rounded-full bg-border group-hover:bg-primary/60 transition-colors",x&&"bg-primary")})}),g.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:c})]})}function hr({className:e,...t}){return g.jsx("div",{className:ve("animate-pulse rounded-md bg-muted",e),...t})}const gg=3e3;function Q$(e,t){if(!t)return"-";const r=Date.parse(e),i=Date.parse(t);if(Number.isNaN(r)||Number.isNaN(i))return"-";const l=(r-i)/1e3;if(l<60)return`+${l.toFixed(1)}s`;const s=Math.floor(l/60),c=Math.floor(l%60);return`+${s}m ${c}s`}function J$(e){switch(e){case"run_started":return"bg-primary/20 text-primary border-primary/40";case"step_started":return"bg-blue-500/20 text-blue-700 dark:text-blue-300 border-blue-500/40";case"step_completed":return"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40";case"run_completed":return"bg-violet-500/20 text-violet-700 dark:text-violet-300 border-violet-500/40";default:return"bg-muted text-muted-foreground border-border"}}function e7(e,t){if(e==="completed")return{label:"Settled",className:"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40"};if(!t)return{label:"No signal",className:"bg-muted text-muted-foreground border-border"};const r=Date.parse(t);if(Number.isNaN(r))return{label:"No signal",className:"bg-muted text-muted-foreground border-border"};const i=Date.now()-r;return i<=gg*2.5?{label:"Live",className:"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40"}:i<=gg*6?{label:"Delayed",className:"bg-amber-500/20 text-amber-700 dark:text-amber-300 border-amber-500/40"}:{label:"Stale",className:"bg-rose-500/20 text-rose-700 dark:text-rose-300 border-rose-500/40"}}function t7(){const{runId:e}=Cg(),[t]=qs(),r=t.get("tab"),[i,l]=w.useState(null),[s,c]=w.useState([]),[f,h]=w.useState([]),[d,m]=w.useState({}),[p,x]=w.useState(null),[b,E]=w.useState([]),[S,_]=w.useState(null),[N,k]=w.useState(!1),[C,A]=w.useState(null),[L,j]=w.useState(null),[z,P]=w.useState(!1),[H,X]=w.useState("all"),q=w.useRef(null),F=C??(r&&f.includes(r)?r:f[0])??"",Y=s.length>0?s[s.length-1]?.ts:void 0,O=e7(i?.status,Y),U=w.useMemo(()=>H==="all"?s:H==="steps"?s.filter(K=>K.type==="step_started"||K.type==="step_completed"):s.filter(K=>K.type!=="step_started"&&K.type!=="step_completed"),[H,s]),R=w.useMemo(()=>{const K=p?.nodes??[];if(K.length===0)return{total:0,completed:0,running:0,pending:0,failed:0};const J=new Map;for(const me of b)J.set(me.node_id,me);let te=0,ne=0,se=0,he=0;for(const me of K){const xe=J.get(me.id)?.status;xe==="completed"?te+=1:xe==="started"?ne+=1:xe==="failed"||xe==="needs_human"?se+=1:he+=1}return{total:K.length,completed:te,running:ne,pending:he,failed:se}},[p,b]);function V(){const K=s.map(J=>({ts:J.ts,type:J.type,by:J.by??"",data:JSON.stringify(J.data)}));uf(K,["ts","type","by","data"],["Time","Type","By","Data"],"events.csv")}function $(){const K=F,te=(K?d[K]:null)?.items??[];if(te.length===0)return;const ne=new Set(["id","created_at"]),se=Array.from(te.reduce((me,ge)=>(Object.keys(ge).filter(xe=>!ne.has(xe)).forEach(xe=>me.add(xe)),me),new Set)),he=se.map(me=>me.replace(/_/g," "));uf(te,se,he,`${K}.csv`)}function W(){document.querySelector('[data-collected-section="true"]')?.scrollIntoView({behavior:"smooth",block:"start"})}function M(){const K=q.current;K&&K.scrollTo({top:K.scrollHeight,behavior:"smooth"})}const B=w.useCallback(async()=>{if(e)try{const[K,J,te,ne]=await Promise.all([lt.getRun(e),lt.getRunEvents(e),lt.getCollectionKinds(e),lt.getNodeResults(e)]);l(K),c(J),h(te),E(ne),_(null);const se={};for(const he of te)se[he]=await lt.getCollections(e,he);if(m(se),K?.workflow_id&&K?.workflow_version_id)try{const he=await lt.getWorkflowVersion(K.workflow_id,K.workflow_version_id,{includePrompts:!1});x(he)}catch{x(null)}else x(null)}catch(K){_(K instanceof Error?K.message:String(K))}},[e]);if(w.useEffect(()=>{B();const K=setInterval(B,gg);return()=>clearInterval(K)},[B]),!e||S)return g.jsx("div",{className:"p-3",children:g.jsxs(_n,{className:"border-destructive",children:[g.jsx(tr,{children:g.jsx(nr,{children:"Error"})}),g.jsxs(kn,{children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:S??"Missing run ID"}),g.jsx(pt,{to:"/runs",className:`text-sm mt-2 inline-block ${En}`,children:"Back to runs"})]})]})});if(i===null)return g.jsxs("div",{className:"h-full flex",children:[g.jsxs("aside",{className:"w-1/2 border-r border-border flex flex-col bg-muted/20 shrink-0",children:[g.jsx("div",{className:"p-2 border-b border-border",children:g.jsx(hr,{className:"h-4 w-24"})}),g.jsx("div",{className:"flex-1 p-4",children:g.jsx(hr,{className:"h-full w-full rounded-lg"})})]}),g.jsxs("main",{className:"flex-1 flex flex-col min-w-0 p-2 gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2 py-1.5 border-b border-border",children:[g.jsx(hr,{className:"h-4 w-32"}),g.jsx(hr,{className:"h-5 w-16 rounded-full"}),g.jsx(hr,{className:"h-4 w-40 ml-auto"})]}),g.jsxs("div",{className:"space-y-2 pl-2 border-l-2 border-border",children:[g.jsx(hr,{className:"h-4 w-full max-w-[200px]"}),g.jsx(hr,{className:"h-4 w-full max-w-[280px]"})]}),g.jsxs("div",{className:"flex-1 flex flex-col border-l-2 border-border pl-2 gap-2",children:[g.jsx(hr,{className:"h-6 w-28"}),g.jsx(hr,{className:"h-8 w-full rounded"}),g.jsx(hr,{className:"flex-1 min-h-[120px] w-full rounded"})]})]})]});const D=p?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"px-2 py-2 border-b border-border flex items-center justify-between gap-1",children:[g.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Workflow"}),g.jsx("button",{type:"button",onClick:()=>k(K=>!K),className:"text-muted-foreground hover:text-foreground p-0.5 rounded","aria-label":"Show workflow tips",children:g.jsx("span",{className:"text-[10px] font-mono",children:"?"})})]}),N&&g.jsx("div",{className:"px-2 py-1.5 border-b border-border bg-muted/50",children:g.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Drag nodes to reposition · Click nodes for details"})}),g.jsx("div",{className:"flex-1 min-h-0",children:g.jsx(rk,{workflow:p,workflowId:i?.workflow_id,versionId:i?.workflow_version_id,events:s,nodeResults:b,collectedKinds:f.filter(K=>(d[K]?.items?.length??0)>0),onCollectionClick:K=>{A(K),W()},readOnly:!0,nodesDraggable:!0,showControls:!0,showBackground:!1,className:"bg-transparent"})})]}):null,oe=g.jsx("main",{className:"h-full flex flex-col overflow-hidden",children:g.jsxs("div",{className:"flex flex-col flex-1 min-h-0 p-2 gap-1.5",children:[g.jsxs("header",{className:"shrink-0 bg-background py-1.5 border-b border-border flex flex-wrap items-center gap-x-3 gap-y-1",children:[g.jsx(ca,{items:[{label:"Runs",to:"/runs"},{label:i?.name??e??"Run",to:void 0}]}),g.jsx(Kn,{variant:"outline",className:ve("text-xs shrink-0",i?.status==="completed"&&"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40",i?.status==="running"&&"bg-amber-500/20 text-amber-700 dark:text-amber-300 border-amber-500/40 animate-pulse",i?.status!=="completed"&&i?.status!=="running"&&"bg-muted text-muted-foreground"),children:i?.status}),g.jsxs(Kn,{variant:"outline",className:ve("text-[10px] shrink-0",O.className),children:["Signal: ",O.label]}),i?.workflow_version_id&&g.jsxs(pt,{to:`/workflow?workflow_id=${encodeURIComponent(i.workflow_id)}&version_id=${encodeURIComponent(i.workflow_version_id)}`,className:`text-xs shrink-0 ${En}`,children:["Workflow version: ",i.workflow_version_id]}),R.total>0&&g.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[g.jsxs(Kn,{variant:"outline",className:"bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 border-emerald-500/40",children:["✓ ",R.completed]}),g.jsxs(Kn,{variant:"outline",className:"bg-blue-500/20 text-blue-700 dark:text-blue-300 border-blue-500/40",children:["▶ ",R.running]}),g.jsxs(Kn,{variant:"outline",className:"bg-muted text-muted-foreground border-border",children:["○ ",R.pending]}),R.failed>0&&g.jsxs(Kn,{variant:"outline",className:"bg-rose-500/20 text-rose-700 dark:text-rose-300 border-rose-500/40",children:["! ",R.failed]})]}),g.jsxs("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:[g.jsx(ta,{value:e,truncateLength:20,className:"text-[11px] text-muted-foreground font-normal"}),g.jsx("button",{type:"button",onClick:W,className:"text-xs px-2 py-1 rounded-md border border-border bg-background hover:bg-muted",children:"Jump to data"}),g.jsxs("button",{type:"button",onClick:()=>P(!0),className:ve("flex items-center gap-1.5 text-xs px-2 py-1 rounded-md border border-border bg-muted/50 hover:bg-muted",z&&"ring-2 ring-ring/50"),"aria-label":"Open events",children:[g.jsx(u3,{className:"size-3.5"}),"Events (",s.length,")"]})]})]}),g.jsx("section",{className:"shrink-0 border-l-2 border-l-primary/40 pl-2 py-1 max-h-48 overflow-y-auto",children:g.jsxs("dl",{className:"text-sm space-y-0.5 pr-1",children:[g.jsxs("div",{className:"flex gap-2",children:[g.jsx("dt",{className:"text-muted-foreground shrink-0 w-16",children:"Created"}),g.jsx("dd",{children:ji(i?.created_at)})]}),i?.input&&Object.keys(i.input).length>0&&Object.entries(i.input).filter(([,K])=>K!=null&&K!=="").map(([K,J])=>g.jsxs("div",{className:"flex gap-2",children:[g.jsx("dt",{className:"text-muted-foreground shrink-0 w-16 capitalize",children:K.replace(/_/g," ")}),g.jsx("dd",{className:"min-w-0 break-words",children:typeof J=="string"&&J.length>200?g.jsx("span",{className:"block rounded bg-muted/50 p-2 text-xs whitespace-pre-wrap",children:J}):typeof J=="object"?g.jsx("span",{className:"block rounded bg-muted/50 p-2 text-xs whitespace-pre-wrap font-mono",children:JSON.stringify(J,null,2)}):g.jsx("span",{className:"rounded bg-muted/50 px-1.5 py-0.5",children:String(J)})})]},K)),(!i?.input||Object.keys(i.input).length===0)&&g.jsx("div",{className:"text-muted-foreground text-xs",children:"No input"})]})}),i?.final_answer!=null&&i.final_answer!==""&&g.jsxs("section",{className:"shrink-0 border-l-2 border-l-emerald-500/40 pl-2 py-1.5",children:[g.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide mb-1",children:"Final answer"}),g.jsx("div",{className:"text-sm prose prose-sm dark:prose-invert max-w-none",children:g.jsx(Ui,{content:i.final_answer})})]}),g.jsx(ny,{open:z,onOpenChange:P,children:g.jsxs(ry,{side:"right",className:"w-full max-w-2xl",children:[g.jsx(bf,{children:g.jsxs(As,{children:["Events (",U.length,"/",s.length,")"]})}),g.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[g.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g.jsxs("select",{value:H,onChange:K=>X(K.target.value),className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted","aria-label":"Event timeline mode",children:[g.jsx("option",{value:"all",children:"All events"}),g.jsx("option",{value:"steps",children:"Step events"}),g.jsx("option",{value:"system",children:"System events"})]}),g.jsx("button",{type:"button",onClick:M,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Jump latest"}),s.length>0&&g.jsx("button",{type:"button",onClick:V,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})]}),g.jsx(SN,{className:"flex-1 -mx-2",children:g.jsx("div",{className:"pr-2",ref:q,children:g.jsxs(pd,{children:[g.jsx(gd,{children:g.jsxs(io,{children:[g.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[70px]",children:"Delta"}),g.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[100px]",children:"Time"}),g.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[120px]",children:"Type"}),g.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[80px]",children:"By"}),g.jsx(St,{className:"h-7 px-1.5 text-xs min-w-[280px]",children:"Data"})]})}),g.jsx(yd,{children:U.map((K,J)=>g.jsxs(io,{"data-event-index":J,className:ve("cursor-default",typeof K.data?.step=="string"&&"cursor-pointer hover:bg-muted/40"),onClick:()=>{const te=K.data?.step;typeof te=="string"&&(j(te),P(!1),W())},children:[g.jsx(xt,{className:"text-[11px] text-muted-foreground py-1 font-mono",children:Q$(K.ts,J>0?U[J-1].ts:null)}),g.jsx(xt,{className:"text-[11px] text-muted-foreground py-1",children:K.ts??"-"}),g.jsx(xt,{className:"py-1",children:g.jsx(Kn,{variant:"outline",className:ve("text-[10px]",J$(K.type)),children:K.type})}),g.jsx(xt,{className:"text-sm py-1",children:K.by??"-"}),g.jsx(xt,{className:"min-w-[280px] max-w-none whitespace-normal break-words align-top py-1.5 text-xs overflow-visible",children:g.jsx(P$,{type:K.type,data:K.data})})]},J))})]})})})]})]})}),f.length>0&&g.jsx("section",{"data-collected-section":"true",className:"flex-1 min-h-0 flex flex-col border-l-2 border-l-emerald-500/40 pl-2",children:g.jsxs(_n,{className:"flex-1 min-h-0 flex flex-col gap-0 py-1",children:[g.jsxs(tr,{className:"py-1 px-2 shrink-0 flex flex-row items-center justify-between gap-2 flex-wrap",children:[g.jsx(nr,{className:"text-sm",children:"Data collected"}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("select",{value:L??"",onChange:K=>j(K.target.value===""?null:K.target.value),className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted min-w-[140px]","aria-label":"Filter by step",children:[g.jsx("option",{value:"",children:"All steps"}),p?.nodes.map(K=>g.jsx("option",{value:K.id,children:K.id.replace(/_/g," ")},K.id))]}),(d[F]?.items?.length??0)>0&&g.jsx("button",{type:"button",onClick:$,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})]})]}),g.jsx(kn,{className:"flex-1 min-h-0 overflow-hidden px-2 pb-1 pt-0 flex flex-col",children:g.jsxs(R$,{value:F,onValueChange:A,className:"flex flex-col flex-1 min-h-0",children:[g.jsx("div",{className:"shrink-0 min-w-0 overflow-x-auto overflow-y-hidden",children:g.jsx(M$,{className:"inline-flex w-max",children:f.map(K=>g.jsx(O$,{value:K,className:"shrink-0 border-l-4 pl-2",style:{borderLeftColor:xr(K)},children:K},K))})}),f.map(K=>g.jsx(D$,{value:K,className:"flex-1 min-h-0 mt-1 data-[state=inactive]:hidden flex flex-col overflow-hidden border-l-4 pl-2",style:{borderLeftColor:xr(K)},children:g.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto overflow-x-auto p-1",children:g.jsx(Y$,{kind:K,items:(d[K]??{items:[]}).items,workflow:p,runId:e??null,stepFilter:L,searchQuery:""})})},K))]})})]})})]})});return p?g.jsx(K$,{defaultFraction:.5,defaultWidth:400,minWidth:200,maxWidth:800,storageKey:"cognetivy-workflow-panel-width",left:g.jsx("aside",{className:"h-full flex flex-col border-r border-border bg-muted/20",children:D}),right:oe,className:"h-full"}):g.jsx("div",{className:"h-full flex",children:oe})}const n7=5e3,Np="cognetivy_collection_run_id";function yg(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(t=>yg(t)).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function r7(){const{kind:e}=Cg(),[t,r]=qs(),{selectedWorkflowId:i,selectedWorkflow:l}=sa(),[s,c]=w.useState(null),[f,h]=w.useState([]),[d,m]=w.useState([]),[p,x]=w.useState(null),[b,E]=w.useState(null),S=t.get("run_id")??"",_=w.useMemo(()=>{const Y=new Map;for(const O of d)Y.set(O.run_id,O.name??O.run_id);return Y},[d]),N=w.useCallback(async()=>{if(e)try{if(!i)return;const[Y,O,U]=await Promise.all([lt.getCollectionSchema(i),lt.getEntityData(e,{workflowId:i}),lt.getRuns()]);c(Y),h(O),m(U),x(null)}catch(Y){x(Y instanceof Error?Y.message:String(Y))}},[e,i]);if(w.useEffect(()=>{N();const Y=setInterval(N,n7);return()=>clearInterval(Y)},[N]),w.useEffect(()=>{if(!(!e||t.get("run_id")))try{const Y=localStorage.getItem(Np);if(Y){const O=new URLSearchParams(t);O.set("run_id",Y),r(O,{replace:!0})}}catch{}},[e,t,r]),!e||p)return g.jsx("div",{className:"p-3",children:g.jsxs(_n,{className:"border-destructive",children:[g.jsx(tr,{children:g.jsx(nr,{children:"Error"})}),g.jsxs(kn,{children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:p??"Missing entity kind"}),g.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Use the Collection section in the sidebar to open a collection."})]})]})});const k=s?.kinds[e],C=k?.references??{},L=w.useMemo(()=>{const Y=k?.item_schema;if(Y&&typeof Y=="object"){const O=Y.properties;if(O&&typeof O=="object")return Object.keys(O)}return f.length>0?Array.from(new Set(f.flatMap(O=>Object.keys(O).filter(U=>!["id","created_at"].includes(U))))):[]},[f,k]).filter((Y,O,U)=>U.indexOf(Y)===O&&Y!=="run_id"),j=w.useMemo(()=>S?f.filter(Y=>String(Y.run_id??"")===S):f,[f,S]),z=e.replace(/_/g," ").replace(/\b\w/g,Y=>Y.toUpperCase());function P(Y){const O=Y==="all"?"":Y,U=new URLSearchParams(t);O?U.set("run_id",O):U.delete("run_id"),r(U,{replace:!0});try{O?localStorage.setItem(Np,O):localStorage.removeItem(Np)}catch{}}const H=e??"";function X(Y,O){const U=Y.id??String(O),R=Y.run_id?`?run_id=${encodeURIComponent(String(Y.run_id))}`:"";return`/data/${encodeURIComponent(H)}/items/${encodeURIComponent(U)}${R}`}function q(Y){E(O=>O===Y?null:Y)}function F(){const Y=["created_at","run_name",...L],O=["Added","Run",...L.map(R=>R.replace(/_/g," "))],U=j.map(R=>({...R,run_name:R.run_id?_.get(String(R.run_id))??"":""}));uf(U,Y,O,`${H}.csv`)}return g.jsxs("div",{className:"p-3 space-y-3",children:[g.jsx(ca,{items:[{label:"Data"},{label:e}]}),g.jsx("h1",{className:"text-2xl font-semibold tracking-tight border-l-4 pl-3",style:{borderLeftColor:xr(e)},children:z}),k&&g.jsxs("div",{className:"text-xs text-muted-foreground py-1.5 px-2 rounded-md bg-muted/40 border border-border/50",children:[g.jsx("span",{className:"font-medium text-foreground/80",children:"Workflow:"})," ",l?.name??"-",g.jsxs("span",{className:"ml-2",children:[g.jsx("span",{className:"font-medium text-foreground/80",children:"Schema:"})," ",k.description]})]}),g.jsxs(_n,{children:[g.jsxs(tr,{className:"py-2 px-3 flex flex-row items-center justify-between gap-2 flex-wrap",children:[g.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[g.jsxs(nr,{className:"text-sm",children:["Data (",j.length," items)"]}),d.length>0&&g.jsxs(Ns,{value:S||"all",onValueChange:P,children:[g.jsx(ks,{className:"w-[200px] h-8 text-xs",size:"sm",children:g.jsx(_s,{placeholder:"Filter by run"})}),g.jsxs(Ts,{children:[g.jsx(Wo,{value:"all",children:"All runs"}),d.map(Y=>g.jsx(Wo,{value:Y.run_id,children:Y.name??Y.run_id},Y.run_id))]})]})]}),j.length>0&&g.jsx("button",{type:"button",onClick:F,className:"text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",children:"Download CSV"})]}),g.jsx(kn,{className:"p-0",children:j.length===0?g.jsx("p",{className:"p-4 text-sm text-muted-foreground text-center",children:f.length===0?"No data yet. Agent defines and populates entities via collection_schema_set and collection_set.":S?"No items for the selected run.":"No data yet."}):g.jsxs(pd,{children:[g.jsx(gd,{children:g.jsxs(io,{children:[g.jsx(St,{className:"w-16 text-right",children:"Actions"}),g.jsx(St,{className:"w-8 min-w-8 text-center",children:"#"}),g.jsx(St,{className:"min-w-[120px]",children:"Added"}),g.jsx(St,{className:"min-w-[120px]",children:"Run"}),L.map(Y=>g.jsx(St,{className:"capitalize min-w-[120px]",children:Y.replace(/_/g," ")},Y))]})}),g.jsx(yd,{children:j.map((Y,O)=>{const U=X(Y,O),R=Y.id??`row-${O}`,V=b===R;return g.jsxs(io,{className:ve("cursor-pointer hover:bg-muted/50",V&&"bg-muted/30"),onClick:()=>q(R),children:[g.jsx(xt,{className:"text-right align-top py-1.5 w-16",onClick:$=>$.stopPropagation(),children:g.jsx("div",{className:"flex items-center justify-end",children:g.jsx("a",{href:U,onClick:$=>$.stopPropagation(),className:"p-1.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted inline-flex",title:"Go to collection item","aria-label":"Go to collection item",children:g.jsx(_N,{className:"size-3.5"})})})}),g.jsx(xt,{className:"text-xs text-muted-foreground text-center align-top w-8 min-w-8 py-1.5",children:O+1}),g.jsx(xt,{className:"text-xs text-muted-foreground whitespace-nowrap align-top min-w-[120px] py-1.5",children:ji(Y.created_at)}),g.jsx(xt,{className:"text-sm min-w-[120px] align-top py-1.5",children:Y.run_id?g.jsx(pt,{to:`/runs/${encodeURIComponent(String(Y.run_id))}`,className:En,onClick:$=>$.stopPropagation(),title:_.get(String(Y.run_id))??String(Y.run_id),children:"Open run"}):"-"}),L.map($=>{const W=Y[$],M=md($,W),B=C[$],G=!V;return g.jsx(xt,{className:"text-sm min-w-[120px] max-w-[500px] whitespace-normal break-words align-top py-1.5",children:g.jsx("div",{className:ve(G&&"line-clamp-2 overflow-hidden"),children:B&&W?Array.isArray(W)?g.jsx("span",{className:"space-x-1",children:W.map((D,oe)=>{const K=String(D),J=Y.run_id?`?run_id=${encodeURIComponent(String(Y.run_id))}`:"";return g.jsx(pt,{to:`/data/${encodeURIComponent(B.kind)}/items/${encodeURIComponent(K)}${J}`,className:En,onClick:te=>te.stopPropagation(),children:K},`${$}-${K}-${oe}`)})}):g.jsx(pt,{to:`/data/${encodeURIComponent(B.kind)}/items/${encodeURIComponent(String(W))}${Y.run_id?`?run_id=${encodeURIComponent(String(Y.run_id))}`:""}`,className:En,onClick:D=>D.stopPropagation(),children:String(W)}):$==="url"&&W?g.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:ve(En,"break-all"),onClick:D=>D.stopPropagation(),children:yg(W)}):M?g.jsx(Ui,{content:W,className:ve("text-xs",G&&"line-clamp-2")}):yg(W)})},$)})]},R)})})]})})]})]})}function o7(){const{selectedWorkflowId:e,selectedWorkflow:t}=sa(),[r,i]=w.useState(null),[l,s]=w.useState(null),c=w.useCallback(async()=>{try{if(!e){i(null);return}const d=await lt.getCollectionSchema(e);i(d),s(null)}catch(d){s(d instanceof Error?d.message:String(d))}},[e]);if(w.useEffect(()=>{c()},[c]),l)return g.jsx("div",{className:"p-3",children:g.jsxs(_n,{className:"border-destructive",children:[g.jsx(tr,{children:g.jsx(nr,{children:"Error"})}),g.jsx(kn,{children:g.jsx("p",{className:"text-sm text-muted-foreground",children:l})})]})});const f=r?Object.entries(r.kinds):[];function h(d){const[m,p]=d;return g.jsx(pt,{to:`/data/${encodeURIComponent(m)}`,className:"block focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-lg",children:g.jsxs(_n,{className:"h-full transition-colors hover:bg-muted/50",children:[g.jsx(tr,{className:"pb-2",children:g.jsxs("div",{className:"flex items-center gap-2 border-l-4 pl-2",style:{borderLeftColor:xr(m)},children:[g.jsx(vf,{className:"size-4 text-muted-foreground shrink-0","aria-hidden":!0}),g.jsx(nr,{className:"text-base",children:m})]})}),g.jsxs(kn,{className:"pt-0",children:[g.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:p.description||`Collection kind: ${m}`}),g.jsx("span",{className:"text-xs text-primary font-medium mt-2 inline-block",children:"View by kind →"})]})]})},m)}return g.jsxs("div",{className:"p-3",children:[g.jsxs("div",{className:"mb-4",children:[g.jsx(ca,{items:[{label:"Collections"}]}),g.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Schema-backed stores per run for workflow: ",g.jsx("span",{className:"font-medium text-foreground/80",children:t?.name??"-"}),"."]})]}),f.length===0?g.jsx(_n,{children:g.jsx(kn,{className:"py-8 text-center text-muted-foreground text-sm",children:"No collection kinds defined. Configure collection schema in your workspace."})}):g.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:f.map(h)})]})}function i7(e){const t=e.citations;return Array.isArray(t)?t.filter(r=>r!=null&&typeof r=="object"):[]}function l7(e){const t=e.derived_from;return Array.isArray(t)?t.filter(r=>r!=null&&typeof r=="object"&&typeof r.kind=="string"&&typeof r.item_id=="string"):[]}function xg(e){return e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim()}function dS(e){return e.label??e.title??e.name??xg(e.item_id)}function a7(e){const t=e.reasoning;return typeof t=="string"&&t.trim()?t:null}function hS(e,t,r){return r?`/runs/${encodeURIComponent(r)}/collections/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`:`/data/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`}function s7({item:e,runId:t,headingLevel:r="h2",className:i}){const l=i7(e),s=l7(e),c=a7(e);return l.length===0&&s.length===0&&!c?null:g.jsxs("div",{className:i,children:[l.length>0&&g.jsxs("section",{className:"space-y-2",children:[g.jsx(r,{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Citations"}),g.jsx("ul",{className:"list-disc list-inside space-y-1.5 text-sm",children:l.map((f,h)=>g.jsxs("li",{children:[f.url?g.jsx("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-all",children:f.title??f.url}):f.item_ref?g.jsxs(g.Fragment,{children:[g.jsx(pt,{to:hS(f.item_ref.kind,f.item_ref.item_id,t??void 0),className:"text-primary hover:underline",children:dS(f.item_ref)}),g.jsx("span",{className:"block text-muted-foreground text-xs mt-0.5 pl-4",children:xg(f.item_ref.kind)})]}):g.jsx("span",{className:"text-muted-foreground",children:" - "}),f.excerpt&&g.jsx("span",{className:"block text-muted-foreground text-xs mt-0.5 pl-4 border-l border-border",children:f.excerpt})]},h))})]}),s.length>0&&g.jsxs("section",{className:"space-y-2",children:[g.jsx(r,{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Derived from"}),g.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:s.map((f,h)=>g.jsxs("li",{children:[g.jsx(pt,{to:hS(f.kind,f.item_id,t??void 0),className:"text-primary hover:underline",children:dS(f)}),g.jsx("span",{className:"block text-muted-foreground text-xs mt-0.5 pl-4",children:xg(f.kind)})]},h))})]}),c&&g.jsxs("section",{className:"space-y-2",children:[g.jsx(r,{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Reasoning"}),md("reasoning",c)?g.jsx(Ui,{content:c,className:"prose prose-sm dark:prose-invert max-w-none text-sm"}):g.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:c})]})]})}const c7="modulepreload",u7=function(e){return"/"+e},mS={},_p=function(t,r,i){let l=Promise.resolve();if(r&&r.length>0){let h=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=c?.nonce||c?.getAttribute("nonce");l=h(r.map(d=>{if(d=u7(d),d in mS)return;mS[d]=!0;const m=d.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":c7,m||(x.as="script"),x.crossOrigin="",x.href=d,f&&x.setAttribute("nonce",f),document.head.appendChild(x),m)return new Promise((b,E)=>{x.addEventListener("load",b),x.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&s(f.reason);return t().catch(s)})},f7=new Set(["id","created_at"]);function ok(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(ok).join(", "):typeof e=="object"?JSON.stringify(e,null,2):String(e)}function vg(e,t){const r=[`# ${t.replace(/_/g," ")}`,""],i=Object.entries(e).filter(([l])=>!f7.has(l));for(const[l,s]of i){if(s==null)continue;const c=l.replace(/_/g," ");r.push(`## ${c}`,"",ok(s),"")}return r.join(`
81
+ `).trim()}const d7=`
82
+ .pdf-md-body { font-family: system-ui, -apple-system, sans-serif; font-size: 12px; line-height: 1.5; color: #1a1a1a; background: #ffffff; padding: 24px; max-width: 100%; }
83
+ .pdf-md-body h1 { font-size: 1.5em; font-weight: 700; margin: 1em 0 0.5em; border-bottom: 1px solid #e5e5e5; padding-bottom: 0.25em; }
84
+ .pdf-md-body h2 { font-size: 1.25em; font-weight: 600; margin: 1em 0 0.5em; }
85
+ .pdf-md-body h3 { font-size: 1.1em; font-weight: 600; margin: 0.75em 0 0.35em; }
86
+ .pdf-md-body p { margin: 0.5em 0; }
87
+ .pdf-md-body ul, .pdf-md-body ol { margin: 0.5em 0; padding-left: 1.5em; }
88
+ .pdf-md-body li { margin: 0.25em 0; }
89
+ .pdf-md-body code { background: #f0f0f0; padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }
90
+ .pdf-md-body pre { background: #f5f5f5; padding: 12px; border-radius: 6px; overflow-x: auto; margin: 0.75em 0; font-size: 11px; }
91
+ .pdf-md-body pre code { background: none; padding: 0; }
92
+ .pdf-md-body blockquote { border-left: 4px solid #ddd; margin: 0.5em 0; padding-left: 1em; color: #555; }
93
+ .pdf-md-body a { color: #0066cc; text-decoration: none; }
94
+ .pdf-md-body strong { font-weight: 600; }
95
+ .pdf-md-body em { font-style: italic; }
96
+ `,Wu=10,h7=2,m7=.95,pS="jpeg";async function p7(e,t,r){const[i,l,s]=await Promise.all([_p(()=>import("./marked.esm-Brtrz5BF.js"),[]),_p(()=>import("./html2canvas.esm-C5Fx4D8v.js"),[]),_p(()=>import("./jspdf.es.min-BPxgpjpS.js").then(S=>S.j),[])]),c=i.marked??i.parse,f=l.default,h=s.default,d=vg(e,t),m=c(d),p=document.createElement("div");p.setAttribute("style","position:absolute;left:-9999px;top:0;width:210mm;background:#ffffff;color:#1a1a1a;margin:0;padding:0;border:0;");const x=document.createElement("style");x.textContent=d7,p.appendChild(x);const b=document.createElement("div");b.className="pdf-md-body",b.innerHTML=m,p.appendChild(b),document.body.appendChild(p);const E=`${t}-item`.replace(/[^a-zA-Z0-9_-]/g,"_");try{const S=await f(p,{scale:h7,useCORS:!0,logging:!1}),_=new h({unit:"mm",format:"a4",orientation:"portrait"}),N=_.internal.pageSize.getWidth(),k=_.internal.pageSize.getHeight(),C=N-Wu*2,L=(k-Wu*2)/C,j=S.width,z=S.height,P=Math.floor(j*L),H=Math.ceil(z/P);for(let X=0;X<H;X++){X>0&&_.addPage();const q=X*P,F=X===H-1&&z%P!==0?z%P:P,Y=document.createElement("canvas");Y.width=j,Y.height=F;const O=Y.getContext("2d");O&&(O.fillStyle="#ffffff",O.fillRect(0,0,j,F),O.drawImage(S,0,q,j,F,0,0,j,F));const U=Y.toDataURL(`image/${pS}`,m7),R=F/j*C;_.addImage(U,pS,Wu,Wu,C,R)}_.save(`${E}.pdf`)}finally{p.parentNode&&document.body.removeChild(p)}}const g7=new Set(["id","source_refs",...TN]),kp=new Set(["run_id","created_at","created_by_node_id","created_by_node_result_id","url"]),gS={id:"demo-item-001",run_id:"run_demo_ux_024",created_at:"2026-02-18T09:23:00.000Z",created_by_node_id:"synthesis_agent",created_by_node_result_id:"node_result_53",title:"Customer support quality is trending up after triage rewrite",summary:"The latest weekly support review indicates a measurable improvement in response quality and resolution confidence after introducing the new triage prompt.",content:`### Key finding
97
+ Average issue clarity improved from **3.1 → 4.2** in two weeks.
98
+
99
+ ### Why it matters
100
+ Clearer issue framing reduced back-and-forth and shortened average resolution time by 18%.
101
+
102
+ ### Suggested action
103
+ Roll out the triage template to the onboarding queue and monitor escalation volume for two more cycles.`,confidence_score:.83,citations:[{title:"Week 7 QA rubric",url:"https://example.com/qa-rubric/week-7",excerpt:"Issue clarity score rose in both billing and onboarding categories."},{item_ref:{kind:"support_ticket",item_id:"ticket-1882",label:"Escalation thread: onboarding billing confusion"},excerpt:"Representative conversation showed fewer clarification loops."}],derived_from:[{kind:"support_ticket",item_id:"ticket-1882",title:"Escalation thread: onboarding billing confusion"},{kind:"weekly_metrics",item_id:"metrics-2026-w07",title:"Support quality metrics · Week 7"}],reasoning:"The strongest signal is consistency across independent reviewers and cohorts, which lowers the chance that this is just sampling noise."};function y7(e){const t=e.source_refs;return Array.isArray(t)?t.filter(r=>r!=null&&typeof r=="object"&&typeof r.id=="string"):[]}function bg(e){return e==null?"-":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(bg).join(", "):typeof e=="object"?JSON.stringify(e):String(e)}function yS(){const e=Cg(),[t]=qs(),r=e.runId??t.get("run_id")??null,i=t.get("mock")==="1",l=e.kind??"",s=e.itemId??"",{selectedWorkflowId:c}=sa(),[f,h]=w.useState(null),[d,m]=w.useState(null),[p,x]=w.useState({}),b=w.useCallback(async()=>{if(!(!l||!s)){if(i){h({...gS,id:s,run_id:r??gS.run_id}),m(null);return}try{if(r){const H=await lt.getCollections(r,l),X=H.items.find(q=>q.id===s)??H.items[parseInt(s,10)];h(X??null),m(X?null:"Item not found")}else{const H=await lt.getEntityData(l),X=H.find(q=>q.id===s)??H[parseInt(s,10)];h(X??null),m(X?null:"Item not found")}}catch(H){m(H instanceof Error?H.message:String(H)),h(null)}}},[l,s,r,i]);if(w.useEffect(()=>{b()},[b]),w.useEffect(()=>{async function H(){if(l)try{if(r){const X=await lt.getRun(r),q=await lt.getCollectionSchema(X.workflow_id);x(q.kinds[l]?.references??{})}else if(c){const X=await lt.getCollectionSchema(c);x(X.kinds[l]?.references??{})}else x({})}catch{x({})}}H().catch(()=>x({}))},[l,r,c]),d||!l)return g.jsx("div",{className:"p-3",children:g.jsxs(_n,{className:"border-destructive",children:[g.jsx(tr,{children:g.jsx(nr,{children:"Error"})}),g.jsxs(kn,{children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:d??"Missing kind or item"}),g.jsx(pt,{to:r?`/runs/${r}`:"/collections",className:"text-sm text-primary hover:underline mt-2 inline-block",children:"Back"})]})]})});if(!f)return g.jsx("div",{className:"p-3",children:g.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})});const E=l.replace(/_/g," "),S=mg(f),_=y7(f),N=Object.entries(f).filter(([H])=>!g7.has(H)).filter(([,H])=>H!=null).sort(([H],[X])=>{const q=Y=>{const O=Y.toLowerCase();return O==="title"||O.endsWith("_title")?0:O.includes("content")||O.includes("summary")||O.includes("description")||O==="body"?1:kp.has(O)||O.endsWith("_id")||O.endsWith("_at")?3:2},F=q(H)-q(X);return F!==0?F:H.localeCompare(X)}),k=N.find(([H])=>{const X=H.toLowerCase();return X==="title"||X.endsWith("_title")}),C=typeof k?.[1]=="string"?k[1]:null,A=N.filter(([H])=>{const X=H.toLowerCase();return k&&H===k[0]?!1:!(kp.has(X)||X.endsWith("_id")||X.endsWith("_at"))}),L=N.filter(([H])=>{const X=H.toLowerCase();return kp.has(X)||X.endsWith("_id")||X.endsWith("_at")}),j=r?[{label:"Runs",to:"/runs"},{label:r,to:`/runs/${r}`},{label:E,to:`/runs/${r}?tab=${l}`},{label:f.id?String(f.id):"Item"}]:[{label:"Collections",to:"/collections"},{label:E,to:`/data/${l}`},{label:f.id?String(f.id):"Item"}];async function z(){if(!f)return;const H=vg(f,l);await navigator.clipboard.writeText(H).catch(()=>{})}async function P(){if(!f)return;const H=Object.entries(f).filter(([F,Y])=>Y!=null&&F!=="id"),X=`
104
+ <article>
105
+ <h3>${l}</h3>
106
+ <table border="1" cellspacing="0" cellpadding="6">
107
+ <tbody>
108
+ ${H.map(([F,Y])=>`<tr><th align="left">${F}</th><td>${String(typeof Y=="object"?JSON.stringify(Y,null,2):Y)}</td></tr>`).join("")}
109
+ </tbody>
110
+ </table>
111
+ </article>
112
+ `,q=vg(f,l);try{await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([X],{type:"text/html"}),"text/plain":new Blob([q],{type:"text/plain"})})])}catch{await navigator.clipboard.writeText(q).catch(()=>{})}}return g.jsxs("div",{className:"p-3 max-w-6xl mx-auto",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2 mt-2",children:[g.jsx(ca,{items:j}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("button",{type:"button",onClick:z,className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",title:"Copy as Markdown",children:[g.jsx(NN,{className:"size-3.5"}),"Copy Markdown"]}),g.jsxs("button",{type:"button",onClick:P,className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",title:"Copy as Rich Text",children:[g.jsx(J5,{className:"size-3.5"}),"Copy Rich Text"]}),g.jsxs("button",{type:"button",onClick:()=>f&&p7(f,l),className:"flex items-center gap-1.5 text-xs px-2 py-1.5 rounded-md border border-border bg-background hover:bg-muted",title:"Download as PDF",children:[g.jsx(o3,{className:"size-3.5"}),"Download PDF"]})]})]}),g.jsxs("article",{className:"mt-6 grid gap-8 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",children:[g.jsxs("div",{className:"space-y-8",children:[g.jsxs("header",{children:[g.jsx("div",{className:"flex items-center gap-2 mb-2",children:g.jsx("span",{className:"inline-flex items-center rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:E})}),g.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:C??(f.id?String(f.id):"Untitled item")}),g.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 text-sm text-muted-foreground",children:[f.created_at&&g.jsxs("span",{children:["Added ",ji(f.created_at)]}),r&&g.jsxs("span",{className:"inline-flex items-center gap-1",children:[g.jsx(ta,{value:r,truncateLength:16}),g.jsx(pt,{to:`/runs/${r}`,className:"text-primary hover:underline",children:"View run"})]}),S&&g.jsxs("span",{children:["Created by node:"," ",g.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:S.replace(/_/g," ")})]})]})]}),g.jsxs("div",{className:"space-y-8",children:[A.map(([H,X])=>{const q=H.replace(/_/g," "),F=md(H,X),Y=p[H];return g.jsxs("section",{children:[g.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:q}),H==="url"&&typeof X=="string"?g.jsx("a",{href:X,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline break-all",children:X}):H==="run_id"&&typeof X=="string"?g.jsxs("span",{className:"inline-flex items-center gap-2",children:[g.jsx(ta,{value:X}),g.jsx(pt,{to:`/runs/${encodeURIComponent(X)}`,className:"text-primary hover:underline text-sm",children:"View run"})]}):Y?Array.isArray(X)?g.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:X.map((O,U)=>{const R=String(O);return g.jsx("li",{children:g.jsx(pt,{to:`/data/${encodeURIComponent(Y.kind)}/items/${encodeURIComponent(R)}${r?`?run_id=${encodeURIComponent(r)}`:""}`,className:"text-primary hover:underline break-all",children:R})},`${H}-${R}-${U}`)})}):g.jsx(pt,{to:`/data/${encodeURIComponent(Y.kind)}/items/${encodeURIComponent(String(X))}${r?`?run_id=${encodeURIComponent(r)}`:""}`,className:"text-primary hover:underline break-all",children:String(X)}):F?g.jsx(Ui,{content:X,sourceRefs:_,className:"prose prose-sm dark:prose-invert max-w-none"}):g.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:bg(X)})]},H)}),L.length>0&&g.jsxs("section",{className:"space-y-4 border-t border-border pt-6",children:[g.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Technical details"}),g.jsx("div",{className:"space-y-4",children:L.map(([H,X])=>{const q=H.replace(/_/g," ");return g.jsxs("section",{children:[g.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mb-2",children:q}),g.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:bg(X)})]},H)})})]})]})]}),g.jsxs("aside",{className:"space-y-4 lg:sticky lg:top-4 self-start",children:[g.jsxs(_n,{children:[g.jsx(tr,{className:"pb-3",children:g.jsx(nr,{className:"text-sm",children:"Evidence & Traceability"})}),g.jsx(kn,{children:g.jsx(s7,{item:f,runId:r??f.run_id,headingLevel:"h3",className:"space-y-5"})})]}),_.length>0&&g.jsxs(_n,{children:[g.jsx(tr,{className:"pb-3",children:g.jsx(nr,{className:"text-sm",children:"Sources"})}),g.jsx(kn,{children:g.jsx("section",{children:g.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:_.map((H,X)=>g.jsx("li",{children:H.url?g.jsx("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:H.label??H.id??`[${X+1}]`}):g.jsx("span",{children:H.label??H.id??`[${X+1}]`})},H.id))})})})]})]})]})]})}function x7(){return g.jsx(k3,{children:g.jsx(bR,{children:g.jsxs(Gn,{path:"/",element:g.jsx(D3,{}),children:[g.jsx(Gn,{index:!0,element:g.jsx(fS,{})}),g.jsx(Gn,{path:"workflow",element:g.jsx(fS,{})}),g.jsx(Gn,{path:"runs",element:g.jsx(A$,{})}),g.jsx(Gn,{path:"runs/:runId",element:g.jsx(t7,{})}),g.jsx(Gn,{path:"runs/:runId/collections/:kind/items/:itemId",element:g.jsx(yS,{})}),g.jsx(Gn,{path:"collections",element:g.jsx(o7,{})}),g.jsx(Gn,{path:"data/:kind",element:g.jsx(r7,{})}),g.jsx(Gn,{path:"data/:kind/items/:itemId",element:g.jsx(yS,{})}),g.jsx(Gn,{path:"*",element:g.jsx(yR,{to:"/",replace:!0})})]})})})}vA.createRoot(document.getElementById("root")).render(g.jsx(w.StrictMode,{children:g.jsx(rj,{children:g.jsx(qR,{children:g.jsx(x7,{})})})}));export{_p as _,v7 as c,Us as g};