makecc 0.2.16 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,150 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function gf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rp={exports:{}},Eo={};var vb;function hN(){if(vb)return Eo;vb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var f in a)f!=="key"&&(l[f]=a[f])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return Eo.Fragment=t,Eo.jsx=n,Eo.jsxs=n,Eo}var wb;function pN(){return wb||(wb=1,rp.exports=hN()),rp.exports}var b=pN(),sp={exports:{}},Te={};var Sb;function mN(){if(Sb)return Te;Sb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function v(D){return D===null||typeof D!="object"?null:(D=x&&D[x]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,N={};function E(D,V,j){this.props=D,this.context=V,this.refs=N,this.updater=j||w}E.prototype.isReactComponent={},E.prototype.setState=function(D,V){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,V,"setState")},E.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function A(){}A.prototype=E.prototype;function _(D,V,j){this.props=D,this.context=V,this.refs=N,this.updater=j||w}var C=_.prototype=new A;C.constructor=_,k(C,E.prototype),C.isPureReactComponent=!0;var B=Array.isArray;function T(){}var L={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Z(D,V,j){var ie=j.ref;return{$$typeof:e,type:D,key:V,ref:ie!==void 0?ie:null,props:j}}function H(D,V){return Z(D.type,V,D.props)}function q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function P(D){var V={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(j){return V[j]})}var te=/\/+/g;function O(D,V){return typeof D=="object"&&D!==null&&D.key!=null?P(""+D.key):V.toString(36)}function U(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(T,T):(D.status="pending",D.then(function(V){D.status==="pending"&&(D.status="fulfilled",D.value=V)},function(V){D.status==="pending"&&(D.status="rejected",D.reason=V)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function R(D,V,j,ie,ce){var fe=typeof D;(fe==="undefined"||fe==="boolean")&&(D=null);var he=!1;if(D===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(D.$$typeof){case e:case t:he=!0;break;case g:return he=D._init,R(he(D._payload),V,j,ie,ce)}}if(he)return ce=ce(D),he=ie===""?"."+O(D,0):ie,B(ce)?(j="",he!=null&&(j=he.replace(te,"$&/")+"/"),R(ce,V,j,"",function(Ee){return Ee})):ce!=null&&(q(ce)&&(ce=H(ce,j+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),V.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(B(D))for(var me=0;me<D.length;me++)ie=D[me],fe=ue+O(ie,me),he+=R(ie,V,j,fe,ce);else if(me=v(D),typeof me=="function")for(D=me.call(D),me=0;!(ie=D.next()).done;)ie=ie.value,fe=ue+O(ie,me++),he+=R(ie,V,j,fe,ce);else if(fe==="object"){if(typeof D.then=="function")return R(U(D),V,j,ie,ce);throw V=String(D),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return he}function I(D,V,j){if(D==null)return D;var ie=[],ce=0;return R(D,ie,"","",function(fe){return V.call(j,fe,ce++)}),ie}function F(D){if(D._status===-1){var V=D._result;V=V(),V.then(function(j){(D._status===0||D._status===-1)&&(D._status=1,D._result=j)},function(j){(D._status===0||D._status===-1)&&(D._status=2,D._result=j)}),D._status===-1&&(D._status=0,D._result=V)}if(D._status===1)return D._result.default;throw D._result}var K=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},z={map:I,forEach:function(D,V,j){I(D,function(){V.apply(this,arguments)},j)},count:function(D){var V=0;return I(D,function(){V++}),V},toArray:function(D){return I(D,function(V){return V})||[]},only:function(D){if(!q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Te.Activity=m,Te.Children=z,Te.Component=E,Te.Fragment=n,Te.Profiler=a,Te.PureComponent=_,Te.StrictMode=r,Te.Suspense=h,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Te.__COMPILER_RUNTIME={__proto__:null,c:function(D){return L.H.useMemoCache(D)}},Te.cache=function(D){return function(){return D.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(D,V,j){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ie=k({},D.props),ce=D.key;if(V!=null)for(fe in V.key!==void 0&&(ce=""+V.key),V)!G.call(V,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&V.ref===void 0||(ie[fe]=V[fe]);var fe=arguments.length-2;if(fe===1)ie.children=j;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return Z(D.type,ce,ie)},Te.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:l,_context:D},D},Te.createElement=function(D,V,j){var ie,ce={},fe=null;if(V!=null)for(ie in V.key!==void 0&&(fe=""+V.key),V)G.call(V,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ce[ie]=V[ie]);var he=arguments.length-2;if(he===1)ce.children=j;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(D&&D.defaultProps)for(ie in he=D.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return Z(D,fe,ce)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(D){return{$$typeof:f,render:D}},Te.isValidElement=q,Te.lazy=function(D){return{$$typeof:g,_payload:{_status:-1,_result:D},_init:F}},Te.memo=function(D,V){return{$$typeof:d,type:D,compare:V===void 0?null:V}},Te.startTransition=function(D){var V=L.T,j={};L.T=j;try{var ie=D(),ce=L.S;ce!==null&&ce(j,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(T,K)}catch(fe){K(fe)}finally{V!==null&&j.types!==null&&(V.types=j.types),L.T=V}},Te.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Te.use=function(D){return L.H.use(D)},Te.useActionState=function(D,V,j){return L.H.useActionState(D,V,j)},Te.useCallback=function(D,V){return L.H.useCallback(D,V)},Te.useContext=function(D){return L.H.useContext(D)},Te.useDebugValue=function(){},Te.useDeferredValue=function(D,V){return L.H.useDeferredValue(D,V)},Te.useEffect=function(D,V){return L.H.useEffect(D,V)},Te.useEffectEvent=function(D){return L.H.useEffectEvent(D)},Te.useId=function(){return L.H.useId()},Te.useImperativeHandle=function(D,V,j){return L.H.useImperativeHandle(D,V,j)},Te.useInsertionEffect=function(D,V){return L.H.useInsertionEffect(D,V)},Te.useLayoutEffect=function(D,V){return L.H.useLayoutEffect(D,V)},Te.useMemo=function(D,V){return L.H.useMemo(D,V)},Te.useOptimistic=function(D,V){return L.H.useOptimistic(D,V)},Te.useReducer=function(D,V,j){return L.H.useReducer(D,V,j)},Te.useRef=function(D){return L.H.useRef(D)},Te.useState=function(D){return L.H.useState(D)},Te.useSyncExternalStore=function(D,V,j){return L.H.useSyncExternalStore(D,V,j)},Te.useTransition=function(){return L.H.useTransition()},Te.version="19.2.3",Te}var _b;function Sl(){return _b||(_b=1,sp.exports=mN()),sp.exports}var X=Sl();const Zo=gf(X);var ap={exports:{}},No={},op={exports:{}},lp={};var kb;function gN(){return kb||(kb=1,(function(e){function t(R,I){var F=R.length;R.push(I);e:for(;0<F;){var K=F-1>>>1,z=R[K];if(0<a(z,I))R[K]=I,R[F]=z,F=K;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var I=R[0],F=R.pop();if(F!==I){R[0]=F;e:for(var K=0,z=R.length,D=z>>>1;K<D;){var V=2*(K+1)-1,j=R[V],ie=V+1,ce=R[ie];if(0>a(j,F))ie<z&&0>a(ce,j)?(R[K]=ce,R[ie]=F,K=ie):(R[K]=j,R[V]=F,K=V);else if(ie<z&&0>a(ce,F))R[K]=ce,R[ie]=F,K=ie;else break e}}return I}function a(R,I){var F=R.sortIndex-I.sortIndex;return F!==0?F:R.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],d=[],g=1,m=null,x=3,v=!1,w=!1,k=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(R){for(var I=n(d);I!==null;){if(I.callback===null)r(d);else if(I.startTime<=R)r(d),I.sortIndex=I.expirationTime,t(h,I);else break;I=n(d)}}function B(R){if(k=!1,C(R),!w)if(n(h)!==null)w=!0,T||(T=!0,P());else{var I=n(d);I!==null&&U(B,I.startTime-R)}}var T=!1,L=-1,G=5,Z=-1;function H(){return N?!0:!(e.unstable_now()-Z<G)}function q(){if(N=!1,T){var R=e.unstable_now();Z=R;var I=!0;try{e:{w=!1,k&&(k=!1,A(L),L=-1),v=!0;var F=x;try{t:{for(C(R),m=n(h);m!==null&&!(m.expirationTime>R&&H());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var z=K(m.expirationTime<=R);if(R=e.unstable_now(),typeof z=="function"){m.callback=z,C(R),I=!0;break t}m===n(h)&&r(h),C(R)}else r(h);m=n(h)}if(m!==null)I=!0;else{var D=n(d);D!==null&&U(B,D.startTime-R),I=!1}}break e}finally{m=null,x=F,v=!1}I=void 0}}finally{I?P():T=!1}}}var P;if(typeof _=="function")P=function(){_(q)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,O=te.port2;te.port1.onmessage=q,P=function(){O.postMessage(null)}}else P=function(){E(q,0)};function U(R,I){L=E(function(){R(e.unstable_now())},I)}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"):G=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 I=3;break;default:I=x}var F=x;x=I;try{return R()}finally{x=F}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(R,I){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var F=x;x=R;try{return I()}finally{x=F}},e.unstable_scheduleCallback=function(R,I,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,R){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=F+z,R={id:g++,callback:I,priorityLevel:R,startTime:F,expirationTime:z,sortIndex:-1},F>K?(R.sortIndex=F,t(d,R),n(h)===null&&R===n(d)&&(k?(A(L),L=-1):k=!0,U(B,F-K))):(R.sortIndex=z,t(h,R),w||v||(w=!0,T||(T=!0,P()))),R},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(R){var I=x;return function(){var F=x;x=I;try{return R.apply(this,arguments)}finally{x=F}}}})(lp)),lp}var Eb;function yN(){return Eb||(Eb=1,op.exports=gN()),op.exports}var up={exports:{}},qt={};var Nb;function xN(){if(Nb)return qt;Nb=1;var e=Sl();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}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 n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(h,d,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:h,containerInfo:d,implementation:g}}var u=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=r,qt.createPortal=function(h,d){var g=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 l(h,d,null,g)},qt.flushSync=function(h){var d=u.T,g=r.p;try{if(u.T=null,r.p=2,h)return h()}finally{u.T=d,r.p=g,r.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,r.d.C(h,d))},qt.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},qt.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:v}):g==="script"&&r.d.X(h,{crossOrigin:m,integrity:x,fetchPriority:v,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 g=f(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},qt.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,m=f(g,d.crossOrigin);r.d.L(h,g,{crossOrigin:m,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 g=f(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},qt.requestFormReset=function(h){r.d.r(h)},qt.unstable_batchedUpdates=function(h,d){return h(d)},qt.useFormState=function(h,d,g){return u.H.useFormState(h,d,g)},qt.useFormStatus=function(){return u.H.useHostTransitionStatus()},qt.version="19.2.3",qt}var Cb;function lw(){if(Cb)return up.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(),up.exports=xN(),up.exports}var Tb;function bN(){if(Tb)return No;Tb=1;var e=yN(),t=Sl(),n=lw();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function h(i){if(l(i)!==i)throw Error(r(188))}function d(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var o=i,c=s;;){var p=o.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){o=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===o)return h(p),i;if(y===c)return h(p),s;y=y.sibling}throw Error(r(188))}if(o.return!==c.return)o=p,c=y;else{for(var S=!1,M=p.child;M;){if(M===o){S=!0,o=p,c=y;break}if(M===c){S=!0,c=p,o=y;break}M=M.sibling}if(!S){for(M=y.child;M;){if(M===o){S=!0,o=y,c=p;break}if(M===c){S=!0,c=y,o=p;break}M=M.sibling}if(!S)throw Error(r(189))}}if(o.alternate!==c)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:s}function g(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=g(i),s!==null)return s;i=i.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function P(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var te=Symbol.for("react.client.reference");function O(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===te?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case k:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case T:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case _:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case C:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return s=i.displayName||null,s!==null?s:O(i.type)||"Memo";case G:s=i._payload,i=i._init;try{return O(i(s))}catch{}}return null}var U=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},K=[],z=-1;function D(i){return{current:i}}function V(i){0>z||(i.current=K[z],K[z]=null,z--)}function j(i,s){z++,K[z]=i.current,i.current=s}var ie=D(null),ce=D(null),fe=D(null),he=D(null);function ue(i,s){switch(j(fe,s),j(ce,i),j(ie,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Px(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Px(s),i=Vx(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}V(ie),j(ie,i)}function me(){V(ie),V(ce),V(fe)}function Ee(i){i.memoizedState!==null&&j(he,i);var s=ie.current,o=Vx(s,i.type);s!==o&&(j(ce,i),j(ie,o))}function Ce(i){ce.current===i&&(V(ie),V(ce)),he.current===i&&(V(he),wo._currentValue=F)}var we,Ne;function Oe(i){if(we===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);we=s&&s[1]||"",Ne=-1<o.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+we+i+Ne}var Qe=!1;function Xe(i,s){if(!i||Qe)return"";Qe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(re){var ee=re}Reflect.construct(i,[],le)}else{try{le.call()}catch(re){ee=re}i.call(le.prototype)}}else{try{throw Error()}catch(re){ee=re}(le=i())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),S=y[0],M=y[1];if(S&&M){var $=S.split(`
4
- `),W=M.split(`
5
- `);for(p=c=0;c<$.length&&!$[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===$.length||p===W.length)for(c=$.length-1,p=W.length-1;1<=c&&0<=p&&$[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if($[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||$[c]!==W[p]){var ae=`
6
- `+$[c].replace(" at new "," at ");return i.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",i.displayName)),ae}while(1<=c&&0<=p);break}}}finally{Qe=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?Oe(o):""}function pt(i,s){switch(i.tag){case 26:case 27:case 5:return Oe(i.type);case 16:return Oe("Lazy");case 13:return i.child!==s&&s!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Xe(i.type,!1);case 11:return Xe(i.type.render,!1);case 1:return Xe(i.type,!0);case 31:return Oe("Activity");default:return""}}function un(i){try{var s="",o=null;do s+=pt(i,o),o=i,i=i.return;while(i);return s}catch(c){return`
7
- Error generating stack: `+c.message+`
8
- `+c.stack}}var Ht=Object.prototype.hasOwnProperty,Qt=e.unstable_scheduleCallback,Bn=e.unstable_cancelCallback,pi=e.unstable_shouldYield,mi=e.unstable_requestPaint,Ct=e.unstable_now,Yi=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,_e=e.unstable_NormalPriority,De=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,Ft=e.log,Hn=e.unstable_setDisableYieldValue,zt=null,mt=null;function Ut(i){if(typeof Ft=="function"&&Hn(i),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(zt,i)}catch{}}var Je=Math.clz32?Math.clz32:Yf,Jn=Math.log,cn=Math.LN2;function Yf(i){return i>>>=0,i===0?32:31-(Jn(i)/cn|0)|0}var ps=256,ms=262144,gs=4194304;function gi(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function ys(i,s,o){var c=i.pendingLanes;if(c===0)return 0;var p=0,y=i.suspendedLanes,S=i.pingedLanes;i=i.warmLanes;var M=c&134217727;return M!==0?(c=M&~y,c!==0?p=gi(c):(S&=M,S!==0?p=gi(S):o||(o=M&~i,o!==0&&(p=gi(o))))):(M=c&~y,M!==0?p=gi(M):S!==0?p=gi(S):o||(o=c&~i,o!==0&&(p=gi(o)))),p===0?0:s!==0&&s!==p&&(s&y)===0&&(y=p&-p,o=s&-s,y>=o||y===32&&(o&4194048)!==0)?s:p}function jr(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Xf(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Ll(){var i=gs;return gs<<=1,(gs&62914560)===0&&(gs=4194304),i}function ja(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function zr(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Gf(i,s,o,c,p,y){var S=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var M=i.entanglements,$=i.expirationTimes,W=i.hiddenUpdates;for(o=S&~o;0<o;){var ae=31-Je(o),le=1<<ae;M[ae]=0,$[ae]=-1;var ee=W[ae];if(ee!==null)for(W[ae]=null,ae=0;ae<ee.length;ae++){var re=ee[ae];re!==null&&(re.lane&=-536870913)}o&=~le}c!==0&&Bl(i,c,0),y!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=y&~(S&~s))}function Bl(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var c=31-Je(s);i.entangledLanes|=s,i.entanglements[c]=i.entanglements[c]|1073741824|o&261930}function Hl(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var c=31-Je(o),p=1<<c;p&s|i[c]&s&&(i[c]|=s),o&=~p}}function Ul(i,s){var o=s&-s;return o=(o&42)!==0?1:za(o),(o&(i.suspendedLanes|s))!==0?0:o}function za(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Ra(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Il(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:hb(i.type))}function ql(i,s){var o=I.p;try{return I.p=i,s()}finally{I.p=o}}var Wn=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Wn,It="__reactProps$"+Wn,yi="__reactContainer$"+Wn,xs="__reactEvents$"+Wn,$l="__reactListeners$"+Wn,Zf="__reactHandles$"+Wn,Pl="__reactResources$"+Wn,Rr="__reactMarker$"+Wn;function Da(i){delete i[Tt],delete i[It],delete i[xs],delete i[$l],delete i[Zf]}function Xi(i){var s=i[Tt];if(s)return s;for(var o=i.parentNode;o;){if(s=o[yi]||o[Tt]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=Kx(i);i!==null;){if(o=i[Tt])return o;i=Kx(i)}return s}i=o,o=i.parentNode}return null}function Gi(i){if(i=i[Tt]||i[yi]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Zi(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Qi(i){var s=i[Pl];return s||(s=i[Pl]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function xt(i){i[Rr]=!0}var Vl=new Set,Fl={};function xi(i,s){Ki(i,s),Ki(i+"Capture",s)}function Ki(i,s){for(Fl[i]=s,i=0;i<s.length;i++)Vl.add(s[i])}var Qf=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]*$"),Oa={},Yl={};function Kf(i){return Ht.call(Yl,i)?!0:Ht.call(Oa,i)?!1:Qf.test(i)?Yl[i]=!0:(Oa[i]=!0,!1)}function bs(i,s,o){if(Kf(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function vs(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function Un(i,s,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+c)}}function Kt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Xl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Jf(i,s,o){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return p.call(this)},set:function(S){o=""+S,y.call(this,S)}}),Object.defineProperty(i,s,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function ws(i){if(!i._valueTracker){var s=Xl(i)?"checked":"value";i._valueTracker=Jf(i,s,""+i[s])}}function Gl(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),c="";return i&&(c=Xl(i)?i.checked?"true":"false":i.value),i=c,i!==o?(s.setValue(i),!0):!1}function Dr(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Wf=/[\n"\\]/g;function Jt(i){return i.replace(Wf,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Or(i,s,o,c,p,y,S,M){i.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.type=S:i.removeAttribute("type"),s!=null?S==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Kt(s)):i.value!==""+Kt(s)&&(i.value=""+Kt(s)):S!=="submit"&&S!=="reset"||i.removeAttribute("value"),s!=null?La(i,S,Kt(s)):o!=null?La(i,S,Kt(o)):c!=null&&i.removeAttribute("value"),p==null&&y!=null&&(i.defaultChecked=!!y),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?i.name=""+Kt(M):i.removeAttribute("name")}function Zl(i,s,o,c,p,y,S,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),s!=null||o!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){ws(i);return}o=o!=null?""+Kt(o):"",s=s!=null?""+Kt(s):o,M||s===i.value||(i.value=s),i.defaultValue=s}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=M?i.checked:!!c,i.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.name=S),ws(i)}function La(i,s,o){s==="number"&&Dr(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function bi(i,s,o,c){if(i=i.options,s){s={};for(var p=0;p<o.length;p++)s["$"+o[p]]=!0;for(o=0;o<i.length;o++)p=s.hasOwnProperty("$"+i[o].value),i[o].selected!==p&&(i[o].selected=p),p&&c&&(i[o].defaultSelected=!0)}else{for(o=""+Kt(o),s=null,p=0;p<i.length;p++){if(i[p].value===o){i[p].selected=!0,c&&(i[p].defaultSelected=!0);return}s!==null||i[p].disabled||(s=i[p])}s!==null&&(s.selected=!0)}}function Hg(i,s,o){if(s!=null&&(s=""+Kt(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+Kt(o):""}function Ug(i,s,o,c){if(s==null){if(c!=null){if(o!=null)throw Error(r(92));if(U(c)){if(1<c.length)throw Error(r(93));c=c[0]}o=c}o==null&&(o=""),s=o}o=Kt(s),i.defaultValue=o,c=i.textContent,c===o&&c!==""&&c!==null&&(i.value=c),ws(i)}function Ss(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var lk=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 Ig(i,s,o){var c=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":c?i.setProperty(s,o):typeof o!="number"||o===0||lk.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function qg(i,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var p in s)c=s[p],s.hasOwnProperty(p)&&o[p]!==c&&Ig(i,p,c)}else for(var y in s)s.hasOwnProperty(y)&&Ig(i,y,s[y])}function ed(i){if(i.indexOf("-")===-1)return!1;switch(i){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 uk=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"]]),ck=/^[\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 Ql(i){return ck.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function vi(){}var td=null;function nd(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var _s=null,ks=null;function $g(i){var s=Gi(i);if(s&&(i=s.stateNode)){var o=i[It]||null;e:switch(i=s.stateNode,s.type){case"input":if(Or(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Jt(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var c=o[s];if(c!==i&&c.form===i.form){var p=c[It]||null;if(!p)throw Error(r(90));Or(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(s=0;s<o.length;s++)c=o[s],c.form===i.form&&Gl(c)}break e;case"textarea":Hg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&bi(i,!!o.multiple,s,!1)}}}var id=!1;function Pg(i,s,o){if(id)return i(s,o);id=!0;try{var c=i(s);return c}finally{if(id=!1,(_s!==null||ks!==null)&&(Bu(),_s&&(s=_s,i=ks,ks=_s=null,$g(s),i)))for(s=0;s<i.length;s++)$g(i[s])}}function Ba(i,s){var o=i.stateNode;if(o===null)return null;var c=o[It]||null;if(c===null)return null;o=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rd=!1;if(wi)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){rd=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{rd=!1}var Ji=null,sd=null,Kl=null;function Vg(){if(Kl)return Kl;var i,s=sd,o=s.length,c,p="value"in Ji?Ji.value:Ji.textContent,y=p.length;for(i=0;i<o&&s[i]===p[i];i++);var S=o-i;for(c=1;c<=S&&s[o-c]===p[y-c];c++);return Kl=p.slice(i,1<c?1-c:void 0)}function Jl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Wl(){return!0}function Fg(){return!1}function Wt(i){function s(o,c,p,y,S){this._reactName=o,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var M in i)i.hasOwnProperty(M)&&(o=i[M],this[M]=o?o(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Wl:Fg,this.isPropagationStopped=Fg,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),s}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=Wt(Lr),Ua=m({},Lr,{view:0,detail:0}),fk=Wt(Ua),ad,od,Ia,tu=m({},Ua,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ud,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ia&&(Ia&&i.type==="mousemove"?(ad=i.screenX-Ia.screenX,od=i.screenY-Ia.screenY):od=ad=0,Ia=i),ad)},movementY:function(i){return"movementY"in i?i.movementY:od}}),Yg=Wt(tu),dk=m({},tu,{dataTransfer:0}),hk=Wt(dk),pk=m({},Ua,{relatedTarget:0}),ld=Wt(pk),mk=m({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),gk=Wt(mk),yk=m({},Lr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),xk=Wt(yk),bk=m({},Lr,{data:0}),Xg=Wt(bk),vk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wk={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"},Sk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _k(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=Sk[i])?!!s[i]:!1}function ud(){return _k}var kk=m({},Ua,{key:function(i){if(i.key){var s=vk[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Jl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?wk[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ud,charCode:function(i){return i.type==="keypress"?Jl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Jl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Ek=Wt(kk),Nk=m({},tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gg=Wt(Nk),Ck=m({},Ua,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ud}),Tk=Wt(Ck),Ak=m({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mk=Wt(Ak),jk=m({},tu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),zk=Wt(jk),Rk=m({},Lr,{newState:0,oldState:0}),Dk=Wt(Rk),Ok=[9,13,27,32],cd=wi&&"CompositionEvent"in window,qa=null;wi&&"documentMode"in document&&(qa=document.documentMode);var Lk=wi&&"TextEvent"in window&&!qa,Zg=wi&&(!cd||qa&&8<qa&&11>=qa),Qg=" ",Kg=!1;function Jg(i,s){switch(i){case"keyup":return Ok.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Es=!1;function Bk(i,s){switch(i){case"compositionend":return Wg(s);case"keypress":return s.which!==32?null:(Kg=!0,Qg);case"textInput":return i=s.data,i===Qg&&Kg?null:i;default:return null}}function Hk(i,s){if(Es)return i==="compositionend"||!cd&&Jg(i,s)?(i=Vg(),Kl=sd=Ji=null,Es=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Zg&&s.locale!=="ko"?null:s.data;default:return null}}var Uk={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 ey(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!Uk[i.type]:s==="textarea"}function ty(i,s,o,c){_s?ks?ks.push(c):ks=[c]:_s=c,s=Vu(s,"onChange"),0<s.length&&(o=new eu("onChange","change",null,o,c),i.push({event:o,listeners:s}))}var $a=null,Pa=null;function Ik(i){Bx(i,0)}function nu(i){var s=Zi(i);if(Gl(s))return i}function ny(i,s){if(i==="change")return s}var iy=!1;if(wi){var fd;if(wi){var dd="oninput"in document;if(!dd){var ry=document.createElement("div");ry.setAttribute("oninput","return;"),dd=typeof ry.oninput=="function"}fd=dd}else fd=!1;iy=fd&&(!document.documentMode||9<document.documentMode)}function sy(){$a&&($a.detachEvent("onpropertychange",ay),Pa=$a=null)}function ay(i){if(i.propertyName==="value"&&nu(Pa)){var s=[];ty(s,Pa,i,nd(i)),Pg(Ik,s)}}function qk(i,s,o){i==="focusin"?(sy(),$a=s,Pa=o,$a.attachEvent("onpropertychange",ay)):i==="focusout"&&sy()}function $k(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return nu(Pa)}function Pk(i,s){if(i==="click")return nu(s)}function Vk(i,s){if(i==="input"||i==="change")return nu(s)}function Fk(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var fn=typeof Object.is=="function"?Object.is:Fk;function Va(i,s){if(fn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),c=Object.keys(s);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var p=o[c];if(!Ht.call(s,p)||!fn(i[p],s[p]))return!1}return!0}function oy(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ly(i,s){var o=oy(i);i=0;for(var c;o;){if(o.nodeType===3){if(c=i+o.textContent.length,i<=s&&c>=s)return{node:o,offset:s-i};i=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=oy(o)}}function uy(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?uy(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function cy(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Dr(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Dr(i.document)}return s}function hd(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var Yk=wi&&"documentMode"in document&&11>=document.documentMode,Ns=null,pd=null,Fa=null,md=!1;function fy(i,s,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;md||Ns==null||Ns!==Dr(c)||(c=Ns,"selectionStart"in c&&hd(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Fa&&Va(Fa,c)||(Fa=c,c=Vu(pd,"onSelect"),0<c.length&&(s=new eu("onSelect","select",null,s,o),i.push({event:s,listeners:c}),s.target=Ns)))}function Br(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var Cs={animationend:Br("Animation","AnimationEnd"),animationiteration:Br("Animation","AnimationIteration"),animationstart:Br("Animation","AnimationStart"),transitionrun:Br("Transition","TransitionRun"),transitionstart:Br("Transition","TransitionStart"),transitioncancel:Br("Transition","TransitionCancel"),transitionend:Br("Transition","TransitionEnd")},gd={},dy={};wi&&(dy=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function Hr(i){if(gd[i])return gd[i];if(!Cs[i])return i;var s=Cs[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in dy)return gd[i]=s[o];return i}var hy=Hr("animationend"),py=Hr("animationiteration"),my=Hr("animationstart"),Xk=Hr("transitionrun"),Gk=Hr("transitionstart"),Zk=Hr("transitioncancel"),gy=Hr("transitionend"),yy=new Map,yd="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(" ");yd.push("scrollEnd");function In(i,s){yy.set(i,s),xi(s,[i])}var iu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},En=[],Ts=0,xd=0;function ru(){for(var i=Ts,s=xd=Ts=0;s<i;){var o=En[s];En[s++]=null;var c=En[s];En[s++]=null;var p=En[s];En[s++]=null;var y=En[s];if(En[s++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}y!==0&&xy(o,p,y)}}function su(i,s,o,c){En[Ts++]=i,En[Ts++]=s,En[Ts++]=o,En[Ts++]=c,xd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function bd(i,s,o,c){return su(i,s,o,c),au(i)}function Ur(i,s){return su(i,null,null,s),au(i)}function xy(i,s,o){i.lanes|=o;var c=i.alternate;c!==null&&(c.lanes|=o);for(var p=!1,y=i.return;y!==null;)y.childLanes|=o,c=y.alternate,c!==null&&(c.childLanes|=o),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(p=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,p&&s!==null&&(p=31-Je(o),i=y.hiddenUpdates,c=i[p],c===null?i[p]=[s]:c.push(s),s.lane=o|536870912),y):null}function au(i){if(50<po)throw po=0,Th=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var As={};function Qk(i,s,o,c){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(i,s,o,c){return new Qk(i,s,o,c)}function vd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Si(i,s){var o=i.alternate;return o===null?(o=dn(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function by(i,s){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function ou(i,s,o,c,p,y){var S=0;if(c=i,typeof i=="function")vd(i)&&(S=1);else if(typeof i=="string")S=tN(i,o,ie.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=dn(31,o,s,p),i.elementType=Z,i.lanes=y,i;case k:return Ir(o.children,p,y,s);case N:S=8,p|=24;break;case E:return i=dn(12,o,s,p|2),i.elementType=E,i.lanes=y,i;case B:return i=dn(13,o,s,p),i.elementType=B,i.lanes=y,i;case T:return i=dn(19,o,s,p),i.elementType=T,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case _:S=10;break e;case A:S=9;break e;case C:S=11;break e;case L:S=14;break e;case G:S=16,c=null;break e}S=29,o=Error(r(130,i===null?"null":typeof i,"")),c=null}return s=dn(S,o,s,p),s.elementType=i,s.type=c,s.lanes=y,s}function Ir(i,s,o,c){return i=dn(7,i,c,s),i.lanes=o,i}function wd(i,s,o){return i=dn(6,i,null,s),i.lanes=o,i}function vy(i){var s=dn(18,null,null,0);return s.stateNode=i,s}function Sd(i,s,o){return s=dn(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var wy=new WeakMap;function Nn(i,s){if(typeof i=="object"&&i!==null){var o=wy.get(i);return o!==void 0?o:(s={value:i,source:s,stack:un(s)},wy.set(i,s),s)}return{value:i,source:s,stack:un(s)}}var Ms=[],js=0,lu=null,Ya=0,Cn=[],Tn=0,Wi=null,ei=1,ti="";function _i(i,s){Ms[js++]=Ya,Ms[js++]=lu,lu=i,Ya=s}function Sy(i,s,o){Cn[Tn++]=ei,Cn[Tn++]=ti,Cn[Tn++]=Wi,Wi=i;var c=ei;i=ti;var p=32-Je(c)-1;c&=~(1<<p),o+=1;var y=32-Je(s)+p;if(30<y){var S=p-p%5;y=(c&(1<<S)-1).toString(32),c>>=S,p-=S,ei=1<<32-Je(s)+p|o<<p|c,ti=y+i}else ei=1<<y|o<<p|c,ti=i}function _d(i){i.return!==null&&(_i(i,1),Sy(i,1,0))}function kd(i){for(;i===lu;)lu=Ms[--js],Ms[js]=null,Ya=Ms[--js],Ms[js]=null;for(;i===Wi;)Wi=Cn[--Tn],Cn[Tn]=null,ti=Cn[--Tn],Cn[Tn]=null,ei=Cn[--Tn],Cn[Tn]=null}function _y(i,s){Cn[Tn++]=ei,Cn[Tn++]=ti,Cn[Tn++]=Wi,ei=s.id,ti=s.overflow,Wi=i}var Rt=null,ot=null,qe=!1,er=null,An=!1,Ed=Error(r(519));function tr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xa(Nn(s,i)),Ed}function ky(i){var s=i.stateNode,o=i.type,c=i.memoizedProps;switch(s[Tt]=i,s[It]=c,o){case"dialog":Be("cancel",s),Be("close",s);break;case"iframe":case"object":case"embed":Be("load",s);break;case"video":case"audio":for(o=0;o<go.length;o++)Be(go[o],s);break;case"source":Be("error",s);break;case"img":case"image":case"link":Be("error",s),Be("load",s);break;case"details":Be("toggle",s);break;case"input":Be("invalid",s),Zl(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Be("invalid",s);break;case"textarea":Be("invalid",s),Ug(s,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||c.suppressHydrationWarning===!0||qx(s.textContent,o)?(c.popover!=null&&(Be("beforetoggle",s),Be("toggle",s)),c.onScroll!=null&&Be("scroll",s),c.onScrollEnd!=null&&Be("scrollend",s),c.onClick!=null&&(s.onclick=vi),s=!0):s=!1,s||tr(i,!0)}function Ey(i){for(Rt=i.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Rt=Rt.return}}function zs(i){if(i!==Rt)return!1;if(!qe)return Ey(i),qe=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||Ph(i.type,i.memoizedProps)),o=!o),o&&ot&&tr(i),Ey(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ot=Qx(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ot=Qx(i)}else s===27?(s=ot,mr(i.type)?(i=Gh,Gh=null,ot=i):ot=s):ot=Rt?jn(i.stateNode.nextSibling):null;return!0}function qr(){ot=Rt=null,qe=!1}function Nd(){var i=er;return i!==null&&(rn===null?rn=i:rn.push.apply(rn,i),er=null),i}function Xa(i){er===null?er=[i]:er.push(i)}var Cd=D(null),$r=null,ki=null;function nr(i,s,o){j(Cd,s._currentValue),s._currentValue=o}function Ei(i){i._currentValue=Cd.current,V(Cd)}function Td(i,s,o){for(;i!==null;){var c=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),i===o)break;i=i.return}}function Ad(i,s,o,c){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var y=p.dependencies;if(y!==null){var S=p.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=p;for(var $=0;$<s.length;$++)if(M.context===s[$]){y.lanes|=o,M=y.alternate,M!==null&&(M.lanes|=o),Td(y.return,o,i),c||(S=null);break e}y=M.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(r(341));S.lanes|=o,y=S.alternate,y!==null&&(y.lanes|=o),Td(S,o,i),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===i){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Rs(i,s,o,c){i=null;for(var p=s,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(r(387));if(S=S.memoizedProps,S!==null){var M=p.type;fn(p.pendingProps.value,S.value)||(i!==null?i.push(M):i=[M])}}else if(p===he.current){if(S=p.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(wo):i=[wo])}p=p.return}i!==null&&Ad(s,i,o,c),s.flags|=262144}function uu(i){for(i=i.firstContext;i!==null;){if(!fn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Pr(i){$r=i,ki=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Dt(i){return Ny($r,i)}function cu(i,s){return $r===null&&Pr(i),Ny(i,s)}function Ny(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},ki===null){if(i===null)throw Error(r(308));ki=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ki=ki.next=s;return o}var Kk=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,c){i.push(c)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},Jk=e.unstable_scheduleCallback,Wk=e.unstable_NormalPriority,bt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new Kk,data:new Map,refCount:0}}function Ga(i){i.refCount--,i.refCount===0&&Jk(Wk,function(){i.controller.abort()})}var Za=null,jd=0,Ds=0,Os=null;function eE(i,s){if(Za===null){var o=Za=[];jd=0,Ds=Dh(),Os={status:"pending",value:void 0,then:function(c){o.push(c)}}}return jd++,s.then(Cy,Cy),s}function Cy(){if(--jd===0&&Za!==null){Os!==null&&(Os.status="fulfilled");var i=Za;Za=null,Ds=0,Os=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function tE(i,s){var o=[],c={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return i.then(function(){c.status="fulfilled",c.value=s;for(var p=0;p<o.length;p++)(0,o[p])(s)},function(p){for(c.status="rejected",c.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),c}var Ty=R.S;R.S=function(i,s){fx=Ct(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&eE(i,s),Ty!==null&&Ty(i,s)};var Vr=D(null);function zd(){var i=Vr.current;return i!==null?i:rt.pooledCache}function fu(i,s){s===null?j(Vr,Vr.current):j(Vr,s.pool)}function Ay(){var i=zd();return i===null?null:{parent:bt._currentValue,pool:i}}var Ls=Error(r(460)),Rd=Error(r(474)),du=Error(r(542)),hu={then:function(){}};function My(i){return i=i.status,i==="fulfilled"||i==="rejected"}function jy(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(vi,vi),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Ry(i),i;default:if(typeof s.status=="string")s.then(vi,vi);else{if(i=rt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(c){if(s.status==="pending"){var p=s;p.status="fulfilled",p.value=c}},function(c){if(s.status==="pending"){var p=s;p.status="rejected",p.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Ry(i),i}throw Yr=s,Ls}}function Fr(i){try{var s=i._init;return s(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Yr=o,Ls):o}}var Yr=null;function zy(){if(Yr===null)throw Error(r(459));var i=Yr;return Yr=null,i}function Ry(i){if(i===Ls||i===du)throw Error(r(483))}var Bs=null,Qa=0;function pu(i){var s=Qa;return Qa+=1,Bs===null&&(Bs=[]),jy(Bs,i,s)}function Ka(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function mu(i,s){throw s.$$typeof===x?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Dy(i){function s(Q,Y){if(i){var J=Q.deletions;J===null?(Q.deletions=[Y],Q.flags|=16):J.push(Y)}}function o(Q,Y){if(!i)return null;for(;Y!==null;)s(Q,Y),Y=Y.sibling;return null}function c(Q){for(var Y=new Map;Q!==null;)Q.key!==null?Y.set(Q.key,Q):Y.set(Q.index,Q),Q=Q.sibling;return Y}function p(Q,Y){return Q=Si(Q,Y),Q.index=0,Q.sibling=null,Q}function y(Q,Y,J){return Q.index=J,i?(J=Q.alternate,J!==null?(J=J.index,J<Y?(Q.flags|=67108866,Y):J):(Q.flags|=67108866,Y)):(Q.flags|=1048576,Y)}function S(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,Y,J,oe){return Y===null||Y.tag!==6?(Y=wd(J,Q.mode,oe),Y.return=Q,Y):(Y=p(Y,J),Y.return=Q,Y)}function $(Q,Y,J,oe){var ve=J.type;return ve===k?ae(Q,Y,J.props.children,oe,J.key):Y!==null&&(Y.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===G&&Fr(ve)===Y.type)?(Y=p(Y,J.props),Ka(Y,J),Y.return=Q,Y):(Y=ou(J.type,J.key,J.props,null,Q.mode,oe),Ka(Y,J),Y.return=Q,Y)}function W(Q,Y,J,oe){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==J.containerInfo||Y.stateNode.implementation!==J.implementation?(Y=Sd(J,Q.mode,oe),Y.return=Q,Y):(Y=p(Y,J.children||[]),Y.return=Q,Y)}function ae(Q,Y,J,oe,ve){return Y===null||Y.tag!==7?(Y=Ir(J,Q.mode,oe,ve),Y.return=Q,Y):(Y=p(Y,J),Y.return=Q,Y)}function le(Q,Y,J){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=wd(""+Y,Q.mode,J),Y.return=Q,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case v:return J=ou(Y.type,Y.key,Y.props,null,Q.mode,J),Ka(J,Y),J.return=Q,J;case w:return Y=Sd(Y,Q.mode,J),Y.return=Q,Y;case G:return Y=Fr(Y),le(Q,Y,J)}if(U(Y)||P(Y))return Y=Ir(Y,Q.mode,J,null),Y.return=Q,Y;if(typeof Y.then=="function")return le(Q,pu(Y),J);if(Y.$$typeof===_)return le(Q,cu(Q,Y),J);mu(Q,Y)}return null}function ee(Q,Y,J,oe){var ve=Y!==null?Y.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return ve!==null?null:M(Q,Y,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case v:return J.key===ve?$(Q,Y,J,oe):null;case w:return J.key===ve?W(Q,Y,J,oe):null;case G:return J=Fr(J),ee(Q,Y,J,oe)}if(U(J)||P(J))return ve!==null?null:ae(Q,Y,J,oe,null);if(typeof J.then=="function")return ee(Q,Y,pu(J),oe);if(J.$$typeof===_)return ee(Q,Y,cu(Q,J),oe);mu(Q,J)}return null}function re(Q,Y,J,oe,ve){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Q=Q.get(J)||null,M(Y,Q,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return Q=Q.get(oe.key===null?J:oe.key)||null,$(Y,Q,oe,ve);case w:return Q=Q.get(oe.key===null?J:oe.key)||null,W(Y,Q,oe,ve);case G:return oe=Fr(oe),re(Q,Y,J,oe,ve)}if(U(oe)||P(oe))return Q=Q.get(J)||null,ae(Y,Q,oe,ve,null);if(typeof oe.then=="function")return re(Q,Y,J,pu(oe),ve);if(oe.$$typeof===_)return re(Q,Y,J,cu(Y,oe),ve);mu(Y,oe)}return null}function ye(Q,Y,J,oe){for(var ve=null,Ge=null,xe=Y,je=Y=0,Ie=null;xe!==null&&je<J.length;je++){xe.index>je?(Ie=xe,xe=null):Ie=xe.sibling;var Ze=ee(Q,xe,J[je],oe);if(Ze===null){xe===null&&(xe=Ie);break}i&&xe&&Ze.alternate===null&&s(Q,xe),Y=y(Ze,Y,je),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze,xe=Ie}if(je===J.length)return o(Q,xe),qe&&_i(Q,je),ve;if(xe===null){for(;je<J.length;je++)xe=le(Q,J[je],oe),xe!==null&&(Y=y(xe,Y,je),Ge===null?ve=xe:Ge.sibling=xe,Ge=xe);return qe&&_i(Q,je),ve}for(xe=c(xe);je<J.length;je++)Ie=re(xe,Q,je,J[je],oe),Ie!==null&&(i&&Ie.alternate!==null&&xe.delete(Ie.key===null?je:Ie.key),Y=y(Ie,Y,je),Ge===null?ve=Ie:Ge.sibling=Ie,Ge=Ie);return i&&xe.forEach(function(vr){return s(Q,vr)}),qe&&_i(Q,je),ve}function ke(Q,Y,J,oe){if(J==null)throw Error(r(151));for(var ve=null,Ge=null,xe=Y,je=Y=0,Ie=null,Ze=J.next();xe!==null&&!Ze.done;je++,Ze=J.next()){xe.index>je?(Ie=xe,xe=null):Ie=xe.sibling;var vr=ee(Q,xe,Ze.value,oe);if(vr===null){xe===null&&(xe=Ie);break}i&&xe&&vr.alternate===null&&s(Q,xe),Y=y(vr,Y,je),Ge===null?ve=vr:Ge.sibling=vr,Ge=vr,xe=Ie}if(Ze.done)return o(Q,xe),qe&&_i(Q,je),ve;if(xe===null){for(;!Ze.done;je++,Ze=J.next())Ze=le(Q,Ze.value,oe),Ze!==null&&(Y=y(Ze,Y,je),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze);return qe&&_i(Q,je),ve}for(xe=c(xe);!Ze.done;je++,Ze=J.next())Ze=re(xe,Q,je,Ze.value,oe),Ze!==null&&(i&&Ze.alternate!==null&&xe.delete(Ze.key===null?je:Ze.key),Y=y(Ze,Y,je),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze);return i&&xe.forEach(function(dN){return s(Q,dN)}),qe&&_i(Q,je),ve}function it(Q,Y,J,oe){if(typeof J=="object"&&J!==null&&J.type===k&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case v:e:{for(var ve=J.key;Y!==null;){if(Y.key===ve){if(ve=J.type,ve===k){if(Y.tag===7){o(Q,Y.sibling),oe=p(Y,J.props.children),oe.return=Q,Q=oe;break e}}else if(Y.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===G&&Fr(ve)===Y.type){o(Q,Y.sibling),oe=p(Y,J.props),Ka(oe,J),oe.return=Q,Q=oe;break e}o(Q,Y);break}else s(Q,Y);Y=Y.sibling}J.type===k?(oe=Ir(J.props.children,Q.mode,oe,J.key),oe.return=Q,Q=oe):(oe=ou(J.type,J.key,J.props,null,Q.mode,oe),Ka(oe,J),oe.return=Q,Q=oe)}return S(Q);case w:e:{for(ve=J.key;Y!==null;){if(Y.key===ve)if(Y.tag===4&&Y.stateNode.containerInfo===J.containerInfo&&Y.stateNode.implementation===J.implementation){o(Q,Y.sibling),oe=p(Y,J.children||[]),oe.return=Q,Q=oe;break e}else{o(Q,Y);break}else s(Q,Y);Y=Y.sibling}oe=Sd(J,Q.mode,oe),oe.return=Q,Q=oe}return S(Q);case G:return J=Fr(J),it(Q,Y,J,oe)}if(U(J))return ye(Q,Y,J,oe);if(P(J)){if(ve=P(J),typeof ve!="function")throw Error(r(150));return J=ve.call(J),ke(Q,Y,J,oe)}if(typeof J.then=="function")return it(Q,Y,pu(J),oe);if(J.$$typeof===_)return it(Q,Y,cu(Q,J),oe);mu(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,Y!==null&&Y.tag===6?(o(Q,Y.sibling),oe=p(Y,J),oe.return=Q,Q=oe):(o(Q,Y),oe=wd(J,Q.mode,oe),oe.return=Q,Q=oe),S(Q)):o(Q,Y)}return function(Q,Y,J,oe){try{Qa=0;var ve=it(Q,Y,J,oe);return Bs=null,ve}catch(xe){if(xe===Ls||xe===du)throw xe;var Ge=dn(29,xe,null,Q.mode);return Ge.lanes=oe,Ge.return=Q,Ge}}}var Xr=Dy(!0),Oy=Dy(!1),ir=!1;function Dd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Od(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function rr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function sr(i,s,o){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(Ke&2)!==0){var p=c.pending;return p===null?s.next=s:(s.next=p.next,p.next=s),c.pending=s,s=au(i),xy(i,null,o),s}return su(i,c,s,o),au(i)}function Ja(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var c=s.lanes;c&=i.pendingLanes,o|=c,s.lanes=o,Hl(i,o)}}function Ld(i,s){var o=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var p=null,y=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};y===null?p=y=S:y=y.next=S,o=o.next}while(o!==null);y===null?p=y=s:y=y.next=s}else p=y=s;o={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var Bd=!1;function Wa(){if(Bd){var i=Os;if(i!==null)throw i}}function eo(i,s,o,c){Bd=!1;var p=i.updateQueue;ir=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,M=p.shared.pending;if(M!==null){p.shared.pending=null;var $=M,W=$.next;$.next=null,S===null?y=W:S.next=W,S=$;var ae=i.alternate;ae!==null&&(ae=ae.updateQueue,M=ae.lastBaseUpdate,M!==S&&(M===null?ae.firstBaseUpdate=W:M.next=W,ae.lastBaseUpdate=$))}if(y!==null){var le=p.baseState;S=0,ae=W=$=null,M=y;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Ds&&(Bd=!0),ae!==null&&(ae=ae.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=i,ke=M;ee=s;var it=o;switch(ke.tag){case 1:if(ye=ke.payload,typeof ye=="function"){le=ye.call(it,le,ee);break e}le=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ke.payload,ee=typeof ye=="function"?ye.call(it,le,ee):ye,ee==null)break e;le=m({},le,ee);break e;case 2:ir=!0}}ee=M.callback,ee!==null&&(i.flags|=64,re&&(i.flags|=8192),re=p.callbacks,re===null?p.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ae===null?(W=ae=re,$=le):ae=ae.next=re,S|=ee;if(M=M.next,M===null){if(M=p.shared.pending,M===null)break;re=M,M=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);ae===null&&($=le),p.baseState=$,p.firstBaseUpdate=W,p.lastBaseUpdate=ae,y===null&&(p.shared.lanes=0),cr|=S,i.lanes=S,i.memoizedState=le}}function Ly(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function By(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Ly(o[i],s)}var Hs=D(null),gu=D(0);function Hy(i,s){i=Di,j(gu,i),j(Hs,s),Di=i|s.baseLanes}function Hd(){j(gu,Di),j(Hs,Hs.current)}function Ud(){Di=gu.current,V(Hs),V(gu)}var hn=D(null),Mn=null;function ar(i){var s=i.alternate;j(gt,gt.current&1),j(hn,i),Mn===null&&(s===null||Hs.current!==null||s.memoizedState!==null)&&(Mn=i)}function Id(i){j(gt,gt.current),j(hn,i),Mn===null&&(Mn=i)}function Uy(i){i.tag===22?(j(gt,gt.current),j(hn,i),Mn===null&&(Mn=i)):or()}function or(){j(gt,gt.current),j(hn,hn.current)}function pn(i){V(hn),Mn===i&&(Mn=null),V(gt)}var gt=D(0);function yu(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Yh(o)||Xh(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ni=0,Me=null,tt=null,vt=null,xu=!1,Us=!1,Gr=!1,bu=0,to=0,Is=null,nE=0;function dt(){throw Error(r(321))}function qd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!fn(i[o],s[o]))return!1;return!0}function $d(i,s,o,c,p,y){return Ni=y,Me=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,R.H=i===null||i.memoizedState===null?S0:ih,Gr=!1,y=o(c,p),Gr=!1,Us&&(y=qy(s,o,c,p)),Iy(i),y}function Iy(i){R.H=ro;var s=tt!==null&&tt.next!==null;if(Ni=0,vt=tt=Me=null,xu=!1,to=0,Is=null,s)throw Error(r(300));i===null||wt||(i=i.dependencies,i!==null&&uu(i)&&(wt=!0))}function qy(i,s,o,c){Me=i;var p=0;do{if(Us&&(Is=null),to=0,Us=!1,25<=p)throw Error(r(301));if(p+=1,vt=tt=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}R.H=_0,y=s(o,c)}while(Us);return y}function iE(){var i=R.H,s=i.useState()[0];return s=typeof s.then=="function"?no(s):s,i=i.useState()[0],(tt!==null?tt.memoizedState:null)!==i&&(Me.flags|=1024),s}function Pd(){var i=bu!==0;return bu=0,i}function Vd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function Fd(i){if(xu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}xu=!1}Ni=0,vt=tt=Me=null,Us=!1,to=bu=0,Is=null}function Yt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Me.memoizedState=vt=i:vt=vt.next=i,vt}function yt(){if(tt===null){var i=Me.alternate;i=i!==null?i.memoizedState:null}else i=tt.next;var s=vt===null?Me.memoizedState:vt.next;if(s!==null)vt=s,tt=i;else{if(i===null)throw Me.alternate===null?Error(r(467)):Error(r(310));tt=i,i={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},vt===null?Me.memoizedState=vt=i:vt=vt.next=i}return vt}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function no(i){var s=to;return to+=1,Is===null&&(Is=[]),i=jy(Is,i,s),s=Me,(vt===null?s.memoizedState:vt.next)===null&&(s=s.alternate,R.H=s===null||s.memoizedState===null?S0:ih),i}function wu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return no(i);if(i.$$typeof===_)return Dt(i)}throw Error(r(438,String(i)))}function Yd(i){var s=null,o=Me.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var c=Me.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(p){return p.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=vu(),Me.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),c=0;c<i;c++)o[c]=H;return s.index++,o}function Ci(i,s){return typeof s=="function"?s(i):s}function Su(i){var s=yt();return Xd(s,tt,i)}function Xd(i,s,o){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=o;var p=i.baseQueue,y=c.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}s.baseQueue=p=y,c.pending=null}if(y=i.baseState,p===null)i.memoizedState=y;else{s=p.next;var M=S=null,$=null,W=s,ae=!1;do{var le=W.lane&-536870913;if(le!==W.lane?(Ue&le)===le:(Ni&le)===le){var ee=W.revertLane;if(ee===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),le===Ds&&(ae=!0);else if((Ni&ee)===ee){W=W.next,ee===Ds&&(ae=!0);continue}else le={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},$===null?(M=$=le,S=y):$=$.next=le,Me.lanes|=ee,cr|=ee;le=W.action,Gr&&o(y,le),y=W.hasEagerState?W.eagerState:o(y,le)}else ee={lane:le,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},$===null?(M=$=ee,S=y):$=$.next=ee,Me.lanes|=le,cr|=le;W=W.next}while(W!==null&&W!==s);if($===null?S=y:$.next=M,!fn(y,i.memoizedState)&&(wt=!0,ae&&(o=Os,o!==null)))throw o;i.memoizedState=y,i.baseState=S,i.baseQueue=$,c.lastRenderedState=y}return p===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function Gd(i){var s=yt(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var c=o.dispatch,p=o.pending,y=s.memoizedState;if(p!==null){o.pending=null;var S=p=p.next;do y=i(y,S.action),S=S.next;while(S!==p);fn(y,s.memoizedState)||(wt=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),o.lastRenderedState=y}return[y,c]}function $y(i,s,o){var c=Me,p=yt(),y=qe;if(y){if(o===void 0)throw Error(r(407));o=o()}else o=s();var S=!fn((tt||p).memoizedState,o);if(S&&(p.memoizedState=o,wt=!0),p=p.queue,Kd(Fy.bind(null,c,p,i),[i]),p.getSnapshot!==s||S||vt!==null&&vt.memoizedState.tag&1){if(c.flags|=2048,qs(9,{destroy:void 0},Vy.bind(null,c,p,o,s),null),rt===null)throw Error(r(349));y||(Ni&127)!==0||Py(c,s,o)}return o}function Py(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=Me.updateQueue,s===null?(s=vu(),Me.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function Vy(i,s,o,c){s.value=o,s.getSnapshot=c,Yy(s)&&Xy(i)}function Fy(i,s,o){return o(function(){Yy(s)&&Xy(i)})}function Yy(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!fn(i,o)}catch{return!0}}function Xy(i){var s=Ur(i,2);s!==null&&sn(s,i,2)}function Zd(i){var s=Yt();if(typeof i=="function"){var o=i;if(i=o(),Gr){Ut(!0);try{o()}finally{Ut(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:i},s}function Gy(i,s,o,c){return i.baseState=o,Xd(i,tt,typeof c=="function"?c:Ci)}function rE(i,s,o,c,p){if(Eu(i))throw Error(r(485));if(i=s.action,i!==null){var y={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){y.listeners.push(S)}};R.T!==null?o(!0):y.isTransition=!1,c(y),o=s.pending,o===null?(y.next=s.pending=y,Zy(s,y)):(y.next=o.next,s.pending=o.next=y)}}function Zy(i,s){var o=s.action,c=s.payload,p=i.state;if(s.isTransition){var y=R.T,S={};R.T=S;try{var M=o(p,c),$=R.S;$!==null&&$(S,M),Qy(i,s,M)}catch(W){Qd(i,s,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),R.T=y}}else try{y=o(p,c),Qy(i,s,y)}catch(W){Qd(i,s,W)}}function Qy(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Ky(i,s,c)},function(c){return Qd(i,s,c)}):Ky(i,s,o)}function Ky(i,s,o){s.status="fulfilled",s.value=o,Jy(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Zy(i,o)))}function Qd(i,s,o){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=o,Jy(s),s=s.next;while(s!==c)}i.action=null}function Jy(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Wy(i,s){return s}function e0(i,s){if(qe){var o=rt.formState;if(o!==null){e:{var c=Me;if(qe){if(ot){t:{for(var p=ot,y=An;p.nodeType!==8;){if(!y){p=null;break t}if(p=jn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){ot=jn(p.nextSibling),c=p.data==="F!";break e}}tr(c)}c=!1}c&&(s=o[0])}}return o=Yt(),o.memoizedState=o.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wy,lastRenderedState:s},o.queue=c,o=b0.bind(null,Me,c),c.dispatch=o,c=Zd(!1),y=nh.bind(null,Me,!1,c.queue),c=Yt(),p={state:s,dispatch:null,action:i,pending:null},c.queue=p,o=rE.bind(null,Me,p,y,o),p.dispatch=o,c.memoizedState=i,[s,o,!1]}function t0(i){var s=yt();return n0(s,tt,i)}function n0(i,s,o){if(s=Xd(i,s,Wy)[0],i=Su(Ci)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=no(s)}catch(S){throw S===Ls?du:S}else c=s;s=yt();var p=s.queue,y=p.dispatch;return o!==s.memoizedState&&(Me.flags|=2048,qs(9,{destroy:void 0},sE.bind(null,p,o),null)),[c,y,i]}function sE(i,s){i.action=s}function i0(i){var s=yt(),o=tt;if(o!==null)return n0(s,o,i);yt(),s=s.memoizedState,o=yt();var c=o.queue.dispatch;return o.memoizedState=i,[s,c,!1]}function qs(i,s,o,c){return i={tag:i,create:o,deps:c,inst:s,next:null},s=Me.updateQueue,s===null&&(s=vu(),Me.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(c=o.next,o.next=i,i.next=c,s.lastEffect=i),i}function r0(){return yt().memoizedState}function _u(i,s,o,c){var p=Yt();Me.flags|=i,p.memoizedState=qs(1|s,{destroy:void 0},o,c===void 0?null:c)}function ku(i,s,o,c){var p=yt();c=c===void 0?null:c;var y=p.memoizedState.inst;tt!==null&&c!==null&&qd(c,tt.memoizedState.deps)?p.memoizedState=qs(s,y,o,c):(Me.flags|=i,p.memoizedState=qs(1|s,y,o,c))}function s0(i,s){_u(8390656,8,i,s)}function Kd(i,s){ku(2048,8,i,s)}function aE(i){Me.flags|=4;var s=Me.updateQueue;if(s===null)s=vu(),Me.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function a0(i){var s=yt().memoizedState;return aE({ref:s,nextImpl:i}),function(){if((Ke&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function o0(i,s){return ku(4,2,i,s)}function l0(i,s){return ku(4,4,i,s)}function u0(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function c0(i,s,o){o=o!=null?o.concat([i]):null,ku(4,4,u0.bind(null,s,i),o)}function Jd(){}function f0(i,s){var o=yt();s=s===void 0?null:s;var c=o.memoizedState;return s!==null&&qd(s,c[1])?c[0]:(o.memoizedState=[i,s],i)}function d0(i,s){var o=yt();s=s===void 0?null:s;var c=o.memoizedState;if(s!==null&&qd(s,c[1]))return c[0];if(c=i(),Gr){Ut(!0);try{i()}finally{Ut(!1)}}return o.memoizedState=[c,s],c}function Wd(i,s,o){return o===void 0||(Ni&1073741824)!==0&&(Ue&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=hx(),Me.lanes|=i,cr|=i,o)}function h0(i,s,o,c){return fn(o,s)?o:Hs.current!==null?(i=Wd(i,o,c),fn(i,s)||(wt=!0),i):(Ni&42)===0||(Ni&1073741824)!==0&&(Ue&261930)===0?(wt=!0,i.memoizedState=o):(i=hx(),Me.lanes|=i,cr|=i,s)}function p0(i,s,o,c,p){var y=I.p;I.p=y!==0&&8>y?y:8;var S=R.T,M={};R.T=M,nh(i,!1,s,o);try{var $=p(),W=R.S;if(W!==null&&W(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=tE($,c);io(i,s,ae,yn(i))}else io(i,s,c,yn(i))}catch(le){io(i,s,{then:function(){},status:"rejected",reason:le},yn())}finally{I.p=y,S!==null&&M.types!==null&&(S.types=M.types),R.T=S}}function oE(){}function eh(i,s,o,c){if(i.tag!==5)throw Error(r(476));var p=m0(i).queue;p0(i,p,s,F,o===null?oE:function(){return g0(i),o(c)})}function m0(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:F},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function g0(i){var s=m0(i);s.next===null&&(s=i.alternate.memoizedState),io(i,s.next.queue,{},yn())}function th(){return Dt(wo)}function y0(){return yt().memoizedState}function x0(){return yt().memoizedState}function lE(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=yn();i=rr(o);var c=sr(s,i,o);c!==null&&(sn(c,s,o),Ja(c,s,o)),s={cache:Md()},i.payload=s;return}s=s.return}}function uE(i,s,o){var c=yn();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Eu(i)?v0(s,o):(o=bd(i,s,o,c),o!==null&&(sn(o,i,c),w0(o,s,c)))}function b0(i,s,o){var c=yn();io(i,s,o,c)}function io(i,s,o,c){var p={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Eu(i))v0(s,p);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var S=s.lastRenderedState,M=y(S,o);if(p.hasEagerState=!0,p.eagerState=M,fn(M,S))return su(i,s,p,0),rt===null&&ru(),!1}catch{}if(o=bd(i,s,p,c),o!==null)return sn(o,i,c),w0(o,s,c),!0}return!1}function nh(i,s,o,c){if(c={lane:2,revertLane:Dh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Eu(i)){if(s)throw Error(r(479))}else s=bd(i,o,c,2),s!==null&&sn(s,i,2)}function Eu(i){var s=i.alternate;return i===Me||s!==null&&s===Me}function v0(i,s){Us=xu=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function w0(i,s,o){if((o&4194048)!==0){var c=s.lanes;c&=i.pendingLanes,o|=c,s.lanes=o,Hl(i,o)}}var ro={readContext:Dt,use:wu,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};ro.useEffectEvent=dt;var S0={readContext:Dt,use:wu,useCallback:function(i,s){return Yt().memoizedState=[i,s===void 0?null:s],i},useContext:Dt,useEffect:s0,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,_u(4194308,4,u0.bind(null,s,i),o)},useLayoutEffect:function(i,s){return _u(4194308,4,i,s)},useInsertionEffect:function(i,s){_u(4,2,i,s)},useMemo:function(i,s){var o=Yt();s=s===void 0?null:s;var c=i();if(Gr){Ut(!0);try{i()}finally{Ut(!1)}}return o.memoizedState=[c,s],c},useReducer:function(i,s,o){var c=Yt();if(o!==void 0){var p=o(s);if(Gr){Ut(!0);try{o(s)}finally{Ut(!1)}}}else p=s;return c.memoizedState=c.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},c.queue=i,i=i.dispatch=uE.bind(null,Me,i),[c.memoizedState,i]},useRef:function(i){var s=Yt();return i={current:i},s.memoizedState=i},useState:function(i){i=Zd(i);var s=i.queue,o=b0.bind(null,Me,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Jd,useDeferredValue:function(i,s){var o=Yt();return Wd(o,i,s)},useTransition:function(){var i=Zd(!1);return i=p0.bind(null,Me,i.queue,!0,!1),Yt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var c=Me,p=Yt();if(qe){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),rt===null)throw Error(r(349));(Ue&127)!==0||Py(c,s,o)}p.memoizedState=o;var y={value:o,getSnapshot:s};return p.queue=y,s0(Fy.bind(null,c,y,i),[i]),c.flags|=2048,qs(9,{destroy:void 0},Vy.bind(null,c,y,o,s),null),o},useId:function(){var i=Yt(),s=rt.identifierPrefix;if(qe){var o=ti,c=ei;o=(c&~(1<<32-Je(c)-1)).toString(32)+o,s="_"+s+"R_"+o,o=bu++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=nE++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:th,useFormState:e0,useActionState:e0,useOptimistic:function(i){var s=Yt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=nh.bind(null,Me,!0,o),o.dispatch=s,[i,s]},useMemoCache:Yd,useCacheRefresh:function(){return Yt().memoizedState=lE.bind(null,Me)},useEffectEvent:function(i){var s=Yt(),o={impl:i};return s.memoizedState=o,function(){if((Ke&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},ih={readContext:Dt,use:wu,useCallback:f0,useContext:Dt,useEffect:Kd,useImperativeHandle:c0,useInsertionEffect:o0,useLayoutEffect:l0,useMemo:d0,useReducer:Su,useRef:r0,useState:function(){return Su(Ci)},useDebugValue:Jd,useDeferredValue:function(i,s){var o=yt();return h0(o,tt.memoizedState,i,s)},useTransition:function(){var i=Su(Ci)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:no(i),s]},useSyncExternalStore:$y,useId:y0,useHostTransitionStatus:th,useFormState:t0,useActionState:t0,useOptimistic:function(i,s){var o=yt();return Gy(o,tt,i,s)},useMemoCache:Yd,useCacheRefresh:x0};ih.useEffectEvent=a0;var _0={readContext:Dt,use:wu,useCallback:f0,useContext:Dt,useEffect:Kd,useImperativeHandle:c0,useInsertionEffect:o0,useLayoutEffect:l0,useMemo:d0,useReducer:Gd,useRef:r0,useState:function(){return Gd(Ci)},useDebugValue:Jd,useDeferredValue:function(i,s){var o=yt();return tt===null?Wd(o,i,s):h0(o,tt.memoizedState,i,s)},useTransition:function(){var i=Gd(Ci)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:no(i),s]},useSyncExternalStore:$y,useId:y0,useHostTransitionStatus:th,useFormState:i0,useActionState:i0,useOptimistic:function(i,s){var o=yt();return tt!==null?Gy(o,tt,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Yd,useCacheRefresh:x0};_0.useEffectEvent=a0;function rh(i,s,o,c){s=i.memoizedState,o=o(c,s),o=o==null?s:m({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var sh={enqueueSetState:function(i,s,o){i=i._reactInternals;var c=yn(),p=rr(c);p.payload=s,o!=null&&(p.callback=o),s=sr(i,p,c),s!==null&&(sn(s,i,c),Ja(s,i,c))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var c=yn(),p=rr(c);p.tag=1,p.payload=s,o!=null&&(p.callback=o),s=sr(i,p,c),s!==null&&(sn(s,i,c),Ja(s,i,c))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=yn(),c=rr(o);c.tag=2,s!=null&&(c.callback=s),s=sr(i,c,o),s!==null&&(sn(s,i,o),Ja(s,i,o))}};function k0(i,s,o,c,p,y,S){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,y,S):s.prototype&&s.prototype.isPureReactComponent?!Va(o,c)||!Va(p,y):!0}function E0(i,s,o,c){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,c),s.state!==i&&sh.enqueueReplaceState(s,s.state,null)}function Zr(i,s){var o=s;if("ref"in s){o={};for(var c in s)c!=="ref"&&(o[c]=s[c])}if(i=i.defaultProps){o===s&&(o=m({},o));for(var p in i)o[p]===void 0&&(o[p]=i[p])}return o}function N0(i){iu(i)}function C0(i){console.error(i)}function T0(i){iu(i)}function Nu(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function A0(i,s,o){try{var c=i.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function ah(i,s,o){return o=rr(o),o.tag=3,o.payload={element:null},o.callback=function(){Nu(i,s)},o}function M0(i){return i=rr(i),i.tag=3,i}function j0(i,s,o,c){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;i.payload=function(){return p(y)},i.callback=function(){A0(s,o,c)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){A0(s,o,c),typeof p!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})})}function cE(i,s,o,c,p){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=o.alternate,s!==null&&Rs(s,o,p,!0),o=hn.current,o!==null){switch(o.tag){case 31:case 13:return Mn===null?Hu():o.alternate===null&&ht===0&&(ht=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===hu?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([c]):s.add(c),jh(i,c,p)),!1;case 22:return o.flags|=65536,c===hu?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([c]):o.add(c)),jh(i,c,p)),!1}throw Error(r(435,o.tag))}return jh(i,c,p),Hu(),!1}if(qe)return s=hn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,c!==Ed&&(i=Error(r(422),{cause:c}),Xa(Nn(i,o)))):(c!==Ed&&(s=Error(r(423),{cause:c}),Xa(Nn(s,o))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,c=Nn(c,o),p=ah(i.stateNode,c,p),Ld(i,p),ht!==4&&(ht=2)),!1;var y=Error(r(520),{cause:c});if(y=Nn(y,o),ho===null?ho=[y]:ho.push(y),ht!==4&&(ht=2),s===null)return!0;c=Nn(c,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=p&-p,o.lanes|=i,i=ah(o.stateNode,c,i),Ld(o,i),!1;case 1:if(s=o.type,y=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(fr===null||!fr.has(y))))return o.flags|=65536,p&=-p,o.lanes|=p,p=M0(p),j0(p,i,o,c),Ld(o,p),!1}o=o.return}while(o!==null);return!1}var oh=Error(r(461)),wt=!1;function Ot(i,s,o,c){s.child=i===null?Oy(s,null,o,c):Xr(s,i.child,o,c)}function z0(i,s,o,c,p){o=o.render;var y=s.ref;if("ref"in c){var S={};for(var M in c)M!=="ref"&&(S[M]=c[M])}else S=c;return Pr(s),c=$d(i,s,o,S,y,p),M=Pd(),i!==null&&!wt?(Vd(i,s,p),Ti(i,s,p)):(qe&&M&&_d(s),s.flags|=1,Ot(i,s,c,p),s.child)}function R0(i,s,o,c,p){if(i===null){var y=o.type;return typeof y=="function"&&!vd(y)&&y.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=y,D0(i,s,y,c,p)):(i=ou(o.type,null,c,s,s.mode,p),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!mh(i,p)){var S=y.memoizedProps;if(o=o.compare,o=o!==null?o:Va,o(S,c)&&i.ref===s.ref)return Ti(i,s,p)}return s.flags|=1,i=Si(y,c),i.ref=s.ref,i.return=s,s.child=i}function D0(i,s,o,c,p){if(i!==null){var y=i.memoizedProps;if(Va(y,c)&&i.ref===s.ref)if(wt=!1,s.pendingProps=c=y,mh(i,p))(i.flags&131072)!==0&&(wt=!0);else return s.lanes=i.lanes,Ti(i,s,p)}return lh(i,s,o,c,p)}function O0(i,s,o,c){var p=c.children,y=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|o:o,i!==null){for(c=s.child=i.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,s.child=null;return L0(i,s,y,o,c)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&fu(s,y!==null?y.cachePool:null),y!==null?Hy(s,y):Hd(),Uy(s);else return c=s.lanes=536870912,L0(i,s,y!==null?y.baseLanes|o:o,o,c)}else y!==null?(fu(s,y.cachePool),Hy(s,y),or(),s.memoizedState=null):(i!==null&&fu(s,null),Hd(),or());return Ot(i,s,p,o),s.child}function so(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function L0(i,s,o,c,p){var y=zd();return y=y===null?null:{parent:bt._currentValue,pool:y},s.memoizedState={baseLanes:o,cachePool:y},i!==null&&fu(s,null),Hd(),Uy(s),i!==null&&Rs(i,s,c,!0),s.childLanes=p,null}function Cu(i,s){return s=Au({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function B0(i,s,o){return Xr(s,i.child,null,o),i=Cu(s,s.pendingProps),i.flags|=2,pn(s),s.memoizedState=null,i}function fE(i,s,o){var c=s.pendingProps,p=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(qe){if(c.mode==="hidden")return i=Cu(s,c),s.lanes=536870912,so(null,i);if(Id(s),(i=ot)?(i=Zx(i,An),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Wi!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},o=vy(i),o.return=s,s.child=o,Rt=s,ot=null)):i=null,i===null)throw tr(s);return s.lanes=536870912,null}return Cu(s,c)}var y=i.memoizedState;if(y!==null){var S=y.dehydrated;if(Id(s),p)if(s.flags&256)s.flags&=-257,s=B0(i,s,o);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(wt||Rs(i,s,o,!1),p=(o&i.childLanes)!==0,wt||p){if(c=rt,c!==null&&(S=Ul(c,o),S!==0&&S!==y.retryLane))throw y.retryLane=S,Ur(i,S),sn(c,i,S),oh;Hu(),s=B0(i,s,o)}else i=y.treeContext,ot=jn(S.nextSibling),Rt=s,qe=!0,er=null,An=!1,i!==null&&_y(s,i),s=Cu(s,c),s.flags|=4096;return s}return i=Si(i.child,{mode:c.mode,children:c.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Tu(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function lh(i,s,o,c,p){return Pr(s),o=$d(i,s,o,c,void 0,p),c=Pd(),i!==null&&!wt?(Vd(i,s,p),Ti(i,s,p)):(qe&&c&&_d(s),s.flags|=1,Ot(i,s,o,p),s.child)}function H0(i,s,o,c,p,y){return Pr(s),s.updateQueue=null,o=qy(s,c,o,p),Iy(i),c=Pd(),i!==null&&!wt?(Vd(i,s,y),Ti(i,s,y)):(qe&&c&&_d(s),s.flags|=1,Ot(i,s,o,y),s.child)}function U0(i,s,o,c,p){if(Pr(s),s.stateNode===null){var y=As,S=o.contextType;typeof S=="object"&&S!==null&&(y=Dt(S)),y=new o(c,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=sh,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=c,y.state=s.memoizedState,y.refs={},Dd(s),S=o.contextType,y.context=typeof S=="object"&&S!==null?Dt(S):As,y.state=s.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(rh(s,o,S,c),y.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(S=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),S!==y.state&&sh.enqueueReplaceState(y,y.state,null),eo(s,c,y,p),Wa(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(i===null){y=s.stateNode;var M=s.memoizedProps,$=Zr(o,M);y.props=$;var W=y.context,ae=o.contextType;S=As,typeof ae=="object"&&ae!==null&&(S=Dt(ae));var le=o.getDerivedStateFromProps;ae=typeof le=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=s.pendingProps!==M,ae||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||W!==S)&&E0(s,y,c,S),ir=!1;var ee=s.memoizedState;y.state=ee,eo(s,c,y,p),Wa(),W=s.memoizedState,M||ee!==W||ir?(typeof le=="function"&&(rh(s,o,le,c),W=s.memoizedState),($=ir||k0(s,o,$,c,ee,W,S))?(ae||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=W),y.props=c,y.state=W,y.context=S,c=$):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{y=s.stateNode,Od(i,s),S=s.memoizedProps,ae=Zr(o,S),y.props=ae,le=s.pendingProps,ee=y.context,W=o.contextType,$=As,typeof W=="object"&&W!==null&&($=Dt(W)),M=o.getDerivedStateFromProps,(W=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==le||ee!==$)&&E0(s,y,c,$),ir=!1,ee=s.memoizedState,y.state=ee,eo(s,c,y,p),Wa();var re=s.memoizedState;S!==le||ee!==re||ir||i!==null&&i.dependencies!==null&&uu(i.dependencies)?(typeof M=="function"&&(rh(s,o,M,c),re=s.memoizedState),(ae=ir||k0(s,o,ae,c,ee,re,$)||i!==null&&i.dependencies!==null&&uu(i.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,$),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,$)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=re),y.props=c,y.state=re,y.context=$,c=ae):(typeof y.componentDidUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&ee===i.memoizedState||(s.flags|=1024),c=!1)}return y=c,Tu(i,s),c=(s.flags&128)!==0,y||c?(y=s.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,i!==null&&c?(s.child=Xr(s,i.child,null,p),s.child=Xr(s,null,o,p)):Ot(i,s,o,p),s.memoizedState=y.state,i=s.child):i=Ti(i,s,p),i}function I0(i,s,o,c){return qr(),s.flags|=256,Ot(i,s,o,c),s.child}var uh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ch(i){return{baseLanes:i,cachePool:Ay()}}function fh(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=gn),i}function q0(i,s,o){var c=s.pendingProps,p=!1,y=(s.flags&128)!==0,S;if((S=y)||(S=i!==null&&i.memoizedState===null?!1:(gt.current&2)!==0),S&&(p=!0,s.flags&=-129),S=(s.flags&32)!==0,s.flags&=-33,i===null){if(qe){if(p?ar(s):or(),(i=ot)?(i=Zx(i,An),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Wi!==null?{id:ei,overflow:ti}:null,retryLane:536870912,hydrationErrors:null},o=vy(i),o.return=s,s.child=o,Rt=s,ot=null)):i=null,i===null)throw tr(s);return Xh(i)?s.lanes=32:s.lanes=536870912,null}var M=c.children;return c=c.fallback,p?(or(),p=s.mode,M=Au({mode:"hidden",children:M},p),c=Ir(c,p,o,null),M.return=s,c.return=s,M.sibling=c,s.child=M,c=s.child,c.memoizedState=ch(o),c.childLanes=fh(i,S,o),s.memoizedState=uh,so(null,c)):(ar(s),dh(s,M))}var $=i.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(y)s.flags&256?(ar(s),s.flags&=-257,s=hh(i,s,o)):s.memoizedState!==null?(or(),s.child=i.child,s.flags|=128,s=null):(or(),M=c.fallback,p=s.mode,c=Au({mode:"visible",children:c.children},p),M=Ir(M,p,o,null),M.flags|=2,c.return=s,M.return=s,c.sibling=M,s.child=c,Xr(s,i.child,null,o),c=s.child,c.memoizedState=ch(o),c.childLanes=fh(i,S,o),s.memoizedState=uh,s=so(null,c));else if(ar(s),Xh(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var W=S.dgst;S=W,c=Error(r(419)),c.stack="",c.digest=S,Xa({value:c,source:null,stack:null}),s=hh(i,s,o)}else if(wt||Rs(i,s,o,!1),S=(o&i.childLanes)!==0,wt||S){if(S=rt,S!==null&&(c=Ul(S,o),c!==0&&c!==$.retryLane))throw $.retryLane=c,Ur(i,c),sn(S,i,c),oh;Yh(M)||Hu(),s=hh(i,s,o)}else Yh(M)?(s.flags|=192,s.child=i.child,s=null):(i=$.treeContext,ot=jn(M.nextSibling),Rt=s,qe=!0,er=null,An=!1,i!==null&&_y(s,i),s=dh(s,c.children),s.flags|=4096);return s}return p?(or(),M=c.fallback,p=s.mode,$=i.child,W=$.sibling,c=Si($,{mode:"hidden",children:c.children}),c.subtreeFlags=$.subtreeFlags&65011712,W!==null?M=Si(W,M):(M=Ir(M,p,o,null),M.flags|=2),M.return=s,c.return=s,c.sibling=M,s.child=c,so(null,c),c=s.child,M=i.child.memoizedState,M===null?M=ch(o):(p=M.cachePool,p!==null?($=bt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=Ay(),M={baseLanes:M.baseLanes|o,cachePool:p}),c.memoizedState=M,c.childLanes=fh(i,S,o),s.memoizedState=uh,so(i.child,c)):(ar(s),o=i.child,i=o.sibling,o=Si(o,{mode:"visible",children:c.children}),o.return=s,o.sibling=null,i!==null&&(S=s.deletions,S===null?(s.deletions=[i],s.flags|=16):S.push(i)),s.child=o,s.memoizedState=null,o)}function dh(i,s){return s=Au({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Au(i,s){return i=dn(22,i,null,s),i.lanes=0,i}function hh(i,s,o){return Xr(s,i.child,null,o),i=dh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function $0(i,s,o){i.lanes|=s;var c=i.alternate;c!==null&&(c.lanes|=s),Td(i.return,s,o)}function ph(i,s,o,c,p,y){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:p,treeForkCount:y}:(S.isBackwards=s,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=o,S.tailMode=p,S.treeForkCount=y)}function P0(i,s,o){var c=s.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=gt.current,M=(S&2)!==0;if(M?(S=S&1|2,s.flags|=128):S&=1,j(gt,S),Ot(i,s,c,o),c=qe?Ya:0,!M&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&$0(i,o,s);else if(i.tag===19)$0(i,o,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(o=s.child,p=null;o!==null;)i=o.alternate,i!==null&&yu(i)===null&&(p=o),o=o.sibling;o=p,o===null?(p=s.child,s.child=null):(p=o.sibling,o.sibling=null),ph(s,!1,p,o,y,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=s.child,s.child=null;p!==null;){if(i=p.alternate,i!==null&&yu(i)===null){s.child=p;break}i=p.sibling,p.sibling=o,o=p,p=i}ph(s,!0,o,null,y,c);break;case"together":ph(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function Ti(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),cr|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(Rs(i,s,o,!1),(o&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,o=Si(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=Si(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function mh(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&uu(i)))}function dE(i,s,o){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),nr(s,bt,i.memoizedState.cache),qr();break;case 27:case 5:Ee(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:nr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Id(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(ar(s),s.flags|=128,null):(o&s.child.childLanes)!==0?q0(i,s,o):(ar(s),i=Ti(i,s,o),i!==null?i.sibling:null);ar(s);break;case 19:var p=(i.flags&128)!==0;if(c=(o&s.childLanes)!==0,c||(Rs(i,s,o,!1),c=(o&s.childLanes)!==0),p){if(c)return P0(i,s,o);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),j(gt,gt.current),c)break;return null;case 22:return s.lanes=0,O0(i,s,o,s.pendingProps);case 24:nr(s,bt,i.memoizedState.cache)}return Ti(i,s,o)}function V0(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)wt=!0;else{if(!mh(i,o)&&(s.flags&128)===0)return wt=!1,dE(i,s,o);wt=(i.flags&131072)!==0}else wt=!1,qe&&(s.flags&1048576)!==0&&Sy(s,Ya,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(i=Fr(s.elementType),s.type=i,typeof i=="function")vd(i)?(c=Zr(i,c),s.tag=1,s=U0(null,s,i,c,o)):(s.tag=0,s=lh(null,s,i,c,o));else{if(i!=null){var p=i.$$typeof;if(p===C){s.tag=11,s=z0(null,s,i,c,o);break e}else if(p===L){s.tag=14,s=R0(null,s,i,c,o);break e}}throw s=O(i)||i,Error(r(306,s,""))}}return s;case 0:return lh(i,s,s.type,s.pendingProps,o);case 1:return c=s.type,p=Zr(c,s.pendingProps),U0(i,s,c,p,o);case 3:e:{if(ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));c=s.pendingProps;var y=s.memoizedState;p=y.element,Od(i,s),eo(s,c,null,o);var S=s.memoizedState;if(c=S.cache,nr(s,bt,c),c!==y.cache&&Ad(s,[bt],o,!0),Wa(),c=S.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:S.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=I0(i,s,c,o);break e}else if(c!==p){p=Nn(Error(r(424)),s),Xa(p),s=I0(i,s,c,o);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,ot=jn(i.firstChild),Rt=s,qe=!0,er=null,An=!0,o=Oy(s,null,c,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(qr(),c===p){s=Ti(i,s,o);break e}Ot(i,s,c,o)}s=s.child}return s;case 26:return Tu(i,s),i===null?(o=tb(s.type,null,s.pendingProps,null))?s.memoizedState=o:qe||(o=s.type,i=s.pendingProps,c=Fu(fe.current).createElement(o),c[Tt]=s,c[It]=i,Lt(c,o,i),xt(c),s.stateNode=c):s.memoizedState=tb(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ee(s),i===null&&qe&&(c=s.stateNode=Jx(s.type,s.pendingProps,fe.current),Rt=s,An=!0,p=ot,mr(s.type)?(Gh=p,ot=jn(c.firstChild)):ot=p),Ot(i,s,s.pendingProps.children,o),Tu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&qe&&((p=c=ot)&&(c=$E(c,s.type,s.pendingProps,An),c!==null?(s.stateNode=c,Rt=s,ot=jn(c.firstChild),An=!1,p=!0):p=!1),p||tr(s)),Ee(s),p=s.type,y=s.pendingProps,S=i!==null?i.memoizedProps:null,c=y.children,Ph(p,y)?c=null:S!==null&&Ph(p,S)&&(s.flags|=32),s.memoizedState!==null&&(p=$d(i,s,iE,null,null,o),wo._currentValue=p),Tu(i,s),Ot(i,s,c,o),s.child;case 6:return i===null&&qe&&((i=o=ot)&&(o=PE(o,s.pendingProps,An),o!==null?(s.stateNode=o,Rt=s,ot=null,i=!0):i=!1),i||tr(s)),null;case 13:return q0(i,s,o);case 4:return ue(s,s.stateNode.containerInfo),c=s.pendingProps,i===null?s.child=Xr(s,null,c,o):Ot(i,s,c,o),s.child;case 11:return z0(i,s,s.type,s.pendingProps,o);case 7:return Ot(i,s,s.pendingProps,o),s.child;case 8:return Ot(i,s,s.pendingProps.children,o),s.child;case 12:return Ot(i,s,s.pendingProps.children,o),s.child;case 10:return c=s.pendingProps,nr(s,s.type,c.value),Ot(i,s,c.children,o),s.child;case 9:return p=s.type._context,c=s.pendingProps.children,Pr(s),p=Dt(p),c=c(p),s.flags|=1,Ot(i,s,c,o),s.child;case 14:return R0(i,s,s.type,s.pendingProps,o);case 15:return D0(i,s,s.type,s.pendingProps,o);case 19:return P0(i,s,o);case 31:return fE(i,s,o);case 22:return O0(i,s,o,s.pendingProps);case 24:return Pr(s),c=Dt(bt),i===null?(p=zd(),p===null&&(p=rt,y=Md(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=o),p=y),s.memoizedState={parent:c,cache:p},Dd(s),nr(s,bt,p)):((i.lanes&o)!==0&&(Od(i,s),eo(s,null,null,o),Wa()),p=i.memoizedState,y=s.memoizedState,p.parent!==c?(p={parent:c,cache:c},s.memoizedState=p,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=p),nr(s,bt,c)):(c=y.cache,nr(s,bt,c),c!==p.cache&&Ad(s,[bt],o,!0))),Ot(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ai(i){i.flags|=4}function gh(i,s,o,c,p){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(yx())i.flags|=8192;else throw Yr=hu,Rd}else i.flags&=-16777217}function F0(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!ab(s))if(yx())i.flags|=8192;else throw Yr=hu,Rd}function Mu(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Ll():536870912,i.lanes|=s,Fs|=s)}function ao(i,s){if(!qe)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function lt(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,c=0;if(s)for(var p=i.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)o|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=c,i.childLanes=o,s}function hE(i,s,o){var c=s.pendingProps;switch(kd(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(s),null;case 1:return lt(s),null;case 3:return o=s.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),Ei(bt),me(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(zs(s)?Ai(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Nd())),lt(s),null;case 26:var p=s.type,y=s.memoizedState;return i===null?(Ai(s),y!==null?(lt(s),F0(s,y)):(lt(s),gh(s,p,null,c,o))):y?y!==i.memoizedState?(Ai(s),lt(s),F0(s,y)):(lt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==c&&Ai(s),lt(s),gh(s,p,i,c,o)),null;case 27:if(Ce(s),o=fe.current,p=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==c&&Ai(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return lt(s),null}i=ie.current,zs(s)?ky(s):(i=Jx(p,c,o),s.stateNode=i,Ai(s))}return lt(s),null;case 5:if(Ce(s),p=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==c&&Ai(s);else{if(!c){if(s.stateNode===null)throw Error(r(166));return lt(s),null}if(y=ie.current,zs(s))ky(s);else{var S=Fu(fe.current);switch(y){case 1:y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=S.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}y[Tt]=s,y[It]=c;e:for(S=s.child;S!==null;){if(S.tag===5||S.tag===6)y.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===s)break e;for(;S.sibling===null;){if(S.return===null||S.return===s)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}s.stateNode=y;e:switch(Lt(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Ai(s)}}return lt(s),gh(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,o),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==c&&Ai(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(r(166));if(i=fe.current,zs(s)){if(i=s.stateNode,o=s.memoizedProps,c=null,p=Rt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}i[Tt]=s,i=!!(i.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||qx(i.nodeValue,o)),i||tr(s,!0)}else i=Fu(i).createTextNode(c),i[Tt]=s,s.stateNode=i}return lt(s),null;case 31:if(o=s.memoizedState,i===null||i.memoizedState!==null){if(c=zs(s),o!==null){if(i===null){if(!c)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Tt]=s}else qr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;lt(s),i=!1}else o=Nd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return s.flags&256?(pn(s),s):(pn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return lt(s),null;case 13:if(c=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=zs(s),c!==null&&c.dehydrated!==null){if(i===null){if(!p)throw Error(r(318));if(p=s.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Tt]=s}else qr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;lt(s),p=!1}else p=Nd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return s.flags&256?(pn(s),s):(pn(s),null)}return pn(s),(s.flags&128)!==0?(s.lanes=o,s):(o=c!==null,i=i!==null&&i.memoizedState!==null,o&&(c=s.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),o!==i&&o&&(s.child.flags|=8192),Mu(s,s.updateQueue),lt(s),null);case 4:return me(),i===null&&Hh(s.stateNode.containerInfo),lt(s),null;case 10:return Ei(s.type),lt(s),null;case 19:if(V(gt),c=s.memoizedState,c===null)return lt(s),null;if(p=(s.flags&128)!==0,y=c.rendering,y===null)if(p)ao(c,!1);else{if(ht!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=yu(i),y!==null){for(s.flags|=128,ao(c,!1),i=y.updateQueue,s.updateQueue=i,Mu(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)by(o,i),o=o.sibling;return j(gt,gt.current&1|2),qe&&_i(s,c.treeForkCount),s.child}i=i.sibling}c.tail!==null&&Ct()>Ou&&(s.flags|=128,p=!0,ao(c,!1),s.lanes=4194304)}else{if(!p)if(i=yu(y),i!==null){if(s.flags|=128,p=!0,i=i.updateQueue,s.updateQueue=i,Mu(s,i),ao(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return lt(s),null}else 2*Ct()-c.renderingStartTime>Ou&&o!==536870912&&(s.flags|=128,p=!0,ao(c,!1),s.lanes=4194304);c.isBackwards?(y.sibling=s.child,s.child=y):(i=c.last,i!==null?i.sibling=y:s.child=y,c.last=y)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=Ct(),i.sibling=null,o=gt.current,j(gt,p?o&1|2:o&1),qe&&_i(s,c.treeForkCount),i):(lt(s),null);case 22:case 23:return pn(s),Ud(),c=s.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(o&536870912)!==0&&(s.flags&128)===0&&(lt(s),s.subtreeFlags&6&&(s.flags|=8192)):lt(s),o=s.updateQueue,o!==null&&Mu(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048),i!==null&&V(Vr),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Ei(bt),lt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function pE(i,s){switch(kd(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ei(bt),me(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Ce(s),null;case 31:if(s.memoizedState!==null){if(pn(s),s.alternate===null)throw Error(r(340));qr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(pn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));qr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return V(gt),null;case 4:return me(),null;case 10:return Ei(s.type),null;case 22:case 23:return pn(s),Ud(),i!==null&&V(Vr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ei(bt),null;case 25:return null;default:return null}}function Y0(i,s){switch(kd(s),s.tag){case 3:Ei(bt),me();break;case 26:case 27:case 5:Ce(s);break;case 4:me();break;case 31:s.memoizedState!==null&&pn(s);break;case 13:pn(s);break;case 19:V(gt);break;case 10:Ei(s.type);break;case 22:case 23:pn(s),Ud(),i!==null&&V(Vr);break;case 24:Ei(bt)}}function oo(i,s){try{var o=s.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var p=c.next;o=p;do{if((o.tag&i)===i){c=void 0;var y=o.create,S=o.inst;c=y(),S.destroy=c}o=o.next}while(o!==p)}}catch(M){et(s,s.return,M)}}function lr(i,s,o){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&i)===i){var S=c.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,p=s;var $=o,W=M;try{W()}catch(ae){et(p,$,ae)}}}c=c.next}while(c!==y)}}catch(ae){et(s,s.return,ae)}}function X0(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{By(s,o)}catch(c){et(i,i.return,c)}}}function G0(i,s,o){o.props=Zr(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(c){et(i,s,c)}}function lo(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof o=="function"?i.refCleanup=o(c):o.current=c}}catch(p){et(i,s,p)}}function ni(i,s){var o=i.ref,c=i.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(p){et(i,s,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){et(i,s,p)}else o.current=null}function Z0(i){var s=i.type,o=i.memoizedProps,c=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(p){et(i,i.return,p)}}function yh(i,s,o){try{var c=i.stateNode;LE(c,i.type,o,s),c[It]=s}catch(p){et(i,i.return,p)}}function Q0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function xh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Q0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&mr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function bh(i,s,o){var c=i.tag;if(c===5||c===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=vi));else if(c!==4&&(c===27&&mr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(bh(i,s,o),i=i.sibling;i!==null;)bh(i,s,o),i=i.sibling}function ju(i,s,o){var c=i.tag;if(c===5||c===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(c!==4&&(c===27&&mr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(ju(i,s,o),i=i.sibling;i!==null;)ju(i,s,o),i=i.sibling}function K0(i){var s=i.stateNode,o=i.memoizedProps;try{for(var c=i.type,p=s.attributes;p.length;)s.removeAttributeNode(p[0]);Lt(s,c,o),s[Tt]=i,s[It]=o}catch(y){et(i,i.return,y)}}var Mi=!1,St=!1,vh=!1,J0=typeof WeakSet=="function"?WeakSet:Set,jt=null;function mE(i,s){if(i=i.containerInfo,qh=Ju,i=cy(i),hd(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var p=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{o.nodeType,y.nodeType}catch{o=null;break e}var S=0,M=-1,$=-1,W=0,ae=0,le=i,ee=null;t:for(;;){for(var re;le!==o||p!==0&&le.nodeType!==3||(M=S+p),le!==y||c!==0&&le.nodeType!==3||($=S+c),le.nodeType===3&&(S+=le.nodeValue.length),(re=le.firstChild)!==null;)ee=le,le=re;for(;;){if(le===i)break t;if(ee===o&&++W===p&&(M=S),ee===y&&++ae===c&&($=S),(re=le.nextSibling)!==null)break;le=ee,ee=le.parentNode}le=re}o=M===-1||$===-1?null:{start:M,end:$}}else o=null}o=o||{start:0,end:0}}else o=null;for($h={focusedElem:i,selectionRange:o},Ju=!1,jt=s;jt!==null;)if(s=jt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,jt=i;else for(;jt!==null;){switch(s=jt,y=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)p=i[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,o=s,p=y.memoizedProps,y=y.memoizedState,c=o.stateNode;try{var ye=Zr(o.type,p);i=c.getSnapshotBeforeUpdate(ye,y),c.__reactInternalSnapshotBeforeUpdate=i}catch(ke){et(o,o.return,ke)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)Fh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Fh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,jt=i;break}jt=s.return}}function W0(i,s,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:zi(i,o),c&4&&oo(5,o);break;case 1:if(zi(i,o),c&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(S){et(o,o.return,S)}else{var p=Zr(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(p,s,i.__reactInternalSnapshotBeforeUpdate)}catch(S){et(o,o.return,S)}}c&64&&X0(o),c&512&&lo(o,o.return);break;case 3:if(zi(i,o),c&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{By(i,s)}catch(S){et(o,o.return,S)}}break;case 27:s===null&&c&4&&K0(o);case 26:case 5:zi(i,o),s===null&&c&4&&Z0(o),c&512&&lo(o,o.return);break;case 12:zi(i,o);break;case 31:zi(i,o),c&4&&nx(i,o);break;case 13:zi(i,o),c&4&&ix(i,o),c&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=kE.bind(null,o),VE(i,o))));break;case 22:if(c=o.memoizedState!==null||Mi,!c){s=s!==null&&s.memoizedState!==null||St,p=Mi;var y=St;Mi=c,(St=s)&&!y?Ri(i,o,(o.subtreeFlags&8772)!==0):zi(i,o),Mi=p,St=y}break;case 30:break;default:zi(i,o)}}function ex(i){var s=i.alternate;s!==null&&(i.alternate=null,ex(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Da(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var ut=null,en=!1;function ji(i,s,o){for(o=o.child;o!==null;)tx(i,s,o),o=o.sibling}function tx(i,s,o){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(zt,o)}catch{}switch(o.tag){case 26:St||ni(o,s),ji(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:St||ni(o,s);var c=ut,p=en;mr(o.type)&&(ut=o.stateNode,en=!1),ji(i,s,o),xo(o.stateNode),ut=c,en=p;break;case 5:St||ni(o,s);case 6:if(c=ut,p=en,ut=null,ji(i,s,o),ut=c,en=p,ut!==null)if(en)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(o.stateNode)}catch(y){et(o,s,y)}else try{ut.removeChild(o.stateNode)}catch(y){et(o,s,y)}break;case 18:ut!==null&&(en?(i=ut,Xx(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Ws(i)):Xx(ut,o.stateNode));break;case 4:c=ut,p=en,ut=o.stateNode.containerInfo,en=!0,ji(i,s,o),ut=c,en=p;break;case 0:case 11:case 14:case 15:lr(2,o,s),St||lr(4,o,s),ji(i,s,o);break;case 1:St||(ni(o,s),c=o.stateNode,typeof c.componentWillUnmount=="function"&&G0(o,s,c)),ji(i,s,o);break;case 21:ji(i,s,o);break;case 22:St=(c=St)||o.memoizedState!==null,ji(i,s,o),St=c;break;default:ji(i,s,o)}}function nx(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Ws(i)}catch(o){et(s,s.return,o)}}}function ix(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Ws(i)}catch(o){et(s,s.return,o)}}function gE(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new J0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new J0),s;default:throw Error(r(435,i.tag))}}function zu(i,s){var o=gE(i);s.forEach(function(c){if(!o.has(c)){o.add(c);var p=EE.bind(null,i,c);c.then(p,p)}})}function tn(i,s){var o=s.deletions;if(o!==null)for(var c=0;c<o.length;c++){var p=o[c],y=i,S=s,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(mr(M.type)){ut=M.stateNode,en=!1;break e}break;case 5:ut=M.stateNode,en=!1;break e;case 3:case 4:ut=M.stateNode.containerInfo,en=!0;break e}M=M.return}if(ut===null)throw Error(r(160));tx(y,S,p),ut=null,en=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)rx(s,i),s=s.sibling}var qn=null;function rx(i,s){var o=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:tn(s,i),nn(i),c&4&&(lr(3,i,i.return),oo(3,i),lr(5,i,i.return));break;case 1:tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),c&64&&Mi&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var p=qn;if(tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),c&4){var y=o!==null?o.memoizedState:null;if(c=i.memoizedState,o===null)if(c===null)if(i.stateNode===null){e:{c=i.type,o=i.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Rr]||y[Tt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(c),p.head.insertBefore(y,p.querySelector("head > title"))),Lt(y,c,o),y[Tt]=i,xt(y),c=y;break e;case"link":var S=rb("link","href",p).get(c+(o.href||""));if(S){for(var M=0;M<S.length;M++)if(y=S[M],y.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&y.getAttribute("rel")===(o.rel==null?null:o.rel)&&y.getAttribute("title")===(o.title==null?null:o.title)&&y.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(M,1);break t}}y=p.createElement(c),Lt(y,c,o),p.head.appendChild(y);break;case"meta":if(S=rb("meta","content",p).get(c+(o.content||""))){for(M=0;M<S.length;M++)if(y=S[M],y.getAttribute("content")===(o.content==null?null:""+o.content)&&y.getAttribute("name")===(o.name==null?null:o.name)&&y.getAttribute("property")===(o.property==null?null:o.property)&&y.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&y.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(M,1);break t}}y=p.createElement(c),Lt(y,c,o),p.head.appendChild(y);break;default:throw Error(r(468,c))}y[Tt]=i,xt(y),c=y}i.stateNode=c}else sb(p,i.type,i.stateNode);else i.stateNode=ib(p,c,i.memoizedProps);else y!==c?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,c===null?sb(p,i.type,i.stateNode):ib(p,c,i.memoizedProps)):c===null&&i.stateNode!==null&&yh(i,i.memoizedProps,o.memoizedProps)}break;case 27:tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),o!==null&&c&4&&yh(i,i.memoizedProps,o.memoizedProps);break;case 5:if(tn(s,i),nn(i),c&512&&(St||o===null||ni(o,o.return)),i.flags&32){p=i.stateNode;try{Ss(p,"")}catch(ye){et(i,i.return,ye)}}c&4&&i.stateNode!=null&&(p=i.memoizedProps,yh(i,p,o!==null?o.memoizedProps:p)),c&1024&&(vh=!0);break;case 6:if(tn(s,i),nn(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,o=i.stateNode;try{o.nodeValue=c}catch(ye){et(i,i.return,ye)}}break;case 3:if(Gu=null,p=qn,qn=Yu(s.containerInfo),tn(s,i),qn=p,nn(i),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Ws(s.containerInfo)}catch(ye){et(i,i.return,ye)}vh&&(vh=!1,sx(i));break;case 4:c=qn,qn=Yu(i.stateNode.containerInfo),tn(s,i),nn(i),qn=c;break;case 12:tn(s,i),nn(i);break;case 31:tn(s,i),nn(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,zu(i,c)));break;case 13:tn(s,i),nn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Du=Ct()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,zu(i,c)));break;case 22:p=i.memoizedState!==null;var $=o!==null&&o.memoizedState!==null,W=Mi,ae=St;if(Mi=W||p,St=ae||$,tn(s,i),St=ae,Mi=W,nn(i),c&8192)e:for(s=i.stateNode,s._visibility=p?s._visibility&-2:s._visibility|1,p&&(o===null||$||Mi||St||Qr(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){$=o=s;try{if(y=$.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=$.stateNode;var le=$.memoizedProps.style,ee=le!=null&&le.hasOwnProperty("display")?le.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){et($,$.return,ye)}}}else if(s.tag===6){if(o===null){$=s;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(ye){et($,$.return,ye)}}}else if(s.tag===18){if(o===null){$=s;try{var re=$.stateNode;p?Gx(re,!0):Gx($.stateNode,!1)}catch(ye){et($,$.return,ye)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=i.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,zu(i,o))));break;case 19:tn(s,i),nn(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,zu(i,c)));break;case 30:break;case 21:break;default:tn(s,i),nn(i)}}function nn(i){var s=i.flags;if(s&2){try{for(var o,c=i.return;c!==null;){if(Q0(c)){o=c;break}c=c.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var p=o.stateNode,y=xh(i);ju(i,y,p);break;case 5:var S=o.stateNode;o.flags&32&&(Ss(S,""),o.flags&=-33);var M=xh(i);ju(i,M,S);break;case 3:case 4:var $=o.stateNode.containerInfo,W=xh(i);bh(i,W,$);break;default:throw Error(r(161))}}catch(ae){et(i,i.return,ae)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function sx(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;sx(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function zi(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)W0(i,s.alternate,s),s=s.sibling}function Qr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:lr(4,s,s.return),Qr(s);break;case 1:ni(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&G0(s,s.return,o),Qr(s);break;case 27:xo(s.stateNode);case 26:case 5:ni(s,s.return),Qr(s);break;case 22:s.memoizedState===null&&Qr(s);break;case 30:Qr(s);break;default:Qr(s)}i=i.sibling}}function Ri(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,p=i,y=s,S=y.flags;switch(y.tag){case 0:case 11:case 15:Ri(p,y,o),oo(4,y);break;case 1:if(Ri(p,y,o),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(W){et(c,c.return,W)}if(c=y,p=c.updateQueue,p!==null){var M=c.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)Ly($[p],M)}catch(W){et(c,c.return,W)}}o&&S&64&&X0(y),lo(y,y.return);break;case 27:K0(y);case 26:case 5:Ri(p,y,o),o&&c===null&&S&4&&Z0(y),lo(y,y.return);break;case 12:Ri(p,y,o);break;case 31:Ri(p,y,o),o&&S&4&&nx(p,y);break;case 13:Ri(p,y,o),o&&S&4&&ix(p,y);break;case 22:y.memoizedState===null&&Ri(p,y,o),lo(y,y.return);break;case 30:break;default:Ri(p,y,o)}s=s.sibling}}function wh(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Ga(o))}function Sh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Ga(i))}function $n(i,s,o,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)ax(i,s,o,c),s=s.sibling}function ax(i,s,o,c){var p=s.flags;switch(s.tag){case 0:case 11:case 15:$n(i,s,o,c),p&2048&&oo(9,s);break;case 1:$n(i,s,o,c);break;case 3:$n(i,s,o,c),p&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Ga(i)));break;case 12:if(p&2048){$n(i,s,o,c),i=s.stateNode;try{var y=s.memoizedProps,S=y.id,M=y.onPostCommit;typeof M=="function"&&M(S,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch($){et(s,s.return,$)}}else $n(i,s,o,c);break;case 31:$n(i,s,o,c);break;case 13:$n(i,s,o,c);break;case 23:break;case 22:y=s.stateNode,S=s.alternate,s.memoizedState!==null?y._visibility&2?$n(i,s,o,c):uo(i,s):y._visibility&2?$n(i,s,o,c):(y._visibility|=2,$s(i,s,o,c,(s.subtreeFlags&10256)!==0||!1)),p&2048&&wh(S,s);break;case 24:$n(i,s,o,c),p&2048&&Sh(s.alternate,s);break;default:$n(i,s,o,c)}}function $s(i,s,o,c,p){for(p=p&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=i,S=s,M=o,$=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:$s(y,S,M,$,p),oo(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?$s(y,S,M,$,p):uo(y,S):(ae._visibility|=2,$s(y,S,M,$,p)),p&&W&2048&&wh(S.alternate,S);break;case 24:$s(y,S,M,$,p),p&&W&2048&&Sh(S.alternate,S);break;default:$s(y,S,M,$,p)}s=s.sibling}}function uo(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,c=s,p=c.flags;switch(c.tag){case 22:uo(o,c),p&2048&&wh(c.alternate,c);break;case 24:uo(o,c),p&2048&&Sh(c.alternate,c);break;default:uo(o,c)}s=s.sibling}}var co=8192;function Ps(i,s,o){if(i.subtreeFlags&co)for(i=i.child;i!==null;)ox(i,s,o),i=i.sibling}function ox(i,s,o){switch(i.tag){case 26:Ps(i,s,o),i.flags&co&&i.memoizedState!==null&&nN(o,qn,i.memoizedState,i.memoizedProps);break;case 5:Ps(i,s,o);break;case 3:case 4:var c=qn;qn=Yu(i.stateNode.containerInfo),Ps(i,s,o),qn=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=co,co=16777216,Ps(i,s,o),co=c):Ps(i,s,o));break;default:Ps(i,s,o)}}function lx(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function fo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var c=s[o];jt=c,cx(c,i)}lx(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ux(i),i=i.sibling}function ux(i){switch(i.tag){case 0:case 11:case 15:fo(i),i.flags&2048&&lr(9,i,i.return);break;case 3:fo(i);break;case 12:fo(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Ru(i)):fo(i);break;default:fo(i)}}function Ru(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var c=s[o];jt=c,cx(c,i)}lx(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:lr(8,s,s.return),Ru(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,Ru(s));break;default:Ru(s)}i=i.sibling}}function cx(i,s){for(;jt!==null;){var o=jt;switch(o.tag){case 0:case 11:case 15:lr(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ga(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,jt=c;else e:for(o=i;jt!==null;){c=jt;var p=c.sibling,y=c.return;if(ex(c),c===o){jt=null;break e}if(p!==null){p.return=y,jt=p;break e}jt=y}}}var yE={getCacheForType:function(i){var s=Dt(bt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return Dt(bt).controller.signal}},xE=typeof WeakMap=="function"?WeakMap:Map,Ke=0,rt=null,Le=null,Ue=0,We=0,mn=null,ur=!1,Vs=!1,_h=!1,Di=0,ht=0,cr=0,Kr=0,kh=0,gn=0,Fs=0,ho=null,rn=null,Eh=!1,Du=0,fx=0,Ou=1/0,Lu=null,fr=null,At=0,dr=null,Ys=null,Oi=0,Nh=0,Ch=null,dx=null,po=0,Th=null;function yn(){return(Ke&2)!==0&&Ue!==0?Ue&-Ue:R.T!==null?Dh():Il()}function hx(){if(gn===0)if((Ue&536870912)===0||qe){var i=ms;ms<<=1,(ms&3932160)===0&&(ms=262144),gn=i}else gn=536870912;return i=hn.current,i!==null&&(i.flags|=32),gn}function sn(i,s,o){(i===rt&&(We===2||We===9)||i.cancelPendingCommit!==null)&&(Xs(i,0),hr(i,Ue,gn,!1)),zr(i,o),((Ke&2)===0||i!==rt)&&(i===rt&&((Ke&2)===0&&(Kr|=o),ht===4&&hr(i,Ue,gn,!1)),ii(i))}function px(i,s,o){if((Ke&6)!==0)throw Error(r(327));var c=!o&&(s&127)===0&&(s&i.expiredLanes)===0||jr(i,s),p=c?wE(i,s):Mh(i,s,!0),y=c;do{if(p===0){Vs&&!c&&hr(i,s,0,!1);break}else{if(o=i.current.alternate,y&&!bE(o)){p=Mh(i,s,!1),y=!1;continue}if(p===2){if(y=s,i.errorRecoveryDisabledLanes&y)var S=0;else S=i.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){s=S;e:{var M=i;p=ho;var $=M.current.memoizedState.isDehydrated;if($&&(Xs(M,S).flags|=256),S=Mh(M,S,!1),S!==2){if(_h&&!$){M.errorRecoveryDisabledLanes|=y,Kr|=y,p=4;break e}y=rn,rn=p,y!==null&&(rn===null?rn=y:rn.push.apply(rn,y))}p=S}if(y=!1,p!==2)continue}}if(p===1){Xs(i,0),hr(i,s,0,!0);break}e:{switch(c=i,y=p,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:hr(c,s,gn,!ur);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(p=Du+300-Ct(),10<p)){if(hr(c,s,gn,!ur),ys(c,0,!0)!==0)break e;Oi=s,c.timeoutHandle=Fx(mx.bind(null,c,o,rn,Lu,Eh,s,gn,Kr,Fs,ur,y,"Throttled",-0,0),p);break e}mx(c,o,rn,Lu,Eh,s,gn,Kr,Fs,ur,y,null,-0,0)}}break}while(!0);ii(i)}function mx(i,s,o,c,p,y,S,M,$,W,ae,le,ee,re){if(i.timeoutHandle=-1,le=s.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vi},ox(s,y,le);var ye=(y&62914560)===y?Du-Ct():(y&4194048)===y?fx-Ct():0;if(ye=iN(le,ye),ye!==null){Oi=y,i.cancelPendingCommit=ye(_x.bind(null,i,s,y,o,c,p,S,M,$,ae,le,null,ee,re)),hr(i,y,S,!W);return}}_x(i,s,y,o,c,p,S,M,$)}function bE(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var p=o[c],y=p.getSnapshot;p=p.value;try{if(!fn(y(),p))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function hr(i,s,o,c){s&=~kh,s&=~Kr,i.suspendedLanes|=s,i.pingedLanes&=~s,c&&(i.warmLanes|=s),c=i.expirationTimes;for(var p=s;0<p;){var y=31-Je(p),S=1<<y;c[y]=-1,p&=~S}o!==0&&Bl(i,o,s)}function Bu(){return(Ke&6)===0?(mo(0),!1):!0}function Ah(){if(Le!==null){if(We===0)var i=Le.return;else i=Le,ki=$r=null,Fd(i),Bs=null,Qa=0,i=Le;for(;i!==null;)Y0(i.alternate,i),i=i.return;Le=null}}function Xs(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,UE(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Oi=0,Ah(),rt=i,Le=o=Si(i.current,null),Ue=s,We=0,mn=null,ur=!1,Vs=jr(i,s),_h=!1,Fs=gn=kh=Kr=cr=ht=0,rn=ho=null,Eh=!1,(s&8)!==0&&(s|=s&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=s;0<c;){var p=31-Je(c),y=1<<p;s|=i[p],c&=~y}return Di=s,ru(),o}function gx(i,s){Me=null,R.H=ro,s===Ls||s===du?(s=zy(),We=3):s===Rd?(s=zy(),We=4):We=s===oh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,mn=s,Le===null&&(ht=1,Nu(i,Nn(s,i.current)))}function yx(){var i=hn.current;return i===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?i===Mn:!1}function xx(){var i=R.H;return R.H=ro,i===null?ro:i}function bx(){var i=R.A;return R.A=yE,i}function Hu(){ht=4,ur||(Ue&4194048)!==Ue&&hn.current!==null||(Vs=!0),(cr&134217727)===0&&(Kr&134217727)===0||rt===null||hr(rt,Ue,gn,!1)}function Mh(i,s,o){var c=Ke;Ke|=2;var p=xx(),y=bx();(rt!==i||Ue!==s)&&(Lu=null,Xs(i,s)),s=!1;var S=ht;e:do try{if(We!==0&&Le!==null){var M=Le,$=mn;switch(We){case 8:Ah(),S=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(s=!0);var W=We;if(We=0,mn=null,Gs(i,M,$,W),o&&Vs){S=0;break e}break;default:W=We,We=0,mn=null,Gs(i,M,$,W)}}vE(),S=ht;break}catch(ae){gx(i,ae)}while(!0);return s&&i.shellSuspendCounter++,ki=$r=null,Ke=c,R.H=p,R.A=y,Le===null&&(rt=null,Ue=0,ru()),S}function vE(){for(;Le!==null;)vx(Le)}function wE(i,s){var o=Ke;Ke|=2;var c=xx(),p=bx();rt!==i||Ue!==s?(Lu=null,Ou=Ct()+500,Xs(i,s)):Vs=jr(i,s);e:do try{if(We!==0&&Le!==null){s=Le;var y=mn;t:switch(We){case 1:We=0,mn=null,Gs(i,s,y,1);break;case 2:case 9:if(My(y)){We=0,mn=null,wx(s);break}s=function(){We!==2&&We!==9||rt!==i||(We=7),ii(i)},y.then(s,s);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:My(y)?(We=0,mn=null,wx(s)):(We=0,mn=null,Gs(i,s,y,7));break;case 5:var S=null;switch(Le.tag){case 26:S=Le.memoizedState;case 5:case 27:var M=Le;if(S?ab(S):M.stateNode.complete){We=0,mn=null;var $=M.sibling;if($!==null)Le=$;else{var W=M.return;W!==null?(Le=W,Uu(W)):Le=null}break t}}We=0,mn=null,Gs(i,s,y,5);break;case 6:We=0,mn=null,Gs(i,s,y,6);break;case 8:Ah(),ht=6;break e;default:throw Error(r(462))}}SE();break}catch(ae){gx(i,ae)}while(!0);return ki=$r=null,R.H=c,R.A=p,Ke=o,Le!==null?0:(rt=null,Ue=0,ru(),ht)}function SE(){for(;Le!==null&&!pi();)vx(Le)}function vx(i){var s=V0(i.alternate,i,Di);i.memoizedProps=i.pendingProps,s===null?Uu(i):Le=s}function wx(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=H0(o,s,s.pendingProps,s.type,void 0,Ue);break;case 11:s=H0(o,s,s.pendingProps,s.type.render,s.ref,Ue);break;case 5:Fd(s);default:Y0(o,s),s=Le=by(s,Di),s=V0(o,s,Di)}i.memoizedProps=i.pendingProps,s===null?Uu(i):Le=s}function Gs(i,s,o,c){ki=$r=null,Fd(s),Bs=null,Qa=0;var p=s.return;try{if(cE(i,p,s,o,Ue)){ht=1,Nu(i,Nn(o,i.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;ht=1,Nu(i,Nn(o,i.current)),Le=null;return}s.flags&32768?(qe||c===1?i=!0:Vs||(Ue&536870912)!==0?i=!1:(ur=i=!0,(c===2||c===9||c===3||c===6)&&(c=hn.current,c!==null&&c.tag===13&&(c.flags|=16384))),Sx(s,i)):Uu(s)}function Uu(i){var s=i;do{if((s.flags&32768)!==0){Sx(s,ur);return}i=s.return;var o=hE(s.alternate,s,Di);if(o!==null){Le=o;return}if(s=s.sibling,s!==null){Le=s;return}Le=s=i}while(s!==null);ht===0&&(ht=5)}function Sx(i,s){do{var o=pE(i.alternate,i);if(o!==null){o.flags&=32767,Le=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Le=i;return}Le=i=o}while(i!==null);ht=6,Le=null}function _x(i,s,o,c,p,y,S,M,$){i.cancelPendingCommit=null;do Iu();while(At!==0);if((Ke&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=xd,Gf(i,o,y,S,M,$),i===rt&&(Le=rt=null,Ue=0),Ys=s,dr=i,Oi=o,Nh=y,Ch=p,dx=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,NE(_e,function(){return Tx(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=R.T,R.T=null,p=I.p,I.p=2,S=Ke,Ke|=4;try{mE(i,s,o)}finally{Ke=S,I.p=p,R.T=c}}At=1,kx(),Ex(),Nx()}}function kx(){if(At===1){At=0;var i=dr,s=Ys,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=R.T,R.T=null;var c=I.p;I.p=2;var p=Ke;Ke|=4;try{rx(s,i);var y=$h,S=cy(i.containerInfo),M=y.focusedElem,$=y.selectionRange;if(S!==M&&M&&M.ownerDocument&&uy(M.ownerDocument.documentElement,M)){if($!==null&&hd(M)){var W=$.start,ae=$.end;if(ae===void 0&&(ae=W),"selectionStart"in M)M.selectionStart=W,M.selectionEnd=Math.min(ae,M.value.length);else{var le=M.ownerDocument||document,ee=le&&le.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=M.textContent.length,ke=Math.min($.start,ye),it=$.end===void 0?ke:Math.min($.end,ye);!re.extend&&ke>it&&(S=it,it=ke,ke=S);var Q=ly(M,ke),Y=ly(M,it);if(Q&&Y&&(re.rangeCount!==1||re.anchorNode!==Q.node||re.anchorOffset!==Q.offset||re.focusNode!==Y.node||re.focusOffset!==Y.offset)){var J=le.createRange();J.setStart(Q.node,Q.offset),re.removeAllRanges(),ke>it?(re.addRange(J),re.extend(Y.node,Y.offset)):(J.setEnd(Y.node,Y.offset),re.addRange(J))}}}}for(le=[],re=M;re=re.parentNode;)re.nodeType===1&&le.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<le.length;M++){var oe=le[M];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Ju=!!qh,$h=qh=null}finally{Ke=p,I.p=c,R.T=o}}i.current=s,At=2}}function Ex(){if(At===2){At=0;var i=dr,s=Ys,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=R.T,R.T=null;var c=I.p;I.p=2;var p=Ke;Ke|=4;try{W0(i,s.alternate,s)}finally{Ke=p,I.p=c,R.T=o}}At=3}}function Nx(){if(At===4||At===3){At=0,mi();var i=dr,s=Ys,o=Oi,c=dx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?At=5:(At=0,Ys=dr=null,Cx(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(fr=null),Ra(o),s=s.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(zt,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=R.T,p=I.p,I.p=2,R.T=null;try{for(var y=i.onRecoverableError,S=0;S<c.length;S++){var M=c[S];y(M.value,{componentStack:M.stack})}}finally{R.T=s,I.p=p}}(Oi&3)!==0&&Iu(),ii(i),p=i.pendingLanes,(o&261930)!==0&&(p&42)!==0?i===Th?po++:(po=0,Th=i):po=0,mo(0)}}function Cx(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Ga(s)))}function Iu(){return kx(),Ex(),Nx(),Tx()}function Tx(){if(At!==5)return!1;var i=dr,s=Nh;Nh=0;var o=Ra(Oi),c=R.T,p=I.p;try{I.p=32>o?32:o,R.T=null,o=Ch,Ch=null;var y=dr,S=Oi;if(At=0,Ys=dr=null,Oi=0,(Ke&6)!==0)throw Error(r(331));var M=Ke;if(Ke|=4,ux(y.current),ax(y,y.current,S,o),Ke=M,mo(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(zt,y)}catch{}return!0}finally{I.p=p,R.T=c,Cx(i,s)}}function Ax(i,s,o){s=Nn(o,s),s=ah(i.stateNode,s,2),i=sr(i,s,2),i!==null&&(zr(i,2),ii(i))}function et(i,s,o){if(i.tag===3)Ax(i,i,o);else for(;s!==null;){if(s.tag===3){Ax(s,i,o);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(fr===null||!fr.has(c))){i=Nn(o,i),o=M0(2),c=sr(s,o,2),c!==null&&(j0(o,c,s,i),zr(c,2),ii(c));break}}s=s.return}}function jh(i,s,o){var c=i.pingCache;if(c===null){c=i.pingCache=new xE;var p=new Set;c.set(s,p)}else p=c.get(s),p===void 0&&(p=new Set,c.set(s,p));p.has(o)||(_h=!0,p.add(o),i=_E.bind(null,i,s,o),s.then(i,i))}function _E(i,s,o){var c=i.pingCache;c!==null&&c.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,rt===i&&(Ue&o)===o&&(ht===4||ht===3&&(Ue&62914560)===Ue&&300>Ct()-Du?(Ke&2)===0&&Xs(i,0):kh|=o,Fs===Ue&&(Fs=0)),ii(i)}function Mx(i,s){s===0&&(s=Ll()),i=Ur(i,s),i!==null&&(zr(i,s),ii(i))}function kE(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),Mx(i,o)}function EE(i,s){var o=0;switch(i.tag){case 31:case 13:var c=i.stateNode,p=i.memoizedState;p!==null&&(o=p.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(s),Mx(i,o)}function NE(i,s){return Qt(i,s)}var qu=null,Zs=null,zh=!1,$u=!1,Rh=!1,pr=0;function ii(i){i!==Zs&&i.next===null&&(Zs===null?qu=Zs=i:Zs=Zs.next=i),$u=!0,zh||(zh=!0,TE())}function mo(i,s){if(!Rh&&$u){Rh=!0;do for(var o=!1,c=qu;c!==null;){if(i!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,M=c.pingedLanes;y=(1<<31-Je(42|i)+1)-1,y&=p&~(S&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,Dx(c,y))}else y=Ue,y=ys(c,c===rt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||jr(c,y)||(o=!0,Dx(c,y));c=c.next}while(o);Rh=!1}}function CE(){jx()}function jx(){$u=zh=!1;var i=0;pr!==0&&HE()&&(i=pr);for(var s=Ct(),o=null,c=qu;c!==null;){var p=c.next,y=zx(c,s);y===0?(c.next=null,o===null?qu=p:o.next=p,p===null&&(Zs=o)):(o=c,(i!==0||(y&3)!==0)&&($u=!0)),c=p}At!==0&&At!==5||mo(i),pr!==0&&(pr=0)}function zx(i,s){for(var o=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var S=31-Je(y),M=1<<S,$=p[S];$===-1?((M&o)===0||(M&c)!==0)&&(p[S]=Xf(M,s)):$<=s&&(i.expiredLanes|=M),y&=~M}if(s=rt,o=Ue,o=ys(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,o===0||i===s&&(We===2||We===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&Bn(c),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||jr(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(c!==null&&Bn(c),Ra(o)){case 2:case 8:o=pe;break;case 32:o=_e;break;case 268435456:o=Pe;break;default:o=_e}return c=Rx.bind(null,i),o=Qt(o,c),i.callbackPriority=s,i.callbackNode=o,s}return c!==null&&c!==null&&Bn(c),i.callbackPriority=2,i.callbackNode=null,2}function Rx(i,s){if(At!==0&&At!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Iu()&&i.callbackNode!==o)return null;var c=Ue;return c=ys(i,i===rt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(px(i,c,s),zx(i,Ct()),i.callbackNode!=null&&i.callbackNode===o?Rx.bind(null,i):null)}function Dx(i,s){if(Iu())return null;px(i,s,!0)}function TE(){IE(function(){(Ke&6)!==0?Qt(se,CE):jx()})}function Dh(){if(pr===0){var i=Ds;i===0&&(i=ps,ps<<=1,(ps&261888)===0&&(ps=256)),pr=i}return pr}function Ox(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ql(""+i)}function Lx(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function AE(i,s,o,c,p){if(s==="submit"&&o&&o.stateNode===p){var y=Ox((p[It]||null).action),S=c.submitter;S&&(s=(s=S[It]||null)?Ox(s.formAction):S.getAttribute("formAction"),s!==null&&(y=s,S=null));var M=new eu("action","action",null,c,p);i.push({event:M,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(pr!==0){var $=S?Lx(p,S):new FormData(p);eh(o,{pending:!0,data:$,method:p.method,action:y},null,$)}}else typeof y=="function"&&(M.preventDefault(),$=S?Lx(p,S):new FormData(p),eh(o,{pending:!0,data:$,method:p.method,action:y},y,$))},currentTarget:p}]})}}for(var Oh=0;Oh<yd.length;Oh++){var Lh=yd[Oh],ME=Lh.toLowerCase(),jE=Lh[0].toUpperCase()+Lh.slice(1);In(ME,"on"+jE)}In(hy,"onAnimationEnd"),In(py,"onAnimationIteration"),In(my,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(Xk,"onTransitionRun"),In(Gk,"onTransitionStart"),In(Zk,"onTransitionCancel"),In(gy,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),xi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xi("onBeforeInput",["compositionend","keypress","textInput","paste"]),xi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var go="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(" "),zE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(go));function Bx(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var c=i[o],p=c.event;c=c.listeners;e:{var y=void 0;if(s)for(var S=c.length-1;0<=S;S--){var M=c[S],$=M.instance,W=M.currentTarget;if(M=M.listener,$!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(ae){iu(ae)}p.currentTarget=null,y=$}else for(S=0;S<c.length;S++){if(M=c[S],$=M.instance,W=M.currentTarget,M=M.listener,$!==y&&p.isPropagationStopped())break e;y=M,p.currentTarget=W;try{y(p)}catch(ae){iu(ae)}p.currentTarget=null,y=$}}}}function Be(i,s){var o=s[xs];o===void 0&&(o=s[xs]=new Set);var c=i+"__bubble";o.has(c)||(Hx(s,i,2,!1),o.add(c))}function Bh(i,s,o){var c=0;s&&(c|=4),Hx(o,i,c,s)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Hh(i){if(!i[Pu]){i[Pu]=!0,Vl.forEach(function(o){o!=="selectionchange"&&(zE.has(o)||Bh(o,!1,i),Bh(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Pu]||(s[Pu]=!0,Bh("selectionchange",!1,s))}}function Hx(i,s,o,c){switch(hb(s)){case 2:var p=aN;break;case 8:p=oN;break;default:p=Wh}o=p.bind(null,s,o,i),p=void 0,!rd||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(p=!0),c?p!==void 0?i.addEventListener(s,o,{capture:!0,passive:p}):i.addEventListener(s,o,!0):p!==void 0?i.addEventListener(s,o,{passive:p}):i.addEventListener(s,o,!1)}function Uh(i,s,o,c,p){var y=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var M=c.stateNode.containerInfo;if(M===p)break;if(S===4)for(S=c.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;M!==null;){if(S=Xi(M),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){c=y=S;continue e}M=M.parentNode}}c=c.return}Pg(function(){var W=y,ae=nd(o),le=[];e:{var ee=yy.get(i);if(ee!==void 0){var re=eu,ye=i;switch(i){case"keypress":if(Jl(o)===0)break e;case"keydown":case"keyup":re=Ek;break;case"focusin":ye="focus",re=ld;break;case"focusout":ye="blur",re=ld;break;case"beforeblur":case"afterblur":re=ld;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=hk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=Tk;break;case hy:case py:case my:re=gk;break;case gy:re=Mk;break;case"scroll":case"scrollend":re=fk;break;case"wheel":re=zk;break;case"copy":case"cut":case"paste":re=xk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Gg;break;case"toggle":case"beforetoggle":re=Dk}var ke=(s&4)!==0,it=!ke&&(i==="scroll"||i==="scrollend"),Q=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var Y=W,J;Y!==null;){var oe=Y;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||Q===null||(oe=Ba(Y,Q),oe!=null&&ke.push(yo(Y,oe,J))),it)break;Y=Y.return}0<ke.length&&(ee=new re(ee,ye,null,o,ae),le.push({event:ee,listeners:ke}))}}if((s&7)===0){e:{if(ee=i==="mouseover"||i==="pointerover",re=i==="mouseout"||i==="pointerout",ee&&o!==td&&(ye=o.relatedTarget||o.fromElement)&&(Xi(ye)||ye[yi]))break e;if((re||ee)&&(ee=ae.window===ae?ae:(ee=ae.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(ye=o.relatedTarget||o.toElement,re=W,ye=ye?Xi(ye):null,ye!==null&&(it=l(ye),ke=ye.tag,ye!==it||ke!==5&&ke!==27&&ke!==6)&&(ye=null)):(re=null,ye=W),re!==ye)){if(ke=Yg,oe="onMouseLeave",Q="onMouseEnter",Y="mouse",(i==="pointerout"||i==="pointerover")&&(ke=Gg,oe="onPointerLeave",Q="onPointerEnter",Y="pointer"),it=re==null?ee:Zi(re),J=ye==null?ee:Zi(ye),ee=new ke(oe,Y+"leave",re,o,ae),ee.target=it,ee.relatedTarget=J,oe=null,Xi(ae)===W&&(ke=new ke(Q,Y+"enter",ye,o,ae),ke.target=J,ke.relatedTarget=it,oe=ke),it=oe,re&&ye)t:{for(ke=RE,Q=re,Y=ye,J=0,oe=Q;oe;oe=ke(oe))J++;oe=0;for(var ve=Y;ve;ve=ke(ve))oe++;for(;0<J-oe;)Q=ke(Q),J--;for(;0<oe-J;)Y=ke(Y),oe--;for(;J--;){if(Q===Y||Y!==null&&Q===Y.alternate){ke=Q;break t}Q=ke(Q),Y=ke(Y)}ke=null}else ke=null;re!==null&&Ux(le,ee,re,ke,!1),ye!==null&&it!==null&&Ux(le,it,ye,ke,!0)}}e:{if(ee=W?Zi(W):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var Ge=ny;else if(ey(ee))if(iy)Ge=Vk;else{Ge=$k;var xe=qk}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&ed(W.elementType)&&(Ge=ny):Ge=Pk;if(Ge&&(Ge=Ge(i,W))){ty(le,Ge,o,ae);break e}xe&&xe(i,ee,W),i==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&La(ee,"number",ee.value)}switch(xe=W?Zi(W):window,i){case"focusin":(ey(xe)||xe.contentEditable==="true")&&(Ns=xe,pd=W,Fa=null);break;case"focusout":Fa=pd=Ns=null;break;case"mousedown":md=!0;break;case"contextmenu":case"mouseup":case"dragend":md=!1,fy(le,o,ae);break;case"selectionchange":if(Yk)break;case"keydown":case"keyup":fy(le,o,ae)}var je;if(cd)e:{switch(i){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Es?Jg(i,o)&&(Ie="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(Ie="onCompositionStart");Ie&&(Zg&&o.locale!=="ko"&&(Es||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Es&&(je=Vg()):(Ji=ae,sd="value"in Ji?Ji.value:Ji.textContent,Es=!0)),xe=Vu(W,Ie),0<xe.length&&(Ie=new Xg(Ie,i,null,o,ae),le.push({event:Ie,listeners:xe}),je?Ie.data=je:(je=Wg(o),je!==null&&(Ie.data=je)))),(je=Lk?Bk(i,o):Hk(i,o))&&(Ie=Vu(W,"onBeforeInput"),0<Ie.length&&(xe=new Xg("onBeforeInput","beforeinput",null,o,ae),le.push({event:xe,listeners:Ie}),xe.data=je)),AE(le,i,W,o,ae)}Bx(le,s)})}function yo(i,s,o){return{instance:i,listener:s,currentTarget:o}}function Vu(i,s){for(var o=s+"Capture",c=[];i!==null;){var p=i,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ba(i,o),p!=null&&c.unshift(yo(i,p,y)),p=Ba(i,s),p!=null&&c.push(yo(i,p,y))),i.tag===3)return c;i=i.return}return[]}function RE(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Ux(i,s,o,c,p){for(var y=s._reactName,S=[];o!==null&&o!==c;){var M=o,$=M.alternate,W=M.stateNode;if(M=M.tag,$!==null&&$===c)break;M!==5&&M!==26&&M!==27||W===null||($=W,p?(W=Ba(o,y),W!=null&&S.unshift(yo(o,W,$))):p||(W=Ba(o,y),W!=null&&S.push(yo(o,W,$)))),o=o.return}S.length!==0&&i.push({event:s,listeners:S})}var DE=/\r\n?/g,OE=/\u0000|\uFFFD/g;function Ix(i){return(typeof i=="string"?i:""+i).replace(DE,`
9
- `).replace(OE,"")}function qx(i,s){return s=Ix(s),Ix(i)===s}function nt(i,s,o,c,p,y){switch(o){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||Ss(i,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&Ss(i,""+c);break;case"className":vs(i,"class",c);break;case"tabIndex":vs(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":vs(i,o,c);break;case"style":qg(i,c,y);break;case"data":if(s!=="object"){vs(i,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(o);break}c=Ql(""+c),i.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(o,"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 y=="function"&&(o==="formAction"?(s!=="input"&&nt(i,s,"name",p.name,p,null),nt(i,s,"formEncType",p.formEncType,p,null),nt(i,s,"formMethod",p.formMethod,p,null),nt(i,s,"formTarget",p.formTarget,p,null)):(nt(i,s,"encType",p.encType,p,null),nt(i,s,"method",p.method,p,null),nt(i,s,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(o);break}c=Ql(""+c),i.setAttribute(o,c);break;case"onClick":c!=null&&(i.onclick=vi);break;case"onScroll":c!=null&&Be("scroll",i);break;case"onScrollEnd":c!=null&&Be("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){i.removeAttribute("xlink:href");break}o=Ql(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,""+c):i.removeAttribute(o);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":c&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":c===!0?i.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(o,c):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(o,c):i.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(o):i.setAttribute(o,c);break;case"popover":Be("beforetoggle",i),Be("toggle",i),bs(i,"popover",c);break;case"xlinkActuate":Un(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Un(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Un(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Un(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Un(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Un(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Un(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Un(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Un(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":bs(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=uk.get(o)||o,bs(i,o,c))}}function Ih(i,s,o,c,p,y){switch(o){case"style":qg(i,c,y);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(o=c.__html,o!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof c=="string"?Ss(i,c):(typeof c=="number"||typeof c=="bigint")&&Ss(i,""+c);break;case"onScroll":c!=null&&Be("scroll",i);break;case"onScrollEnd":c!=null&&Be("scrollend",i);break;case"onClick":c!=null&&(i.onclick=vi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fl.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),s=o.slice(2,p?o.length-7:void 0),y=i[It]||null,y=y!=null?y[o]:null,typeof y=="function"&&i.removeEventListener(s,y,p),typeof c=="function")){typeof y!="function"&&y!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,c,p);break e}o in i?i[o]=c:c===!0?i.setAttribute(o,""):bs(i,o,c)}}}function Lt(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",i),Be("load",i);var c=!1,p=!1,y;for(y in o)if(o.hasOwnProperty(y)){var S=o[y];if(S!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:nt(i,s,y,S,o,null)}}p&&nt(i,s,"srcSet",o.srcSet,o,null),c&&nt(i,s,"src",o.src,o,null);return;case"input":Be("invalid",i);var M=y=S=p=null,$=null,W=null;for(c in o)if(o.hasOwnProperty(c)){var ae=o[c];if(ae!=null)switch(c){case"name":p=ae;break;case"type":S=ae;break;case"checked":$=ae;break;case"defaultChecked":W=ae;break;case"value":y=ae;break;case"defaultValue":M=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:nt(i,s,c,ae,o,null)}}Zl(i,y,M,$,W,S,p,!1);return;case"select":Be("invalid",i),c=S=y=null;for(p in o)if(o.hasOwnProperty(p)&&(M=o[p],M!=null))switch(p){case"value":y=M;break;case"defaultValue":S=M;break;case"multiple":c=M;default:nt(i,s,p,M,o,null)}s=y,o=S,i.multiple=!!c,s!=null?bi(i,!!c,s,!1):o!=null&&bi(i,!!c,o,!0);return;case"textarea":Be("invalid",i),y=p=c=null;for(S in o)if(o.hasOwnProperty(S)&&(M=o[S],M!=null))switch(S){case"value":c=M;break;case"defaultValue":p=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:nt(i,s,S,M,o,null)}Ug(i,c,p,y);return;case"option":for($ in o)o.hasOwnProperty($)&&(c=o[$],c!=null)&&($==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":nt(i,s,$,c,o,null));return;case"dialog":Be("beforetoggle",i),Be("toggle",i),Be("cancel",i),Be("close",i);break;case"iframe":case"object":Be("load",i);break;case"video":case"audio":for(c=0;c<go.length;c++)Be(go[c],i);break;case"image":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"embed":case"source":case"link":Be("error",i),Be("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(W in o)if(o.hasOwnProperty(W)&&(c=o[W],c!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:nt(i,s,W,c,o,null)}return;default:if(ed(s)){for(ae in o)o.hasOwnProperty(ae)&&(c=o[ae],c!==void 0&&Ih(i,s,ae,c,o,void 0));return}}for(M in o)o.hasOwnProperty(M)&&(c=o[M],c!=null&&nt(i,s,M,c,o,null))}function LE(i,s,o,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,S=null,M=null,$=null,W=null,ae=null;for(re in o){var le=o[re];if(o.hasOwnProperty(re)&&le!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":$=le;default:c.hasOwnProperty(re)||nt(i,s,re,null,c,le)}}for(var ee in c){var re=c[ee];if(le=o[ee],c.hasOwnProperty(ee)&&(re!=null||le!=null))switch(ee){case"type":y=re;break;case"name":p=re;break;case"checked":W=re;break;case"defaultChecked":ae=re;break;case"value":S=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,s));break;default:re!==le&&nt(i,s,ee,re,c,le)}}Or(i,S,M,$,W,ae,y,p);return;case"select":re=S=M=ee=null;for(y in o)if($=o[y],o.hasOwnProperty(y)&&$!=null)switch(y){case"value":break;case"multiple":re=$;default:c.hasOwnProperty(y)||nt(i,s,y,null,c,$)}for(p in c)if(y=c[p],$=o[p],c.hasOwnProperty(p)&&(y!=null||$!=null))switch(p){case"value":ee=y;break;case"defaultValue":M=y;break;case"multiple":S=y;default:y!==$&&nt(i,s,p,y,c,$)}s=M,o=S,c=re,ee!=null?bi(i,!!o,ee,!1):!!c!=!!o&&(s!=null?bi(i,!!o,s,!0):bi(i,!!o,o?[]:"",!1));return;case"textarea":re=ee=null;for(M in o)if(p=o[M],o.hasOwnProperty(M)&&p!=null&&!c.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:nt(i,s,M,null,c,p)}for(S in c)if(p=c[S],y=o[S],c.hasOwnProperty(S)&&(p!=null||y!=null))switch(S){case"value":ee=p;break;case"defaultValue":re=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==y&&nt(i,s,S,p,c,y)}Hg(i,ee,re);return;case"option":for(var ye in o)ee=o[ye],o.hasOwnProperty(ye)&&ee!=null&&!c.hasOwnProperty(ye)&&(ye==="selected"?i.selected=!1:nt(i,s,ye,null,c,ee));for($ in c)ee=c[$],re=o[$],c.hasOwnProperty($)&&ee!==re&&(ee!=null||re!=null)&&($==="selected"?i.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":nt(i,s,$,ee,c,re));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 ke in o)ee=o[ke],o.hasOwnProperty(ke)&&ee!=null&&!c.hasOwnProperty(ke)&&nt(i,s,ke,null,c,ee);for(W in c)if(ee=c[W],re=o[W],c.hasOwnProperty(W)&&ee!==re&&(ee!=null||re!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,s));break;default:nt(i,s,W,ee,c,re)}return;default:if(ed(s)){for(var it in o)ee=o[it],o.hasOwnProperty(it)&&ee!==void 0&&!c.hasOwnProperty(it)&&Ih(i,s,it,void 0,c,ee);for(ae in c)ee=c[ae],re=o[ae],!c.hasOwnProperty(ae)||ee===re||ee===void 0&&re===void 0||Ih(i,s,ae,ee,c,re);return}}for(var Q in o)ee=o[Q],o.hasOwnProperty(Q)&&ee!=null&&!c.hasOwnProperty(Q)&&nt(i,s,Q,null,c,ee);for(le in c)ee=c[le],re=o[le],!c.hasOwnProperty(le)||ee===re||ee==null&&re==null||nt(i,s,le,ee,c,re)}function $x(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BE(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var p=o[c],y=p.transferSize,S=p.initiatorType,M=p.duration;if(y&&M&&$x(S)){for(S=0,M=p.responseEnd,c+=1;c<o.length;c++){var $=o[c],W=$.startTime;if(W>M)break;var ae=$.transferSize,le=$.initiatorType;ae&&$x(le)&&($=$.responseEnd,S+=ae*($<M?1:(M-W)/($-W)))}if(--c,s+=8*(y+S)/(p.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var qh=null,$h=null;function Fu(i){return i.nodeType===9?i:i.ownerDocument}function Px(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Vx(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Ph(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Vh=null;function HE(){var i=window.event;return i&&i.type==="popstate"?i===Vh?!1:(Vh=i,!0):(Vh=null,!1)}var Fx=typeof setTimeout=="function"?setTimeout:void 0,UE=typeof clearTimeout=="function"?clearTimeout:void 0,Yx=typeof Promise=="function"?Promise:void 0,IE=typeof queueMicrotask=="function"?queueMicrotask:typeof Yx<"u"?function(i){return Yx.resolve(null).then(i).catch(qE)}:Fx;function qE(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Xx(i,s){var o=s,c=0;do{var p=o.nextSibling;if(i.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(c===0){i.removeChild(p),Ws(s);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")xo(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,xo(o);for(var y=o.firstChild;y;){var S=y.nextSibling,M=y.nodeName;y[Rr]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=S}}else o==="body"&&xo(i.ownerDocument.body);o=p}while(o);Ws(s)}function Gx(i,s){var o=i;i=0;do{var c=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=c}while(o)}function Fh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Fh(o),Da(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function $E(i,s,o,c){for(;i.nodeType===1;){var p=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[Rr])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=jn(i.nextSibling),i===null)break}return null}function PE(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=jn(i.nextSibling),i===null))return null;return i}function Zx(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=jn(i.nextSibling),i===null))return null;return i}function Yh(i){return i.data==="$?"||i.data==="$~"}function Xh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function VE(i,s){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||o.readyState!=="loading")s();else{var c=function(){s(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function jn(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Gh=null;function Qx(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return jn(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function Kx(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return i;s--}else o!=="/$"&&o!=="/&"||s++}i=i.previousSibling}return null}function Jx(i,s,o){switch(s=Fu(o),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function xo(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Da(i)}var zn=new Map,Wx=new Set;function Yu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Li=I.d;I.d={f:FE,r:YE,D:XE,C:GE,L:ZE,m:QE,X:JE,S:KE,M:WE};function FE(){var i=Li.f(),s=Bu();return i||s}function YE(i){var s=Gi(i);s!==null&&s.tag===5&&s.type==="form"?g0(s):Li.r(i)}var Qs=typeof document>"u"?null:document;function eb(i,s,o){var c=Qs;if(c&&typeof s=="string"&&s){var p=Jt(s);p='link[rel="'+i+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Wx.has(p)||(Wx.add(p),i={rel:i,crossOrigin:o,href:s},c.querySelector(p)===null&&(s=c.createElement("link"),Lt(s,"link",i),xt(s),c.head.appendChild(s)))}}function XE(i){Li.D(i),eb("dns-prefetch",i,null)}function GE(i,s){Li.C(i,s),eb("preconnect",i,s)}function ZE(i,s,o){Li.L(i,s,o);var c=Qs;if(c&&i&&s){var p='link[rel="preload"][as="'+Jt(s)+'"]';s==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Jt(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Jt(o.imageSizes)+'"]')):p+='[href="'+Jt(i)+'"]';var y=p;switch(s){case"style":y=Ks(i);break;case"script":y=Js(i)}zn.has(y)||(i=m({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),zn.set(y,i),c.querySelector(p)!==null||s==="style"&&c.querySelector(bo(y))||s==="script"&&c.querySelector(vo(y))||(s=c.createElement("link"),Lt(s,"link",i),xt(s),c.head.appendChild(s)))}}function QE(i,s){Li.m(i,s);var o=Qs;if(o&&i){var c=s&&typeof s.as=="string"?s.as:"script",p='link[rel="modulepreload"][as="'+Jt(c)+'"][href="'+Jt(i)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Js(i)}if(!zn.has(y)&&(i=m({rel:"modulepreload",href:i},s),zn.set(y,i),o.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(vo(y)))return}c=o.createElement("link"),Lt(c,"link",i),xt(c),o.head.appendChild(c)}}}function KE(i,s,o){Li.S(i,s,o);var c=Qs;if(c&&i){var p=Qi(c).hoistableStyles,y=Ks(i);s=s||"default";var S=p.get(y);if(!S){var M={loading:0,preload:null};if(S=c.querySelector(bo(y)))M.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},o),(o=zn.get(y))&&Zh(i,o);var $=S=c.createElement("link");xt($),Lt($,"link",i),$._p=new Promise(function(W,ae){$.onload=W,$.onerror=ae}),$.addEventListener("load",function(){M.loading|=1}),$.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Xu(S,s,c)}S={type:"stylesheet",instance:S,count:1,state:M},p.set(y,S)}}}function JE(i,s){Li.X(i,s);var o=Qs;if(o&&i){var c=Qi(o).hoistableScripts,p=Js(i),y=c.get(p);y||(y=o.querySelector(vo(p)),y||(i=m({src:i,async:!0},s),(s=zn.get(p))&&Qh(i,s),y=o.createElement("script"),xt(y),Lt(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function WE(i,s){Li.M(i,s);var o=Qs;if(o&&i){var c=Qi(o).hoistableScripts,p=Js(i),y=c.get(p);y||(y=o.querySelector(vo(p)),y||(i=m({src:i,async:!0,type:"module"},s),(s=zn.get(p))&&Qh(i,s),y=o.createElement("script"),xt(y),Lt(y,"link",i),o.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function tb(i,s,o,c){var p=(p=fe.current)?Yu(p):null;if(!p)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=Ks(o.href),o=Qi(p).hoistableStyles,c=o.get(s),c||(c={type:"style",instance:null,count:0,state:null},o.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=Ks(o.href);var y=Qi(p).hoistableStyles,S=y.get(i);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,S),(y=p.querySelector(bo(i)))&&!y._p&&(S.instance=y,S.state.loading=5),zn.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},zn.set(i,o),y||eN(p,i,o,S.state))),s&&c===null)throw Error(r(528,""));return S}if(s&&c!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Js(o),o=Qi(p).hoistableScripts,c=o.get(s),c||(c={type:"script",instance:null,count:0,state:null},o.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ks(i){return'href="'+Jt(i)+'"'}function bo(i){return'link[rel="stylesheet"]['+i+"]"}function nb(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function eN(i,s,o,c){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=i.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),Lt(s,"link",o),xt(s),i.head.appendChild(s))}function Js(i){return'[src="'+Jt(i)+'"]'}function vo(i){return"script[async]"+i}function ib(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var c=i.querySelector('style[data-href~="'+Jt(o.href)+'"]');if(c)return s.instance=c,xt(c),c;var p=m({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),xt(c),Lt(c,"style",p),Xu(c,o.precedence,i),s.instance=c;case"stylesheet":p=Ks(o.href);var y=i.querySelector(bo(p));if(y)return s.state.loading|=4,s.instance=y,xt(y),y;c=nb(o),(p=zn.get(p))&&Zh(c,p),y=(i.ownerDocument||i).createElement("link"),xt(y);var S=y;return S._p=new Promise(function(M,$){S.onload=M,S.onerror=$}),Lt(y,"link",c),s.state.loading|=4,Xu(y,o.precedence,i),s.instance=y;case"script":return y=Js(o.src),(p=i.querySelector(vo(y)))?(s.instance=p,xt(p),p):(c=o,(p=zn.get(y))&&(c=m({},o),Qh(c,p)),i=i.ownerDocument||i,p=i.createElement("script"),xt(p),Lt(p,"link",c),i.head.appendChild(p),s.instance=p);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,Xu(c,o.precedence,i));return s.instance}function Xu(i,s,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,S=0;S<c.length;S++){var M=c[S];if(M.dataset.precedence===s)y=M;else if(y!==p)break}y?y.parentNode.insertBefore(i,y.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function Zh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Qh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Gu=null;function rb(i,s,o){if(Gu===null){var c=new Map,p=Gu=new Map;p.set(o,c)}else p=Gu,c=p.get(o),c||(c=new Map,p.set(o,c));if(c.has(i))return c;for(c.set(i,null),o=o.getElementsByTagName(i),p=0;p<o.length;p++){var y=o[p];if(!(y[Rr]||y[Tt]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var S=y.getAttribute(s)||"";S=i+S;var M=c.get(S);M?M.push(y):c.set(S,[y])}}return c}function sb(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function tN(i,s,o){if(o===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function ab(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function nN(i,s,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Ks(c.href),y=s.querySelector(bo(p));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Zu.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=y,xt(y);return}y=s.ownerDocument||s,c=nb(c),(p=zn.get(p))&&Zh(c,p),y=y.createElement("link"),xt(y);var S=y;S._p=new Promise(function(M,$){S.onload=M,S.onerror=$}),Lt(y,"link",c),o.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Zu.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var Kh=0;function iN(i,s){return i.stylesheets&&i.count===0&&Ku(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var c=setTimeout(function(){if(i.stylesheets&&Ku(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Kh===0&&(Kh=62500*BE());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Ku(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Kh?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Zu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Qu=null;function Ku(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Qu=new Map,s.forEach(rN,i),Qu=null,Zu.call(i))}function rN(i,s){if(!(s.state.loading&4)){var o=Qu.get(i);if(o)var c=o.get(null);else{o=new Map,Qu.set(i,o);for(var p=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var S=p[y];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),c=S)}c&&o.set(null,c)}p=s.instance,S=p.getAttribute("data-precedence"),y=o.get(S)||c,y===c&&o.set(null,p),o.set(S,p),this.count++,c=Zu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),s.state.loading|=4}}var wo={$$typeof:_,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function sN(i,s,o,c,p,y,S,M,$){this.tag=1,this.containerInfo=i,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=ja(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ja(0),this.hiddenUpdates=ja(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function ob(i,s,o,c,p,y,S,M,$,W,ae,le){return i=new sN(i,s,o,S,$,W,ae,le,M),s=1,y===!0&&(s|=24),y=dn(3,null,null,s),i.current=y,y.stateNode=i,s=Md(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:c,isDehydrated:o,cache:s},Dd(y),i}function lb(i){return i?(i=As,i):As}function ub(i,s,o,c,p,y){p=lb(p),c.context===null?c.context=p:c.pendingContext=p,c=rr(s),c.payload={element:o},y=y===void 0?null:y,y!==null&&(c.callback=y),o=sr(i,c,s),o!==null&&(sn(o,i,s),Ja(o,i,s))}function cb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Jh(i,s){cb(i,s),(i=i.alternate)&&cb(i,s)}function fb(i){if(i.tag===13||i.tag===31){var s=Ur(i,67108864);s!==null&&sn(s,i,67108864),Jh(i,67108864)}}function db(i){if(i.tag===13||i.tag===31){var s=yn();s=za(s);var o=Ur(i,s);o!==null&&sn(o,i,s),Jh(i,s)}}var Ju=!0;function aN(i,s,o,c){var p=R.T;R.T=null;var y=I.p;try{I.p=2,Wh(i,s,o,c)}finally{I.p=y,R.T=p}}function oN(i,s,o,c){var p=R.T;R.T=null;var y=I.p;try{I.p=8,Wh(i,s,o,c)}finally{I.p=y,R.T=p}}function Wh(i,s,o,c){if(Ju){var p=ep(c);if(p===null)Uh(i,s,c,Wu,o),pb(i,c);else if(uN(p,i,s,o,c))c.stopPropagation();else if(pb(i,c),s&4&&-1<lN.indexOf(i)){for(;p!==null;){var y=Gi(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var S=gi(y.pendingLanes);if(S!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var $=1<<31-Je(S);M.entanglements[1]|=$,S&=~$}ii(y),(Ke&6)===0&&(Ou=Ct()+500,mo(0))}}break;case 31:case 13:M=Ur(y,2),M!==null&&sn(M,y,2),Bu(),Jh(y,2)}if(y=ep(c),y===null&&Uh(i,s,c,Wu,o),y===p)break;p=y}p!==null&&c.stopPropagation()}else Uh(i,s,c,null,o)}}function ep(i){return i=nd(i),tp(i)}var Wu=null;function tp(i){if(Wu=null,i=Xi(i),i!==null){var s=l(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=u(s),i!==null)return i;i=null}else if(o===31){if(i=f(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Wu=i,null}function hb(i){switch(i){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(Yi()){case se:return 2;case pe:return 8;case _e:case De:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var np=!1,gr=null,yr=null,xr=null,So=new Map,_o=new Map,br=[],lN="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 pb(i,s){switch(i){case"focusin":case"focusout":gr=null;break;case"dragenter":case"dragleave":yr=null;break;case"mouseover":case"mouseout":xr=null;break;case"pointerover":case"pointerout":So.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(s.pointerId)}}function ko(i,s,o,c,p,y){return i===null||i.nativeEvent!==y?(i={blockedOn:s,domEventName:o,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},s!==null&&(s=Gi(s),s!==null&&fb(s)),i):(i.eventSystemFlags|=c,s=i.targetContainers,p!==null&&s.indexOf(p)===-1&&s.push(p),i)}function uN(i,s,o,c,p){switch(s){case"focusin":return gr=ko(gr,i,s,o,c,p),!0;case"dragenter":return yr=ko(yr,i,s,o,c,p),!0;case"mouseover":return xr=ko(xr,i,s,o,c,p),!0;case"pointerover":var y=p.pointerId;return So.set(y,ko(So.get(y)||null,i,s,o,c,p)),!0;case"gotpointercapture":return y=p.pointerId,_o.set(y,ko(_o.get(y)||null,i,s,o,c,p)),!0}return!1}function mb(i){var s=Xi(i.target);if(s!==null){var o=l(s);if(o!==null){if(s=o.tag,s===13){if(s=u(o),s!==null){i.blockedOn=s,ql(i.priority,function(){db(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,ql(i.priority,function(){db(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ec(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=ep(i.nativeEvent);if(o===null){o=i.nativeEvent;var c=new o.constructor(o.type,o);td=c,o.target.dispatchEvent(c),td=null}else return s=Gi(o),s!==null&&fb(s),i.blockedOn=o,!1;s.shift()}return!0}function gb(i,s,o){ec(i)&&o.delete(s)}function cN(){np=!1,gr!==null&&ec(gr)&&(gr=null),yr!==null&&ec(yr)&&(yr=null),xr!==null&&ec(xr)&&(xr=null),So.forEach(gb),_o.forEach(gb)}function tc(i,s){i.blockedOn===s&&(i.blockedOn=null,np||(np=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,cN)))}var nc=null;function yb(i){nc!==i&&(nc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){nc===i&&(nc=null);for(var s=0;s<i.length;s+=3){var o=i[s],c=i[s+1],p=i[s+2];if(typeof c!="function"){if(tp(c||o)===null)continue;break}var y=Gi(o);y!==null&&(i.splice(s,3),s-=3,eh(y,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function Ws(i){function s($){return tc($,i)}gr!==null&&tc(gr,i),yr!==null&&tc(yr,i),xr!==null&&tc(xr,i),So.forEach(s),_o.forEach(s);for(var o=0;o<br.length;o++){var c=br[o];c.blockedOn===i&&(c.blockedOn=null)}for(;0<br.length&&(o=br[0],o.blockedOn===null);)mb(o),o.blockedOn===null&&br.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var p=o[c],y=o[c+1],S=p[It]||null;if(typeof y=="function")S||yb(o);else if(S){var M=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[It]||null)M=S.formAction;else if(tp(p)!==null)continue}else M=S.action;typeof M=="function"?o[c+1]=M:(o.splice(c,3),c-=3),yb(o)}}}function xb(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function s(){p!==null&&(p(),p=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),p!==null&&(p(),p=null)}}}function ip(i){this._internalRoot=i}ic.prototype.render=ip.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,c=yn();ub(o,c,i,s,null,null)},ic.prototype.unmount=ip.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;ub(i.current,2,null,i,null,null),Bu(),s[yi]=null}};function ic(i){this._internalRoot=i}ic.prototype.unstable_scheduleHydration=function(i){if(i){var s=Il();i={blockedOn:null,target:i,priority:s};for(var o=0;o<br.length&&s!==0&&s<br[o].priority;o++);br.splice(o,0,i),o===0&&mb(i)}};var bb=t.version;if(bb!=="19.2.3")throw Error(r(527,bb,"19.2.3"));I.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(s),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var fN={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{zt=rc.inject(fN),mt=rc}catch{}}return No.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,c="",p=N0,y=C0,S=T0;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(p=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(S=s.onRecoverableError)),s=ob(i,1,!1,null,null,o,c,null,p,y,S,xb),i[yi]=s.current,Hh(i),new ip(s)},No.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var c=!1,p="",y=N0,S=C0,M=T0,$=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(y=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(M=o.onRecoverableError),o.formState!==void 0&&($=o.formState)),s=ob(i,1,!0,s,o??null,c,p,$,y,S,M,xb),s.context=lb(null),o=s.current,c=yn(),c=za(c),p=rr(c),p.callback=null,sr(o,p,c),o=c,s.current.lanes=o,zr(s,o),ii(s),i[yi]=s.current,Hh(i),new ic(s)},No.version="19.2.3",No}var Ab;function vN(){if(Ab)return ap.exports;Ab=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(),ap.exports=bN(),ap.exports}var wN=vN();function Et(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Et(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var SN={value:()=>{}};function yf(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Bc(n)}function Bc(e){this._=e}function _N(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Bc.prototype=yf.prototype={constructor:Bc,on:function(e,t){var n=this._,r=_N(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l<u;)if((a=(e=r[l]).type)&&(a=kN(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<u;)if(a=(e=r[l]).type)n[a]=Mb(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Mb(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Bc(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,l;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,a=l.length;r<a;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,l=r.length;a<l;++a)r[a].value.apply(t,n)}};function kN(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function Mb(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=SN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Jp="http://www.w3.org/1999/xhtml";const jb={svg:"http://www.w3.org/2000/svg",xhtml:Jp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xf(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),jb.hasOwnProperty(t)?{space:jb[t],local:e}:e}function EN(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Jp&&t.documentElement.namespaceURI===Jp?t.createElement(e):t.createElementNS(n,e)}}function NN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function uw(e){var t=xf(e);return(t.local?NN:EN)(t)}function CN(){}function qm(e){return e==null?CN:function(){return this.querySelector(e)}}function TN(e){typeof e!="function"&&(e=qm(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,f=r[a]=new Array(u),h,d,g=0;g<u;++g)(h=l[g])&&(d=e.call(h,h.__data__,g,l))&&("__data__"in h&&(d.__data__=h.__data__),f[g]=d);return new kn(r,this._parents)}function AN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function MN(){return[]}function cw(e){return e==null?MN:function(){return this.querySelectorAll(e)}}function jN(e){return function(){return AN(e.apply(this,arguments))}}function zN(e){typeof e=="function"?e=jN(e):e=cw(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&(r.push(e.call(h,h.__data__,d,u)),a.push(h));return new kn(r,a)}function fw(e){return function(){return this.matches(e)}}function dw(e){return function(t){return t.matches(e)}}var RN=Array.prototype.find;function DN(e){return function(){return RN.call(this.children,e)}}function ON(){return this.firstElementChild}function LN(e){return this.select(e==null?ON:DN(typeof e=="function"?e:dw(e)))}var BN=Array.prototype.filter;function HN(){return Array.from(this.children)}function UN(e){return function(){return BN.call(this.children,e)}}function IN(e){return this.selectAll(e==null?HN:UN(typeof e=="function"?e:dw(e)))}function qN(e){typeof e!="function"&&(e=fw(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,f=r[a]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new kn(r,this._parents)}function hw(e){return new Array(e.length)}function $N(){return new kn(this._enter||this._groups.map(hw),this._parents)}function Qc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Qc.prototype={constructor:Qc,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 PN(e){return function(){return e}}function VN(e,t,n,r,a,l){for(var u=0,f,h=t.length,d=l.length;u<d;++u)(f=t[u])?(f.__data__=l[u],r[u]=f):n[u]=new Qc(e,l[u]);for(;u<h;++u)(f=t[u])&&(a[u]=f)}function FN(e,t,n,r,a,l,u){var f,h,d=new Map,g=t.length,m=l.length,x=new Array(g),v;for(f=0;f<g;++f)(h=t[f])&&(x[f]=v=u.call(h,h.__data__,f,t)+"",d.has(v)?a[f]=h:d.set(v,h));for(f=0;f<m;++f)v=u.call(e,l[f],f,l)+"",(h=d.get(v))?(r[f]=h,h.__data__=l[f],d.delete(v)):n[f]=new Qc(e,l[f]);for(f=0;f<g;++f)(h=t[f])&&d.get(x[f])===h&&(a[f]=h)}function YN(e){return e.__data__}function XN(e,t){if(!arguments.length)return Array.from(this,YN);var n=t?FN:VN,r=this._parents,a=this._groups;typeof e!="function"&&(e=PN(e));for(var l=a.length,u=new Array(l),f=new Array(l),h=new Array(l),d=0;d<l;++d){var g=r[d],m=a[d],x=m.length,v=GN(e.call(g,g&&g.__data__,d,r)),w=v.length,k=f[d]=new Array(w),N=u[d]=new Array(w),E=h[d]=new Array(x);n(g,m,k,N,E,v,t);for(var A=0,_=0,C,B;A<w;++A)if(C=k[A]){for(A>=_&&(_=A+1);!(B=N[_])&&++_<w;);C._next=B||null}}return u=new kn(u,r),u._enter=f,u._exit=h,u}function GN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZN(){return new kn(this._exit||this._groups.map(hw),this._parents)}function QN(e,t,n){var r=this.enter(),a=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?l.remove():n(l),r&&a?r.merge(a).order():a}function KN(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,l=r.length,u=Math.min(a,l),f=new Array(a),h=0;h<u;++h)for(var d=n[h],g=r[h],m=d.length,x=f[h]=new Array(m),v,w=0;w<m;++w)(v=d[w]||g[w])&&(x[w]=v);for(;h<a;++h)f[h]=n[h];return new kn(f,this._parents)}function JN(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,l=r[a],u;--a>=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function WN(e){e||(e=eC);function t(m,x){return m&&x?e(m.__data__,x.__data__):!m-!x}for(var n=this._groups,r=n.length,a=new Array(r),l=0;l<r;++l){for(var u=n[l],f=u.length,h=a[l]=new Array(f),d,g=0;g<f;++g)(d=u[g])&&(h[g]=d);h.sort(t)}return new kn(a,this._parents).order()}function eC(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function tC(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function nC(){return Array.from(this)}function iC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length;a<l;++a){var u=r[a];if(u)return u}return null}function rC(){let e=0;for(const t of this)++e;return e}function sC(){return!this.node()}function aC(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],l=0,u=a.length,f;l<u;++l)(f=a[l])&&e.call(f,f.__data__,l,a);return this}function oC(e){return function(){this.removeAttribute(e)}}function lC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function uC(e,t){return function(){this.setAttribute(e,t)}}function cC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function fC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function dC(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function hC(e,t){var n=xf(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?lC:oC:typeof t=="function"?n.local?dC:fC:n.local?cC:uC)(n,t))}function pw(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function pC(e){return function(){this.style.removeProperty(e)}}function mC(e,t,n){return function(){this.style.setProperty(e,t,n)}}function gC(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function yC(e,t,n){return arguments.length>1?this.each((t==null?pC:typeof t=="function"?gC:mC)(e,t,n??"")):pa(this.node(),e)}function pa(e,t){return e.style.getPropertyValue(t)||pw(e).getComputedStyle(e,null).getPropertyValue(t)}function xC(e){return function(){delete this[e]}}function bC(e,t){return function(){this[e]=t}}function vC(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function wC(e,t){return arguments.length>1?this.each((t==null?xC:typeof t=="function"?vC:bC)(e,t)):this.node()[e]}function mw(e){return e.trim().split(/^|\s+/)}function $m(e){return e.classList||new gw(e)}function gw(e){this._node=e,this._names=mw(e.getAttribute("class")||"")}gw.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 yw(e,t){for(var n=$m(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function xw(e,t){for(var n=$m(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function SC(e){return function(){yw(this,e)}}function _C(e){return function(){xw(this,e)}}function kC(e,t){return function(){(t.apply(this,arguments)?yw:xw)(this,e)}}function EC(e,t){var n=mw(e+"");if(arguments.length<2){for(var r=$m(this.node()),a=-1,l=n.length;++a<l;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?kC:t?SC:_C)(n,t))}function NC(){this.textContent=""}function CC(e){return function(){this.textContent=e}}function TC(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function AC(e){return arguments.length?this.each(e==null?NC:(typeof e=="function"?TC:CC)(e)):this.node().textContent}function MC(){this.innerHTML=""}function jC(e){return function(){this.innerHTML=e}}function zC(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function RC(e){return arguments.length?this.each(e==null?MC:(typeof e=="function"?zC:jC)(e)):this.node().innerHTML}function DC(){this.nextSibling&&this.parentNode.appendChild(this)}function OC(){return this.each(DC)}function LC(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BC(){return this.each(LC)}function HC(e){var t=typeof e=="function"?e:uw(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function UC(){return null}function IC(e,t){var n=typeof e=="function"?e:uw(e),r=t==null?UC:typeof t=="function"?t:qm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qC(){var e=this.parentNode;e&&e.removeChild(this)}function $C(){return this.each(qC)}function PC(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function VC(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function FC(e){return this.select(e?VC:PC)}function YC(e){return arguments.length?this.property("__data__",e):this.node().__data__}function XC(e){return function(t){e.call(this,t,this.__data__)}}function GC(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ZC(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n<a;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function QC(e,t,n){return function(){var r=this.__on,a,l=XC(t);if(r){for(var u=0,f=r.length;u<f;++u)if((a=r[u]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=l,a.options=n),a.value=t;return}}this.addEventListener(e.type,l,n),a={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(a):this.__on=[a]}}function KC(e,t,n){var r=GC(e+""),a,l=r.length,u;if(arguments.length<2){var f=this.node().__on;if(f){for(var h=0,d=f.length,g;h<d;++h)for(a=0,g=f[h];a<l;++a)if((u=r[a]).type===g.type&&u.name===g.name)return g.value}return}for(f=t?QC:ZC,a=0;a<l;++a)this.each(f(r[a],t,n));return this}function bw(e,t,n){var r=pw(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function JC(e,t){return function(){return bw(this,e,t)}}function WC(e,t){return function(){return bw(this,e,t.apply(this,arguments))}}function eT(e,t){return this.each((typeof t=="function"?WC:JC)(e,t))}function*tT(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,l=r.length,u;a<l;++a)(u=r[a])&&(yield u)}var vw=[null];function kn(e,t){this._groups=e,this._parents=t}function _l(){return new kn([[document.documentElement]],vw)}function nT(){return this}kn.prototype=_l.prototype={constructor:kn,select:TN,selectAll:zN,selectChild:LN,selectChildren:IN,filter:qN,data:XN,enter:$N,exit:ZN,join:QN,merge:KN,selection:nT,order:JN,sort:WN,call:tC,nodes:nC,node:iC,size:rC,empty:sC,each:aC,attr:hC,style:yC,property:wC,classed:EC,text:AC,html:RC,raise:OC,lower:BC,append:HC,insert:IC,remove:$C,clone:FC,datum:YC,on:KC,dispatch:eT,[Symbol.iterator]:tT};function Sn(e){return typeof e=="string"?new kn([[document.querySelector(e)]],[document.documentElement]):new kn([[e]],vw)}function iT(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pn(e,t){if(e=iT(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const rT={passive:!1},al={capture:!0,passive:!1};function cp(e){e.stopImmediatePropagation()}function ca(e){e.preventDefault(),e.stopImmediatePropagation()}function ww(e){var t=e.document.documentElement,n=Sn(e).on("dragstart.drag",ca,al);"onselectstart"in t?n.on("selectstart.drag",ca,al):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Sw(e,t){var n=e.document.documentElement,r=Sn(e).on("dragstart.drag",null);t&&(r.on("click.drag",ca,al),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const sc=e=>()=>e;function Wp(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:f,dx:h,dy:d,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,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:g}})}Wp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function sT(e){return!e.ctrlKey&&!e.button}function aT(){return this.parentNode}function oT(e,t){return t??{x:e.x,y:e.y}}function lT(){return navigator.maxTouchPoints||"ontouchstart"in this}function _w(){var e=sT,t=aT,n=oT,r=lT,a={},l=yf("start","drag","end"),u=0,f,h,d,g,m=0;function x(C){C.on("mousedown.drag",v).filter(r).on("touchstart.drag",N).on("touchmove.drag",E,rT).on("touchend.drag touchcancel.drag",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(C,B){if(!(g||!e.call(this,C,B))){var T=_(this,t.call(this,C,B),C,B,"mouse");T&&(Sn(C.view).on("mousemove.drag",w,al).on("mouseup.drag",k,al),ww(C.view),cp(C),d=!1,f=C.clientX,h=C.clientY,T("start",C))}}function w(C){if(ca(C),!d){var B=C.clientX-f,T=C.clientY-h;d=B*B+T*T>m}a.mouse("drag",C)}function k(C){Sn(C.view).on("mousemove.drag mouseup.drag",null),Sw(C.view,d),ca(C),a.mouse("end",C)}function N(C,B){if(e.call(this,C,B)){var T=C.changedTouches,L=t.call(this,C,B),G=T.length,Z,H;for(Z=0;Z<G;++Z)(H=_(this,L,C,B,T[Z].identifier,T[Z]))&&(cp(C),H("start",C,T[Z]))}}function E(C){var B=C.changedTouches,T=B.length,L,G;for(L=0;L<T;++L)(G=a[B[L].identifier])&&(ca(C),G("drag",C,B[L]))}function A(C){var B=C.changedTouches,T=B.length,L,G;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),L=0;L<T;++L)(G=a[B[L].identifier])&&(cp(C),G("end",C,B[L]))}function _(C,B,T,L,G,Z){var H=l.copy(),q=Pn(Z||T,B),P,te,O;if((O=n.call(C,new Wp("beforestart",{sourceEvent:T,target:x,identifier:G,active:u,x:q[0],y:q[1],dx:0,dy:0,dispatch:H}),L))!=null)return P=O.x-q[0]||0,te=O.y-q[1]||0,function U(R,I,F){var K=q,z;switch(R){case"start":a[G]=U,z=u++;break;case"end":delete a[G],--u;case"drag":q=Pn(F||I,B),z=u;break}H.call(R,C,new Wp(R,{sourceEvent:I,subject:O,target:x,identifier:G,active:z,x:q[0]+P,y:q[1]+te,dx:q[0]-K[0],dy:q[1]-K[1],dispatch:H}),L)}}return x.filter=function(C){return arguments.length?(e=typeof C=="function"?C:sc(!!C),x):e},x.container=function(C){return arguments.length?(t=typeof C=="function"?C:sc(C),x):t},x.subject=function(C){return arguments.length?(n=typeof C=="function"?C:sc(C),x):n},x.touchable=function(C){return arguments.length?(r=typeof C=="function"?C:sc(!!C),x):r},x.on=function(){var C=l.on.apply(l,arguments);return C===l?x:C},x.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,x):Math.sqrt(m)},x}function Pm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kw(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function kl(){}var ol=.7,Kc=1/ol,fa="\\s*([+-]?\\d+)\\s*",ll="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uT=/^#([0-9a-f]{3,8})$/,cT=new RegExp(`^rgb\\(${fa},${fa},${fa}\\)$`),fT=new RegExp(`^rgb\\(${oi},${oi},${oi}\\)$`),dT=new RegExp(`^rgba\\(${fa},${fa},${fa},${ll}\\)$`),hT=new RegExp(`^rgba\\(${oi},${oi},${oi},${ll}\\)$`),pT=new RegExp(`^hsl\\(${ll},${oi},${oi}\\)$`),mT=new RegExp(`^hsla\\(${ll},${oi},${oi},${ll}\\)$`),zb={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};Pm(kl,os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rb,formatHex:Rb,formatHex8:gT,formatHsl:yT,formatRgb:Db,toString:Db});function Rb(){return this.rgb().formatHex()}function gT(){return this.rgb().formatHex8()}function yT(){return Ew(this).formatHsl()}function Db(){return this.rgb().formatRgb()}function os(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uT.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ob(t):n===3?new on(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ac(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ac(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=cT.exec(e))?new on(t[1],t[2],t[3],1):(t=fT.exec(e))?new on(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dT.exec(e))?ac(t[1],t[2],t[3],t[4]):(t=hT.exec(e))?ac(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pT.exec(e))?Hb(t[1],t[2]/100,t[3]/100,1):(t=mT.exec(e))?Hb(t[1],t[2]/100,t[3]/100,t[4]):zb.hasOwnProperty(e)?Ob(zb[e]):e==="transparent"?new on(NaN,NaN,NaN,0):null}function Ob(e){return new on(e>>16&255,e>>8&255,e&255,1)}function ac(e,t,n,r){return r<=0&&(e=t=n=NaN),new on(e,t,n,r)}function xT(e){return e instanceof kl||(e=os(e)),e?(e=e.rgb(),new on(e.r,e.g,e.b,e.opacity)):new on}function em(e,t,n,r){return arguments.length===1?xT(e):new on(e,t,n,r??1)}function on(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Pm(on,em,kw(kl,{brighter(e){return e=e==null?Kc:Math.pow(Kc,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ol:Math.pow(ol,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new on(ss(this.r),ss(this.g),ss(this.b),Jc(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:Lb,formatHex:Lb,formatHex8:bT,formatRgb:Bb,toString:Bb}));function Lb(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}`}function bT(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}${rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bb(){const e=Jc(this.opacity);return`${e===1?"rgb(":"rgba("}${ss(this.r)}, ${ss(this.g)}, ${ss(this.b)}${e===1?")":`, ${e})`}`}function Jc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ss(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rs(e){return e=ss(e),(e<16?"0":"")+e.toString(16)}function Hb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fn(e,t,n,r)}function Ew(e){if(e instanceof Fn)return new Fn(e.h,e.s,e.l,e.opacity);if(e instanceof kl||(e=os(e)),!e)return new Fn;if(e instanceof Fn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,f=l-a,h=(l+a)/2;return f?(t===l?u=(n-r)/f+(n<r)*6:n===l?u=(r-t)/f+2:u=(t-n)/f+4,f/=h<.5?l+a:2-l-a,u*=60):f=h>0&&h<1?0:u,new Fn(u,f,h,e.opacity)}function vT(e,t,n,r){return arguments.length===1?Ew(e):new Fn(e,t,n,r??1)}function Fn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Pm(Fn,vT,kw(kl,{brighter(e){return e=e==null?Kc:Math.pow(Kc,e),new Fn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ol:Math.pow(ol,e),new Fn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new on(fp(e>=240?e-240:e+120,a,r),fp(e,a,r),fp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Fn(Ub(this.h),oc(this.s),oc(this.l),Jc(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=Jc(this.opacity);return`${e===1?"hsl(":"hsla("}${Ub(this.h)}, ${oc(this.s)*100}%, ${oc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ub(e){return e=(e||0)%360,e<0?e+360:e}function oc(e){return Math.max(0,Math.min(1,e||0))}function fp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Vm=e=>()=>e;function wT(e,t){return function(n){return e+n*t}}function ST(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function _T(e){return(e=+e)==1?Nw:function(t,n){return n-t?ST(t,n,e):Vm(isNaN(t)?n:t)}}function Nw(e,t){var n=t-e;return n?wT(e,n):Vm(isNaN(e)?t:e)}const Wc=(function e(t){var n=_T(t);function r(a,l){var u=n((a=em(a)).r,(l=em(l)).r),f=n(a.g,l.g),h=n(a.b,l.b),d=Nw(a.opacity,l.opacity);return function(g){return a.r=u(g),a.g=f(g),a.b=h(g),a.opacity=d(g),a+""}}return r.gamma=e,r})(1);function kT(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;a<n;++a)r[a]=e[a]*(1-l)+t[a]*l;return r}}function ET(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function NT(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),l=new Array(n),u;for(u=0;u<r;++u)a[u]=tl(e[u],t[u]);for(;u<n;++u)l[u]=t[u];return function(f){for(u=0;u<r;++u)l[u]=a[u](f);return l}}function CT(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function si(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function TT(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=tl(e[a],t[a]):r[a]=t[a];return function(l){for(a in n)r[a]=n[a](l);return r}}var tm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dp=new RegExp(tm.source,"g");function AT(e){return function(){return e}}function MT(e){return function(t){return e(t)+""}}function Cw(e,t){var n=tm.lastIndex=dp.lastIndex=0,r,a,l,u=-1,f=[],h=[];for(e=e+"",t=t+"";(r=tm.exec(e))&&(a=dp.exec(t));)(l=a.index)>n&&(l=t.slice(n,l),f[u]?f[u]+=l:f[++u]=l),(r=r[0])===(a=a[0])?f[u]?f[u]+=a:f[++u]=a:(f[++u]=null,h.push({i:u,x:si(r,a)})),n=dp.lastIndex;return n<t.length&&(l=t.slice(n),f[u]?f[u]+=l:f[++u]=l),f.length<2?h[0]?MT(h[0].x):AT(t):(t=h.length,function(d){for(var g=0,m;g<t;++g)f[(m=h[g]).i]=m.x(d);return f.join("")})}function tl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Vm(t):(n==="number"?si:n==="string"?(r=os(t))?(t=r,Wc):Cw:t instanceof os?Wc:t instanceof Date?CT:ET(t)?kT:Array.isArray(t)?NT:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?TT:si)(e,t)}var Ib=180/Math.PI,nm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tw(e,t,n,r,a,l){var u,f,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*n+t*r)&&(n-=e*h,r-=t*h),(f=Math.sqrt(n*n+r*r))&&(n/=f,r/=f,h/=f),e*r<t*n&&(e=-e,t=-t,h=-h,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Ib,skewX:Math.atan(h)*Ib,scaleX:u,scaleY:f}}var lc;function jT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?nm:Tw(t.a,t.b,t.c,t.d,t.e,t.f)}function zT(e){return e==null||(lc||(lc=document.createElementNS("http://www.w3.org/2000/svg","g")),lc.setAttribute("transform",e),!(e=lc.transform.baseVal.consolidate()))?nm:(e=e.matrix,Tw(e.a,e.b,e.c,e.d,e.e,e.f))}function Aw(e,t,n,r){function a(d){return d.length?d.pop()+" ":""}function l(d,g,m,x,v,w){if(d!==m||g!==x){var k=v.push("translate(",null,t,null,n);w.push({i:k-4,x:si(d,m)},{i:k-2,x:si(g,x)})}else(m||x)&&v.push("translate("+m+t+x+n)}function u(d,g,m,x){d!==g?(d-g>180?g+=360:g-d>180&&(d+=360),x.push({i:m.push(a(m)+"rotate(",null,r)-2,x:si(d,g)})):g&&m.push(a(m)+"rotate("+g+r)}function f(d,g,m,x){d!==g?x.push({i:m.push(a(m)+"skewX(",null,r)-2,x:si(d,g)}):g&&m.push(a(m)+"skewX("+g+r)}function h(d,g,m,x,v,w){if(d!==m||g!==x){var k=v.push(a(v)+"scale(",null,",",null,")");w.push({i:k-4,x:si(d,m)},{i:k-2,x:si(g,x)})}else(m!==1||x!==1)&&v.push(a(v)+"scale("+m+","+x+")")}return function(d,g){var m=[],x=[];return d=e(d),g=e(g),l(d.translateX,d.translateY,g.translateX,g.translateY,m,x),u(d.rotate,g.rotate,m,x),f(d.skewX,g.skewX,m,x),h(d.scaleX,d.scaleY,g.scaleX,g.scaleY,m,x),d=g=null,function(v){for(var w=-1,k=x.length,N;++w<k;)m[(N=x[w]).i]=N.x(v);return m.join("")}}}var RT=Aw(jT,"px, ","px)","deg)"),DT=Aw(zT,", ",")",")"),OT=1e-12;function qb(e){return((e=Math.exp(e))+1/e)/2}function LT(e){return((e=Math.exp(e))-1/e)/2}function BT(e){return((e=Math.exp(2*e))-1)/(e+1)}const Hc=(function e(t,n,r){function a(l,u){var f=l[0],h=l[1],d=l[2],g=u[0],m=u[1],x=u[2],v=g-f,w=m-h,k=v*v+w*w,N,E;if(k<OT)E=Math.log(x/d)/t,N=function(L){return[f+L*v,h+L*w,d*Math.exp(t*L*E)]};else{var A=Math.sqrt(k),_=(x*x-d*d+r*k)/(2*d*n*A),C=(x*x-d*d-r*k)/(2*x*n*A),B=Math.log(Math.sqrt(_*_+1)-_),T=Math.log(Math.sqrt(C*C+1)-C);E=(T-B)/t,N=function(L){var G=L*E,Z=qb(B),H=d/(n*A)*(Z*BT(t*G+B)-LT(B));return[f+H*v,h+H*w,d*Z/qb(t*G+B)]}}return N.duration=E*1e3*t/Math.SQRT2,N}return a.rho=function(l){var u=Math.max(.001,+l),f=u*u,h=f*f;return e(u,f,h)},a})(Math.SQRT2,2,4);var ma=0,Qo=0,Co=0,Mw=1e3,ef,Ko,tf=0,ls=0,bf=0,ul=typeof performance=="object"&&performance.now?performance:Date,jw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fm(){return ls||(jw(HT),ls=ul.now()+bf)}function HT(){ls=0}function nf(){this._call=this._time=this._next=null}nf.prototype=zw.prototype={constructor:nf,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Fm():+n)+(t==null?0:+t),!this._next&&Ko!==this&&(Ko?Ko._next=this:ef=this,Ko=this),this._call=e,this._time=n,im()},stop:function(){this._call&&(this._call=null,this._time=1/0,im())}};function zw(e,t,n){var r=new nf;return r.restart(e,t,n),r}function UT(){Fm(),++ma;for(var e=ef,t;e;)(t=ls-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ma}function $b(){ls=(tf=ul.now())+bf,ma=Qo=0;try{UT()}finally{ma=0,qT(),ls=0}}function IT(){var e=ul.now(),t=e-tf;t>Mw&&(bf-=t,tf=e)}function qT(){for(var e,t=ef,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ef=n);Ko=e,im(r)}function im(e){if(!ma){Qo&&(Qo=clearTimeout(Qo));var t=e-ls;t>24?(e<1/0&&(Qo=setTimeout($b,e-ul.now()-bf)),Co&&(Co=clearInterval(Co))):(Co||(tf=ul.now(),Co=setInterval(IT,Mw)),ma=1,jw($b))}}function Pb(e,t,n){var r=new nf;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var $T=yf("start","end","cancel","interrupt"),PT=[],Rw=0,Vb=1,rm=2,Uc=3,Fb=4,sm=5,Ic=6;function vf(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;VT(e,n,{name:t,index:r,group:a,on:$T,tween:PT,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:Rw})}function Ym(e,t){var n=Qn(e,t);if(n.state>Rw)throw new Error("too late; already scheduled");return n}function di(e,t){var n=Qn(e,t);if(n.state>Uc)throw new Error("too late; already running");return n}function Qn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function VT(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=zw(l,0,n.time);function l(d){n.state=Vb,n.timer.restart(u,n.delay,n.time),n.delay<=d&&u(d-n.delay)}function u(d){var g,m,x,v;if(n.state!==Vb)return h();for(g in r)if(v=r[g],v.name===n.name){if(v.state===Uc)return Pb(u);v.state===Fb?(v.state=Ic,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[g]):+g<t&&(v.state=Ic,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[g])}if(Pb(function(){n.state===Uc&&(n.state=Fb,n.timer.restart(f,n.delay,n.time),f(d))}),n.state=rm,n.on.call("start",e,e.__data__,n.index,n.group),n.state===rm){for(n.state=Uc,a=new Array(x=n.tween.length),g=0,m=-1;g<x;++g)(v=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=v);a.length=m+1}}function f(d){for(var g=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(h),n.state=sm,1),m=-1,x=a.length;++m<x;)a[m].call(e,g);n.state===sm&&(n.on.call("end",e,e.__data__,n.index,n.group),h())}function h(){n.state=Ic,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function qc(e,t){var n=e.__transition,r,a,l=!0,u;if(n){t=t==null?null:t+"";for(u in n){if((r=n[u]).name!==t){l=!1;continue}a=r.state>rm&&r.state<sm,r.state=Ic,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[u]}l&&delete e.__transition}}function FT(e){return this.each(function(){qc(this,e)})}function YT(e,t){var n,r;return function(){var a=di(this,e),l=a.tween;if(l!==n){r=n=l;for(var u=0,f=r.length;u<f;++u)if(r[u].name===t){r=r.slice(),r.splice(u,1);break}}a.tween=r}}function XT(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var l=di(this,e),u=l.tween;if(u!==r){a=(r=u).slice();for(var f={name:t,value:n},h=0,d=a.length;h<d;++h)if(a[h].name===t){a[h]=f;break}h===d&&a.push(f)}l.tween=a}}function GT(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Qn(this.node(),n).tween,a=0,l=r.length,u;a<l;++a)if((u=r[a]).name===e)return u.value;return null}return this.each((t==null?YT:XT)(n,e,t))}function Xm(e,t,n){var r=e._id;return e.each(function(){var a=di(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Qn(a,r).value[t]}}function Dw(e,t){var n;return(typeof t=="number"?si:t instanceof os?Wc:(n=os(t))?(t=n,Wc):Cw)(e,t)}function ZT(e){return function(){this.removeAttribute(e)}}function QT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function KT(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttribute(e);return u===a?null:u===r?l:l=t(r=u,n)}}function JT(e,t,n){var r,a=n+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===a?null:u===r?l:l=t(r=u,n)}}function WT(e,t,n){var r,a,l;return function(){var u,f=n(this),h;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=f+"",u===h?null:u===r&&h===a?l:(a=h,l=t(r=u,f)))}}function e4(e,t,n){var r,a,l;return function(){var u,f=n(this),h;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=f+"",u===h?null:u===r&&h===a?l:(a=h,l=t(r=u,f)))}}function t4(e,t){var n=xf(e),r=n==="transform"?DT:Dw;return this.attrTween(e,typeof t=="function"?(n.local?e4:WT)(n,r,Xm(this,"attr."+e,t)):t==null?(n.local?QT:ZT)(n):(n.local?JT:KT)(n,r,t))}function n4(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function i4(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function r4(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&i4(e,l)),n}return a._value=t,a}function s4(e,t){var n,r;function a(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&n4(e,l)),n}return a._value=t,a}function a4(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=xf(e);return this.tween(n,(r.local?r4:s4)(r,t))}function o4(e,t){return function(){Ym(this,e).delay=+t.apply(this,arguments)}}function l4(e,t){return t=+t,function(){Ym(this,e).delay=t}}function u4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?o4:l4)(t,e)):Qn(this.node(),t).delay}function c4(e,t){return function(){di(this,e).duration=+t.apply(this,arguments)}}function f4(e,t){return t=+t,function(){di(this,e).duration=t}}function d4(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?c4:f4)(t,e)):Qn(this.node(),t).duration}function h4(e,t){if(typeof t!="function")throw new Error;return function(){di(this,e).ease=t}}function p4(e){var t=this._id;return arguments.length?this.each(h4(t,e)):Qn(this.node(),t).ease}function m4(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;di(this,e).ease=n}}function g4(e){if(typeof e!="function")throw new Error;return this.each(m4(this._id,e))}function y4(e){typeof e!="function"&&(e=fw(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var l=t[a],u=l.length,f=r[a]=[],h,d=0;d<u;++d)(h=l[d])&&e.call(h,h.__data__,d,l)&&f.push(h);return new Pi(r,this._parents,this._name,this._id)}function x4(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,l=Math.min(r,a),u=new Array(r),f=0;f<l;++f)for(var h=t[f],d=n[f],g=h.length,m=u[f]=new Array(g),x,v=0;v<g;++v)(x=h[v]||d[v])&&(m[v]=x);for(;f<r;++f)u[f]=t[f];return new Pi(u,this._parents,this._name,this._id)}function b4(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function v4(e,t,n){var r,a,l=b4(t)?Ym:di;return function(){var u=l(this,e),f=u.on;f!==r&&(a=(r=f).copy()).on(t,n),u.on=a}}function w4(e,t){var n=this._id;return arguments.length<2?Qn(this.node(),n).on.on(e):this.each(v4(n,e,t))}function S4(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _4(){return this.on("end.remove",S4(this._id))}function k4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qm(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var f=r[u],h=f.length,d=l[u]=new Array(h),g,m,x=0;x<h;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),d[x]=m,vf(d[x],t,n,x,d,Qn(g,n)));return new Pi(l,this._parents,t,n)}function E4(e){var t=this._name,n=this._id;typeof e!="function"&&(e=cw(e));for(var r=this._groups,a=r.length,l=[],u=[],f=0;f<a;++f)for(var h=r[f],d=h.length,g,m=0;m<d;++m)if(g=h[m]){for(var x=e.call(g,g.__data__,m,h),v,w=Qn(g,n),k=0,N=x.length;k<N;++k)(v=x[k])&&vf(v,t,n,k,x,w);l.push(x),u.push(g)}return new Pi(l,u,t,n)}var N4=_l.prototype.constructor;function C4(){return new N4(this._groups,this._parents)}function T4(e,t){var n,r,a;return function(){var l=pa(this,e),u=(this.style.removeProperty(e),pa(this,e));return l===u?null:l===n&&u===r?a:a=t(n=l,r=u)}}function Ow(e){return function(){this.style.removeProperty(e)}}function A4(e,t,n){var r,a=n+"",l;return function(){var u=pa(this,e);return u===a?null:u===r?l:l=t(r=u,n)}}function M4(e,t,n){var r,a,l;return function(){var u=pa(this,e),f=n(this),h=f+"";return f==null&&(h=f=(this.style.removeProperty(e),pa(this,e))),u===h?null:u===r&&h===a?l:(a=h,l=t(r=u,f))}}function j4(e,t){var n,r,a,l="style."+t,u="end."+l,f;return function(){var h=di(this,e),d=h.on,g=h.value[l]==null?f||(f=Ow(t)):void 0;(d!==n||a!==g)&&(r=(n=d).copy()).on(u,a=g),h.on=r}}function z4(e,t,n){var r=(e+="")=="transform"?RT:Dw;return t==null?this.styleTween(e,T4(e,r)).on("end.style."+e,Ow(e)):typeof t=="function"?this.styleTween(e,M4(e,r,Xm(this,"style."+e,t))).each(j4(this._id,e)):this.styleTween(e,A4(e,r,t),n).on("end.style."+e,null)}function R4(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function D4(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&R4(e,u,n)),r}return l._value=t,l}function O4(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,D4(e,t,n??""))}function L4(e){return function(){this.textContent=e}}function B4(e){return function(){var t=e(this);this.textContent=t??""}}function H4(e){return this.tween("text",typeof e=="function"?B4(Xm(this,"text",e)):L4(e==null?"":e+""))}function U4(e){return function(t){this.textContent=e.call(this,t)}}function I4(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&U4(a)),t}return r._value=e,r}function q4(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,I4(e))}function $4(){for(var e=this._name,t=this._id,n=Lw(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],f=u.length,h,d=0;d<f;++d)if(h=u[d]){var g=Qn(h,t);vf(h,e,n,d,u,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Pi(r,this._parents,e,n)}function P4(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(l,u){var f={value:u},h={value:function(){--a===0&&l()}};n.each(function(){var d=di(this,r),g=d.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(h)),d.on=t}),a===0&&l()})}var V4=0;function Pi(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Lw(){return++V4}var Bi=_l.prototype;Pi.prototype={constructor:Pi,select:k4,selectAll:E4,selectChild:Bi.selectChild,selectChildren:Bi.selectChildren,filter:y4,merge:x4,selection:C4,transition:$4,call:Bi.call,nodes:Bi.nodes,node:Bi.node,size:Bi.size,empty:Bi.empty,each:Bi.each,on:w4,attr:t4,attrTween:a4,style:z4,styleTween:O4,text:H4,textTween:q4,remove:_4,tween:GT,delay:u4,duration:d4,ease:p4,easeVarying:g4,end:P4,[Symbol.iterator]:Bi[Symbol.iterator]};function F4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Y4={time:null,delay:0,duration:250,ease:F4};function X4(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function G4(e){var t,n;e instanceof Pi?(t=e._id,e=e._name):(t=Lw(),(n=Y4).time=Fm(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],f=u.length,h,d=0;d<f;++d)(h=u[d])&&vf(h,e,t,d,u,n||X4(h,t));return new Pi(r,this._parents,e,t)}_l.prototype.interrupt=FT;_l.prototype.transition=G4;const uc=e=>()=>e;function Z4(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function qi(e,t,n){this.k=e,this.x=t,this.y=n}qi.prototype={constructor:qi,scale:function(e){return e===1?this:new qi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qi(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 wf=new qi(1,0,0);Bw.prototype=qi.prototype;function Bw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wf;return e.__zoom}function hp(e){e.stopImmediatePropagation()}function To(e){e.preventDefault(),e.stopImmediatePropagation()}function Q4(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function K4(){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 Yb(){return this.__zoom||wf}function J4(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function W4(){return navigator.maxTouchPoints||"ontouchstart"in this}function eA(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function Hw(){var e=Q4,t=K4,n=eA,r=J4,a=W4,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],f=250,h=Hc,d=yf("start","zoom","end"),g,m,x,v=500,w=150,k=0,N=10;function E(O){O.property("__zoom",Yb).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",H).filter(a).on("touchstart.zoom",q).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(O,U,R,I){var F=O.selection?O.selection():O;F.property("__zoom",Yb),O!==F?B(O,U,R,I):F.interrupt().each(function(){T(this,arguments).event(I).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},E.scaleBy=function(O,U,R,I){E.scaleTo(O,function(){var F=this.__zoom.k,K=typeof U=="function"?U.apply(this,arguments):U;return F*K},R,I)},E.scaleTo=function(O,U,R,I){E.transform(O,function(){var F=t.apply(this,arguments),K=this.__zoom,z=R==null?C(F):typeof R=="function"?R.apply(this,arguments):R,D=K.invert(z),V=typeof U=="function"?U.apply(this,arguments):U;return n(_(A(K,V),z,D),F,u)},R,I)},E.translateBy=function(O,U,R,I){E.transform(O,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),u)},null,I)},E.translateTo=function(O,U,R,I,F){E.transform(O,function(){var K=t.apply(this,arguments),z=this.__zoom,D=I==null?C(K):typeof I=="function"?I.apply(this,arguments):I;return n(wf.translate(D[0],D[1]).scale(z.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof R=="function"?-R.apply(this,arguments):-R),K,u)},I,F)};function A(O,U){return U=Math.max(l[0],Math.min(l[1],U)),U===O.k?O:new qi(U,O.x,O.y)}function _(O,U,R){var I=U[0]-R[0]*O.k,F=U[1]-R[1]*O.k;return I===O.x&&F===O.y?O:new qi(O.k,I,F)}function C(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function B(O,U,R,I){O.on("start.zoom",function(){T(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(I).end()}).tween("zoom",function(){var F=this,K=arguments,z=T(F,K).event(I),D=t.apply(F,K),V=R==null?C(D):typeof R=="function"?R.apply(F,K):R,j=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),ie=F.__zoom,ce=typeof U=="function"?U.apply(F,K):U,fe=h(ie.invert(V).concat(j/ie.k),ce.invert(V).concat(j/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=j/ue[2];he=new qi(me,V[0]-ue[0]*me,V[1]-ue[1]*me)}z.zoom(null,he)}})}function T(O,U,R){return!R&&O.__zooming||new L(O,U)}function L(O,U){this.that=O,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,U),this.taps=0}L.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 Z4(O,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:d}),U)}};function G(O,...U){if(!e.apply(this,arguments))return;var R=T(this,U).event(O),I=this.__zoom,F=Math.max(l[0],Math.min(l[1],I.k*Math.pow(2,r.apply(this,arguments)))),K=Pn(O);if(R.wheel)(R.mouse[0][0]!==K[0]||R.mouse[0][1]!==K[1])&&(R.mouse[1]=I.invert(R.mouse[0]=K)),clearTimeout(R.wheel);else{if(I.k===F)return;R.mouse=[K,I.invert(K)],qc(this),R.start()}To(O),R.wheel=setTimeout(z,w),R.zoom("mouse",n(_(A(I,F),R.mouse[0],R.mouse[1]),R.extent,u));function z(){R.wheel=null,R.end()}}function Z(O,...U){if(x||!e.apply(this,arguments))return;var R=O.currentTarget,I=T(this,U,!0).event(O),F=Sn(O.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",j,!0),K=Pn(O,R),z=O.clientX,D=O.clientY;ww(O.view),hp(O),I.mouse=[K,this.__zoom.invert(K)],qc(this),I.start();function V(ie){if(To(ie),!I.moved){var ce=ie.clientX-z,fe=ie.clientY-D;I.moved=ce*ce+fe*fe>k}I.event(ie).zoom("mouse",n(_(I.that.__zoom,I.mouse[0]=Pn(ie,R),I.mouse[1]),I.extent,u))}function j(ie){F.on("mousemove.zoom mouseup.zoom",null),Sw(ie.view,I.moved),To(ie),I.event(ie).end()}}function H(O,...U){if(e.apply(this,arguments)){var R=this.__zoom,I=Pn(O.changedTouches?O.changedTouches[0]:O,this),F=R.invert(I),K=R.k*(O.shiftKey?.5:2),z=n(_(A(R,K),I,F),t.apply(this,U),u);To(O),f>0?Sn(this).transition().duration(f).call(B,z,I,O):Sn(this).call(E.transform,z,I,O)}}function q(O,...U){if(e.apply(this,arguments)){var R=O.touches,I=R.length,F=T(this,U,O.changedTouches.length===I).event(O),K,z,D,V;for(hp(O),z=0;z<I;++z)D=R[z],V=Pn(D,this),V=[V,this.__zoom.invert(V),D.identifier],F.touch0?!F.touch1&&F.touch0[2]!==V[2]&&(F.touch1=V,F.taps=0):(F.touch0=V,K=!0,F.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(F.taps<2&&(m=V[0],g=setTimeout(function(){g=null},v)),qc(this),F.start())}}function P(O,...U){if(this.__zooming){var R=T(this,U).event(O),I=O.changedTouches,F=I.length,K,z,D,V;for(To(O),K=0;K<F;++K)z=I[K],D=Pn(z,this),R.touch0&&R.touch0[2]===z.identifier?R.touch0[0]=D:R.touch1&&R.touch1[2]===z.identifier&&(R.touch1[0]=D);if(z=R.that.__zoom,R.touch1){var j=R.touch0[0],ie=R.touch0[1],ce=R.touch1[0],fe=R.touch1[1],he=(he=ce[0]-j[0])*he+(he=ce[1]-j[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;z=A(z,Math.sqrt(he/ue)),D=[(j[0]+ce[0])/2,(j[1]+ce[1])/2],V=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(R.touch0)D=R.touch0[0],V=R.touch0[1];else return;R.zoom("touch",n(_(z,D,V),R.extent,u))}}function te(O,...U){if(this.__zooming){var R=T(this,U).event(O),I=O.changedTouches,F=I.length,K,z;for(hp(O),x&&clearTimeout(x),x=setTimeout(function(){x=null},v),K=0;K<F;++K)z=I[K],R.touch0&&R.touch0[2]===z.identifier?delete R.touch0:R.touch1&&R.touch1[2]===z.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&&(z=Pn(z,this),Math.hypot(m[0]-z[0],m[1]-z[1])<N)){var D=Sn(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return E.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:uc(+O),E):r},E.filter=function(O){return arguments.length?(e=typeof O=="function"?O:uc(!!O),E):e},E.touchable=function(O){return arguments.length?(a=typeof O=="function"?O:uc(!!O),E):a},E.extent=function(O){return arguments.length?(t=typeof O=="function"?O:uc([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),E):t},E.scaleExtent=function(O){return arguments.length?(l[0]=+O[0],l[1]=+O[1],E):[l[0],l[1]]},E.translateExtent=function(O){return arguments.length?(u[0][0]=+O[0][0],u[1][0]=+O[1][0],u[0][1]=+O[0][1],u[1][1]=+O[1][1],E):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},E.constrain=function(O){return arguments.length?(n=O,E):n},E.duration=function(O){return arguments.length?(f=+O,E):f},E.interpolate=function(O){return arguments.length?(h=O,E):h},E.on=function(){var O=d.on.apply(d,arguments);return O===d?E:O},E.clickDistance=function(O){return arguments.length?(k=(O=+O)*O,E):Math.sqrt(k)},E.tapDistance=function(O){return arguments.length?(N=+O,E):N},E}const ui={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},cl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Uw=["Enter"," ","Escape"],Iw={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ga;(function(e){e.Strict="strict",e.Loose="loose"})(ga||(ga={}));var as;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(as||(as={}));var fl;(function(e){e.Partial="partial",e.Full="full"})(fl||(fl={}));const qw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Tr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Tr||(Tr={}));var rf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(rf||(rf={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const Xb={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function $w(e){return e===null?null:e?"valid":"invalid"}const Pw=e=>"id"in e&&"source"in e&&"target"in e,tA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),El=(e,t=[0,0])=>{const{width:n,height:r}=Vi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},nA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Gm(a)?a:t.nodeLookup.get(a.id));const f=u?sf(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Sf(r,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _f(n)},Nl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Sf(n,sf(a)),r=!0)}),r?_f(n):{x:0,y:0,width:0,height:0}},Zm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const f={...Tl(t,[n,r,a]),width:t.width/a,height:t.height/a},h=[];for(const d of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=d;if(u&&!m||x)continue;const v=g.width??d.width??d.initialWidth??null,w=g.height??d.height??d.initialHeight??null,k=dl(f,xa(d)),N=(v??0)*(w??0),E=l&&k>0;(!d.internals.handleBounds||E||k>=N||d.dragging)&&h.push(d)}return h},iA=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function rA(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&(t?.includeHiddenNodes||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function sA({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return Promise.resolve(!0);const f=rA(e,u),h=Nl(f),d=Qm(h,t,n,u?.minZoom??a,u?.maxZoom??l,u?.padding??.1);return await r.setViewport(d,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Vw({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),f=u.parentId?n.get(u.parentId):void 0,{x:h,y:d}=f?f.internals.positionAbsolute:{x:0,y:0},g=u.origin??r;let m=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!f)l?.("005",ui.error005());else{const v=f.measured.width,w=f.measured.height;v&&w&&(m=[[h,d],[h+v,d+w]])}else f&&ba(u.extent)&&(m=[[u.extent[0][0]+h,u.extent[0][1]+d],[u.extent[1][0]+h,u.extent[1][1]+d]]);const x=ba(m)?us(t,m,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&l?.("015",ui.error015()),{position:{x:x.x-h+(u.measured.width??0)*g[0],y:x.y-d+(u.measured.height??0)*g[1]},positionAbsolute:x}}async function aA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(x=>x.id)),u=[];for(const x of n){if(x.deletable===!1)continue;const v=l.has(x.id),w=!v&&x.parentId&&u.find(k=>k.id===x.parentId);(v||w)&&u.push(x)}const f=new Set(t.map(x=>x.id)),h=r.filter(x=>x.deletable!==!1),g=iA(u,h);for(const x of h)f.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!a)return{edges:g,nodes:u};const m=await a({nodes:u,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:u}:{edges:[],nodes:[]}:m}const ya=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),us=(e={x:0,y:0},t,n)=>({x:ya(e.x,t[0][0],t[1][0]-(n?.width??0)),y:ya(e.y,t[0][1],t[1][1]-(n?.height??0))});function Fw(e,t,n){const{width:r,height:a}=Vi(n),{x:l,y:u}=n.internals.positionAbsolute;return us(e,[[l,u],[l+r,u+a]],t)}const Gb=(e,t,n)=>e<t?ya(Math.abs(e-t),1,t)/t:e>n?-ya(Math.abs(e-n),1,t)/t:0,Yw=(e,t,n=15,r=40)=>{const a=Gb(e.x,r,t.width-r)*n,l=Gb(e.y,r,t.height-r)*n;return[a,l]},Sf=(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)}),am=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_f=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xa=(e,t=[0,0])=>{const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:El(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},sf=(e,t=[0,0])=>{const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:El(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Xw=(e,t)=>_f(Sf(am(e),am(t))),dl=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Zb=e=>Yn(e.width)&&Yn(e.height)&&Yn(e.x)&&Yn(e.y),Yn=e=>!isNaN(e)&&isFinite(e),oA=(e,t)=>{},Cl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Tl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const f={x:(e-n)/a,y:(t-r)/a};return l?Cl(f,u):f},af=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ea(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function lA(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ea(e,n),a=ea(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ea(e.top??e.y??0,n),a=ea(e.bottom??e.y??0,n),l=ea(e.left??e.x??0,t),u=ea(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function uA(e,t,n,r,a,l){const{x:u,y:f}=af(e,[t,n,r]),{x:h,y:d}=af({x:e.x+e.width,y:e.y+e.height},[t,n,r]),g=a-h,m=l-d;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const Qm=(e,t,n,r,a,l)=>{const u=lA(l,t,n),f=(t-u.x)/e.width,h=(n-u.y)/e.height,d=Math.min(f,h),g=ya(d,r,a),m=e.x+e.width/2,x=e.y+e.height/2,v=t/2-m*g,w=n/2-x*g,k=uA(e,v,w,g,t,n),N={left:Math.min(k.left-u.left,0),top:Math.min(k.top-u.top,0),right:Math.min(k.right-u.right,0),bottom:Math.min(k.bottom-u.bottom,0)};return{x:v-N.left+N.right,y:w-N.top+N.bottom,zoom:g}},hl=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ba(e){return e!=null&&e!=="parent"}function Vi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Gw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Zw(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const f=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*f[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*f[1]}return l}function Qb(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function cA(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function fA(e){return{...Iw,...e||{}}}function nl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Xn(e),f=Tl({x:l-(a?.left??0),y:u-(a?.top??0)},r),{x:h,y:d}=n?Cl(f,t):f;return{xSnapped:h,ySnapped:d,...f}}const Km=e=>({width:e.offsetWidth,height:e.offsetHeight}),Qw=e=>e?.getRootNode?.()||window?.document,dA=["INPUT","SELECT","TEXTAREA"];function Kw(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:dA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Jw=e=>"clientX"in e,Xn=(e,t)=>{const n=Jw(e),r=n?e.clientX:e.touches?.[0].clientX,a=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:a-(t?.top??0)}},Kb=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const f=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(f.left-n.left)/r,y:(f.top-n.top)/r,...Km(u)}})};function Ww({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:f}){const h=e*.125+a*.375+u*.375+n*.125,d=t*.125+l*.375+f*.375+r*.125,g=Math.abs(h-e),m=Math.abs(d-t);return[h,d,g,m]}function cc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Jb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case be.Left:return[t-cc(t-r,l),n];case be.Right:return[t+cc(r-t,l),n];case be.Top:return[t,n-cc(n-a,l)];case be.Bottom:return[t,n+cc(a-n,l)]}}function eS({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top,curvature:u=.25}){const[f,h]=Jb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[d,g]=Jb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[m,x,v,w]=Ww({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:f,sourceControlY:h,targetControlX:d,targetControlY:g});return[`M${e},${t} C${f},${h} ${d},${g} ${r},${a}`,m,x,v,w]}function tS({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n<e?n+a:n-a,u=Math.abs(r-t)/2,f=r<t?r+u:r-u;return[l,f,a,u]}function hA({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:l="basic"}){if(l==="manual")return r;const u=a&&n?r+1e3:r,f=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return u+f}function pA({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const l=Sf(sf(e),sf(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return dl(u,_f(l))>0}const mA=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,gA=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),om=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||mA;let a;return Pw(e)?a={...e}:a={...e,id:r(e)},gA(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function nS({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,f]=tS({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,f]}const Wb={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},yA=({source:e,sourcePosition:t=be.Bottom,target:n})=>t===be.Left||t===be.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},e1=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xA({source:e,sourcePosition:t=be.Bottom,target:n,targetPosition:r=be.Top,center:a,offset:l,stepPosition:u}){const f=Wb[t],h=Wb[r],d={x:e.x+f.x*l,y:e.y+f.y*l},g={x:n.x+h.x*l,y:n.y+h.y*l},m=yA({source:d,sourcePosition:t,target:g}),x=m.x!==0?"x":"y",v=m[x];let w=[],k,N;const E={x:0,y:0},A={x:0,y:0},[,,_,C]=tS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(f[x]*h[x]===-1){x==="x"?(k=a.x??d.x+(g.x-d.x)*u,N=a.y??(d.y+g.y)/2):(k=a.x??(d.x+g.x)/2,N=a.y??d.y+(g.y-d.y)*u);const T=[{x:k,y:d.y},{x:k,y:g.y}],L=[{x:d.x,y:N},{x:g.x,y:N}];f[x]===v?w=x==="x"?T:L:w=x==="x"?L:T}else{const T=[{x:d.x,y:g.y}],L=[{x:g.x,y:d.y}];if(x==="x"?w=f.x===v?L:T:w=f.y===v?T:L,t===r){const P=Math.abs(e[x]-n[x]);if(P<=l){const te=Math.min(l-1,l-P);f[x]===v?E[x]=(d[x]>e[x]?-1:1)*te:A[x]=(g[x]>n[x]?-1:1)*te}}if(t!==r){const P=x==="x"?"y":"x",te=f[x]===h[P],O=d[P]>g[P],U=d[P]<g[P];(f[x]===1&&(!te&&O||te&&U)||f[x]!==1&&(!te&&U||te&&O))&&(w=x==="x"?T:L)}const G={x:d.x+E.x,y:d.y+E.y},Z={x:g.x+A.x,y:g.y+A.y},H=Math.max(Math.abs(G.x-w[0].x),Math.abs(Z.x-w[0].x)),q=Math.max(Math.abs(G.y-w[0].y),Math.abs(Z.y-w[0].y));H>=q?(k=(G.x+Z.x)/2,N=w[0].y):(k=w[0].x,N=(G.y+Z.y)/2)}return[[e,{x:d.x+E.x,y:d.y+E.y},...w,{x:g.x+A.x,y:g.y+A.y},n],k,N,_,C]}function bA(e,t,n,r){const a=Math.min(e1(e,t)/2,e1(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const d=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+a*d},${u}Q ${l},${u} ${l},${u+a*g}`}const f=e.x<n.x?1:-1,h=e.y<n.y?-1:1;return`L ${l},${u+a*h}Q ${l},${u} ${l+a*f},${u}`}function lm({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top,borderRadius:u=5,centerX:f,centerY:h,offset:d=20,stepPosition:g=.5}){const[m,x,v,w,k]=xA({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:f,y:h},offset:d,stepPosition:g});return[m.reduce((E,A,_)=>{let C="";return _>0&&_<m.length-1?C=bA(m[_-1],A,m[_+1],u):C=`${_===0?"M":"L"}${A.x} ${A.y}`,E+=C,E},""),x,v,w,k]}function t1(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function vA(e){const{sourceNode:t,targetNode:n}=e;if(!t1(t)||!t1(n))return null;const r=t.internals.handleBounds||n1(t.handles),a=n.internals.handleBounds||n1(n.handles),l=i1(r?.source??[],e.sourceHandle),u=i1(e.connectionMode===ga.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),e.targetHandle);if(!l||!u)return e.onError?.("008",ui.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const f=l?.position||be.Bottom,h=u?.position||be.Top,d=cs(t,l,f),g=cs(n,u,h);return{sourceX:d.x,sourceY:d.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:h}}function n1(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function cs(e,t,n=be.Left,r=!1){const a=(t?.x??0)+e.internals.positionAbsolute.x,l=(t?.y??0)+e.internals.positionAbsolute.y,{width:u,height:f}=t??Vi(e);if(r)return{x:a+u/2,y:l+f/2};switch(t?.position??n){case be.Top:return{x:a+u/2,y:l};case be.Right:return{x:a+u,y:l+f/2};case be.Bottom:return{x:a+u/2,y:l+f};case be.Left:return{x:a,y:l+f/2}}}function i1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function um(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function wA(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,f)=>([f.markerStart||r,f.markerEnd||a].forEach(h=>{if(h&&typeof h=="object"){const d=um(h,t);l.has(d)||(u.push({id:d,color:h.color||n,...h}),l.add(d))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const iS=1e3,SA=10,Jm={nodeOrigin:[0,0],nodeExtent:cl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_A={...Jm,checkEquality:!0};function Wm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function kA(e,t,n){const r=Wm(Jm,n);for(const a of e.values())if(a.parentId)tg(a,e,t,r);else{const l=El(a,r.nodeOrigin),u=ba(a.extent)?a.extent:r.nodeExtent,f=us(l,u,Vi(a));a.internals.positionAbsolute=f}}function EA(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function eg(e){return e==="manual"}function cm(e,t,n,r={}){const a=Wm(_A,r),l={i:0},u=new Map(t),f=a?.elevateNodesOnSelect&&!eg(a.zIndexMode)?iS:0;let h=e.length>0;t.clear(),n.clear();for(const d of e){let g=u.get(d.id);if(a.checkEquality&&d===g?.internals.userNode)t.set(d.id,g);else{const m=El(d,a.nodeOrigin),x=ba(d.extent)?d.extent:a.nodeExtent,v=us(m,x,Vi(d));g={...a.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:v,handleBounds:EA(d,g),z:rS(d,f,a.zIndexMode),userNode:d}},t.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&tg(g,t,n,r,l)}return h}function NA(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function tg(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:h}=Wm(Jm,r),d=e.parentId,g=t.get(d);if(!g){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}NA(e,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&h==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*SA),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=l&&!eg(h)?iS:0,{x,y:v,z:w}=CA(e,g,u,f,m,h),{positionAbsolute:k}=e.internals,N=x!==k.x||v!==k.y;(N||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:v}:k,z:w}})}function rS(e,t,n){const r=Yn(e.zIndex)?e.zIndex:0;return eg(n)?r:r+(e.selected?t:0)}function CA(e,t,n,r,a,l){const{x:u,y:f}=t.internals.positionAbsolute,h=Vi(e),d=El(e,n),g=ba(e.extent)?us(d,e.extent,h):d;let m=us({x:u+g.x,y:f+g.y},r,h);e.extent==="parent"&&(m=Fw(m,h,t));const x=rS(e,a,l),v=t.internals.z??0;return{x:m.x,y:m.y,z:v>=x?v+1:x}}function ng(e,t,n,r=[0,0]){const a=[],l=new Map;for(const u of e){const f=t.get(u.parentId);if(!f)continue;const h=l.get(u.parentId)?.expandedRect??xa(f),d=Xw(h,u.rect);l.set(u.parentId,{expandedRect:d,parent:f})}return l.size>0&&l.forEach(({expandedRect:u,parent:f},h)=>{const d=f.internals.positionAbsolute,g=Vi(f),m=f.origin??r,x=u.x<d.x?Math.round(Math.abs(d.x-u.x)):0,v=u.y<d.y?Math.round(Math.abs(d.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),k=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],E=(k-g.height)*m[1];(x>0||v>0||N||E)&&(a.push({id:h,type:"position",position:{x:f.position.x-x+N,y:f.position.y-v+E}}),n.get(h)?.forEach(A=>{e.some(_=>_.id===A.id)||a.push({id:A.id,type:"position",position:{x:A.position.x+x,y:A.position.y+v}})})),(g.width<u.width||g.height<u.height||x||v)&&a.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:k+(v?m[1]*v-E:0)}})}),a}function TA(e,t,n,r,a,l,u){const f=r?.querySelector(".xyflow__viewport");let h=!1;if(!f)return{changes:[],updatedInternals:h};const d=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const v of e.values()){const w=t.get(v.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),h=!0;continue}const k=Km(v.nodeElement),N=w.measured.width!==k.width||w.measured.height!==k.height;if(!!(k.width&&k.height&&(N||!w.internals.handleBounds||v.force))){const A=v.nodeElement.getBoundingClientRect(),_=ba(w.extent)?w.extent:l;let{positionAbsolute:C}=w.internals;w.parentId&&w.extent==="parent"?C=Fw(C,k,t.get(w.parentId)):_&&(C=us(C,_,k));const B={...w,measured:k,internals:{...w.internals,positionAbsolute:C,handleBounds:{source:Kb("source",v.nodeElement,A,m,w.id),target:Kb("target",v.nodeElement,A,m,w.id)}}};t.set(w.id,B),w.parentId&&tg(B,t,n,{nodeOrigin:a,zIndexMode:u}),h=!0,N&&(d.push({id:w.id,type:"dimensions",dimensions:k}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:xa(B,a)}))}}if(x.length>0){const v=ng(x,t,n,a);d.push(...v)}return{changes:d,updatedInternals:h}}async function AA({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r),f=!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2]);return Promise.resolve(f)}function r1(e,t,n,r,a,l){let u=a;const f=r.get(u)||new Map;r.set(u,f.set(n,t)),u=`${a}-${e}`;const h=r.get(u)||new Map;if(r.set(u,h.set(n,t)),l){u=`${a}-${e}-${l}`;const d=r.get(u)||new Map;r.set(u,d.set(n,t))}}function sS(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:f=null}=r,h={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:f},d=`${a}-${u}--${l}-${f}`,g=`${l}-${f}--${a}-${u}`;r1("source",h,g,e,a,u),r1("target",h,d,e,l,f),t.set(r.id,r)}}function aS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:aS(n,t):!1}function s1(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function MA(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!aS(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const f=e.get(l);f&&a.set(l,{id:l,position:f.position||{x:0,y:0},distance:{x:n.x-f.internals.positionAbsolute.x,y:n.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 a}function pp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const a=[];for(const[u,f]of t){const h=n.get(u)?.internals.userNode;h&&a.push({...h,position:f.position,dragging:r})}if(!e)return[a[0],a];const l=n.get(e)?.internals.userNode;return[l?{...l,position:t.get(e)?.position||l.position,dragging:r}:a[0],a]}function jA({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=Cl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function zA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,f=new Map,h=!1,d={x:0,y:0},g=null,m=!1,x=null,v=!1,w=!1,k=null;function N({noDragClassName:A,handleSelector:_,domNode:C,isSelectable:B,nodeId:T,nodeClickDistance:L=0}){x=Sn(C);function G({x:P,y:te}){const{nodeLookup:O,nodeExtent:U,snapGrid:R,snapToGrid:I,nodeOrigin:F,onNodeDrag:K,onSelectionDrag:z,onError:D,updateNodePositions:V}=t();l={x:P,y:te};let j=!1;const ie=f.size>1,ce=ie&&U?am(Nl(f)):null,fe=ie&&I?jA({dragItems:f,snapGrid:R,x:P,y:te}):null;for(const[he,ue]of f){if(!O.has(he))continue;let me={x:P-ue.distance.x,y:te-ue.distance.y};I&&(me=fe?{x:Math.round(me.x+fe.x),y:Math.round(me.y+fe.y)}:Cl(me,R));let Ee=null;if(ie&&U&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,Oe=Ne.x-ce.x+U[0][0],Qe=Ne.x+ue.measured.width-ce.x2+U[1][0],Xe=Ne.y-ce.y+U[0][1],pt=Ne.y+ue.measured.height-ce.y2+U[1][1];Ee=[[Oe,Xe],[Qe,pt]]}const{position:Ce,positionAbsolute:we}=Vw({nodeId:he,nextPosition:me,nodeLookup:O,nodeExtent:Ee||U,nodeOrigin:F,onError:D});j=j||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||j,!!j&&(V(f,!0),k&&(r||K||!T&&z))){const[he,ue]=pp({nodeId:T,dragItems:f,nodeLookup:O});r?.(k,f,he,ue),K?.(k,he,ue),T||z?.(k,ue)}}async function Z(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:O,autoPanOnNodeDrag:U}=t();if(!U){h=!1,cancelAnimationFrame(u);return}const[R,I]=Yw(d,g,O);(R!==0||I!==0)&&(l.x=(l.x??0)-R/P[2],l.y=(l.y??0)-I/P[2],await te({x:R,y:I})&&G(l)),u=requestAnimationFrame(Z)}function H(P){const{nodeLookup:te,multiSelectionActive:O,nodesDraggable:U,transform:R,snapGrid:I,snapToGrid:F,selectNodesOnDrag:K,onNodeDragStart:z,onSelectionDragStart:D,unselectNodesAndEdges:V}=t();m=!0,(!K||!B)&&!O&&T&&(te.get(T)?.selected||V()),B&&K&&T&&e?.(T);const j=nl(P.sourceEvent,{transform:R,snapGrid:I,snapToGrid:F,containerBounds:g});if(l=j,f=MA(te,U,j,T),f.size>0&&(n||z||!T&&D)){const[ie,ce]=pp({nodeId:T,dragItems:f,nodeLookup:te});n?.(P.sourceEvent,f,ie,ce),z?.(P.sourceEvent,ie,ce),T||D?.(P.sourceEvent,ce)}}const q=_w().clickDistance(L).on("start",P=>{const{domNode:te,nodeDragThreshold:O,transform:U,snapGrid:R,snapToGrid:I}=t();g=te?.getBoundingClientRect()||null,v=!1,w=!1,k=P.sourceEvent,O===0&&H(P),l=nl(P.sourceEvent,{transform:U,snapGrid:R,snapToGrid:I,containerBounds:g}),d=Xn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:O,snapGrid:U,snapToGrid:R,nodeDragThreshold:I,nodeLookup:F}=t(),K=nl(P.sourceEvent,{transform:O,snapGrid:U,snapToGrid:R,containerBounds:g});if(k=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||T&&!F.has(T))&&(v=!0),!v){if(!h&&te&&m&&(h=!0,Z()),!m){const z=Xn(P.sourceEvent,g),D=z.x-d.x,V=z.y-d.y;Math.sqrt(D*D+V*V)>I&&H(P)}(l.x!==K.xSnapped||l.y!==K.ySnapped)&&f&&m&&(d=Xn(P.sourceEvent,g),G(K))}}).on("end",P=>{if(!(!m||v)&&(h=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:O,onNodeDragStop:U,onSelectionDragStop:R}=t();if(w&&(O(f,!1),w=!1),a||U||!T&&R){const[I,F]=pp({nodeId:T,dragItems:f,nodeLookup:te,dragging:!1});a?.(P.sourceEvent,f,I,F),U?.(P.sourceEvent,I,F),T||R?.(P.sourceEvent,F)}}}).filter(P=>{const te=P.target;return!P.button&&(!A||!s1(te,`.${A}`,C))&&(!_||s1(te,_,C))});x.call(q)}function E(){x?.on(".drag",null)}return{update:N,destroy:E}}function RA(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())dl(a,xa(l))>0&&r.push(l);return r}const DA=250;function OA(e,t,n,r){let a=[],l=1/0;const u=RA(e,n,t+DA);for(const f of u){const h=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:g,y:m}=cs(f,d,d.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>t||(x<l?(a=[{...d,x:g,y:m}],l=x):x===l&&a.push({...d,x:g,y:m}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(h=>h.type===f)??a[0]}return a[0]}function oS(e,t,n,r,a,l=!1){const u=r.get(e);if(!u)return null;const f=a==="strict"?u.internals.handleBounds?.[t]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(n?f?.find(d=>d.id===n):f?.[0])??null;return h&&l?{...h,...cs(u,h,h.position,!0)}:h}function lS(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function LA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const uS=()=>!0;function BA(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:h,lib:d,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:v,onConnectStart:w,onConnect:k,onConnectEnd:N,isValidConnection:E=uS,onReconnectEnd:A,updateConnection:_,getTransform:C,getFromHandle:B,autoPanSpeed:T,dragThreshold:L=1,handleDomNode:G}){const Z=Qw(e.target);let H=0,q;const{x:P,y:te}=Xn(e),O=lS(l,G),U=f?.getBoundingClientRect();let R=!1;if(!U||!O)return;const I=oS(a,O,r,h,t);if(!I)return;let F=Xn(e,U),K=!1,z=null,D=!1,V=null;function j(){if(!g||!U)return;const[Ce,we]=Yw(F,U,T);x({x:Ce,y:we}),H=requestAnimationFrame(j)}const ie={...I,nodeId:a,type:O,position:I.position},ce=h.get(a);let he={inProgress:!0,isValid:null,from:cs(ce,ie,be.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:F,toHandle:null,toPosition:Xb[ie.position],toNode:null,pointer:F};function ue(){R=!0,_(he),w?.(e,{nodeId:a,handleId:r,handleType:O})}L===0&&ue();function me(Ce){if(!R){const{x:pt,y:un}=Xn(Ce),Ht=pt-P,Qt=un-te;if(!(Ht*Ht+Qt*Qt>L*L))return;ue()}if(!B()||!ie){Ee(Ce);return}const we=C();F=Xn(Ce,U),q=OA(Tl(F,we,!1,[1,1]),n,h,ie),K||(j(),K=!0);const Ne=cS(Ce,{handle:q,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:E,doc:Z,lib:d,flowId:m,nodeLookup:h});V=Ne.handleDomNode,z=Ne.connection,D=LA(!!q,Ne.isValid);const Oe=h.get(a),Qe=Oe?cs(Oe,ie,be.Left,!0):he.from,Xe={...he,from:Qe,isValid:D,to:Ne.toHandle&&D?af({x:Ne.toHandle.x,y:Ne.toHandle.y},we):F,toHandle:Ne.toHandle,toPosition:D&&Ne.toHandle?Ne.toHandle.position:Xb[ie.position],toNode:Ne.toHandle?h.get(Ne.toHandle.nodeId):null,pointer:F};_(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(R){(q||V)&&z&&D&&k?.(z);const{inProgress:we,...Ne}=he,Oe={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,Oe),l&&A?.(Ce,Oe)}v(),cancelAnimationFrame(H),K=!1,D=!1,z=null,V=null,Z.removeEventListener("mousemove",me),Z.removeEventListener("mouseup",Ee),Z.removeEventListener("touchmove",me),Z.removeEventListener("touchend",Ee)}}Z.addEventListener("mousemove",me),Z.addEventListener("mouseup",Ee),Z.addEventListener("touchmove",me),Z.addEventListener("touchend",Ee)}function cS(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:f,flowId:h,isValidConnection:d=uS,nodeLookup:g}){const m=l==="target",x=t?u.querySelector(`.${f}-flow__handle[data-id="${h}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:v,y:w}=Xn(e),k=u.elementFromPoint(v,w),N=k?.classList.contains(`${f}-flow__handle`)?k:x,E={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const A=lS(void 0,N),_=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),B=N.classList.contains("connectable"),T=N.classList.contains("connectableend");if(!_||!A)return E;const L={source:m?_:r,sourceHandle:m?C:a,target:m?r:_,targetHandle:m?a:C};E.connection=L;const Z=B&&T&&(n===ga.Strict?m&&A==="source"||!m&&A==="target":_!==r||C!==a);E.isValid=Z&&d(L),E.toHandle=oS(_,A,C,g,n,!0)}return E}const fm={onPointerDown:BA,isValid:cS};function HA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=Sn(e);function l({translateExtent:f,width:h,height:d,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:v=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const C=n(),B=_.sourceEvent.ctrlKey&&hl()?10:1,T=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*g,L=C[2]*Math.pow(2,T*B);t.scaleTo(L)};let k=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(k=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},E=_=>{const C=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const B=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],T=[B[0]-k[0],B[1]-k[1]];k=B;const L=r()*Math.max(C[2],Math.log(C[2]))*(v?-1:1),G={x:C[0]-T[0]*L,y:C[1]-T[1]*L},Z=[[0,0],[h,d]];t.setViewportConstrained({x:G.x,y:G.y,zoom:C[2]},Z,f)},A=Hw().on("start",N).on("zoom",m?E:null).on("zoom.wheel",x?w:null);a.call(A,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Pn}}const kf=e=>({x:e.x,y:e.y,zoom:e.k}),mp=({x:e,y:t,zoom:n})=>wf.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),fS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),UA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gp=(e,t=0,n=UA,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},dS=e=>{const t=e.ctrlKey&&hl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function IA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:f,onPanZoom:h,onPanZoomEnd:d}){return g=>{if(la(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&u){const N=Pn(g),E=dS(g),A=m*Math.pow(2,E);r.scaleTo(n,A,N,g);return}const x=g.deltaMode===1?20:1;let v=a===as.Vertical?0:g.deltaX*x,w=a===as.Horizontal?0:g.deltaY*x;!hl()&&g.shiftKey&&a!==as.Vertical&&(v=g.deltaY*x,w=0),r.translateBy(n,-(v/m)*l,-(w/m)*l,{internal:!0});const k=kf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(g,k),e.panScrollTimeout=setTimeout(()=>{d?.(g,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,k))}}function qA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,f=la(r,e);if(r.ctrlKey&&l&&f&&r.preventDefault(),u||f)return null;r.preventDefault(),n.call(this,r,a)}}function $A({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const a=kf(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,a)}}function PA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{e.usedRightMouseButton=!!(n&&fS(t,e.mouseButton??0)),l.sourceEvent?.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!l.sourceEvent?.internal&&a?.(l.sourceEvent,kf(l.transform))}}function VA({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,l&&fS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const f=kf(u.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(u.sourceEvent,f)},n?150:0)}}}function FA({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:f,noPanClassName:h,lib:d,connectionInProgress:g}){return m=>{const x=e||t,v=n&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(la(m,`${d}-flow__node`)||la(m,`${d}-flow__edge`)))return!0;if(!r&&!x&&!a&&!l&&!n||u||g&&!w||la(m,f)&&w||la(m,h)&&(!w||a&&w&&!e)||!n&&m.ctrlKey&&w)return!1;if(!n&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!x&&!a&&!v&&w||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&k}}function YA({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Hw().scaleExtent([t,n]).translateExtent(r),x=Sn(e).call(m);A({x:a.x,y:a.y,zoom:ya(a.zoom,t,n)},[[0,0],[g.width,g.height]],r);const v=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(dS);function k(q,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?tl:Hc).transform(gp(x,P?.duration,P?.ease,()=>te(!0)),q)}):Promise.resolve(!1)}function N({noWheelClassName:q,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:O,panOnScroll:U,panOnDrag:R,panOnScrollMode:I,panOnScrollSpeed:F,preventScrolling:K,zoomOnPinch:z,zoomOnScroll:D,zoomOnDoubleClick:V,zoomActivationKeyPressed:j,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){O&&!d.isZoomingOrPanning&&E();const me=U&&!j&&!O;m.clickDistance(ue?1/0:!Yn(he)||he<0?0:he);const Ee=me?IA({zoomPanValues:d,noWheelClassName:q,d3Selection:x,d3Zoom:m,panOnScrollMode:I,panOnScrollSpeed:F,zoomOnPinch:z,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):qA({noWheelClassName:q,preventScrolling:K,d3ZoomHandler:v});if(x.on("wheel.zoom",Ee,{passive:!1}),!O){const we=$A({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:u});m.on("start",we);const Ne=PA({zoomPanValues:d,panOnDrag:R,onPaneContextMenu:!!te,onPanZoom:l,onTransformChange:ce});m.on("zoom",Ne);const Oe=VA({zoomPanValues:d,panOnDrag:R,panOnScroll:U,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:h});m.on("end",Oe)}const Ce=FA({zoomActivationKeyPressed:j,panOnDrag:R,zoomOnScroll:D,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:z,userSelectionActive:O,noPanClassName:P,noWheelClassName:q,lib:ie,connectionInProgress:fe});m.filter(Ce),V?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function E(){m.on("zoom",null)}async function A(q,P,te){const O=mp(q),U=m?.constrain()(O,P,te);return U&&await k(U),new Promise(R=>R(U))}async function _(q,P){const te=mp(q);return await k(te,P),new Promise(O=>O(te))}function C(q){if(x){const P=mp(q),te=x.property("__zoom");(te.k!==q.zoom||te.x!==q.x||te.y!==q.y)&&m?.transform(x,P,null,{sync:!0})}}function B(){const q=x?Bw(x.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}function T(q,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?tl:Hc).scaleTo(gp(x,P?.duration,P?.ease,()=>te(!0)),q)}):Promise.resolve(!1)}function L(q,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?tl:Hc).scaleBy(gp(x,P?.duration,P?.ease,()=>te(!0)),q)}):Promise.resolve(!1)}function G(q){m?.scaleExtent(q)}function Z(q){m?.translateExtent(q)}function H(q){const P=!Yn(q)||q<0?0:q;m?.clickDistance(P)}return{update:N,destroy:E,setViewport:_,setViewportConstrained:A,getViewport:B,scaleTo:T,scaleBy:L,setScaleExtent:G,setTranslateExtent:Z,syncViewport:C,setClickDistance:H}}var va;(function(e){e.Line="line",e.Handle="handle"})(va||(va={}));function XA({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,f=n-r,h=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&a&&(h[0]=h[0]*-1),f&&l&&(h[1]=h[1]*-1),h}function a1(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function wr(e,t){return Math.max(0,t-e)}function Sr(e,t){return Math.max(0,e-t)}function fc(e,t,n){return Math.max(0,t-e,e-n)}function o1(e,t){return e?!t:t}function GA(e,t,n,r,a,l,u,f){let{affectsX:h,affectsY:d}=t;const{isHorizontal:g,isVertical:m}=t,x=g&&m,{xSnapped:v,ySnapped:w}=n,{minWidth:k,maxWidth:N,minHeight:E,maxHeight:A}=r,{x:_,y:C,width:B,height:T,aspectRatio:L}=e;let G=Math.floor(g?v-e.pointerX:0),Z=Math.floor(m?w-e.pointerY:0);const H=B+(h?-G:G),q=T+(d?-Z:Z),P=-l[0]*B,te=-l[1]*T;let O=fc(H,k,N),U=fc(q,E,A);if(u){let F=0,K=0;h&&G<0?F=wr(_+G+P,u[0][0]):!h&&G>0&&(F=Sr(_+H+P,u[1][0])),d&&Z<0?K=wr(C+Z+te,u[0][1]):!d&&Z>0&&(K=Sr(C+q+te,u[1][1])),O=Math.max(O,F),U=Math.max(U,K)}if(f){let F=0,K=0;h&&G>0?F=Sr(_+G,f[0][0]):!h&&G<0&&(F=wr(_+H,f[1][0])),d&&Z>0?K=Sr(C+Z,f[0][1]):!d&&Z<0&&(K=wr(C+q,f[1][1])),O=Math.max(O,F),U=Math.max(U,K)}if(a){if(g){const F=fc(H/L,E,A)*L;if(O=Math.max(O,F),u){let K=0;!h&&!d||h&&!d&&x?K=Sr(C+te+H/L,u[1][1])*L:K=wr(C+te+(h?G:-G)/L,u[0][1])*L,O=Math.max(O,K)}if(f){let K=0;!h&&!d||h&&!d&&x?K=wr(C+H/L,f[1][1])*L:K=Sr(C+(h?G:-G)/L,f[0][1])*L,O=Math.max(O,K)}}if(m){const F=fc(q*L,k,N)/L;if(U=Math.max(U,F),u){let K=0;!h&&!d||d&&!h&&x?K=Sr(_+q*L+P,u[1][0])/L:K=wr(_+(d?Z:-Z)*L+P,u[0][0])/L,U=Math.max(U,K)}if(f){let K=0;!h&&!d||d&&!h&&x?K=wr(_+q*L,f[1][0])/L:K=Sr(_+(d?Z:-Z)*L,f[0][0])/L,U=Math.max(U,K)}}}Z=Z+(Z<0?U:-U),G=G+(G<0?O:-O),a&&(x?H>q*L?Z=(o1(h,d)?-G:G)/L:G=(o1(h,d)?-Z:Z)*L:g?(Z=G/L,d=h):(G=Z*L,h=d));const R=h?_+G:_,I=d?C+Z:C;return{width:B+(h?-G:G),height:T+(d?-Z:Z),x:l[0]*G*(h?-1:1)+R,y:l[1]*Z*(d?-1:1)+I}}const hS={width:0,height:0,x:0,y:0},ZA={...hS,pointerX:0,pointerY:0,aspectRatio:1};function QA(e){return[[0,0],[e.measured.width,e.measured.height]]}function KA(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,f=n[0]*l,h=n[1]*u;return[[r-f,a-h],[r+l-f,a+u-h]]}function JA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=Sn(e);let u={controlDirection:a1("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:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:v,onResize:w,onResizeEnd:k,shouldResize:N}){let E={...hS},A={...ZA};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:a1(d)};let _,C=null,B=[],T,L,G,Z=!1;const H=_w().on("start",q=>{const{nodeLookup:P,transform:te,snapGrid:O,snapToGrid:U,nodeOrigin:R,paneDomNode:I}=n();if(_=P.get(t),!_)return;C=I?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:K}=nl(q.sourceEvent,{transform:te,snapGrid:O,snapToGrid:U,containerBounds:C});E={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},A={...E,pointerX:F,pointerY:K,aspectRatio:E.width/E.height},T=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(T=P.get(_.parentId),L=T&&_.extent==="parent"?QA(T):void 0),B=[],G=void 0;for(const[z,D]of P)if(D.parentId===t&&(B.push({id:z,position:{...D.position},extent:D.extent}),D.extent==="parent"||D.expandParent)){const V=KA(D,_,D.origin??R);G?G=[[Math.min(V[0][0],G[0][0]),Math.min(V[0][1],G[0][1])],[Math.max(V[1][0],G[1][0]),Math.max(V[1][1],G[1][1])]]:G=V}v?.(q,{...E})}).on("drag",q=>{const{transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:U}=n(),R=nl(q.sourceEvent,{transform:P,snapGrid:te,snapToGrid:O,containerBounds:C}),I=[];if(!_)return;const{x:F,y:K,width:z,height:D}=E,V={},j=_.origin??U,{width:ie,height:ce,x:fe,y:he}=GA(A,u.controlDirection,R,u.boundaries,u.keepAspectRatio,j,L,G),ue=ie!==z,me=ce!==D,Ee=fe!==F&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||j[0]===1||j[1]===1)&&(V.x=Ee?fe:E.x,V.y=Ce?he:E.y,E.x=V.x,E.y=V.y,B.length>0)){const Qe=fe-F,Xe=he-K;for(const pt of B)pt.position={x:pt.position.x-Qe+j[0]*(ie-z),y:pt.position.y-Xe+j[1]*(ce-D)},I.push(pt)}if((ue||me)&&(V.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:E.width,V.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:E.height,E.width=V.width,E.height=V.height),T&&_.expandParent){const Qe=j[0]*(V.width??0);V.x&&V.x<Qe&&(E.x=Qe,A.x=A.x-(V.x-Qe));const Xe=j[1]*(V.height??0);V.y&&V.y<Xe&&(E.y=Xe,A.y=A.y-(V.y-Xe))}const we=XA({width:E.width,prevWidth:z,height:E.height,prevHeight:D,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={...E,direction:we};N?.(q,Ne)!==!1&&(Z=!0,w?.(q,Ne),r(V,I))}).on("end",q=>{Z&&(k?.(q,{...E}),a?.({...E}),Z=!1)});l.call(H)}function h(){l.on(".drag",null)}return{update:f,destroy:h}}var yp={exports:{}},xp={},bp={exports:{}},vp={};var l1;function WA(){if(l1)return vp;l1=1;var e=Sl();function t(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(m,x){var v=x(),w=r({inst:{value:v,getSnapshot:x}}),k=w[0].inst,N=w[1];return l(function(){k.value=v,k.getSnapshot=x,h(k)&&N({inst:k})},[m,v,x]),a(function(){return h(k)&&N({inst:k}),m(function(){h(k)&&N({inst:k})})},[m]),u(v),v}function h(m){var x=m.getSnapshot;m=m.value;try{var v=x();return!n(m,v)}catch{return!0}}function d(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:f;return vp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,vp}var u1;function eM(){return u1||(u1=1,bp.exports=WA()),bp.exports}var c1;function tM(){if(c1)return xp;c1=1;var e=Sl(),t=eM();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return xp.useSyncExternalStoreWithSelector=function(d,g,m,x,v){var w=l(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=f(function(){function E(T){if(!A){if(A=!0,_=T,T=x(T),v!==void 0&&k.hasValue){var L=k.value;if(v(L,T))return C=L}return C=T}if(L=C,r(_,T))return L;var G=x(T);return v!==void 0&&v(L,G)?(_=T,L):(_=T,C=G)}var A=!1,_,C,B=m===void 0?null:m;return[function(){return E(g())},B===null?void 0:function(){return E(B())}]},[g,m,x,v]);var N=a(d,w[0],w[1]);return u(function(){k.hasValue=!0,k.value=N},[N]),h(N),N},xp}var f1;function nM(){return f1||(f1=1,yp.exports=tM()),yp.exports}var iM=nM();const rM=gf(iM),sM={},d1=e=>{let t;const n=new Set,r=(g,m)=>{const x=typeof g=="function"?g(t):g;if(!Object.is(x,t)){const v=t;t=m??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(w=>w(t,v))}},a=()=>t,h={setState:r,getState:a,getInitialState:()=>d,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(sM?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(r,a,h);return h},aM=e=>e?d1(e):d1,{useDebugValue:oM}=Zo,{useSyncExternalStoreWithSelector:lM}=rM,uM=e=>e;function pS(e,t=uM,n){const r=lM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oM(r),r}const h1=(e,t)=>{const n=aM(e),r=(a,l=t)=>pS(n,a,l);return Object.assign(r,n),r},cM=(e,t)=>e?h1(e,t):h1;function ct(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}lw();const Ef=X.createContext(null),fM=Ef.Provider,mS=ui.error001();function Ye(e,t){const n=X.useContext(Ef);if(n===null)throw new Error(mS);return pS(n,e,t)}function ft(){const e=X.useContext(Ef);if(e===null)throw new Error(mS);return X.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const p1={display:"none"},dM={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},gS="react-flow__node-desc",yS="react-flow__edge-desc",hM="react-flow__aria-live",pM=e=>e.ariaLiveMessage,mM=e=>e.ariaLabelConfig;function gM({rfId:e}){const t=Ye(pM);return b.jsx("div",{id:`${hM}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:dM,children:t})}function yM({rfId:e,disableKeyboardA11y:t}){const n=Ye(mM);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${gS}-${e}`,style:p1,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${yS}-${e}`,style:p1,children:n["edge.a11yDescription.default"]}),!t&&b.jsx(gM,{rfId:e})]})}const Nf=X.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return b.jsx("div",{className:Et(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Nf.displayName="Panel";function xM({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:b.jsx(Nf,{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:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const bM=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},dc=e=>e.id;function vM(e,t){return ct(e.selectedNodes.map(dc),t.selectedNodes.map(dc))&&ct(e.selectedEdges.map(dc),t.selectedEdges.map(dc))}function wM({onSelectionChange:e}){const t=ft(),{selectedNodes:n,selectedEdges:r}=Ye(bM,vM);return X.useEffect(()=>{const a={nodes:n,edges:r};e?.(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const SM=e=>!!e.onSelectionChangeHandlers;function _M({onSelectionChange:e}){const t=Ye(SM);return e||t?b.jsx(wM,{onSelectionChange:e}):null}const xS=[0,0],kM={x:0,y:0,zoom:1},EM=["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"],m1=[...EM,"rfId"],NM=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}),g1={translateExtent:cl,nodeOrigin:xS,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function CM(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:f,setDefaultNodesAndEdges:h}=Ye(NM,ct),d=ft();X.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{g.current=g1,f()}),[]);const g=X.useRef(g1);return X.useEffect(()=>{for(const m of m1){const x=e[m],v=g.current[m];x!==v&&(typeof e[m]>"u"||(m==="nodes"?t(x):m==="edges"?n(x):m==="minZoom"?r(x):m==="maxZoom"?a(x):m==="translateExtent"?l(x):m==="nodeExtent"?u(x):m==="ariaLabelConfig"?d.setState({ariaLabelConfig:fA(x)}):m==="fitView"?d.setState({fitViewQueued:x}):m==="fitViewOptions"?d.setState({fitViewOptions:x}):d.setState({[m]:x})))}g.current=e},m1.map(m=>e[m])),null}function y1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function TM(e){const[t,n]=X.useState(e==="system"?null:e);return X.useEffect(()=>{if(e!=="system"){n(e);return}const r=y1(),a=()=>n(r?.matches?"dark":"light");return a(),r?.addEventListener("change",a),()=>{r?.removeEventListener("change",a)}},[e]),t!==null?t:y1()?.matches?"dark":"light"}const x1=typeof document<"u"?document:null;function pl(e=null,t={target:x1,actInsideInputWithModifier:!0}){const[n,r]=X.useState(!1),a=X.useRef(!1),l=X.useRef(new Set([])),[u,f]=X.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
10
- `).replace(`
11
-
12
- `,`
13
- +`).split(`
14
- `)),g=d.reduce((m,x)=>m.concat(...x),[]);return[d,g]}return[[],[]]},[e]);return X.useEffect(()=>{const h=t?.target??x1,d=t?.actInsideInputWithModifier??!0;if(e!==null){const g=v=>{if(a.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!a.current||a.current&&!d)&&Kw(v))return!1;const k=v1(v.code,f);if(l.current.add(v[k]),b1(u,l.current,!1)){const N=v.composedPath?.()?.[0]||v.target,E=N?.nodeName==="BUTTON"||N?.nodeName==="A";t.preventDefault!==!1&&(a.current||!E)&&v.preventDefault(),r(!0)}},m=v=>{const w=v1(v.code,f);b1(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(v[w]),v.key==="Meta"&&l.current.clear(),a.current=!1},x=()=>{l.current.clear(),r(!1)};return h?.addEventListener("keydown",g),h?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h?.removeEventListener("keydown",g),h?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,r]),n}function b1(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function v1(e,t){return t.includes(e)?"code":"key"}const AM=()=>{const e=ft();return X.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:f}=e.getState(),h=Qm(t,r,a,l,u,n?.padding??.1);return f?(await f.setViewport(h,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:f,y:h}=u.getBoundingClientRect(),d={x:t.x-f,y:t.y-h},g=n.snapGrid??a,m=n.snapToGrid??l;return Tl(d,r,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=af(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function bS(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const f={...l};for(const h of u)MM(h,f);n.push(f)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function MM(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 $c(e,t){return bS(e,t)}function vS(e,t){return bS(e,t)}function ns(e,t){return{id:e,type:"select",selected:t}}function ua(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(ns(l.id,u)))}return r}function w1({items:e=[],lookup:t}){const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,l]of e.entries()){const u=t.get(l.id),f=u?.internals?.userNode??u;f!==void 0&&f!==l&&n.push({id:l.id,item:l,type:"replace"}),f===void 0&&n.push({item:l,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function S1(e){return{id:e.id,type:"remove"}}const _1=e=>tA(e),jM=e=>Pw(e);function wS(e){return X.forwardRef(e)}const zM=typeof window<"u"?X.useLayoutEffect:X.useEffect;function k1(e){const[t,n]=X.useState(BigInt(0)),[r]=X.useState(()=>RM(()=>n(a=>a+BigInt(1))));return zM(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function RM(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const SS=X.createContext(null);function DM({children:e}){const t=ft(),n=X.useCallback(f=>{const{nodes:h=[],setNodes:d,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:v,onNodesChangeMiddlewareMap:w}=t.getState();let k=h;for(const E of f)k=typeof E=="function"?E(k):E;let N=w1({items:k,lookup:x});for(const E of w.values())N=E(N);g&&d(k),N.length>0?m?.(N):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:A,setNodes:_}=t.getState();E&&_(A)})},[]),r=k1(n),a=X.useCallback(f=>{const{edges:h=[],setEdges:d,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=t.getState();let v=h;for(const w of f)v=typeof w=="function"?w(v):w;g?d(v):m&&m(w1({items:v,lookup:x}))},[]),l=k1(a),u=X.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return b.jsx(SS.Provider,{value:u,children:e})}function OM(){const e=X.useContext(SS);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const LM=e=>!!e.panZoom;function ig(){const e=AM(),t=ft(),n=OM(),r=Ye(LM),a=X.useMemo(()=>{const l=m=>t.getState().nodeLookup.get(m),u=m=>{n.nodeQueue.push(m)},f=m=>{n.edgeQueue.push(m)},h=m=>{const{nodeLookup:x,nodeOrigin:v}=t.getState(),w=_1(m)?m:x.get(m.id),k=w.parentId?Zw(w.position,w.measured,w.parentId,x,v):w.position,N={...w,position:k,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return xa(N)},d=(m,x,v={replace:!1})=>{u(w=>w.map(k=>{if(k.id===m){const N=typeof x=="function"?x(k):x;return v.replace&&_1(N)?N:{...k,...N}}return k}))},g=(m,x,v={replace:!1})=>{f(w=>w.map(k=>{if(k.id===m){const N=typeof x=="function"?x(k):x;return v.replace&&jM(N)?N:{...k,...N}}return k}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>l(m)?.internals.userNode,getInternalNode:l,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(x=>({...x}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:u,setEdges:f,addNodes:m=>{const x=Array.isArray(m)?m:[m];n.nodeQueue.push(v=>[...v,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];n.edgeQueue.push(v=>[...v,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:v}=t.getState(),[w,k,N]=v;return{nodes:m.map(E=>({...E})),edges:x.map(E=>({...E})),viewport:{x:w,y:k,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:v,edges:w,onNodesDelete:k,onEdgesDelete:N,triggerNodeChanges:E,triggerEdgeChanges:A,onDelete:_,onBeforeDelete:C}=t.getState(),{nodes:B,edges:T}=await aA({nodesToRemove:m,edgesToRemove:x,nodes:v,edges:w,onBeforeDelete:C}),L=T.length>0,G=B.length>0;if(L){const Z=T.map(S1);N?.(T),A(Z)}if(G){const Z=B.map(S1);k?.(B),E(Z)}return(G||L)&&_?.({nodes:B,edges:T}),{deletedNodes:B,deletedEdges:T}},getIntersectingNodes:(m,x=!0,v)=>{const w=Zb(m),k=w?m:h(m),N=v!==void 0;return k?(v||t.getState().nodes).filter(E=>{const A=t.getState().nodeLookup.get(E.id);if(A&&!w&&(E.id===m.id||!A.internals.positionAbsolute))return!1;const _=xa(N?E:A),C=dl(_,k);return x&&C>0||C>=_.width*_.height||C>=k.width*k.height}):[]},isNodeIntersecting:(m,x,v=!0)=>{const k=Zb(m)?m:h(m);if(!k)return!1;const N=dl(k,x);return v&&N>0||N>=x.width*x.height||N>=k.width*k.height},updateNode:d,updateNodeData:(m,x,v={replace:!1})=>{d(m,w=>{const k=typeof x=="function"?x(w):x;return v.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},v)},updateEdge:g,updateEdgeData:(m,x,v={replace:!1})=>{g(m,w=>{const k=typeof x=="function"?x(w):x;return v.replace?{...w,data:k}:{...w,data:{...w.data,...k}}},v)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:v}=t.getState();return nA(m,{nodeLookup:x,nodeOrigin:v})},getHandleConnections:({type:m,id:x,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:v})=>Array.from(t.getState().connectionLookup.get(`${v}${m?x?`-${m}-${x}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const x=t.getState().fitViewResolver??cA();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:x}),n.nodeQueue.push(v=>[...v]),x.promise}}},[]);return X.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const E1=e=>e.selected,BM=typeof window<"u"?window:void 0;function HM({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ft(),{deleteElements:r}=ig(),a=pl(e,{actInsideInputWithModifier:!1}),l=pl(t,{target:BM});X.useEffect(()=>{if(a){const{edges:u,nodes:f}=n.getState();r({nodes:f.filter(E1),edges:u.filter(E1)}),n.setState({nodesSelectionActive:!1})}},[a]),X.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function UM(e){const t=ft();X.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const r=Km(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",ui.error004()),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Cf={position:"absolute",width:"100%",height:"100%",top:0,left:0},IM=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function qM({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=as.Free,zoomOnDoubleClick:u=!0,panOnDrag:f=!0,defaultViewport:h,translateExtent:d,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:v=!0,children:w,noWheelClassName:k,noPanClassName:N,onViewportChange:E,isControlledViewport:A,paneClickDistance:_,selectionOnDrag:C}){const B=ft(),T=X.useRef(null),{userSelectionActive:L,lib:G,connectionInProgress:Z}=Ye(IM,ct),H=pl(x),q=X.useRef();UM(T);const P=X.useCallback(te=>{E?.({x:te[0],y:te[1],zoom:te[2]}),A||B.setState({transform:te})},[E,A]);return X.useEffect(()=>{if(T.current){q.current=YA({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:d,viewport:h,onDraggingChange:R=>B.setState({paneDragging:R}),onPanZoomStart:(R,I)=>{const{onViewportChangeStart:F,onMoveStart:K}=B.getState();K?.(R,I),F?.(I)},onPanZoom:(R,I)=>{const{onViewportChange:F,onMove:K}=B.getState();K?.(R,I),F?.(I)},onPanZoomEnd:(R,I)=>{const{onViewportChangeEnd:F,onMoveEnd:K}=B.getState();K?.(R,I),F?.(I)}});const{x:te,y:O,zoom:U}=q.current.getViewport();return B.setState({panZoom:q.current,transform:[te,O,U],domNode:T.current.closest(".react-flow")}),()=>{q.current?.destroy()}}},[]),X.useEffect(()=>{q.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:H,preventScrolling:v,noPanClassName:N,userSelectionActive:L,noWheelClassName:k,lib:G,onTransformChange:P,connectionInProgress:Z,selectionOnDrag:C,paneClickDistance:_})},[e,t,n,r,a,l,u,f,H,v,N,L,k,G,P,Z,C,_]),b.jsx("div",{className:"react-flow__renderer",ref:T,style:Cf,children:w})}const $M=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function PM(){const{userSelectionActive:e,userSelectionRect:t}=Ye($M,ct);return e&&t?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const wp=(e,t)=>n=>{n.target===t.current&&e?.(n)},VM=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function FM({isSelecting:e,selectionKeyPressed:t,selectionMode:n=fl.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:l,onSelectionStart:u,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:d,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:v,children:w}){const k=ft(),{userSelectionActive:N,elementsSelectable:E,dragging:A,connectionInProgress:_}=Ye(VM,ct),C=E&&(e||N),B=X.useRef(null),T=X.useRef(),L=X.useRef(new Set),G=X.useRef(new Set),Z=X.useRef(!1),H=F=>{if(Z.current||_){Z.current=!1;return}h?.(F),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},q=F=>{if(Array.isArray(r)&&r?.includes(2)){F.preventDefault();return}d?.(F)},P=g?F=>g(F):void 0,te=F=>{Z.current&&(F.stopPropagation(),Z.current=!1)},O=F=>{const{domNode:K}=k.getState();if(T.current=K?.getBoundingClientRect(),!T.current)return;const z=F.target===B.current;if(!z&&!!F.target.closest(".nokey")||!e||!(l&&z||t)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),Z.current=!1;const{x:j,y:ie}=Xn(F.nativeEvent,T.current);k.setState({userSelectionRect:{width:0,height:0,startX:j,startY:ie,x:j,y:ie}}),z||(F.stopPropagation(),F.preventDefault())},U=F=>{const{userSelectionRect:K,transform:z,nodeLookup:D,edgeLookup:V,connectionLookup:j,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=k.getState();if(!T.current||!K)return;const{x:ue,y:me}=Xn(F.nativeEvent,T.current),{startX:Ee,startY:Ce}=K;if(!Z.current){const Xe=t?0:a;if(Math.hypot(ue-Ee,me-Ce)<=Xe)return;he(),u?.(F)}Z.current=!0;const we={startX:Ee,startY:Ce,x:ue<Ee?ue:Ee,y:me<Ce?me:Ce,width:Math.abs(ue-Ee),height:Math.abs(me-Ce)},Ne=L.current,Oe=G.current;L.current=new Set(Zm(D,we,z,n===fl.Partial,!0).map(Xe=>Xe.id)),G.current=new Set;const Qe=fe?.selectable??!0;for(const Xe of L.current){const pt=j.get(Xe);if(pt)for(const{edgeId:un}of pt.values()){const Ht=V.get(un);Ht&&(Ht.selectable??Qe)&&G.current.add(un)}}if(!Qb(Ne,L.current)){const Xe=ua(D,L.current,!0);ie(Xe)}if(!Qb(Oe,G.current)){const Xe=ua(V,G.current);ce(Xe)}k.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},R=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!N&&F.target===B.current&&k.getState().userSelectionRect&&H?.(F),k.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f?.(F),k.setState({nodesSelectionActive:L.current.size>0})))},I=r===!0||Array.isArray(r)&&r.includes(0);return b.jsxs("div",{className:Et(["react-flow__pane",{draggable:I,dragging:A,selection:e}]),onClick:C?void 0:wp(H,B),onContextMenu:wp(q,B),onWheel:wp(P,B),onPointerEnter:C?void 0:m,onPointerMove:C?U:x,onPointerUp:C?R:void 0,onPointerDownCapture:C?O:void 0,onClickCapture:C?te:void 0,onPointerLeave:v,ref:B,style:Cf,children:[w,b.jsx(PM,{})]})}function dm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:f,onError:h}=t.getState(),d=f.get(e);if(!d){h?.("012",ui.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&u)&&(l({nodes:[d],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):a([e])}function _S({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const f=ft(),[h,d]=X.useState(!1),g=X.useRef();return X.useEffect(()=>{g.current=zA({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{dm({id:m,store:f,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),X.useEffect(()=>{if(t)g.current?.destroy();else if(e.current)return g.current?.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u}),()=>{g.current?.destroy()}},[n,r,t,l,e,a]),h}const YM=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function kS(){const e=ft();return X.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:f,updateNodePositions:h,nodeLookup:d,nodeOrigin:g}=e.getState(),m=new Map,x=YM(u),v=a?l[0]:5,w=a?l[1]:5,k=n.direction.x*v*n.factor,N=n.direction.y*w*n.factor;for(const[,E]of d){if(!x(E))continue;let A={x:E.internals.positionAbsolute.x+k,y:E.internals.positionAbsolute.y+N};a&&(A=Cl(A,l));const{position:_,positionAbsolute:C}=Vw({nodeId:E.id,nextPosition:A,nodeLookup:d,nodeExtent:r,nodeOrigin:g,onError:f});E.position=_,E.internals.positionAbsolute=C,m.set(E.id,E)}h(m)},[])}const rg=X.createContext(null),XM=rg.Provider;rg.Consumer;const ES=()=>X.useContext(rg),GM=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ZM=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:f,toHandle:h,isValid:d}=u,g=h?.nodeId===e&&h?.id===t&&h?.type===n;return{connectingFrom:f?.nodeId===e&&f?.id===t&&f?.type===n,connectingTo:g,clickConnecting:a?.nodeId===e&&a?.id===t&&a?.type===n,isPossibleEndHandle:l===ga.Strict?f?.type!==n:e!==f?.nodeId||t!==f?.id,connectionInProcess:!!f,clickConnectionInProcess:!!a,valid:g&&d}};function QM({type:e="source",position:t=be.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:f,children:h,className:d,onMouseDown:g,onTouchStart:m,...x},v){const w=u||null,k=e==="target",N=ft(),E=ES(),{connectOnClick:A,noPanClassName:_,rfId:C}=Ye(GM,ct),{connectingFrom:B,connectingTo:T,clickConnecting:L,isPossibleEndHandle:G,connectionInProcess:Z,clickConnectionInProcess:H,valid:q}=Ye(ZM(E,w,e),ct);E||N.getState().onError?.("010",ui.error010());const P=U=>{const{defaultEdgeOptions:R,onConnect:I,hasDefaultEdges:F}=N.getState(),K={...R,...U};if(F){const{edges:z,setEdges:D}=N.getState();D(om(K,z))}I?.(K),f?.(K)},te=U=>{if(!E)return;const R=Jw(U.nativeEvent);if(a&&(R&&U.button===0||!R)){const I=N.getState();fm.onPointerDown(U.nativeEvent,{handleDomNode:U.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:k,handleId:w,nodeId:E,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:I.onConnectEnd,updateConnection:I.updateConnection,onConnect:P,isValidConnection:n||I.isValidConnection,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}R?g?.(U):m?.(U)},O=U=>{const{onClickConnectStart:R,onClickConnectEnd:I,connectionClickStartHandle:F,connectionMode:K,isValidConnection:z,lib:D,rfId:V,nodeLookup:j,connection:ie}=N.getState();if(!E||!F&&!a)return;if(!F){R?.(U.nativeEvent,{nodeId:E,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:E,type:e,id:w}});return}const ce=Qw(U.target),fe=n||z,{connection:he,isValid:ue}=fm.isValid(U.nativeEvent,{handle:{nodeId:E,id:w,type:e},connectionMode:K,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:fe,flowId:V,doc:ce,lib:D,nodeLookup:j});ue&&he&&P(he);const me=structuredClone(ie);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,I?.(U,me),N.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":w,"data-nodeid":E,"data-handlepos":t,"data-id":`${C}-${E}-${w}-${e}`,className:Et(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,d,{source:!k,target:k,connectable:r,connectablestart:a,connectableend:l,clickconnecting:L,connectingfrom:B,connectingto:T,valid:q,connectionindicator:r&&(!Z||G)&&(Z||H?l:a)}]),onMouseDown:te,onTouchStart:te,onClick:A?O:void 0,ref:v,...x,children:h})}const wa=X.memo(wS(QM));function KM({data:e,isConnectable:t,sourcePosition:n=be.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(wa,{type:"source",position:n,isConnectable:t})]})}function JM({data:e,isConnectable:t,targetPosition:n=be.Top,sourcePosition:r=be.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(wa,{type:"target",position:n,isConnectable:t}),e?.label,b.jsx(wa,{type:"source",position:r,isConnectable:t})]})}function WM(){return null}function e3({data:e,isConnectable:t,targetPosition:n=be.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(wa,{type:"target",position:n,isConnectable:t}),e?.label]})}const of={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},N1={input:KM,default:JM,output:e3,group:WM};function t3(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 n3=e=>{const{width:t,height:n,x:r,y:a}=Nl(e.nodeLookup,{filter:l=>!!l.selected});return{width:Yn(t)?t:null,height:Yn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function i3({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ft(),{width:a,height:l,transformString:u,userSelectionActive:f}=Ye(n3,ct),h=kS(),d=X.useRef(null);if(X.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),_S({nodeRef:d}),f||!a||!l)return null;const g=e?x=>{const v=r.getState().nodes.filter(w=>w.selected);e(x,v)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(of,x.key)&&(x.preventDefault(),h({direction:of[x.key],factor:x.shiftKey?4:1}))};return b.jsx("div",{className:Et(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:b.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:l}})})}const C1=typeof window<"u"?window:void 0,r3=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function NS({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:f,deleteKeyCode:h,selectionKeyCode:d,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:N,elementsSelectable:E,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:C,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:G,defaultViewport:Z,translateExtent:H,minZoom:q,maxZoom:P,preventScrolling:te,onSelectionContextMenu:O,noWheelClassName:U,noPanClassName:R,disableKeyboardA11y:I,onViewportChange:F,isControlledViewport:K}){const{nodesSelectionActive:z,userSelectionActive:D}=Ye(r3,ct),V=pl(d,{target:C1}),j=pl(k,{target:C1}),ie=j||G,ce=j||C,fe=g&&ie!==!0,he=V||D||fe;return HM({deleteKeyCode:h,multiSelectionKeyCode:w}),b.jsx(qM,{onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:A,zoomOnPinch:_,panOnScroll:ce,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:!V&&ie,defaultViewport:Z,translateExtent:H,minZoom:q,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:U,noPanClassName:R,onViewportChange:F,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:b.jsxs(FM,{onSelectionStart:x,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:ie,isSelecting:!!he,selectionMode:m,selectionKeyPressed:V,paneClickDistance:f,selectionOnDrag:fe,children:[e,z&&b.jsx(i3,{onSelectionContextMenu:O,noPanClassName:R,disableKeyboardA11y:I})]})})}NS.displayName="FlowRenderer";const s3=X.memo(NS),a3=e=>t=>e?Zm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function o3(e){return Ye(X.useCallback(a3(e),[e]),ct)}const l3=e=>e.updateNodeInternals;function u3(){const e=Ye(l3),[t]=X.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return X.useEffect(()=>()=>{t?.disconnect()},[t]),t}function c3({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=ft(),l=X.useRef(null),u=X.useRef(null),f=X.useRef(e.sourcePosition),h=X.useRef(e.targetPosition),d=X.useRef(t),g=n&&!!e.internals.handleBounds;return X.useEffect(()=>{l.current&&!e.hidden&&(!g||u.current!==l.current)&&(u.current&&r?.unobserve(u.current),r?.observe(l.current),u.current=l.current)},[g,e.hidden]),X.useEffect(()=>()=>{u.current&&(r?.unobserve(u.current),u.current=null)},[]),X.useEffect(()=>{if(l.current){const m=d.current!==t,x=f.current!==e.sourcePosition,v=h.current!==e.targetPosition;(m||x||v)&&(d.current=t,f.current=e.sourcePosition,h.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function f3({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:f,elementsSelectable:h,nodesConnectable:d,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:v,disableKeyboardA11y:w,rfId:k,nodeTypes:N,nodeClickDistance:E,onError:A}){const{node:_,internals:C,isParent:B}=Ye(ue=>{const me=ue.nodeLookup.get(e),Ee=ue.parentLookup.has(e);return{node:me,internals:me.internals,isParent:Ee}},ct);let T=_.type||"default",L=N?.[T]||N1[T];L===void 0&&(A?.("003",ui.error003(T)),T="default",L=N?.default||N1.default);const G=!!(_.draggable||f&&typeof _.draggable>"u"),Z=!!(_.selectable||h&&typeof _.selectable>"u"),H=!!(_.connectable||d&&typeof _.connectable>"u"),q=!!(_.focusable||g&&typeof _.focusable>"u"),P=ft(),te=Gw(_),O=c3({node:_,nodeType:T,hasDimensions:te,resizeObserver:m}),U=_S({nodeRef:O,disabled:_.hidden||!G,noDragClassName:x,handleSelector:_.dragHandle,nodeId:e,isSelectable:Z,nodeClickDistance:E}),R=kS();if(_.hidden)return null;const I=Vi(_),F=t3(_),K=Z||G||t||n||r||a,z=n?ue=>n(ue,{...C.userNode}):void 0,D=r?ue=>r(ue,{...C.userNode}):void 0,V=a?ue=>a(ue,{...C.userNode}):void 0,j=l?ue=>l(ue,{...C.userNode}):void 0,ie=u?ue=>u(ue,{...C.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();Z&&(!me||!G||Ee>0)&&dm({id:e,store:P,nodeRef:O}),t&&t(ue,{...C.userNode})},fe=ue=>{if(!(Kw(ue.nativeEvent)||w)){if(Uw.includes(ue.key)&&Z){const me=ue.key==="Escape";dm({id:e,store:P,unselect:me,nodeRef:O})}else if(G&&_.selected&&Object.prototype.hasOwnProperty.call(of,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),R({direction:of[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;Zm(new Map([[e,_]]),{x:0,y:0,width:me,height:Ee},ue,!0).length>0||we(_.position.x+I.width/2,_.position.y+I.height/2,{zoom:ue[2]})};return b.jsx("div",{className:Et(["react-flow__node",`react-flow__node-${T}`,{[v]:G},_.className,{selected:_.selected,selectable:Z,parent:B,draggable:G,dragging:U}]),ref:O,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",..._.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:D,onMouseLeave:V,onContextMenu:j,onClick:ce,onDoubleClick:ie,onKeyDown:q?fe:void 0,tabIndex:q?0:void 0,onFocus:q?he:void 0,role:_.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${gS}-${k}`,"aria-label":_.ariaLabel,..._.domAttributes,children:b.jsx(XM,{value:e,children:b.jsx(L,{id:e,data:_.data,type:T,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:_.selected??!1,selectable:Z,draggable:G,deletable:_.deletable??!0,isConnectable:H,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:U,dragHandle:_.dragHandle,zIndex:C.z,parentId:_.parentId,...I})})})}var d3=X.memo(f3);const h3=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function CS(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:l}=Ye(h3,ct),u=o3(e.onlyRenderVisibleElements),f=u3();return b.jsx("div",{className:"react-flow__nodes",style:Cf,children:u.map(h=>b.jsx(d3,{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:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},h))})}CS.displayName="NodeRenderer";const p3=X.memo(CS);function m3(e){return Ye(X.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&pA({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),ct)}const g3=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},y3=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},T1={[rf.Arrow]:g3,[rf.ArrowClosed]:y3};function x3(e){const t=ft();return X.useMemo(()=>Object.prototype.hasOwnProperty.call(T1,e)?T1[e]:(t.getState().onError?.("009",ui.error009(e)),null),[e])}const b3=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:f="auto-start-reverse"})=>{const h=x3(t);return h?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:f,refX:"0",refY:"0",children:b.jsx(h,{color:n,strokeWidth:u})}):null},TS=({defaultColor:e,rfId:t})=>{const n=Ye(l=>l.edges),r=Ye(l=>l.defaultEdgeOptions),a=X.useMemo(()=>wA(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return a.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:a.map(l=>b.jsx(b3,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};TS.displayName="MarkerDefinitions";var v3=X.memo(TS);function AS({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:f=2,children:h,className:d,...g}){const[m,x]=X.useState({x:1,y:0,width:0,height:0}),v=Et(["react-flow__edge-textwrapper",d]),w=X.useRef(null);return X.useEffect(()=>{if(w.current){const k=w.current.getBBox();x({x:k.x,y:k.y,width:k.width,height:k.height})}},[n]),n?b.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:v,visibility:m.width?"visible":"hidden",...g,children:[a&&b.jsx("rect",{width:m.width+2*u[0],x:-u[0],y:-u[1],height:m.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:f,ry:f}),b.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:r,children:n}),h]}):null}AS.displayName="EdgeText";const w3=X.memo(AS);function Tf({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h,interactionWidth:d=20,...g}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...g,d:e,fill:"none",className:Et(["react-flow__edge-path",g.className])}),d?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&Yn(t)&&Yn(n)?b.jsx(w3,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:h}):null]})}function A1({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===be.Left||e===be.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function MS({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top}){const[u,f]=A1({pos:n,x1:e,y1:t,x2:r,y2:a}),[h,d]=A1({pos:l,x1:r,y1:a,x2:e,y2:t}),[g,m,x,v]=Ww({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:h,targetControlY:d});return[`M${e},${t} C${u},${f} ${h},${d} ${r},${a}`,g,m,x,v]}function jS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:f,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:w,markerEnd:k,markerStart:N,interactionWidth:E})=>{const[A,_,C]=MS({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:f}),B=e.isInternal?void 0:t;return b.jsx(Tf,{id:B,path:A,labelX:_,labelY:C,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:w,markerEnd:k,markerStart:N,interactionWidth:E})})}const S3=jS({isInternal:!1}),zS=jS({isInternal:!0});S3.displayName="SimpleBezierEdge";zS.displayName="SimpleBezierEdgeInternal";function RS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:v=be.Bottom,targetPosition:w=be.Top,markerEnd:k,markerStart:N,pathOptions:E,interactionWidth:A})=>{const[_,C,B]=lm({sourceX:n,sourceY:r,sourcePosition:v,targetX:a,targetY:l,targetPosition:w,borderRadius:E?.borderRadius,offset:E?.offset,stepPosition:E?.stepPosition}),T=e.isInternal?void 0:t;return b.jsx(Tf,{id:T,path:_,labelX:C,labelY:B,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:k,markerStart:N,interactionWidth:A})})}const DS=RS({isInternal:!1}),OS=RS({isInternal:!0});DS.displayName="SmoothStepEdge";OS.displayName="SmoothStepEdgeInternal";function LS(e){return X.memo(({id:t,...n})=>{const r=e.isInternal?void 0:t;return b.jsx(DS,{...n,id:r,pathOptions:X.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const _3=LS({isInternal:!1}),BS=LS({isInternal:!0});_3.displayName="StepEdge";BS.displayName="StepEdgeInternal";function HS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:w,interactionWidth:k})=>{const[N,E,A]=nS({sourceX:n,sourceY:r,targetX:a,targetY:l}),_=e.isInternal?void 0:t;return b.jsx(Tf,{id:_,path:N,labelX:E,labelY:A,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:w,interactionWidth:k})})}const k3=HS({isInternal:!1}),US=HS({isInternal:!0});k3.displayName="StraightEdge";US.displayName="StraightEdgeInternal";function IS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=be.Bottom,targetPosition:f=be.Top,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:w,markerEnd:k,markerStart:N,pathOptions:E,interactionWidth:A})=>{const[_,C,B]=eS({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:f,curvature:E?.curvature}),T=e.isInternal?void 0:t;return b.jsx(Tf,{id:T,path:_,labelX:C,labelY:B,label:h,labelStyle:d,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:v,style:w,markerEnd:k,markerStart:N,interactionWidth:A})})}const E3=IS({isInternal:!1}),qS=IS({isInternal:!0});E3.displayName="BezierEdge";qS.displayName="BezierEdgeInternal";const M1={default:qS,straight:US,step:BS,smoothstep:OS,simplebezier:zS},j1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},N3=(e,t,n)=>n===be.Left?e-t:n===be.Right?e+t:e,C3=(e,t,n)=>n===be.Top?e-t:n===be.Bottom?e+t:e,z1="react-flow__edgeupdater";function R1({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:f}){return b.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Et([z1,`${z1}-${f}`]),cx:N3(t,r,e),cy:C3(n,r,e),r,stroke:"transparent",fill:"transparent"})}function T3({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:f,targetPosition:h,onReconnect:d,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:v}){const w=ft(),k=(C,B)=>{if(C.button!==0)return;const{autoPanOnConnect:T,domNode:L,isValidConnection:G,connectionMode:Z,connectionRadius:H,lib:q,onConnectStart:P,onConnectEnd:te,cancelConnection:O,nodeLookup:U,rfId:R,panBy:I,updateConnection:F}=w.getState(),K=B.type==="target",z=(j,ie)=>{x(!1),m?.(j,n,B.type,ie)},D=j=>d?.(n,j),V=(j,ie)=>{x(!0),g?.(C,n,B.type),P?.(j,ie)};fm.onPointerDown(C.nativeEvent,{autoPanOnConnect:T,connectionMode:Z,connectionRadius:H,domNode:L,handleId:B.id,nodeId:B.nodeId,nodeLookup:U,isTarget:K,edgeUpdaterType:B.type,lib:q,flowId:R,cancelConnection:O,panBy:I,isValidConnection:G,onConnect:D,onConnectStart:V,onConnectEnd:te,onReconnectEnd:z,updateConnection:F,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>k(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=C=>k(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),A=()=>v(!0),_=()=>v(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(R1,{position:f,centerX:r,centerY:a,radius:t,onMouseDown:N,onMouseEnter:A,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&b.jsx(R1,{position:h,centerX:l,centerY:u,radius:t,onMouseDown:E,onMouseEnter:A,onMouseOut:_,type:"target"})]})}function A3({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:v,rfId:w,edgeTypes:k,noPanClassName:N,onError:E,disableKeyboardA11y:A}){let _=Ye(we=>we.edgeLookup.get(e));const C=Ye(we=>we.defaultEdgeOptions);_=C?{...C,..._}:_;let B=_.type||"default",T=k?.[B]||M1[B];T===void 0&&(E?.("011",ui.error011(B)),B="default",T=k?.default||M1.default);const L=!!(_.focusable||t&&typeof _.focusable>"u"),G=typeof m<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),Z=!!(_.selectable||r&&typeof _.selectable>"u"),H=X.useRef(null),[q,P]=X.useState(!1),[te,O]=X.useState(!1),U=ft(),{zIndex:R,sourceX:I,sourceY:F,targetX:K,targetY:z,sourcePosition:D,targetPosition:V}=Ye(X.useCallback(we=>{const Ne=we.nodeLookup.get(_.source),Oe=we.nodeLookup.get(_.target);if(!Ne||!Oe)return{zIndex:_.zIndex,...j1};const Qe=vA({id:e,sourceNode:Ne,targetNode:Oe,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:we.connectionMode,onError:E});return{zIndex:hA({selected:_.selected,zIndex:_.zIndex,sourceNode:Ne,targetNode:Oe,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Qe||j1}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),ct),j=X.useMemo(()=>_.markerStart?`url('#${um(_.markerStart,w)}')`:void 0,[_.markerStart,w]),ie=X.useMemo(()=>_.markerEnd?`url('#${um(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||I===null||F===null||K===null||z===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:Oe,multiSelectionActive:Qe}=U.getState();Z&&(U.setState({nodesSelectionActive:!1}),_.selected&&Qe?(Oe({nodes:[],edges:[_]}),H.current?.blur()):Ne([e])),a&&a(we,_)},fe=l?we=>{l(we,{..._})}:void 0,he=u?we=>{u(we,{..._})}:void 0,ue=f?we=>{f(we,{..._})}:void 0,me=h?we=>{h(we,{..._})}:void 0,Ee=d?we=>{d(we,{..._})}:void 0,Ce=we=>{if(!A&&Uw.includes(we.key)&&Z){const{unselectNodesAndEdges:Ne,addSelectedEdges:Oe}=U.getState();we.key==="Escape"?(H.current?.blur(),Ne({edges:[_]})):Oe([e])}};return b.jsx("svg",{style:{zIndex:R},children:b.jsxs("g",{className:Et(["react-flow__edge",`react-flow__edge-${B}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!Z&&!a,updating:q,selectable:Z}]),onClick:ce,onDoubleClick:fe,onContextMenu:he,onMouseEnter:ue,onMouseMove:me,onMouseLeave:Ee,onKeyDown:L?Ce:void 0,tabIndex:L?0:void 0,role:_.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":L?`${yS}-${w}`:void 0,ref:H,..._.domAttributes,children:[!te&&b.jsx(T,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:Z,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:I,sourceY:F,targetX:K,targetY:z,sourcePosition:D,targetPosition:V,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:j,markerEnd:ie,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),G&&b.jsx(T3,{edge:_,isReconnectable:G,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:v,sourceX:I,sourceY:F,targetX:K,targetY:z,sourcePosition:D,targetPosition:V,setUpdateHover:P,setReconnecting:O})]})})}var M3=X.memo(A3);const j3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $S({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:f,onEdgeMouseMove:h,onEdgeMouseLeave:d,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:v,onReconnectEnd:w,disableKeyboardA11y:k}){const{edgesFocusable:N,edgesReconnectable:E,elementsSelectable:A,onError:_}=Ye(j3,ct),C=m3(t);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(v3,{defaultColor:e,rfId:n}),C.map(B=>b.jsx(M3,{id:B,edgesFocusable:N,edgesReconnectable:E,elementsSelectable:A,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:f,onMouseMove:h,onMouseLeave:d,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:v,onReconnectEnd:w,rfId:n,onError:_,edgeTypes:r,disableKeyboardA11y:k},B))]})}$S.displayName="EdgeRenderer";const z3=X.memo($S),R3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function D3({children:e}){const t=Ye(R3);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function O3(e){const t=ig(),n=X.useRef(!1);X.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const L3=e=>e.panZoom?.syncViewport;function B3(e){const t=Ye(L3),n=ft();return X.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function H3(e){return e.connection.inProgress?{...e.connection,to:Tl(e.connection.to,e.transform)}:{...e.connection}}function U3(e){return H3}function I3(e){const t=U3();return Ye(t,ct)}const q3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:f,inProgress:h}=Ye(q3,ct);return!(l&&a&&h)?null:b.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:Et(["react-flow__connection",$w(f)]),children:b.jsx(PS,{style:t,type:n,CustomComponent:r,isValid:f})})})}const PS=({style:e,type:t=Tr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:f,fromPosition:h,to:d,toNode:g,toHandle:m,toPosition:x,pointer:v}=I3();if(!a)return;if(n)return b.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:l.x,fromY:l.y,toX:d.x,toY:d.y,fromPosition:h,toPosition:x,connectionStatus:$w(r),toNode:g,toHandle:m,pointer:v});let w="";const k={sourceX:l.x,sourceY:l.y,sourcePosition:h,targetX:d.x,targetY:d.y,targetPosition:x};switch(t){case Tr.Bezier:[w]=eS(k);break;case Tr.SimpleBezier:[w]=MS(k);break;case Tr.Step:[w]=lm({...k,borderRadius:0});break;case Tr.SmoothStep:[w]=lm(k);break;default:[w]=nS(k)}return b.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};PS.displayName="ConnectionLine";const P3={};function D1(e=P3){X.useRef(e),ft(),X.useEffect(()=>{},[e])}function V3(){ft(),X.useRef(!1),X.useEffect(()=>{},[])}function VS({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:v,connectionLineType:w,connectionLineStyle:k,connectionLineComponent:N,connectionLineContainerStyle:E,selectionKeyCode:A,selectionOnDrag:_,selectionMode:C,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:L,deleteKeyCode:G,onlyRenderVisibleElements:Z,elementsSelectable:H,defaultViewport:q,translateExtent:P,minZoom:te,maxZoom:O,preventScrolling:U,defaultMarkerColor:R,zoomOnScroll:I,zoomOnPinch:F,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:D,zoomOnDoubleClick:V,panOnDrag:j,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Oe,onEdgeMouseLeave:Qe,reconnectRadius:Xe,onReconnect:pt,onReconnectStart:un,onReconnectEnd:Ht,noDragClassName:Qt,noWheelClassName:Bn,noPanClassName:pi,disableKeyboardA11y:mi,nodeExtent:Ct,rfId:Yi,viewport:se,onViewportChange:pe}){return D1(e),D1(t),V3(),O3(n),B3(se),b.jsx(s3,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:G,selectionKeyCode:A,selectionOnDrag:_,selectionMode:C,onSelectionStart:x,onSelectionEnd:v,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:L,elementsSelectable:H,zoomOnScroll:I,zoomOnPinch:F,zoomOnDoubleClick:V,panOnScroll:K,panOnScrollSpeed:z,panOnScrollMode:D,panOnDrag:j,defaultViewport:q,translateExtent:P,minZoom:te,maxZoom:O,onSelectionContextMenu:m,preventScrolling:U,noDragClassName:Qt,noWheelClassName:Bn,noPanClassName:pi,disableKeyboardA11y:mi,onViewportChange:pe,isControlledViewport:!!se,children:b.jsxs(D3,{children:[b.jsx(z3,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:pt,onReconnectStart:un,onReconnectEnd:Ht,onlyRenderVisibleElements:Z,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:Oe,onEdgeMouseLeave:Qe,reconnectRadius:Xe,defaultMarkerColor:R,noPanClassName:pi,disableKeyboardA11y:mi,rfId:Yi}),b.jsx($3,{style:k,type:w,component:N,containerStyle:E}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(p3,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:h,onNodeMouseLeave:d,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:Z,noPanClassName:pi,noDragClassName:Qt,disableKeyboardA11y:mi,nodeExtent:Ct,rfId:Yi}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}VS.displayName="GraphView";const F3=X.memo(VS),O1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:h=.5,maxZoom:d=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const v=new Map,w=new Map,k=new Map,N=new Map,E=r??t??[],A=n??e??[],_=g??[0,0],C=m??cl;sS(k,N,E);const B=cm(A,v,w,{nodeOrigin:_,nodeExtent:C,zIndexMode:x});let T=[0,0,1];if(u&&a&&l){const L=Nl(v,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:G,y:Z,zoom:H}=Qm(L,a,l,h,d,f?.padding??.1);T=[G,Z,H]}return{rfId:"1",width:a??0,height:l??0,transform:T,nodes:A,nodesInitialized:B,nodeLookup:v,parentLookup:w,edges:E,edgeLookup:N,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:h,maxZoom:d,translateExtent:cl,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ga.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:f,fitViewResolver:null,connection:{...qw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:oA,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Iw,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Y3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>cM((v,w)=>{async function k(){const{nodeLookup:N,panZoom:E,fitViewOptions:A,fitViewResolver:_,width:C,height:B,minZoom:T,maxZoom:L}=w();E&&(await sA({nodes:N,width:C,height:B,panZoom:E,minZoom:T,maxZoom:L},A),_?.resolve(!0),v({fitViewResolver:null}))}return{...O1({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:h,maxZoom:d,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:x}),setNodes:N=>{const{nodeLookup:E,parentLookup:A,nodeOrigin:_,elevateNodesOnSelect:C,fitViewQueued:B,zIndexMode:T}=w(),L=cm(N,E,A,{nodeOrigin:_,nodeExtent:m,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:T});B&&L?(k(),v({nodes:N,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:N,nodesInitialized:L})},setEdges:N=>{const{connectionLookup:E,edgeLookup:A}=w();sS(E,A,N),v({edges:N})},setDefaultNodesAndEdges:(N,E)=>{if(N){const{setNodes:A}=w();A(N),v({hasDefaultNodes:!0})}if(E){const{setEdges:A}=w();A(E),v({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:E,nodeLookup:A,parentLookup:_,domNode:C,nodeOrigin:B,nodeExtent:T,debug:L,fitViewQueued:G,zIndexMode:Z}=w(),{changes:H,updatedInternals:q}=TA(N,A,_,C,B,T,Z);q&&(kA(A,_,{nodeOrigin:B,nodeExtent:T,zIndexMode:Z}),G?(k(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),H?.length>0&&(L&&console.log("React Flow: trigger node changes",H),E?.(H)))},updateNodePositions:(N,E=!1)=>{const A=[];let _=[];const{nodeLookup:C,triggerNodeChanges:B,connection:T,updateConnection:L,onNodesChangeMiddlewareMap:G}=w();for(const[Z,H]of N){const q=C.get(Z),P=!!(q?.expandParent&&q?.parentId&&H?.position),te={id:Z,type:"position",position:P?{x:Math.max(0,H.position.x),y:Math.max(0,H.position.y)}:H.position,dragging:E};if(q&&T.inProgress&&T.fromNode.id===q.id){const O=cs(q,T.fromHandle,be.Left,!0);L({...T,from:O})}P&&q.parentId&&A.push({id:Z,parentId:q.parentId,rect:{...H.internals.positionAbsolute,width:H.measured.width??0,height:H.measured.height??0}}),_.push(te)}if(A.length>0){const{parentLookup:Z,nodeOrigin:H}=w(),q=ng(A,C,Z,H);_.push(...q)}for(const Z of G.values())_=Z(_);B(_)},triggerNodeChanges:N=>{const{onNodesChange:E,setNodes:A,nodes:_,hasDefaultNodes:C,debug:B}=w();if(N?.length){if(C){const T=$c(N,_);A(T)}B&&console.log("React Flow: trigger node changes",N),E?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:E,setEdges:A,edges:_,hasDefaultEdges:C,debug:B}=w();if(N?.length){if(C){const T=vS(N,_);A(T)}B&&console.log("React Flow: trigger edge changes",N),E?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:E,edgeLookup:A,nodeLookup:_,triggerNodeChanges:C,triggerEdgeChanges:B}=w();if(E){const T=N.map(L=>ns(L,!0));C(T);return}C(ua(_,new Set([...N]),!0)),B(ua(A))},addSelectedEdges:N=>{const{multiSelectionActive:E,edgeLookup:A,nodeLookup:_,triggerNodeChanges:C,triggerEdgeChanges:B}=w();if(E){const T=N.map(L=>ns(L,!0));B(T);return}B(ua(A,new Set([...N]))),C(ua(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:E}={})=>{const{edges:A,nodes:_,nodeLookup:C,triggerNodeChanges:B,triggerEdgeChanges:T}=w(),L=N||_,G=E||A,Z=L.map(q=>{const P=C.get(q.id);return P&&(P.selected=!1),ns(q.id,!1)}),H=G.map(q=>ns(q.id,!1));B(Z),T(H)},setMinZoom:N=>{const{panZoom:E,maxZoom:A}=w();E?.setScaleExtent([N,A]),v({minZoom:N})},setMaxZoom:N=>{const{panZoom:E,minZoom:A}=w();E?.setScaleExtent([A,N]),v({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),v({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:E,triggerNodeChanges:A,triggerEdgeChanges:_,elementsSelectable:C}=w();if(!C)return;const B=E.reduce((L,G)=>G.selected?[...L,ns(G.id,!1)]:L,[]),T=N.reduce((L,G)=>G.selected?[...L,ns(G.id,!1)]:L,[]);A(B),_(T)},setNodeExtent:N=>{const{nodes:E,nodeLookup:A,parentLookup:_,nodeOrigin:C,elevateNodesOnSelect:B,nodeExtent:T,zIndexMode:L}=w();N[0][0]===T[0][0]&&N[0][1]===T[0][1]&&N[1][0]===T[1][0]&&N[1][1]===T[1][1]||(cm(E,A,_,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:L}),v({nodeExtent:N}))},panBy:N=>{const{transform:E,width:A,height:_,panZoom:C,translateExtent:B}=w();return AA({delta:N,panZoom:C,transform:E,translateExtent:B,width:A,height:_})},setCenter:async(N,E,A)=>{const{width:_,height:C,maxZoom:B,panZoom:T}=w();if(!T)return Promise.resolve(!1);const L=typeof A?.zoom<"u"?A.zoom:B;return await T.setViewport({x:_/2-N*L,y:C/2-E*L,zoom:L},{duration:A?.duration,ease:A?.ease,interpolate:A?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...qw}})},updateConnection:N=>{v({connection:N})},reset:()=>v({...O1()})}},Object.is);function FS({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:h,fitView:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:v}){const[w]=X.useState(()=>Y3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:d,minZoom:u,maxZoom:f,fitViewOptions:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return b.jsx(fM,{value:w,children:b.jsx(DM,{children:v})})}function X3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:f,fitViewOptions:h,minZoom:d,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:v}){return X.useContext(Ef)?b.jsx(b.Fragment,{children:e}):b.jsx(FS,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:f,initialFitViewOptions:h,initialMinZoom:d,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:v,children:e})}const G3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Z3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:f,onEdgeClick:h,onInit:d,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:v,onConnectStart:w,onConnectEnd:k,onClickConnectStart:N,onClickConnectEnd:E,onNodeMouseEnter:A,onNodeMouseMove:_,onNodeMouseLeave:C,onNodeContextMenu:B,onNodeDoubleClick:T,onNodeDragStart:L,onNodeDrag:G,onNodeDragStop:Z,onNodesDelete:H,onEdgesDelete:q,onDelete:P,onSelectionChange:te,onSelectionDragStart:O,onSelectionDrag:U,onSelectionDragStop:R,onSelectionContextMenu:I,onSelectionStart:F,onSelectionEnd:K,onBeforeDelete:z,connectionMode:D,connectionLineType:V=Tr.Bezier,connectionLineStyle:j,connectionLineComponent:ie,connectionLineContainerStyle:ce,deleteKeyCode:fe="Backspace",selectionKeyCode:he="Shift",selectionOnDrag:ue=!1,selectionMode:me=fl.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ce=hl()?"Meta":"Control",zoomActivationKeyCode:we=hl()?"Meta":"Control",snapToGrid:Ne,snapGrid:Oe,onlyRenderVisibleElements:Qe=!1,selectNodesOnDrag:Xe,nodesDraggable:pt,autoPanOnNodeFocus:un,nodesConnectable:Ht,nodesFocusable:Qt,nodeOrigin:Bn=xS,edgesFocusable:pi,edgesReconnectable:mi,elementsSelectable:Ct=!0,defaultViewport:Yi=kM,minZoom:se=.5,maxZoom:pe=2,translateExtent:_e=cl,preventScrolling:De=!0,nodeExtent:Pe,defaultMarkerColor:Ft="#b1b1b7",zoomOnScroll:Hn=!0,zoomOnPinch:zt=!0,panOnScroll:mt=!1,panOnScrollSpeed:Ut=.5,panOnScrollMode:Je=as.Free,zoomOnDoubleClick:Jn=!0,panOnDrag:cn=!0,onPaneClick:Yf,onPaneMouseEnter:ps,onPaneMouseMove:ms,onPaneMouseLeave:gs,onPaneScroll:gi,onPaneContextMenu:ys,paneClickDistance:jr=1,nodeClickDistance:Xf=0,children:Ll,onReconnect:ja,onReconnectStart:zr,onReconnectEnd:Gf,onEdgeContextMenu:Bl,onEdgeDoubleClick:Hl,onEdgeMouseEnter:Ul,onEdgeMouseMove:za,onEdgeMouseLeave:Ra,reconnectRadius:Il=10,onNodesChange:ql,onEdgesChange:Wn,noDragClassName:Tt="nodrag",noWheelClassName:It="nowheel",noPanClassName:yi="nopan",fitView:xs,fitViewOptions:$l,connectOnClick:Zf,attributionPosition:Pl,proOptions:Rr,defaultEdgeOptions:Da,elevateNodesOnSelect:Xi=!0,elevateEdgesOnSelect:Gi=!1,disableKeyboardA11y:Zi=!1,autoPanOnConnect:Qi,autoPanOnNodeDrag:xt,autoPanSpeed:Vl,connectionRadius:Fl,isValidConnection:xi,onError:Ki,style:Qf,id:Oa,nodeDragThreshold:Yl,connectionDragThreshold:Kf,viewport:bs,onViewportChange:vs,width:Un,height:Kt,colorMode:Xl="light",debug:Jf,onScroll:ws,ariaLabelConfig:Gl,zIndexMode:Dr="basic",...Wf},Jt){const Or=Oa||"1",Zl=TM(Xl),La=X.useCallback(bi=>{bi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ws?.(bi)},[ws]);return b.jsx("div",{"data-testid":"rf__wrapper",...Wf,onScroll:La,style:{...Qf,...G3},ref:Jt,className:Et(["react-flow",a,Zl]),id:Oa,role:"application",children:b.jsxs(X3,{nodes:e,edges:t,width:Un,height:Kt,fitView:xs,fitViewOptions:$l,minZoom:se,maxZoom:pe,nodeOrigin:Bn,nodeExtent:Pe,zIndexMode:Dr,children:[b.jsx(F3,{onInit:d,onNodeClick:f,onEdgeClick:h,onNodeMouseEnter:A,onNodeMouseMove:_,onNodeMouseLeave:C,onNodeContextMenu:B,onNodeDoubleClick:T,nodeTypes:l,edgeTypes:u,connectionLineType:V,connectionLineStyle:j,connectionLineComponent:ie,connectionLineContainerStyle:ce,selectionKeyCode:he,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:fe,multiSelectionKeyCode:Ce,panActivationKeyCode:Ee,zoomActivationKeyCode:we,onlyRenderVisibleElements:Qe,defaultViewport:Yi,translateExtent:_e,minZoom:se,maxZoom:pe,preventScrolling:De,zoomOnScroll:Hn,zoomOnPinch:zt,zoomOnDoubleClick:Jn,panOnScroll:mt,panOnScrollSpeed:Ut,panOnScrollMode:Je,panOnDrag:cn,onPaneClick:Yf,onPaneMouseEnter:ps,onPaneMouseMove:ms,onPaneMouseLeave:gs,onPaneScroll:gi,onPaneContextMenu:ys,paneClickDistance:jr,nodeClickDistance:Xf,onSelectionContextMenu:I,onSelectionStart:F,onSelectionEnd:K,onReconnect:ja,onReconnectStart:zr,onReconnectEnd:Gf,onEdgeContextMenu:Bl,onEdgeDoubleClick:Hl,onEdgeMouseEnter:Ul,onEdgeMouseMove:za,onEdgeMouseLeave:Ra,reconnectRadius:Il,defaultMarkerColor:Ft,noDragClassName:Tt,noWheelClassName:It,noPanClassName:yi,rfId:Or,disableKeyboardA11y:Zi,nodeExtent:Pe,viewport:bs,onViewportChange:vs}),b.jsx(CM,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:w,onConnectEnd:k,onClickConnectStart:N,onClickConnectEnd:E,nodesDraggable:pt,autoPanOnNodeFocus:un,nodesConnectable:Ht,nodesFocusable:Qt,edgesFocusable:pi,edgesReconnectable:mi,elementsSelectable:Ct,elevateNodesOnSelect:Xi,elevateEdgesOnSelect:Gi,minZoom:se,maxZoom:pe,nodeExtent:Pe,onNodesChange:ql,onEdgesChange:Wn,snapToGrid:Ne,snapGrid:Oe,connectionMode:D,translateExtent:_e,connectOnClick:Zf,defaultEdgeOptions:Da,fitView:xs,fitViewOptions:$l,onNodesDelete:H,onEdgesDelete:q,onDelete:P,onNodeDragStart:L,onNodeDrag:G,onNodeDragStop:Z,onSelectionDrag:U,onSelectionDragStart:O,onSelectionDragStop:R,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:yi,nodeOrigin:Bn,rfId:Or,autoPanOnConnect:Qi,autoPanOnNodeDrag:xt,autoPanSpeed:Vl,onError:Ki,connectionRadius:Fl,isValidConnection:xi,selectNodesOnDrag:Xe,nodeDragThreshold:Yl,connectionDragThreshold:Kf,onBeforeDelete:z,debug:Jf,ariaLabelConfig:Gl,zIndexMode:Dr}),b.jsx(_M,{onSelectionChange:te}),Ll,b.jsx(xM,{proOptions:Rr,position:Pl}),b.jsx(yM,{rfId:Or,disableKeyboardA11y:Zi})]})})}var Q3=wS(Z3);function K3({dimensions:e,lineWidth:t,variant:n,className:r}){return b.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Et(["react-flow__background-pattern",n,r])})}function J3({radius:e,className:t}){return b.jsx("circle",{cx:e,cy:e,r:e,className:Et(["react-flow__background-pattern","dots",t])})}var $i;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})($i||($i={}));const W3={[$i.Dots]:1,[$i.Lines]:1,[$i.Cross]:6},e5=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function YS({id:e,variant:t=$i.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:f,style:h,className:d,patternClassName:g}){const m=X.useRef(null),{transform:x,patternId:v}=Ye(e5,ct),w=r||W3[t],k=t===$i.Dots,N=t===$i.Cross,E=Array.isArray(n)?n:[n,n],A=[E[0]*x[2]||1,E[1]*x[2]||1],_=w*x[2],C=Array.isArray(l)?l:[l,l],B=N?[_,_]:A,T=[C[0]*x[2]||1+B[0]/2,C[1]*x[2]||1+B[1]/2],L=`${v}${e||""}`;return b.jsxs("svg",{className:Et(["react-flow__background",d]),style:{...h,...Cf,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[b.jsx("pattern",{id:L,x:x[0]%A[0],y:x[1]%A[1],width:A[0],height:A[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:k?b.jsx(J3,{radius:_/2,className:g}):b.jsx(K3,{dimensions:B,lineWidth:a,variant:t,className:g})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}YS.displayName="Background";const t5=X.memo(YS);function n5(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function i5(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function r5(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function s5(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function a5(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function hc({children:e,className:t,...n}){return b.jsx("button",{type:"button",className:Et(["react-flow__controls-button",t]),...n,children:e})}const o5=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function XS({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:f,onInteractiveChange:h,className:d,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":v}){const w=ft(),{isInteractive:k,minZoomReached:N,maxZoomReached:E,ariaLabelConfig:A}=Ye(o5,ct),{zoomIn:_,zoomOut:C,fitView:B}=ig(),T=()=>{_(),l?.()},L=()=>{C(),u?.()},G=()=>{B(a),f?.()},Z=()=>{w.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),h?.(!k)},H=x==="horizontal"?"horizontal":"vertical";return b.jsxs(Nf,{className:Et(["react-flow__controls",H,d]),position:m,style:e,"data-testid":"rf__controls","aria-label":v??A["controls.ariaLabel"],children:[t&&b.jsxs(b.Fragment,{children:[b.jsx(hc,{onClick:T,className:"react-flow__controls-zoomin",title:A["controls.zoomIn.ariaLabel"],"aria-label":A["controls.zoomIn.ariaLabel"],disabled:E,children:b.jsx(n5,{})}),b.jsx(hc,{onClick:L,className:"react-flow__controls-zoomout",title:A["controls.zoomOut.ariaLabel"],"aria-label":A["controls.zoomOut.ariaLabel"],disabled:N,children:b.jsx(i5,{})})]}),n&&b.jsx(hc,{className:"react-flow__controls-fitview",onClick:G,title:A["controls.fitView.ariaLabel"],"aria-label":A["controls.fitView.ariaLabel"],children:b.jsx(r5,{})}),r&&b.jsx(hc,{className:"react-flow__controls-interactive",onClick:Z,title:A["controls.interactive.ariaLabel"],"aria-label":A["controls.interactive.ariaLabel"],children:k?b.jsx(a5,{}):b.jsx(s5,{})}),g]})}XS.displayName="Controls";const l5=X.memo(XS);function u5({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:f,strokeWidth:h,className:d,borderRadius:g,shapeRendering:m,selected:x,onClick:v}){const{background:w,backgroundColor:k}=l||{},N=u||w||k;return b.jsx("rect",{className:Et(["react-flow__minimap-node",{selected:x},d]),x:t,y:n,rx:g,ry:g,width:r,height:a,style:{fill:N,stroke:f,strokeWidth:h},shapeRendering:m,onClick:v?E=>v(E,e):void 0})}const c5=X.memo(u5),f5=e=>e.nodes.map(t=>t.id),Sp=e=>e instanceof Function?e:()=>e;function d5({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=c5,onClick:u}){const f=Ye(f5,ct),h=Sp(t),d=Sp(e),g=Sp(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:f.map(x=>b.jsx(p5,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:d,nodeClassNameFunc:g,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:m},x))})}function h5({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:f,onClick:h}){const{node:d,x:g,y:m,width:x,height:v}=Ye(w=>{const{internals:k}=w.nodeLookup.get(e),N=k.userNode,{x:E,y:A}=k.positionAbsolute,{width:_,height:C}=Vi(N);return{node:N,x:E,y:A,width:_,height:C}},ct);return!d||d.hidden||!Gw(d)?null:b.jsx(f,{x:g,y:m,width:x,height:v,style:d.style,selected:!!d.selected,className:r(d),color:t(d),borderRadius:a,strokeColor:n(d),strokeWidth:l,shapeRendering:u,onClick:h,id:d.id})}const p5=X.memo(h5);var m5=X.memo(d5);const g5=200,y5=150,x5=e=>!e.hidden,b5=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?Xw(Nl(e.nodeLookup,{filter:x5}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},v5="react-flow__minimap-desc";function GS({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:f,bgColor:h,maskColor:d,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:v,onNodeClick:w,pannable:k=!1,zoomable:N=!1,ariaLabel:E,inversePan:A,zoomStep:_=1,offsetScale:C=5}){const B=ft(),T=X.useRef(null),{boundingRect:L,viewBB:G,rfId:Z,panZoom:H,translateExtent:q,flowWidth:P,flowHeight:te,ariaLabelConfig:O}=Ye(b5,ct),U=e?.width??g5,R=e?.height??y5,I=L.width/U,F=L.height/R,K=Math.max(I,F),z=K*U,D=K*R,V=C*K,j=L.x-(z-L.width)/2-V,ie=L.y-(D-L.height)/2-V,ce=z+V*2,fe=D+V*2,he=`${v5}-${Z}`,ue=X.useRef(0),me=X.useRef();ue.current=K,X.useEffect(()=>{if(T.current&&H)return me.current=HA({domNode:T.current,panZoom:H,getTransform:()=>B.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[H]),X.useEffect(()=>{me.current?.update({translateExtent:q,width:P,height:te,inversePan:A,pannable:k,zoomStep:_,zoomable:N})},[k,N,A,_,q,P,te]);const Ee=v?Ne=>{const[Oe,Qe]=me.current?.pointer(Ne)||[0,0];v(Ne,{x:Oe,y:Qe})}:void 0,Ce=w?X.useCallback((Ne,Oe)=>{const Qe=B.getState().nodeLookup.get(Oe).internals.userNode;w(Ne,Qe)},[]):void 0,we=E??O["minimap.ariaLabel"];return b.jsx(Nf,{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 g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Et(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:U,height:R,viewBox:`${j} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:T,onClick:Ee,children:[we&&b.jsx("title",{id:he,children:we}),b.jsx(m5,{onClick:Ce,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:f}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${j-V},${ie-V}h${ce+V*2}v${fe+V*2}h${-ce-V*2}z
15
- M${G.x},${G.y}h${G.width}v${G.height}h${-G.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}GS.displayName="MiniMap";const w5=X.memo(GS),S5=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,_5={[va.Line]:"right",[va.Handle]:"bottom-right"};function k5({nodeId:e,position:t,variant:n=va.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:f=10,minHeight:h=10,maxWidth:d=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:v=!0,shouldResize:w,onResizeStart:k,onResize:N,onResizeEnd:E}){const A=ES(),_=typeof e=="string"?e:A,C=ft(),B=X.useRef(null),T=n===va.Handle,L=Ye(X.useCallback(S5(T&&v),[T,v]),ct),G=X.useRef(null),Z=t??_5[n];X.useEffect(()=>{if(!(!B.current||!_))return G.current||(G.current=JA({domNode:B.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:q,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:U,domNode:R}=C.getState();return{nodeLookup:q,transform:P,snapGrid:te,snapToGrid:O,nodeOrigin:U,paneDomNode:R}},onChange:(q,P)=>{const{triggerNodeChanges:te,nodeLookup:O,parentLookup:U,nodeOrigin:R}=C.getState(),I=[],F={x:q.x,y:q.y},K=O.get(_);if(K&&K.expandParent&&K.parentId){const z=K.origin??R,D=q.width??K.measured.width??0,V=q.height??K.measured.height??0,j={id:K.id,parentId:K.parentId,rect:{width:D,height:V,...Zw({x:q.x??K.position.x,y:q.y??K.position.y},{width:D,height:V},K.parentId,O,z)}},ie=ng([j],O,U,R);I.push(...ie),F.x=q.x?Math.max(z[0]*D,q.x):void 0,F.y=q.y?Math.max(z[1]*V,q.y):void 0}if(F.x!==void 0&&F.y!==void 0){const z={id:_,type:"position",position:{...F}};I.push(z)}if(q.width!==void 0&&q.height!==void 0){const D={id:_,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};I.push(D)}for(const z of P){const D={...z,type:"position"};I.push(D)}te(I)},onEnd:({width:q,height:P})=>{const te={id:_,type:"dimensions",resizing:!1,dimensions:{width:q,height:P}};C.getState().triggerNodeChanges([te])}})),G.current.update({controlPosition:Z,boundaries:{minWidth:f,minHeight:h,maxWidth:d,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:k,onResize:N,onResizeEnd:E,shouldResize:w}),()=>{G.current?.destroy()}},[Z,f,h,d,g,m,k,N,E,w]);const H=Z.split("-");return b.jsx("div",{className:Et(["react-flow__resize-control","nodrag",...H,n,r]),ref:B,style:{...a,scale:L,...u&&{[T?"backgroundColor":"borderColor"]:u}},children:l})}X.memo(k5);const ZS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const E5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const N5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const L1=e=>{const t=N5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var C5={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 T5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const A5=X.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...f},h)=>X.createElement("svg",{ref:h,...C5,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ZS("lucide",a),...!l&&!T5(f)&&{"aria-hidden":"true"},...f},[...u.map(([d,g])=>X.createElement(d,g)),...Array.isArray(l)?l:[l]]));const Re=(e,t)=>{const n=X.forwardRef(({className:r,...a},l)=>X.createElement(A5,{ref:l,iconNode:t,className:ZS(`lucide-${E5(L1(e))}`,`lucide-${e}`,r),...a}));return n.displayName=L1(e),n};const M5=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],sg=Re("anchor",M5);const j5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],z5=Re("arrow-left",j5);const R5=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],D5=Re("bot",R5);const O5=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Af=Re("chart-column",O5);const L5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],B5=Re("check",L5);const H5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],QS=Re("chevron-down",H5);const U5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],I5=Re("chevron-right",U5);const q5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$5=Re("chevron-up",q5);const P5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],hm=Re("circle-alert",P5);const V5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Mf=Re("circle-check-big",V5);const F5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Y5=Re("circle-check",F5);const X5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ag=Re("circle-x",X5);const G5=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],pm=Re("download",G5);const Z5=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Q5=Re("eye-off",Z5);const K5=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],KS=Re("eye",K5);const J5=[["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:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],W5=Re("file-code",J5);const ej=[["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:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ml=Re("file-text",ej);const tj=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],mm=Re("folder-open",tj);const nj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],ij=Re("globe",nj);const rj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],JS=Re("image",rj);const sj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],aj=Re("info",sj);const oj=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],lj=Re("key",oj);const uj=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],cj=Re("link-2",uj);const fj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],lf=Re("loader-circle",fj);const dj=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],hj=Re("maximize-2",dj);const pj=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],jf=Re("message-square",pj);const mj=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],gj=Re("minimize-2",mj);const yj=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],gl=Re("play",yj);const xj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],bj=Re("refresh-cw",xj);const vj=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],wj=Re("save",vj);const Sj=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],_j=Re("send",Sj);const kj=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ej=Re("server",kj);const Nj=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Cj=Re("settings-2",Nj);const Tj=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],WS=Re("settings",Tj);const Aj=[["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"}]],Al=Re("sparkles",Aj);const Mj=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ds=Re("terminal",Mj);const jj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],yl=Re("trash-2",jj);const zj=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Rj=Re("triangle-alert",zj);const Dj=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Oj=Re("upload",Dj);const Lj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],og=Re("x",Lj);const Bj=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],zf=Re("zap",Bj),B1=e=>{let t;const n=new Set,r=(d,g)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const x=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,x))}},a=()=>t,f={setState:r,getState:a,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,a,f);return f},Hj=(e=>e?B1(e):B1),Uj=e=>e;function Ij(e,t=Uj){const n=Zo.useSyncExternalStore(e.subscribe,Zo.useCallback(()=>t(e.getState()),[e,t]),Zo.useCallback(()=>t(e.getInitialState()),[e,t]));return Zo.useDebugValue(n),n}const H1=e=>{const t=Hj(e),n=r=>Ij(t,r);return Object.assign(n,t),n},Rf=(e=>e?H1(e):H1);function qj(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var l;const u=h=>h===null?null:JSON.parse(h,void 0),f=(l=n.getItem(a))!=null?l:null;return f instanceof Promise?f.then(u):u(f)},setItem:(a,l)=>n.setItem(a,JSON.stringify(l,void 0)),removeItem:a=>n.removeItem(a)}}const gm=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return gm(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return gm(r)(n)}}}},$j=(e,t)=>(n,r,a)=>{let l={storage:qj(()=>localStorage),partialize:N=>N,version:0,merge:(N,E)=>({...E,...N}),...t},u=!1,f=0;const h=new Set,d=new Set;let g=l.storage;if(!g)return e((...N)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...N)},r,a);const m=()=>{const N=l.partialize({...r()});return g.setItem(l.name,{state:N,version:l.version})},x=a.setState;a.setState=(N,E)=>(x(N,E),m());const v=e((...N)=>(n(...N),m()),r,a);a.getInitialState=()=>v;let w;const k=()=>{var N,E;if(!g)return;const A=++f;u=!1,h.forEach(C=>{var B;return C((B=r())!=null?B:v)});const _=((E=l.onRehydrateStorage)==null?void 0:E.call(l,(N=r())!=null?N:v))||void 0;return gm(g.getItem.bind(g))(l.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==l.version){if(l.migrate){const B=l.migrate(C.state,C.version);return B instanceof Promise?B.then(T=>[!0,T]):[!0,B]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var B;if(A!==f)return;const[T,L]=C;if(w=l.merge(L,(B=r())!=null?B:v),n(w,!0),T)return m()}).then(()=>{A===f&&(_?.(w,void 0),w=r(),u=!0,d.forEach(C=>C(w)))}).catch(C=>{A===f&&_?.(void 0,C)})};return a.persist={setOptions:N=>{l={...l,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>k(),hasHydrated:()=>u,onHydrate:N=>(h.add(N),()=>{h.delete(N)}),onFinishHydration:N=>(d.add(N),()=>{d.delete(N)})},l.skipHydration||k(),w||v},e2=$j,Pj="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Sa=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Pj[n[e]&63];return t};const ci=Rf()(e2(e=>({nodes:[],edges:[],selectedNodeId:null,workflowId:Sa(),workflowName:"Untitled Workflow",isDraft:!0,addNode:t=>e(n=>({nodes:[...n.nodes,t]})),updateNode:(t,n)=>e(r=>({nodes:r.nodes.map(a=>a.id===t?{...a,data:{...a.data,...n}}:a)})),updateNodeStatus:(t,n,r)=>e(a=>({nodes:a.nodes.map(l=>l.id===t?{...l,data:{...l.data,status:n,progress:r??l.data.progress}}:l)})),removeNode:t=>e(n=>({nodes:n.nodes.filter(r=>r.id!==t),edges:n.edges.filter(r=>r.source!==t&&r.target!==t),selectedNodeId:n.selectedNodeId===t?null:n.selectedNodeId})),setSelectedNode:t=>e({selectedNodeId:t}),addEdge:t=>e(n=>({edges:[...n.edges,t]})),removeEdge:t=>e(n=>({edges:n.edges.filter(r=>r.id!==t)})),setWorkflowName:t=>e({workflowName:t}),loadWorkflow:t=>e({nodes:t.nodes,edges:t.edges,workflowName:t.name||"Imported Workflow",selectedNodeId:null}),mergeExistingConfig:t=>e(n=>{const r=new Set(t.map(d=>d.id)),a=["skill-","subagent-","command-","hook-"],l=d=>a.some(g=>d.startsWith(g)),u=n.nodes.filter(d=>l(d.id)?r.has(d.id):!0),f=new Set(u.map(d=>d.id)),h=t.filter(d=>!f.has(d.id));return{nodes:[...u,...h]}}),clearWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null}),newWorkflow:()=>e({nodes:[],edges:[],selectedNodeId:null,workflowId:Sa(),workflowName:"Untitled Workflow",isDraft:!0}),setNodes:t=>e({nodes:t}),setEdges:t=>e({edges:t})}),{name:"workflow-storage",partialize:e=>({nodes:e.nodes,edges:e.edges,workflowId:e.workflowId,workflowName:e.workflowName})})),t2=e=>e.nodes.find(t=>t.id===e.selectedNodeId),ka=Rf((e,t)=>({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null,logs:[],startExecution:()=>{e({isRunning:!0,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:Date.now(),endTime:null,workflowResults:[],outputDir:null}),t().addLog("info","Workflow execution started")},stopExecution:()=>{e({isRunning:!1,currentNodeId:null,endTime:Date.now()}),t().addLog("info","Workflow execution stopped")},setCurrentNode:n=>{e({currentNodeId:n}),n&&t().addLog("info","Processing node",n)},markNodeCompleted:(n,r)=>{e(a=>{const l=new Set(a.completedNodes);l.add(n);const u=new Map(a.results);return r!==void 0&&u.set(n,r),{completedNodes:l,results:u}}),t().addLog("success","Node completed",n)},markNodeFailed:(n,r)=>{e(a=>{const l=new Set(a.failedNodes);return l.add(n),{failedNodes:l}}),t().addLog("error",r||"Node failed",n)},setWorkflowResults:(n,r)=>{e({workflowResults:n,outputDir:r||null}),n.forEach(a=>{a.result&&e(l=>{const u=new Map(l.results);return u.set(a.nodeId,a.result),{results:u}})})},resetExecution:()=>{e({isRunning:!1,currentNodeId:null,completedNodes:new Set,failedNodes:new Set,results:new Map,startTime:null,endTime:null,workflowResults:[],outputDir:null})},addLog:(n,r,a,l)=>{const u={id:Sa(),timestamp:Date.now(),level:n,message:r,nodeId:a,details:l};e(f=>({logs:[...f.logs,u]}))},clearLogs:()=>e({logs:[]})}));function ge(e,t,n,r,a){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}function ne(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}let n2=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return n2=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))};function xl(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const ym=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};class Ae extends Error{}class Pt extends Ae{constructor(t,n,r,a){super(`${Pt.makeMessage(t,n,r)}`),this.status=t,this.headers=a,this.requestID=a?.get("request-id"),this.error=n}static makeMessage(t,n,r){const a=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return t&&a?`${t} ${a}`:t?`${t} status code (no body)`:a||"(no status code or body)"}static generate(t,n,r,a){if(!t||!a)return new Df({message:r,cause:ym(n)});const l=n;return t===400?new r2(t,l,r,a):t===401?new s2(t,l,r,a):t===403?new a2(t,l,r,a):t===404?new o2(t,l,r,a):t===409?new l2(t,l,r,a):t===422?new u2(t,l,r,a):t===429?new c2(t,l,r,a):t>=500?new f2(t,l,r,a):new Pt(t,l,r,a)}}class Gn extends Pt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class Df extends Pt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}}class i2 extends Df{constructor({message:t}={}){super({message:t??"Request timed out."})}}class r2 extends Pt{}class s2 extends Pt{}class a2 extends Pt{}class o2 extends Pt{}class l2 extends Pt{}class u2 extends Pt{}class c2 extends Pt{}class f2 extends Pt{}const Vj=/^[a-z][a-z0-9+.-]*:/i,Fj=e=>Vj.test(e);let xm=e=>(xm=Array.isArray,xm(e)),U1=xm;function bm(e){return typeof e!="object"?{}:e??{}}function Yj(e){if(!e)return!0;for(const t in e)return!1;return!0}function Xj(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const Gj=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Ae(`${e} must be an integer`);if(t<0)throw new Ae(`${e} must be a positive integer`);return t},d2=e=>{try{return JSON.parse(e)}catch{return}},Zj=e=>new Promise(t=>setTimeout(t,e)),sa="0.71.2",Qj=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function Kj(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const Jj=()=>{const e=Kj();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":q1(Deno.build.os),"X-Stainless-Arch":I1(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":q1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":I1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const t=Wj();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Wj(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:n}of e){const r=n.exec(navigator.userAgent);if(r){const a=r[1]||0,l=r[2]||0,u=r[3]||0;return{browser:t,version:`${a}.${l}.${u}`}}}return null}const I1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",q1=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let $1;const ez=()=>$1??($1=Jj());function tz(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function h2(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function p2(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return h2({start(){},async pull(n){const{done:r,value:a}=await t.next();r?n.close():n.enqueue(a)},async cancel(){await t.return?.()}})}function lg(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){const n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function nz(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}const t=e.getReader(),n=t.cancel();t.releaseLock(),await n}const iz=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function rz(e){let t=0;for(const a of e)t+=a.length;const n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}let P1;function ug(e){let t;return(P1??(t=new globalThis.TextEncoder,P1=t.encode.bind(t)))(e)}let V1;function F1(e){let t;return(V1??(t=new globalThis.TextDecoder,V1=t.decode.bind(t)))(e)}var bn,vn;class Ml{constructor(){bn.set(this,void 0),vn.set(this,void 0),ge(this,bn,new Uint8Array),ge(this,vn,null)}decode(t){if(t==null)return[];const n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?ug(t):t;ge(this,bn,rz([ne(this,bn,"f"),n]));const r=[];let a;for(;(a=sz(ne(this,bn,"f"),ne(this,vn,"f")))!=null;){if(a.carriage&&ne(this,vn,"f")==null){ge(this,vn,a.index);continue}if(ne(this,vn,"f")!=null&&(a.index!==ne(this,vn,"f")+1||a.carriage)){r.push(F1(ne(this,bn,"f").subarray(0,ne(this,vn,"f")-1))),ge(this,bn,ne(this,bn,"f").subarray(ne(this,vn,"f"))),ge(this,vn,null);continue}const l=ne(this,vn,"f")!==null?a.preceding-1:a.preceding,u=F1(ne(this,bn,"f").subarray(0,l));r.push(u),ge(this,bn,ne(this,bn,"f").subarray(a.index)),ge(this,vn,null)}return r}flush(){return ne(this,bn,"f").length?this.decode(`
16
- `):[]}}bn=new WeakMap,vn=new WeakMap;Ml.NEWLINE_CHARS=new Set([`
17
- `,"\r"]);Ml.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function sz(e,t){for(let a=t??0;a<e.length;a++){if(e[a]===10)return{preceding:a,index:a+1,carriage:!1};if(e[a]===13)return{preceding:a,index:a+1,carriage:!0}}return null}function az(e){for(let r=0;r<e.length-1;r++){if(e[r]===10&&e[r+1]===10||e[r]===13&&e[r+1]===13)return r+2;if(e[r]===13&&e[r+1]===10&&r+3<e.length&&e[r+2]===13&&e[r+3]===10)return r+4}return-1}const uf={off:0,error:200,warn:300,info:400,debug:500},Y1=(e,t,n)=>{if(e){if(Xj(uf,e))return e;Xt(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(uf))}`)}};function Jo(){}function pc(e,t,n){return!t||uf[e]>uf[n]?Jo:t[e].bind(t)}const oz={error:Jo,warn:Jo,info:Jo,debug:Jo};let X1=new WeakMap;function Xt(e){const t=e.logger,n=e.logLevel??"off";if(!t)return oz;const r=X1.get(t);if(r&&r[0]===n)return r[1];const a={error:pc("error",t,n),warn:pc("warn",t,n),info:pc("info",t,n),debug:pc("debug",t,n)};return X1.set(t,[n,a]),a}const is=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var Ao;class ai{constructor(t,n,r){this.iterator=t,Ao.set(this,void 0),this.controller=n,ge(this,Ao,r)}static fromSSEResponse(t,n,r){let a=!1;const l=r?Xt(r):console;async function*u(){if(a)throw new Ae("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let f=!1;try{for await(const h of lz(t,n)){if(h.event==="completion")try{yield JSON.parse(h.data)}catch(d){throw l.error("Could not parse message into JSON:",h.data),l.error("From chunk:",h.raw),d}if(h.event==="message_start"||h.event==="message_delta"||h.event==="message_stop"||h.event==="content_block_start"||h.event==="content_block_delta"||h.event==="content_block_stop")try{yield JSON.parse(h.data)}catch(d){throw l.error("Could not parse message into JSON:",h.data),l.error("From chunk:",h.raw),d}if(h.event!=="ping"&&h.event==="error")throw new Pt(void 0,d2(h.data)??h.data,void 0,t.headers)}f=!0}catch(h){if(xl(h))return;throw h}finally{f||n.abort()}}return new ai(u,n,r)}static fromReadableStream(t,n,r){let a=!1;async function*l(){const f=new Ml,h=lg(t);for await(const d of h)for(const g of f.decode(d))yield g;for(const d of f.flush())yield d}async function*u(){if(a)throw new Ae("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let f=!1;try{for await(const h of l())f||h&&(yield JSON.parse(h));f=!0}catch(h){if(xl(h))return;throw h}finally{f||n.abort()}}return new ai(u,n,r)}[(Ao=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){const t=[],n=[],r=this.iterator(),a=l=>({next:()=>{if(l.length===0){const u=r.next();t.push(u),n.push(u)}return l.shift()}});return[new ai(()=>a(t),this.controller,ne(this,Ao,"f")),new ai(()=>a(n),this.controller,ne(this,Ao,"f"))]}toReadableStream(){const t=this;let n;return h2({async start(){n=t[Symbol.asyncIterator]()},async pull(r){try{const{value:a,done:l}=await n.next();if(l)return r.close();const u=ug(JSON.stringify(a)+`
18
- `);r.enqueue(u)}catch(a){r.error(a)}},async cancel(){await n.return?.()}})}}async function*lz(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ae("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ae("Attempted to iterate over a response with no body");const n=new cz,r=new Ml,a=lg(e.body);for await(const l of uz(a))for(const u of r.decode(l)){const f=n.decode(u);f&&(yield f)}for(const l of r.flush()){const u=n.decode(l);u&&(yield u)}}async function*uz(e){let t=new Uint8Array;for await(const n of e){if(n==null)continue;const r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?ug(n):n;let a=new Uint8Array(t.length+r.length);a.set(t),a.set(r,t.length),t=a;let l;for(;(l=az(t))!==-1;)yield t.slice(0,l),t=t.slice(l)}t.length>0&&(yield t)}class cz{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const l={event:this.event,data:this.data.join(`
19
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],l}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,r,a]=fz(t,":");return a.startsWith(" ")&&(a=a.substring(1)),n==="event"?this.event=a:n==="data"&&this.data.push(a),null}}function fz(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function m2(e,t){const{response:n,requestLogID:r,retryOfRequestLogID:a,startTime:l}=t,u=await(async()=>{if(t.options.stream)return Xt(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller):ai.fromSSEResponse(n,t.controller);if(n.status===204)return null;if(t.options.__binaryResponse)return n;const h=n.headers.get("content-type")?.split(";")[0]?.trim();if(h?.includes("application/json")||h?.endsWith("+json")){const m=await n.json();return g2(m,n)}return await n.text()})();return Xt(e).debug(`[${r}] response parsed`,is({retryOfRequestLogID:a,url:n.url,status:n.status,body:u,durationMs:Date.now()-l})),u}function g2(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("request-id"),enumerable:!1})}var Wo;class Of extends Promise{constructor(t,n,r=m2){super(a=>{a(null)}),this.responsePromise=n,this.parseResponse=r,Wo.set(this,void 0),ge(this,Wo,t)}_thenUnwrap(t){return new Of(ne(this,Wo,"f"),this.responsePromise,async(n,r)=>g2(t(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(ne(this,Wo,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}Wo=new WeakMap;var mc;class y2{constructor(t,n,r,a){mc.set(this,void 0),ge(this,mc,t),this.options=a,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const t=this.nextPageRequestOptions();if(!t)throw new Ae("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ne(this,mc,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(mc=new WeakMap,Symbol.asyncIterator)](){for await(const t of this.iterPages())for(const n of t.getPaginatedItems())yield n}}class dz extends Of{constructor(t,n,r){super(t,n,async(a,l)=>new r(a,l.response,await m2(a,l),l.options))}async*[Symbol.asyncIterator](){const t=await this;for await(const n of t)yield n}}class jl extends y2{constructor(t,n,r,a){super(t,n,r,a),this.data=r.data||[],this.has_more=r.has_more||!1,this.first_id=r.first_id||null,this.last_id=r.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){const n=this.first_id;return n?{...this.options,query:{...bm(this.options.query),before_id:n}}:null}const t=this.last_id;return t?{...this.options,query:{...bm(this.options.query),after_id:t}}:null}}class x2 extends y2{constructor(t,n,r,a){super(t,n,r,a),this.data=r.data||[],this.has_more=r.has_more||!1,this.next_page=r.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){const t=this.next_page;return t?{...this.options,query:{...bm(this.options.query),page:t}}:null}}const b2=()=>{if(typeof File>"u"){const{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function da(e,t,n){return b2(),new File(e,t??"unknown_file",n)}function Pc(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const v2=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",cg=async(e,t)=>({...e,body:await pz(e.body,t)}),G1=new WeakMap;function hz(e){const t=typeof e=="function"?e:e.fetch,n=G1.get(t);if(n)return n;const r=(async()=>{try{const a="Response"in t?t.Response:(await t("data:,")).constructor,l=new FormData;return l.toString()!==await new a(l).text()}catch{return!0}})();return G1.set(t,r),r}const pz=async(e,t)=>{if(!await hz(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const n=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,a])=>vm(n,r,a))),n},mz=e=>e instanceof Blob&&"name"in e,vm=async(e,t,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response){let r={};const a=n.headers.get("Content-Type");a&&(r={type:a}),e.append(t,da([await n.blob()],Pc(n),r))}else if(v2(n))e.append(t,da([await new Response(p2(n)).blob()],Pc(n)));else if(mz(n))e.append(t,da([n],Pc(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>vm(e,t+"[]",r)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,a])=>vm(e,`${t}[${r}]`,a)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},w2=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",gz=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&w2(e),yz=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function xz(e,t,n){if(b2(),e=await e,t||(t=Pc(e)),gz(e))return e instanceof File&&t==null&&n==null?e:da([await e.arrayBuffer()],t??e.name,{type:e.type,lastModified:e.lastModified,...n});if(yz(e)){const a=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),da(await wm(a),t,n)}const r=await wm(e);if(!n?.type){const a=r.find(l=>typeof l=="object"&&"type"in l&&l.type);typeof a=="string"&&(n={...n,type:a})}return da(r,t,n)}async function wm(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(w2(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(v2(e))for await(const n of e)t.push(...await wm(n));else{const n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${bz(e)}`)}return t}function bz(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}class Kn{constructor(t){this._client=t}}const S2=Symbol.for("brand.privateNullableHeaders");function*vz(e){if(!e)return;if(S2 in e){const{values:r,nulls:a}=e;yield*r.entries();for(const l of a)yield[l,null];return}let t=!1,n;e instanceof Headers?n=e.entries():U1(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let r of n){const a=r[0];if(typeof a!="string")throw new TypeError("expected header name to be a string");const l=U1(r[1])?r[1]:[r[1]];let u=!1;for(const f of l)f!==void 0&&(t&&!u&&(u=!0,yield[a,null]),yield[a,f])}}const Ve=e=>{const t=new Headers,n=new Set;for(const r of e){const a=new Set;for(const[l,u]of vz(r)){const f=l.toLowerCase();a.has(f)||(t.delete(l),a.add(f)),u===null?(t.delete(l),n.add(f)):(t.append(l,u),n.delete(f))}}return{[S2]:!0,values:t,nulls:n}};function _2(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const Z1=Object.freeze(Object.create(null)),wz=(e=_2)=>function(n,...r){if(n.length===1)return n[0];let a=!1;const l=[],u=n.reduce((g,m,x)=>{/[?#]/.test(m)&&(a=!0);const v=r[x];let w=(a?encodeURIComponent:e)(""+v);return x!==r.length&&(v==null||typeof v=="object"&&v.toString===Object.getPrototypeOf(Object.getPrototypeOf(v.hasOwnProperty??Z1)??Z1)?.toString)&&(w=v+"",l.push({start:g.length+m.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(v).slice(8,-1)} is not a valid path parameter`})),g+m+(x===r.length?"":w)},""),f=u.split(/[?#]/,1)[0],h=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let d;for(;(d=h.exec(f))!==null;)l.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(l.sort((g,m)=>g.start-m.start),l.length>0){let g=0;const m=l.reduce((x,v)=>{const w=" ".repeat(v.start-g),k="^".repeat(v.length);return g=v.start+v.length,x+w+k},"");throw new Ae(`Path parameters result in path with invalid segments:
20
- ${l.map(x=>x.error).join(`
21
- `)}
22
- ${u}
23
- ${m}`)}return u},Bt=wz(_2);class k2 extends Kn{list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/files",jl,{query:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])})}delete(t,n={},r){const{betas:a}=n??{};return this._client.delete(Bt`/v1/files/${t}`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},r?.headers])})}download(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/files/${t}/content`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}retrieveMetadata(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/files/${t}`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"files-api-2025-04-14"].toString()},r?.headers])})}upload(t,n){const{betas:r,...a}=t;return this._client.post("/v1/files",cg({body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])},this._client))}}let E2=class extends Kn{retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/models/${t}?beta=true`,{...r,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/models?beta=true",jl,{query:a,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}};const N2={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};function Q1(e,t,n){return!t||!("parse"in(t.output_format??{}))?{...e,content:e.content.map(r=>{if(r.type==="text"){const a=Object.defineProperty({...r},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(a,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return r}),parsed_output:null}:C2(e,t,n)}function C2(e,t,n){let r=null;const a=e.content.map(l=>{if(l.type==="text"){const u=Sz(t,l.text);r===null&&(r=u);const f=Object.defineProperty({...l},"parsed_output",{value:u,enumerable:!1});return Object.defineProperty(f,"parsed",{get(){return n.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),u},enumerable:!1})}return l});return{...e,content:a,parsed_output:r}}function Sz(e,t){if(e.output_format?.type!=="json_schema")return null;try{return"parse"in e.output_format?e.output_format.parse(t):JSON.parse(t)}catch(n){throw new Ae(`Failed to parse structured output: ${n}`)}}const _z=e=>{let t=0,n=[];for(;t<e.length;){let r=e[t];if(r==="\\"){t++;continue}if(r==="{"){n.push({type:"brace",value:"{"}),t++;continue}if(r==="}"){n.push({type:"brace",value:"}"}),t++;continue}if(r==="["){n.push({type:"paren",value:"["}),t++;continue}if(r==="]"){n.push({type:"paren",value:"]"}),t++;continue}if(r===":"){n.push({type:"separator",value:":"}),t++;continue}if(r===","){n.push({type:"delimiter",value:","}),t++;continue}if(r==='"'){let f="",h=!1;for(r=e[++t];r!=='"';){if(t===e.length){h=!0;break}if(r==="\\"){if(t++,t===e.length){h=!0;break}f+=r+e[t],r=e[++t]}else f+=r,r=e[++t]}r=e[++t],h||n.push({type:"string",value:f});continue}if(r&&/\s/.test(r)){t++;continue}let l=/[0-9]/;if(r&&l.test(r)||r==="-"||r==="."){let f="";for(r==="-"&&(f+=r,r=e[++t]);r&&l.test(r)||r===".";)f+=r,r=e[++t];n.push({type:"number",value:f});continue}let u=/[a-z]/i;if(r&&u.test(r)){let f="";for(;r&&u.test(r)&&t!==e.length;)f+=r,r=e[++t];if(f=="true"||f=="false"||f==="null")n.push({type:"name",value:f});else{t++;continue}continue}t++}return n},aa=e=>{if(e.length===0)return e;let t=e[e.length-1];switch(t.type){case"separator":return e=e.slice(0,e.length-1),aa(e);case"number":let n=t.value[t.value.length-1];if(n==="."||n==="-")return e=e.slice(0,e.length-1),aa(e);case"string":let r=e[e.length-2];if(r?.type==="delimiter")return e=e.slice(0,e.length-1),aa(e);if(r?.type==="brace"&&r.value==="{")return e=e.slice(0,e.length-1),aa(e);break;case"delimiter":return e=e.slice(0,e.length-1),aa(e)}return e},kz=e=>{let t=[];return e.map(n=>{n.type==="brace"&&(n.value==="{"?t.push("}"):t.splice(t.lastIndexOf("}"),1)),n.type==="paren"&&(n.value==="["?t.push("]"):t.splice(t.lastIndexOf("]"),1))}),t.length>0&&t.reverse().map(n=>{n==="}"?e.push({type:"brace",value:"}"}):n==="]"&&e.push({type:"paren",value:"]"})}),e},Ez=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},T2=e=>JSON.parse(Ez(kz(aa(_z(e)))));var Rn,_r,ta,Mo,gc,jo,zo,yc,Ro,Hi,Do,xc,bc,Jr,vc,wc,Oo,_p,K1,Sc,kp,Ep,Np,J1;const W1="__json_buf";function ev(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class cf{constructor(t,n){Rn.add(this),this.messages=[],this.receivedMessages=[],_r.set(this,void 0),ta.set(this,null),this.controller=new AbortController,Mo.set(this,void 0),gc.set(this,()=>{}),jo.set(this,()=>{}),zo.set(this,void 0),yc.set(this,()=>{}),Ro.set(this,()=>{}),Hi.set(this,{}),Do.set(this,!1),xc.set(this,!1),bc.set(this,!1),Jr.set(this,!1),vc.set(this,void 0),wc.set(this,void 0),Oo.set(this,void 0),Sc.set(this,r=>{if(ge(this,xc,!0),xl(r)&&(r=new Gn),r instanceof Gn)return ge(this,bc,!0),this._emit("abort",r);if(r instanceof Ae)return this._emit("error",r);if(r instanceof Error){const a=new Ae(r.message);return a.cause=r,this._emit("error",a)}return this._emit("error",new Ae(String(r)))}),ge(this,Mo,new Promise((r,a)=>{ge(this,gc,r,"f"),ge(this,jo,a,"f")})),ge(this,zo,new Promise((r,a)=>{ge(this,yc,r,"f"),ge(this,Ro,a,"f")})),ne(this,Mo,"f").catch(()=>{}),ne(this,zo,"f").catch(()=>{}),ge(this,ta,t),ge(this,Oo,n?.logger??console)}get response(){return ne(this,vc,"f")}get request_id(){return ne(this,wc,"f")}async withResponse(){ge(this,Jr,!0);const t=await ne(this,Mo,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){const n=new cf(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r,{logger:a}={}){const l=new cf(n,{logger:a});for(const u of n.messages)l._addMessageParam(u);return ge(l,ta,{...n,stream:!0}),l._run(()=>l._createMessage(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),l}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},ne(this,Sc,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,r){const a=r?.signal;let l;a&&(a.aborted&&this.controller.abort(),l=this.controller.abort.bind(this.controller),a.addEventListener("abort",l));try{ne(this,Rn,"m",kp).call(this);const{response:u,data:f}=await t.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,Rn,"m",Ep).call(this,h);if(f.controller.signal?.aborted)throw new Gn;ne(this,Rn,"m",Np).call(this)}finally{a&&l&&a.removeEventListener("abort",l)}}_connected(t){this.ended||(ge(this,vc,t),ge(this,wc,t?.headers.get("request-id")),ne(this,gc,"f").call(this,t),this._emit("connect"))}get ended(){return ne(this,Do,"f")}get errored(){return ne(this,xc,"f")}get aborted(){return ne(this,bc,"f")}abort(){this.controller.abort()}on(t,n){return(ne(this,Hi,"f")[t]||(ne(this,Hi,"f")[t]=[])).push({listener:n}),this}off(t,n){const r=ne(this,Hi,"f")[t];if(!r)return this;const a=r.findIndex(l=>l.listener===n);return a>=0&&r.splice(a,1),this}once(t,n){return(ne(this,Hi,"f")[t]||(ne(this,Hi,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,r)=>{ge(this,Jr,!0),t!=="error"&&this.once("error",r),this.once(t,n)})}async done(){ge(this,Jr,!0),await ne(this,zo,"f")}get currentMessage(){return ne(this,_r,"f")}async finalMessage(){return await this.done(),ne(this,Rn,"m",_p).call(this)}async finalText(){return await this.done(),ne(this,Rn,"m",K1).call(this)}_emit(t,...n){if(ne(this,Do,"f"))return;t==="end"&&(ge(this,Do,!0),ne(this,yc,"f").call(this));const r=ne(this,Hi,"f")[t];if(r&&(ne(this,Hi,"f")[t]=r.filter(a=>!a.once),r.forEach(({listener:a})=>a(...n))),t==="abort"){const a=n[0];!ne(this,Jr,"f")&&!r?.length&&Promise.reject(a),ne(this,jo,"f").call(this,a),ne(this,Ro,"f").call(this,a),this._emit("end");return}if(t==="error"){const a=n[0];!ne(this,Jr,"f")&&!r?.length&&Promise.reject(a),ne(this,jo,"f").call(this,a),ne(this,Ro,"f").call(this,a),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,Rn,"m",_p).call(this))}async _fromReadableStream(t,n){const r=n?.signal;let a;r&&(r.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),r.addEventListener("abort",a));try{ne(this,Rn,"m",kp).call(this),this._connected(null);const l=ai.fromReadableStream(t,this.controller);for await(const u of l)ne(this,Rn,"m",Ep).call(this,u);if(l.controller.signal?.aborted)throw new Gn;ne(this,Rn,"m",Np).call(this)}finally{r&&a&&r.removeEventListener("abort",a)}}[(_r=new WeakMap,ta=new WeakMap,Mo=new WeakMap,gc=new WeakMap,jo=new WeakMap,zo=new WeakMap,yc=new WeakMap,Ro=new WeakMap,Hi=new WeakMap,Do=new WeakMap,xc=new WeakMap,bc=new WeakMap,Jr=new WeakMap,vc=new WeakMap,wc=new WeakMap,Oo=new WeakMap,Sc=new WeakMap,Rn=new WeakSet,_p=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},K1=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new Ae("stream ended without producing a content block with type=text");return n.join(" ")},kp=function(){this.ended||ge(this,_r,void 0)},Ep=function(n){if(this.ended)return;const r=ne(this,Rn,"m",J1).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{const a=r.content.at(-1);switch(n.delta.type){case"text_delta":{a.type==="text"&&this._emit("text",n.delta.text,a.text||"");break}case"citations_delta":{a.type==="text"&&this._emit("citation",n.delta.citation,a.citations??[]);break}case"input_json_delta":{ev(a)&&a.input&&this._emit("inputJson",n.delta.partial_json,a.input);break}case"thinking_delta":{a.type==="thinking"&&this._emit("thinking",n.delta.thinking,a.thinking);break}case"signature_delta":{a.type==="thinking"&&this._emit("signature",a.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(Q1(r,ne(this,ta,"f"),{logger:ne(this,Oo,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ge(this,_r,r);break}}},Np=function(){if(this.ended)throw new Ae("stream has ended, this shouldn't happen");const n=ne(this,_r,"f");if(!n)throw new Ae("request ended without sending any chunks");return ge(this,_r,void 0),Q1(n,ne(this,ta,"f"),{logger:ne(this,Oo,"f")})},J1=function(n){let r=ne(this,_r,"f");if(n.type==="message_start"){if(r)throw new Ae(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new Ae(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.container=n.delta.container,r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.usage.output_tokens=n.usage.output_tokens,r.context_management=n.context_management,n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),r;case"content_block_start":return r.content.push(n.content_block),r;case"content_block_delta":{const a=r.content.at(n.index);switch(n.delta.type){case"text_delta":{a?.type==="text"&&(r.content[n.index]={...a,text:(a.text||"")+n.delta.text});break}case"citations_delta":{a?.type==="text"&&(r.content[n.index]={...a,citations:[...a.citations??[],n.delta.citation]});break}case"input_json_delta":{if(a&&ev(a)){let l=a[W1]||"";l+=n.delta.partial_json;const u={...a};if(Object.defineProperty(u,W1,{value:l,enumerable:!1,writable:!0}),l)try{u.input=T2(l)}catch(f){const h=new Ae(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${l}`);ne(this,Sc,"f").call(this,h)}r.content[n.index]=u}break}case"thinking_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,thinking:a.thinking+n.delta.thinking});break}case"signature_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,signature:n.delta.signature});break}default:n.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){const t=[],n=[];let r=!1;return this.on("streamEvent",a=>{const l=n.shift();l?l.resolve(a):t.push(a)}),this.on("end",()=>{r=!0;for(const a of n)a.resolve(void 0);n.length=0}),this.on("abort",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),this.on("error",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((l,u)=>n.push({resolve:l,reject:u})).then(l=>l?{value:l,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ai(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}const Nz=1e5,Cz=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
24
- 1. Task Overview
25
- The user's core request and success criteria
26
- Any clarifications or constraints they specified
27
- 2. Current State
28
- What has been completed so far
29
- Files created, modified, or analyzed (with paths if relevant)
30
- Key outputs or artifacts produced
31
- 3. Important Discoveries
32
- Technical constraints or requirements uncovered
33
- Decisions made and their rationale
34
- Errors encountered and how they were resolved
35
- What approaches were tried that didn't work (and why)
36
- 4. Next Steps
37
- Specific actions needed to complete the task
38
- Any blockers or open questions to resolve
39
- Priority order if multiple steps remain
40
- 5. Context to Preserve
41
- User preferences or style requirements
42
- Domain-specific details that aren't obvious
43
- Any promises made to the user
44
- Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
45
- Wrap your summary in <summary></summary> tags.`;var Lo,na,Wr,Mt,Bo,xn,Ii,kr,Ho,tv,Sm;function nv(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}class A2{constructor(t,n,r){Lo.add(this),this.client=t,na.set(this,!1),Wr.set(this,!1),Mt.set(this,void 0),Bo.set(this,void 0),xn.set(this,void 0),Ii.set(this,void 0),kr.set(this,void 0),Ho.set(this,0),ge(this,Mt,{params:{...n,messages:structuredClone(n.messages)}}),ge(this,Bo,{...r,headers:Ve([{"x-stainless-helper":"BetaToolRunner"},r?.headers])}),ge(this,kr,nv())}async*[(na=new WeakMap,Wr=new WeakMap,Mt=new WeakMap,Bo=new WeakMap,xn=new WeakMap,Ii=new WeakMap,kr=new WeakMap,Ho=new WeakMap,Lo=new WeakSet,tv=async function(){const n=ne(this,Mt,"f").params.compactionControl;if(!n||!n.enabled)return!1;let r=0;if(ne(this,xn,"f")!==void 0)try{const d=await ne(this,xn,"f");r=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}const a=n.contextTokenThreshold??Nz;if(r<a)return!1;const l=n.model??ne(this,Mt,"f").params.model,u=n.summaryPrompt??Cz,f=ne(this,Mt,"f").params.messages;if(f[f.length-1].role==="assistant"){const d=f[f.length-1];if(Array.isArray(d.content)){const g=d.content.filter(m=>m.type!=="tool_use");g.length===0?f.pop():d.content=g}}const h=await this.client.beta.messages.create({model:l,messages:[...f,{role:"user",content:[{type:"text",text:u}]}],max_tokens:ne(this,Mt,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(h.content[0]?.type!=="text")throw new Ae("Expected text response for compaction");return ne(this,Mt,"f").params.messages=[{role:"user",content:h.content}],!0},Symbol.asyncIterator)](){var t;if(ne(this,na,"f"))throw new Ae("Cannot iterate over a consumed stream");ge(this,na,!0),ge(this,Wr,!0),ge(this,Ii,void 0);try{for(;;){let n;try{if(ne(this,Mt,"f").params.max_iterations&&ne(this,Ho,"f")>=ne(this,Mt,"f").params.max_iterations)break;ge(this,Wr,!1,"f"),ge(this,Ii,void 0,"f"),ge(this,Ho,(t=ne(this,Ho,"f"),t++,t),"f"),ge(this,xn,void 0,"f");const{max_iterations:r,compactionControl:a,...l}=ne(this,Mt,"f").params;if(l.stream?(n=this.client.beta.messages.stream({...l},ne(this,Bo,"f")),ge(this,xn,n.finalMessage(),"f"),ne(this,xn,"f").catch(()=>{}),yield n):(ge(this,xn,this.client.beta.messages.create({...l,stream:!1},ne(this,Bo,"f")),"f"),yield ne(this,xn,"f")),!await ne(this,Lo,"m",tv).call(this)){if(!ne(this,Wr,"f")){const{role:h,content:d}=await ne(this,xn,"f");ne(this,Mt,"f").params.messages.push({role:h,content:d})}const f=await ne(this,Lo,"m",Sm).call(this,ne(this,Mt,"f").params.messages.at(-1));if(f)ne(this,Mt,"f").params.messages.push(f);else if(!ne(this,Wr,"f"))break}}finally{n&&n.abort()}}if(!ne(this,xn,"f"))throw new Ae("ToolRunner concluded without a message from the server");ne(this,kr,"f").resolve(await ne(this,xn,"f"))}catch(n){throw ge(this,na,!1),ne(this,kr,"f").promise.catch(()=>{}),ne(this,kr,"f").reject(n),ge(this,kr,nv()),n}}setMessagesParams(t){typeof t=="function"?ne(this,Mt,"f").params=t(ne(this,Mt,"f").params):ne(this,Mt,"f").params=t,ge(this,Wr,!0),ge(this,Ii,void 0)}async generateToolResponse(){const t=await ne(this,xn,"f")??this.params.messages.at(-1);return t?ne(this,Lo,"m",Sm).call(this,t):null}done(){return ne(this,kr,"f").promise}async runUntilDone(){if(!ne(this,na,"f"))for await(const t of this);return this.done()}get params(){return ne(this,Mt,"f").params}pushMessages(...t){this.setMessagesParams(n=>({...n,messages:[...n.messages,...t]}))}then(t,n){return this.runUntilDone().then(t,n)}}Sm=async function(t){return ne(this,Ii,"f")!==void 0?ne(this,Ii,"f"):(ge(this,Ii,Tz(ne(this,Mt,"f").params,t)),ne(this,Ii,"f"))};async function Tz(e,t=e.messages.at(-1)){if(!t||t.role!=="assistant"||!t.content||typeof t.content=="string")return null;const n=t.content.filter(a=>a.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async a=>{const l=e.tools.find(u=>("name"in u?u.name:u.mcp_server_name)===a.name);if(!l||!("run"in l))return{type:"tool_result",tool_use_id:a.id,content:`Error: Tool '${a.name}' not found`,is_error:!0};try{let u=a.input;"parse"in l&&l.parse&&(u=l.parse(u));const f=await l.run(u);return{type:"tool_result",tool_use_id:a.id,content:f}}catch(u){return{type:"tool_result",tool_use_id:a.id,content:`Error: ${u instanceof Error?u.message:String(u)}`,is_error:!0}}}))}}class Lf{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){const t=new Ml;for await(const n of this.iterator)for(const r of t.decode(n))yield JSON.parse(r);for(const n of t.flush())yield JSON.parse(n)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(t,n){if(!t.body)throw n.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ae("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ae("Attempted to iterate over a response with no body");return new Lf(lg(t.body),n)}}let M2=class extends Kn{create(t,n){const{betas:r,...a}=t;return this._client.post("/v1/messages/batches?beta=true",{body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/messages/batches/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/messages/batches?beta=true",jl,{query:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"message-batches-2024-09-24"].toString()},n?.headers])})}delete(t,n={},r){const{betas:a}=n??{};return this._client.delete(Bt`/v1/messages/batches/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},r?.headers])})}cancel(t,n={},r){const{betas:a}=n??{};return this._client.post(Bt`/v1/messages/batches/${t}/cancel?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"message-batches-2024-09-24"].toString()},r?.headers])})}async results(t,n={},r){const a=await this.retrieve(t);if(!a.results_url)throw new Ae(`No batch \`results_url\`; Has it finished processing? ${a.processing_status} - ${a.id}`);const{betas:l}=n??{};return this._client.get(a.results_url,{...r,headers:Ve([{"anthropic-beta":[...l??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((u,f)=>Lf.fromResponse(f.response,f.controller))}};const iv={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};let Bf=class extends Kn{constructor(){super(...arguments),this.batches=new M2(this._client)}create(t,n){const{betas:r,...a}=t;a.model in iv&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${iv[a.model]}
46
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let l=this._client._options.timeout;if(!a.stream&&l==null){const u=N2[a.model]??void 0;l=this._client.calculateNonstreamingTimeout(a.max_tokens,u)}return this._client.post("/v1/messages?beta=true",{body:a,timeout:l??6e5,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),stream:t.stream??!1})}parse(t,n){return n={...n,headers:Ve([{"anthropic-beta":[...t.betas??[],"structured-outputs-2025-11-13"].toString()},n?.headers])},this.create(t,n).then(r=>C2(r,t,{logger:this._client.logger??console}))}stream(t,n){return cf.createMessage(this,t,n)}countTokens(t,n){const{betas:r,...a}=t;return this._client.post("/v1/messages/count_tokens?beta=true",{body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"token-counting-2024-11-01"].toString()},n?.headers])})}toolRunner(t,n){return new A2(this._client,t,n)}};Bf.Batches=M2;Bf.BetaToolRunner=A2;class j2 extends Kn{create(t,n={},r){const{betas:a,...l}=n??{};return this._client.post(Bt`/v1/skills/${t}/versions?beta=true`,cg({body:l,...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])},this._client))}retrieve(t,n,r){const{skill_id:a,betas:l}=n;return this._client.get(Bt`/v1/skills/${a}/versions/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...l??[],"skills-2025-10-02"].toString()},r?.headers])})}list(t,n={},r){const{betas:a,...l}=n??{};return this._client.getAPIList(Bt`/v1/skills/${t}/versions?beta=true`,x2,{query:l,...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(t,n,r){const{skill_id:a,betas:l}=n;return this._client.delete(Bt`/v1/skills/${a}/versions/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...l??[],"skills-2025-10-02"].toString()},r?.headers])})}}class fg extends Kn{constructor(){super(...arguments),this.versions=new j2(this._client)}create(t={},n){const{betas:r,...a}=t??{};return this._client.post("/v1/skills?beta=true",cg({body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/skills/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/skills?beta=true",x2,{query:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(t,n={},r){const{betas:a}=n??{};return this._client.delete(Bt`/v1/skills/${t}?beta=true`,{...r,headers:Ve([{"anthropic-beta":[...a??[],"skills-2025-10-02"].toString()},r?.headers])})}}fg.Versions=j2;class Ea extends Kn{constructor(){super(...arguments),this.models=new E2(this._client),this.messages=new Bf(this._client),this.files=new k2(this._client),this.skills=new fg(this._client)}}Ea.Models=E2;Ea.Messages=Bf;Ea.Files=k2;Ea.Skills=fg;class z2 extends Kn{create(t,n){const{betas:r,...a}=t;return this._client.post("/v1/complete",{body:a,timeout:this._client._options.timeout??6e5,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers]),stream:t.stream??!1})}}var Dn,Er,Uo,_c,Io,qo,kc,$o,Ui,Po,Ec,Nc,es,Cc,Tc,Cp,rv,Tp,Ap,Mp,jp,sv;const av="__json_buf";function ov(e){return e.type==="tool_use"||e.type==="server_tool_use"}class ff{constructor(){Dn.add(this),this.messages=[],this.receivedMessages=[],Er.set(this,void 0),this.controller=new AbortController,Uo.set(this,void 0),_c.set(this,()=>{}),Io.set(this,()=>{}),qo.set(this,void 0),kc.set(this,()=>{}),$o.set(this,()=>{}),Ui.set(this,{}),Po.set(this,!1),Ec.set(this,!1),Nc.set(this,!1),es.set(this,!1),Cc.set(this,void 0),Tc.set(this,void 0),Tp.set(this,t=>{if(ge(this,Ec,!0),xl(t)&&(t=new Gn),t instanceof Gn)return ge(this,Nc,!0),this._emit("abort",t);if(t instanceof Ae)return this._emit("error",t);if(t instanceof Error){const n=new Ae(t.message);return n.cause=t,this._emit("error",n)}return this._emit("error",new Ae(String(t)))}),ge(this,Uo,new Promise((t,n)=>{ge(this,_c,t,"f"),ge(this,Io,n,"f")})),ge(this,qo,new Promise((t,n)=>{ge(this,kc,t,"f"),ge(this,$o,n,"f")})),ne(this,Uo,"f").catch(()=>{}),ne(this,qo,"f").catch(()=>{})}get response(){return ne(this,Cc,"f")}get request_id(){return ne(this,Tc,"f")}async withResponse(){ge(this,es,!0);const t=await ne(this,Uo,"f");if(!t)throw new Error("Could not resolve a `Response` object");return{data:this,response:t,request_id:t.headers.get("request-id")}}static fromReadableStream(t){const n=new ff;return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r){const a=new ff;for(const l of n.messages)a._addMessageParam(l);return a._run(()=>a._createMessage(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),a}_run(t){t().then(()=>{this._emitFinal(),this._emit("end")},ne(this,Tp,"f"))}_addMessageParam(t){this.messages.push(t)}_addMessage(t,n=!0){this.receivedMessages.push(t),n&&this._emit("message",t)}async _createMessage(t,n,r){const a=r?.signal;let l;a&&(a.aborted&&this.controller.abort(),l=this.controller.abort.bind(this.controller),a.addEventListener("abort",l));try{ne(this,Dn,"m",Ap).call(this);const{response:u,data:f}=await t.create({...n,stream:!0},{...r,signal:this.controller.signal}).withResponse();this._connected(u);for await(const h of f)ne(this,Dn,"m",Mp).call(this,h);if(f.controller.signal?.aborted)throw new Gn;ne(this,Dn,"m",jp).call(this)}finally{a&&l&&a.removeEventListener("abort",l)}}_connected(t){this.ended||(ge(this,Cc,t),ge(this,Tc,t?.headers.get("request-id")),ne(this,_c,"f").call(this,t),this._emit("connect"))}get ended(){return ne(this,Po,"f")}get errored(){return ne(this,Ec,"f")}get aborted(){return ne(this,Nc,"f")}abort(){this.controller.abort()}on(t,n){return(ne(this,Ui,"f")[t]||(ne(this,Ui,"f")[t]=[])).push({listener:n}),this}off(t,n){const r=ne(this,Ui,"f")[t];if(!r)return this;const a=r.findIndex(l=>l.listener===n);return a>=0&&r.splice(a,1),this}once(t,n){return(ne(this,Ui,"f")[t]||(ne(this,Ui,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,r)=>{ge(this,es,!0),t!=="error"&&this.once("error",r),this.once(t,n)})}async done(){ge(this,es,!0),await ne(this,qo,"f")}get currentMessage(){return ne(this,Er,"f")}async finalMessage(){return await this.done(),ne(this,Dn,"m",Cp).call(this)}async finalText(){return await this.done(),ne(this,Dn,"m",rv).call(this)}_emit(t,...n){if(ne(this,Po,"f"))return;t==="end"&&(ge(this,Po,!0),ne(this,kc,"f").call(this));const r=ne(this,Ui,"f")[t];if(r&&(ne(this,Ui,"f")[t]=r.filter(a=>!a.once),r.forEach(({listener:a})=>a(...n))),t==="abort"){const a=n[0];!ne(this,es,"f")&&!r?.length&&Promise.reject(a),ne(this,Io,"f").call(this,a),ne(this,$o,"f").call(this,a),this._emit("end");return}if(t==="error"){const a=n[0];!ne(this,es,"f")&&!r?.length&&Promise.reject(a),ne(this,Io,"f").call(this,a),ne(this,$o,"f").call(this,a),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,Dn,"m",Cp).call(this))}async _fromReadableStream(t,n){const r=n?.signal;let a;r&&(r.aborted&&this.controller.abort(),a=this.controller.abort.bind(this.controller),r.addEventListener("abort",a));try{ne(this,Dn,"m",Ap).call(this),this._connected(null);const l=ai.fromReadableStream(t,this.controller);for await(const u of l)ne(this,Dn,"m",Mp).call(this,u);if(l.controller.signal?.aborted)throw new Gn;ne(this,Dn,"m",jp).call(this)}finally{r&&a&&r.removeEventListener("abort",a)}}[(Er=new WeakMap,Uo=new WeakMap,_c=new WeakMap,Io=new WeakMap,qo=new WeakMap,kc=new WeakMap,$o=new WeakMap,Ui=new WeakMap,Po=new WeakMap,Ec=new WeakMap,Nc=new WeakMap,es=new WeakMap,Cc=new WeakMap,Tc=new WeakMap,Tp=new WeakMap,Dn=new WeakSet,Cp=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},rv=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");const n=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(n.length===0)throw new Ae("stream ended without producing a content block with type=text");return n.join(" ")},Ap=function(){this.ended||ge(this,Er,void 0)},Mp=function(n){if(this.ended)return;const r=ne(this,Dn,"m",sv).call(this,n);switch(this._emit("streamEvent",n,r),n.type){case"content_block_delta":{const a=r.content.at(-1);switch(n.delta.type){case"text_delta":{a.type==="text"&&this._emit("text",n.delta.text,a.text||"");break}case"citations_delta":{a.type==="text"&&this._emit("citation",n.delta.citation,a.citations??[]);break}case"input_json_delta":{ov(a)&&a.input&&this._emit("inputJson",n.delta.partial_json,a.input);break}case"thinking_delta":{a.type==="thinking"&&this._emit("thinking",n.delta.thinking,a.thinking);break}case"signature_delta":{a.type==="thinking"&&this._emit("signature",a.signature);break}default:n.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(r,!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ge(this,Er,r);break}}},jp=function(){if(this.ended)throw new Ae("stream has ended, this shouldn't happen");const n=ne(this,Er,"f");if(!n)throw new Ae("request ended without sending any chunks");return ge(this,Er,void 0),n},sv=function(n){let r=ne(this,Er,"f");if(n.type==="message_start"){if(r)throw new Ae(`Unexpected event order, got ${n.type} before receiving "message_stop"`);return n.message}if(!r)throw new Ae(`Unexpected event order, got ${n.type} before "message_start"`);switch(n.type){case"message_stop":return r;case"message_delta":return r.stop_reason=n.delta.stop_reason,r.stop_sequence=n.delta.stop_sequence,r.usage.output_tokens=n.usage.output_tokens,n.usage.input_tokens!=null&&(r.usage.input_tokens=n.usage.input_tokens),n.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=n.usage.cache_creation_input_tokens),n.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=n.usage.cache_read_input_tokens),n.usage.server_tool_use!=null&&(r.usage.server_tool_use=n.usage.server_tool_use),r;case"content_block_start":return r.content.push({...n.content_block}),r;case"content_block_delta":{const a=r.content.at(n.index);switch(n.delta.type){case"text_delta":{a?.type==="text"&&(r.content[n.index]={...a,text:(a.text||"")+n.delta.text});break}case"citations_delta":{a?.type==="text"&&(r.content[n.index]={...a,citations:[...a.citations??[],n.delta.citation]});break}case"input_json_delta":{if(a&&ov(a)){let l=a[av]||"";l+=n.delta.partial_json;const u={...a};Object.defineProperty(u,av,{value:l,enumerable:!1,writable:!0}),l&&(u.input=T2(l)),r.content[n.index]=u}break}case"thinking_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,thinking:a.thinking+n.delta.thinking});break}case"signature_delta":{a?.type==="thinking"&&(r.content[n.index]={...a,signature:n.delta.signature});break}default:n.delta}return r}case"content_block_stop":return r}},Symbol.asyncIterator)](){const t=[],n=[];let r=!1;return this.on("streamEvent",a=>{const l=n.shift();l?l.resolve(a):t.push(a)}),this.on("end",()=>{r=!0;for(const a of n)a.resolve(void 0);n.length=0}),this.on("abort",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),this.on("error",a=>{r=!0;for(const l of n)l.reject(a);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((l,u)=>n.push({resolve:l,reject:u})).then(l=>l?{value:l,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ai(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}class R2 extends Kn{create(t,n){return this._client.post("/v1/messages/batches",{body:t,...n})}retrieve(t,n){return this._client.get(Bt`/v1/messages/batches/${t}`,n)}list(t={},n){return this._client.getAPIList("/v1/messages/batches",jl,{query:t,...n})}delete(t,n){return this._client.delete(Bt`/v1/messages/batches/${t}`,n)}cancel(t,n){return this._client.post(Bt`/v1/messages/batches/${t}/cancel`,n)}async results(t,n){const r=await this.retrieve(t);if(!r.results_url)throw new Ae(`No batch \`results_url\`; Has it finished processing? ${r.processing_status} - ${r.id}`);return this._client.get(r.results_url,{...n,headers:Ve([{Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((a,l)=>Lf.fromResponse(l.response,l.controller))}}class dg extends Kn{constructor(){super(...arguments),this.batches=new R2(this._client)}create(t,n){t.model in lv&&console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${lv[t.model]}
47
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);let r=this._client._options.timeout;if(!t.stream&&r==null){const a=N2[t.model]??void 0;r=this._client.calculateNonstreamingTimeout(t.max_tokens,a)}return this._client.post("/v1/messages",{body:t,timeout:r??6e5,...n,stream:t.stream??!1})}stream(t,n){return ff.createMessage(this,t,n)}countTokens(t,n){return this._client.post("/v1/messages/count_tokens",{body:t,...n})}}const lv={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"};dg.Batches=R2;class D2 extends Kn{retrieve(t,n={},r){const{betas:a}=n??{};return this._client.get(Bt`/v1/models/${t}`,{...r,headers:Ve([{...a?.toString()!=null?{"anthropic-beta":a?.toString()}:void 0},r?.headers])})}list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/models",jl,{query:a,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}}var Az={};const Ac=e=>{if(typeof globalThis.process<"u")return Az?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var _m,hg,Vc,O2;const Mz="\\n\\nHuman:",jz="\\n\\nAssistant:";class Nt{constructor({baseURL:t=Ac("ANTHROPIC_BASE_URL"),apiKey:n=Ac("ANTHROPIC_API_KEY")??null,authToken:r=Ac("ANTHROPIC_AUTH_TOKEN")??null,...a}={}){_m.add(this),Vc.set(this,void 0);const l={apiKey:n,authToken:r,...a,baseURL:t||"https://api.anthropic.com"};if(!l.dangerouslyAllowBrowser&&Qj())throw new Ae(`It looks like you're running in a browser-like environment.
48
-
49
- This is disabled by default, as it risks exposing your secret API credentials to attackers.
50
- If you understand the risks and have appropriate mitigations in place,
51
- you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
52
-
53
- new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
54
- `);this.baseURL=l.baseURL,this.timeout=l.timeout??hg.DEFAULT_TIMEOUT,this.logger=l.logger??console;const u="warn";this.logLevel=u,this.logLevel=Y1(l.logLevel,"ClientOptions.logLevel",this)??Y1(Ac("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=l.fetchOptions,this.maxRetries=l.maxRetries??2,this.fetch=l.fetch??tz(),ge(this,Vc,iz),this._options=l,this.apiKey=typeof n=="string"?n:null,this.authToken=r}withOptions(t){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){if(!(t.get("x-api-key")||t.get("authorization"))&&!(this.apiKey&&t.get("x-api-key"))&&!n.has("x-api-key")&&!(this.authToken&&t.get("authorization"))&&!n.has("authorization"))throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(t){return Ve([await this.apiKeyAuth(t),await this.bearerAuth(t)])}async apiKeyAuth(t){if(this.apiKey!=null)return Ve([{"X-Api-Key":this.apiKey}])}async bearerAuth(t){if(this.authToken!=null)return Ve([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(t){return Object.entries(t).filter(([n,r])=>typeof r<"u").map(([n,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(n)}=`;throw new Ae(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${sa}`}defaultIdempotencyKey(){return`stainless-node-retry-${n2()}`}makeStatusError(t,n,r,a){return Pt.generate(t,n,r,a)}buildURL(t,n,r){const a=!ne(this,_m,"m",O2).call(this)&&r||this.baseURL,l=Fj(t)?new URL(t):new URL(a+(a.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),u=this.defaultQuery();return Yj(u)||(n={...u,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(l.search=this.stringifyQuery(n)),l.toString()}_calculateNonstreamingTimeout(t){if(3600*t/128e3>600)throw new Ae("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(t){}async prepareRequest(t,{url:n,options:r}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,r){return this.request(Promise.resolve(r).then(a=>({method:t,path:n,...a})))}request(t,n=null){return new Of(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,r){const a=await t,l=a.maxRetries??this.maxRetries;n==null&&(n=l),await this.prepareOptions(a);const{req:u,url:f,timeout:h}=await this.buildRequest(a,{retryCount:l-n});await this.prepareRequest(u,{url:f,options:a});const d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=r===void 0?"":`, retryOf: ${r}`,m=Date.now();if(Xt(this).debug(`[${d}] sending request`,is({retryOfRequestLogID:r,method:a.method,url:f,options:a,headers:u.headers})),a.signal?.aborted)throw new Gn;const x=new AbortController,v=await this.fetchWithTimeout(f,u,h,x).catch(ym),w=Date.now();if(v instanceof globalThis.Error){const E=`retrying, ${n} attempts remaining`;if(a.signal?.aborted)throw new Gn;const A=xl(v)||/timed? ?out/i.test(String(v)+("cause"in v?String(v.cause):""));if(n)return Xt(this).info(`[${d}] connection ${A?"timed out":"failed"} - ${E}`),Xt(this).debug(`[${d}] connection ${A?"timed out":"failed"} (${E})`,is({retryOfRequestLogID:r,url:f,durationMs:w-m,message:v.message})),this.retryRequest(a,n,r??d);throw Xt(this).info(`[${d}] connection ${A?"timed out":"failed"} - error; no more retries left`),Xt(this).debug(`[${d}] connection ${A?"timed out":"failed"} (error; no more retries left)`,is({retryOfRequestLogID:r,url:f,durationMs:w-m,message:v.message})),A?new i2:new Df({cause:v})}const k=[...v.headers.entries()].filter(([E])=>E==="request-id").map(([E,A])=>", "+E+": "+JSON.stringify(A)).join(""),N=`[${d}${g}${k}] ${u.method} ${f} ${v.ok?"succeeded":"failed"} with status ${v.status} in ${w-m}ms`;if(!v.ok){const E=await this.shouldRetry(v);if(n&&E){const L=`retrying, ${n} attempts remaining`;return await nz(v.body),Xt(this).info(`${N} - ${L}`),Xt(this).debug(`[${d}] response error (${L})`,is({retryOfRequestLogID:r,url:v.url,status:v.status,headers:v.headers,durationMs:w-m})),this.retryRequest(a,n,r??d,v.headers)}const A=E?"error; no more retries left":"error; not retryable";Xt(this).info(`${N} - ${A}`);const _=await v.text().catch(L=>ym(L).message),C=d2(_),B=C?void 0:_;throw Xt(this).debug(`[${d}] response error (${A})`,is({retryOfRequestLogID:r,url:v.url,status:v.status,headers:v.headers,message:B,durationMs:Date.now()-m})),this.makeStatusError(v.status,C,B,v.headers)}return Xt(this).info(N),Xt(this).debug(`[${d}] response start`,is({retryOfRequestLogID:r,url:v.url,status:v.status,headers:v.headers,durationMs:w-m})),{response:v,options:a,controller:x,requestLogID:d,retryOfRequestLogID:r,startTime:m}}getAPIList(t,n,r){return this.requestAPIList(n,{method:"get",path:t,...r})}requestAPIList(t,n){const r=this.makeRequest(n,null,void 0);return new dz(this,r,t)}async fetchWithTimeout(t,n,r,a){const{signal:l,method:u,...f}=n||{};l&&l.addEventListener("abort",()=>a.abort());const h=setTimeout(()=>a.abort(),r),d=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:a.signal,...d?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,t,g)}finally{clearTimeout(h)}}async shouldRetry(t){const n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,r,a){let l;const u=a?.get("retry-after-ms");if(u){const h=parseFloat(u);Number.isNaN(h)||(l=h)}const f=a?.get("retry-after");if(f&&!l){const h=parseFloat(f);Number.isNaN(h)?l=Date.parse(f)-Date.now():l=h*1e3}if(!(l&&0<=l&&l<60*1e3)){const h=t.maxRetries??this.maxRetries;l=this.calculateDefaultRetryTimeoutMillis(n,h)}return await Zj(l),this.makeRequest(t,n-1,r)}calculateDefaultRetryTimeoutMillis(t,n){const l=n-t,u=Math.min(.5*Math.pow(2,l),8),f=1-Math.random()*.25;return u*f*1e3}calculateNonstreamingTimeout(t,n){if(36e5*t/128e3>6e5||n!=null&&t>n)throw new Ae("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(t,{retryCount:n=0}={}){const r={...t},{method:a,path:l,query:u,defaultBaseURL:f}=r,h=this.buildURL(l,u,f);"timeout"in r&&Gj("timeout",r.timeout),r.timeout=r.timeout??this.timeout;const{bodyHeaders:d,body:g}=this.buildBody({options:r}),m=await this.buildHeaders({options:t,method:a,bodyHeaders:d,retryCount:n});return{req:{method:a,headers:m,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&g instanceof globalThis.ReadableStream&&{duplex:"half"},...g&&{body:g},...this.fetchOptions??{},...r.fetchOptions??{}},url:h,timeout:r.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:r,retryCount:a}){let l={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),l[this.idempotencyHeader]=t.idempotencyKey);const u=Ve([l,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(a),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...ez(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(t),this._options.defaultHeaders,r,t.headers]);return this.validateHeaders(u),u.values}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};const r=Ve([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&r.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:p2(t)}:ne(this,Vc,"f").call(this,{body:t,headers:r})}}hg=Nt,Vc=new WeakMap,_m=new WeakSet,O2=function(){return this.baseURL!=="https://api.anthropic.com"};Nt.Anthropic=hg;Nt.HUMAN_PROMPT=Mz;Nt.AI_PROMPT=jz;Nt.DEFAULT_TIMEOUT=6e5;Nt.AnthropicError=Ae;Nt.APIError=Pt;Nt.APIConnectionError=Df;Nt.APIConnectionTimeoutError=i2;Nt.APIUserAbortError=Gn;Nt.NotFoundError=o2;Nt.ConflictError=l2;Nt.RateLimitError=c2;Nt.BadRequestError=r2;Nt.AuthenticationError=s2;Nt.InternalServerError=f2;Nt.PermissionDeniedError=a2;Nt.UnprocessableEntityError=u2;Nt.toFile=xz;class zl extends Nt{constructor(){super(...arguments),this.completions=new z2(this),this.messages=new dg(this),this.models=new D2(this),this.beta=new Ea(this)}}zl.Completions=z2;zl.Messages=dg;zl.Models=D2;zl.Beta=Ea;let Mc=null;function L2(){return Mc||(Mc=localStorage.getItem("claude_api_key"),Mc)}async function zz(e,t,n="sonnet"){const r=L2();if(!r)throw new Error("API key not set. Please configure your Claude API key.");const a=new zl({apiKey:r,dangerouslyAllowBrowser:!0}),l={sonnet:"claude-sonnet-4-20250514",opus:"claude-opus-4-20250514",haiku:"claude-3-5-haiku-20241022"},f=(await a.messages.create({model:l[n],max_tokens:4096,system:e,messages:[{role:"user",content:t}]})).content.find(h=>h.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function Rz(){return!!L2()}function Dz(e,t){const n=new Map(e.map(f=>[f.id,f])),r=new Map,a=new Map;e.forEach(f=>{r.set(f.id,0),a.set(f.id,[])}),t.forEach(f=>{a.get(f.source)?.push(f.target),r.set(f.target,(r.get(f.target)||0)+1)});const l=[];r.forEach((f,h)=>{f===0&&l.push(h)});const u=[];for(;l.length>0;){const f=l.shift(),h=n.get(f);h&&u.push(h),a.get(f)?.forEach(d=>{const g=(r.get(d)||0)-1;r.set(d,g),g===0&&l.push(d)})}return u}function Oz(e,t,n){const r=t.filter(l=>l.target===e),a=[];for(const l of r){const u=n.get(l.source);u!==void 0&&a.push(typeof u=="string"?u:JSON.stringify(u,null,2))}return a.join(`
55
-
56
- ---
57
-
58
- `)}async function Lz(e,t){const n=e.data;t.onNodeProgress(e.id,50);const r=n.value||n.placeholder||"User input placeholder";return t.onNodeProgress(e.id,100),t.onLog("info",`Input received: ${r.slice(0,50)}...`,e.id),r}async function Bz(e,t,n){const r=e.data;if(!Rz())throw new Error("API key not configured. Please set your Claude API key.");n.onNodeProgress(e.id,20),n.onLog("info",`Starting AI agent: ${r.label}`,e.id);const a=r.systemPrompt||`You are an AI assistant. ${r.description||""}`,l=t||"Please help me with the following task.";n.onNodeProgress(e.id,50);try{const u=await zz(a,l,r.model||"sonnet");return n.onNodeProgress(e.id,100),n.onLog("success",`Agent completed: ${u.slice(0,100)}...`,e.id),u}catch(u){throw new Error(`Subagent execution failed: ${u instanceof Error?u.message:"Unknown error"}`)}}async function Hz(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Executing skill: ${r.label}`,e.id);const a=`# Skill: ${r.label}
59
-
60
- Category: ${r.category||"general"}
61
- Skill ID: ${r.skillId||"custom-skill"}
62
-
63
- ## Description
64
- ${r.description||"Custom skill"}
65
-
66
- ## Input
67
- ${t}
68
-
69
- ## Output
70
- Skill executed successfully with the provided input.`;return n.onNodeProgress(e.id,100),n.onLog("success",`Skill ${r.label} completed`,e.id),a}async function Uz(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Executing command: /${r.commandName||"unnamed"}`,e.id);const a=`# Command Execution
71
-
72
- Command: /${r.commandName||"command"}
73
- Path: ${r.commandPath||"default"}
74
-
75
- ## Input
76
- ${t}
77
-
78
- ## Status
79
- Command executed successfully. In production, this would run the actual slash command.`;return n.onNodeProgress(e.id,100),n.onLog("success",`Command /${r.commandName||"unnamed"} completed`,e.id),a}async function Iz(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Configuring hook: ${r.hookEvent||"PreToolUse"}`,e.id);const a=`# Hook Configuration
80
-
81
- Event: ${r.hookEvent||"PreToolUse"}
82
- Matcher: ${r.hookMatcher||"*"}
83
- Command: ${r.hookCommand||'echo "Hook executed"'}
84
-
85
- ## Input
86
- ${t}
87
-
88
- ## Status
89
- Hook configured successfully. In production, this would set up the actual hook.`;return n.onNodeProgress(e.id,100),n.onLog("success",`Hook ${r.hookEvent||"unnamed"} configured`,e.id),a}async function qz(e,t,n){const r=e.data;n.onNodeProgress(e.id,50),n.onLog("info",`Preparing output: ${r.label}`,e.id);const a=`# Workflow Output
90
-
91
- ## Result
92
- ${t}
93
-
94
- ## Output Type
95
- ${r.outputType||"auto"}
96
-
97
- ## Generated at
98
- ${new Date().toISOString()}`;return n.onNodeProgress(e.id,100),n.onLog("success","Workflow completed successfully",e.id),a}async function $z(e,t,n){const r={results:new Map,cancelled:!1},a=Dz(e,t);n.onLog("info",`Starting workflow execution with ${a.length} nodes`);for(const l of a){n.onNodeStart(l.id);try{const u=Oz(l.id,t,r.results);let f;switch(l.type){case"input":f=await Lz(l,n);break;case"subagent":f=await Bz(l,u,n);break;case"skill":f=await Hz(l,u,n);break;case"command":f=await Uz(l,u,n);break;case"hook":f=await Iz(l,u,n);break;case"output":f=await qz(l,u,n);break;default:f=u}r.results.set(l.id,f),n.onNodeComplete(l.id,f)}catch(u){const f=u instanceof Error?u.message:"Unknown error";throw n.onNodeError(l.id,f),n.onLog("error",`Node ${l.data.label} failed: ${f}`,l.id),u}}return r.results}async function Pz(e,t){try{const n=await fetch("/api/save/workflow-output",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workflowName:e,files:t})});return n.ok?await n.json():{success:!1,error:(await n.json()).message}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Failed to save files"}}}function B2(){const{nodes:e,edges:t,workflowName:n,updateNodeStatus:r}=ci(),{isRunning:a,startExecution:l,stopExecution:u,setCurrentNode:f,markNodeCompleted:h,markNodeFailed:d,setWorkflowResults:g,addLog:m,clearLogs:x}=ka(),[v,w]=X.useState(null),k=X.useCallback(async()=>{if(e.length===0){m("warning","No nodes to execute");return}x(),l(),w(null),m("info",`워크플로우 "${n}" 실행 시작...`);try{const N=await $z(e,t,{onNodeStart:_=>{r(_,"running",0),f(_)},onNodeProgress:(_,C)=>{r(_,"running",C)},onNodeComplete:(_,C)=>{r(_,"completed",100),h(_,C)},onNodeError:(_,C)=>{r(_,"error",0),d(_,C)},onLog:(_,C,B)=>{m(_,C,B)}}),E=[],A=[];for(const[_,C]of N){const B=e.find(L=>L.id===_),T=typeof C=="string"?C:JSON.stringify(C,null,2);if(E.push({nodeId:_,label:B?.data.label||_,success:!0,result:T}),B?.type==="output"){const L=`${B.data.label.replace(/\s+/g,"_")}.md`;A.push({name:L,content:T})}}if(g(E),u(),m("success","워크플로우 실행 완료!"),A.length>0){m("info",`${A.length}개 파일 저장 중...`);const _=await Pz(n,A);_.success&&_.outputDir?(w(_.outputDir),m("info",`파일 저장 완료: ${_.outputDir}`),A.forEach(C=>{m("info",` - ${C.name}`)})):m("error",`파일 저장 실패: ${_.error}`)}}catch(N){const E=N instanceof Error?N.message:"Unknown error";u(),m("error",`실행 오류: ${E}`)}},[e,t,n,m,x,l,u,r,f,h,d,g]);return{isRunning:a,execute:k,savedOutputDir:v}}function Vz(e,t,n,r="local"){const a=r==="global"?"~/.claude":".claude",l=Fz(t,a),u=Yz(t,a),f=Xz(e,t,n,a),h=Gz(t);return{skills:l,commands:f,agents:u,mcpSettings:h}}function Fz(e,t){return e.filter(r=>r.type==="skill").filter(r=>r.data.skillType==="custom").map(r=>{const a=r.data,l=Na(a.skillId||a.label),u=`${t}/skills/${l}/SKILL.md`,f=Zz(a);return{name:l,path:u,content:f}})}function Yz(e,t){return e.filter(r=>r.type==="subagent").map(r=>{const a=r.data,l=Na(a.label),u=`${t}/agents/${l}.md`,f=Qz(a);return{name:l,path:u,content:f}})}function Xz(e,t,n,r){if(t.length===0)return[];const a=Na(e),l=`${r}/commands/${a}.md`,u=Kz(e,t,n);return[{name:a,path:l,content:u}]}function Gz(e){return e.filter(n=>n.type==="hook").length===0,null}function Zz(e){if(e.skillContent)return e.skillContent;const t=Na(e.skillId||e.label),n=e.description||e.label,r=["---",`name: ${t}`,`description: ${n}`,"---","",`# ${e.label}`,""];return e.mdContent?r.push(e.mdContent):r.push(`Execute the ${e.label} skill.`),r.join(`
99
- `)}function Qz(e){const t=Na(e.label),n=e.description||e.label,r=e.tools.length>0?e.tools.join(", "):"Read, Write, Edit",a=e.model||"sonnet",l=["---",`name: ${t}`,`description: ${n}`,`tools: ${r}`,`model: ${a}`,"---",""];return e.systemPrompt?l.push(e.systemPrompt):e.mdContent?l.push(e.mdContent):(l.push(`# ${e.label}`),l.push(""),l.push(`This agent performs the ${e.role} role.`)),l.join(`
100
- `)}function Kz(e,t,n){const r=t.filter(g=>g.type==="input"),a=t.filter(g=>g.type==="output"),l=r.map(g=>`<${Na(g.data.label)}>`).join(" "),f=["---",`description: ${`Workflow: ${e}`}`];l&&f.push(`argument-hint: ${l}`),f.push("---"),f.push(""),f.push(`# ${e}`),f.push(""),r.length>0&&(f.push("## Inputs"),f.push(""),r.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.description||m.placeholder||"User input"}`)}),f.push("")),f.push("## Workflow Steps"),f.push("");const h=Jz(t,n);let d=1;return h.forEach(g=>{if(g.type!=="input"){if(f.push(`${d}. **${g.data.label}**`),g.data.description&&f.push(` ${g.data.description}`),g.type==="subagent"){const m=g.data;m.systemPrompt&&f.push(` - Prompt: ${m.systemPrompt.substring(0,100)}${m.systemPrompt.length>100?"...":""}`),m.tools.length>0&&f.push(` - Tools: ${m.tools.join(", ")}`)}if(g.type==="skill"){const m=g.data;m.skillId&&f.push(` - Invoke skill: ${m.skillId}`)}if(g.type==="command"){const m=g.data;f.push(` - Command: /${m.commandName}`)}if(g.type==="hook"){const m=g.data;f.push(` - Hook: ${m.hookEvent} (${m.hookMatcher||"*"})`)}f.push(""),d++}}),a.length>0&&(f.push("## Outputs"),f.push(""),a.forEach(g=>{const m=g.data;f.push(`- **${m.label}**: ${m.outputType} format`)})),f.join(`
101
- `)}function Na(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Jz(e,t){const n=new Map(e.map(f=>[f.id,f])),r=new Map,a=new Map;e.forEach(f=>{r.set(f.id,0),a.set(f.id,[])}),t.forEach(f=>{a.get(f.source)?.push(f.target),r.set(f.target,(r.get(f.target)||0)+1)});const l=[];r.forEach((f,h)=>{f===0&&l.push(h)});const u=[];for(;l.length>0;){const f=l.shift(),h=n.get(f);h&&u.push(h),a.get(f)?.forEach(d=>{const g=(r.get(d)||0)-1;r.set(d,g),g===0&&l.push(d)})}return u}async function H2(){try{const e=await fetch("/api/load/claude-config");if(!e.ok)throw new Error(`Failed to load config: ${e.statusText}`);const t=await e.json();return Wz(t)}catch(e){return console.error("Failed to load Claude config:",e),[]}}function Wz(e){const t=[];let n=0;const r=280,a=150;for(const l of e.skills)t.push({id:l.id,type:"skill",position:{x:100+n,y:a},data:{label:l.label,description:l.description,status:"idle",skillType:"custom",skillId:l.skillId,skillPath:l.skillPath}}),n+=r;for(const l of e.subagents)t.push({id:l.id,type:"subagent",position:{x:100+n,y:a},data:{label:l.label,description:l.description,role:"custom",tools:l.tools,model:l.model,skills:l.skills,systemPrompt:l.systemPrompt,status:"idle",usedInputs:[]}}),n+=r;for(const l of e.commands)t.push({id:l.id,type:"command",position:{x:100+n,y:a},data:{label:l.label,description:l.description,commandName:l.commandName,commandContent:l.commandContent,status:"idle",usedInputs:[]}}),n+=r;for(const l of e.hooks)t.push({id:l.id,type:"hook",position:{x:100+n,y:a},data:{label:l.label,description:l.description,hookEvent:l.hookEvent,hookMatcher:l.hookMatcher,hookCommand:l.hookCommand,status:"idle",usedInputs:[]}}),n+=r;return t}function U2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=U2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=U2(e))&&(r&&(r+=" "),r+=t);return r}const I2="http://localhost:3001/api";async function eR(e,t){const n=await fetch(`${I2}/save/workflow`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({config:e,options:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.message||"Failed to save workflow")}return n.json()}async function tR(){const e=await fetch(`${I2}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function nR(e,t){const n=[];return t.includeSkills&&e.skills.forEach(r=>{n.push({path:r.path,content:r.content,type:"skill"})}),t.includeCommands&&e.commands.forEach(r=>{n.push({path:r.path,content:r.content,type:"command"})}),t.includeAgents&&e.agents.forEach(r=>{n.push({path:r.path,content:r.content,type:"agent"})}),t.includeMcpSettings&&e.mcpSettings&&n.push({path:t.location==="global"?"~/.claude/settings.local.json":".claude/settings.local.json",content:JSON.stringify(e.mcpSettings,null,2),type:"mcp"}),{files:n}}function iR({isOpen:e,onClose:t,config:n}){const[r,a]=X.useState("local"),[l,u]=X.useState(!0),[f,h]=X.useState(!0),[d,g]=X.useState(!0),[m,x]=X.useState(!0),[v,w]=X.useState(""),[k,N]=X.useState([]),[E,A]=X.useState(null),[_,C]=X.useState(!1),[B,T]=X.useState(null),[L,G]=X.useState(null);X.useEffect(()=>{e&&tR().then(w).catch(()=>w("."))},[e]),X.useEffect(()=>{if(!e)return;nR(n,{location:r,includeSkills:l,includeCommands:f,includeAgents:d,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!E&&A(te[0])})},[e,n,r,l,f,d,m]);const Z=async()=>{C(!0),G(null),T(null);const P={location:r,includeSkills:l,includeCommands:f,includeAgents:d,includeMcpSettings:m};try{const te=await eR(n,P);T(te),te.success&&setTimeout(()=>t(),2e3)}catch(te){G(te instanceof Error?te.message:"Failed to save")}finally{C(!1)}},H=P=>{switch(P){case"skill":return b.jsx(ml,{className:"w-4 h-4 text-node-skill"});case"agent":return b.jsx(D5,{className:"w-4 h-4 text-node-generate"});case"command":return b.jsx(ds,{className:"w-4 h-4 text-accent"});case"mcp":return b.jsx(WS,{className:"w-4 h-4 text-node-mcp"});default:return b.jsx(ml,{className:"w-4 h-4 text-gray-400"})}},q=n.skills.length>0||n.commands.length>0||n.agents.length>0||n.mcpSettings;return e?b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:b.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx(pm,{className:"w-5 h-5 text-accent"}),b.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),b.jsx("button",{onClick:t,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(og,{className:"w-5 h-5 text-gray-400"})})]}),b.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("button",{onClick:()=>a("local"),className:Gt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",r==="local"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[b.jsx(mm,{className:"w-4 h-4"}),b.jsxs("div",{children:[b.jsx("div",{className:"text-sm font-medium",children:"Local"}),b.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),b.jsxs("button",{onClick:()=>a("global"),className:Gt("w-full flex items-center gap-3 px-3 py-2 rounded-lg border transition-colors text-left",r==="global"?"border-accent bg-accent/10 text-white":"border-border hover:border-gray-500 text-gray-400"),children:[b.jsx(mm,{className:"w-4 h-4"}),b.jsxs("div",{children:[b.jsx("div",{className:"text-sm font-medium",children:"Global"}),b.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:l,onChange:P=>u(P.target.checked),disabled:n.skills.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsxs("span",{className:Gt("text-sm",n.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",n.skills.length,")"]})]}),b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:f,onChange:P=>h(P.target.checked),disabled:n.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsxs("span",{className:Gt("text-sm",n.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",n.commands.length,")"]})]}),b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:d,onChange:P=>g(P.target.checked),disabled:n.agents.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsxs("span",{className:Gt("text-sm",n.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",n.agents.length,")"]})]}),b.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[b.jsx("input",{type:"checkbox",checked:m,onChange:P=>x(P.target.checked),disabled:!n.mcpSettings,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),b.jsx("span",{className:Gt("text-sm",n.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),b.jsxs("div",{className:"pt-4 border-t border-border",children:[b.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),b.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:v,children:v||"Loading..."})]})]}),b.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[k.map((P,te)=>b.jsxs("button",{onClick:()=>A(P),className:Gt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",E===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[H(P.type),b.jsx("span",{children:P.path.split("/").pop()})]},te)),k.length===0&&b.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),b.jsx("div",{className:"flex-1 overflow-auto p-4",children:E?b.jsxs("div",{className:"space-y-2",children:[b.jsx("div",{className:"text-xs text-gray-500 font-mono",children:E.path}),b.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:E.content})]}):b.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[B&&B.success&&b.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[b.jsx(B5,{className:"w-4 h-4"}),b.jsx("span",{children:"Saved successfully!"})]}),B&&!B.success&&b.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[b.jsx(hm,{className:"w-4 h-4"}),b.jsx("span",{children:"Some files failed to save"})]}),L&&b.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[b.jsx(hm,{className:"w-4 h-4"}),b.jsx("span",{children:L})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),b.jsxs("button",{onClick:Z,disabled:_||k.length===0||!q,className:Gt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",_||k.length===0||!q?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[b.jsx(pm,{className:"w-4 h-4"}),_?"Saving...":"Export"]})]})]})]})}):null}const pg=Rf()(e2(e=>({apiMode:"proxy",apiKey:"",proxyUrl:"https://makecc-proxy.vercel.app",setApiMode:t=>e({apiMode:t}),setApiKey:t=>e({apiKey:t}),setProxyUrl:t=>e({proxyUrl:t})}),{name:"makecc-settings"}));function rR({isOpen:e,onClose:t}){const{apiMode:n,apiKey:r,proxyUrl:a,setApiMode:l,setApiKey:u,setProxyUrl:f}=pg(),[h,d]=X.useState(n),[g,m]=X.useState(r),[x,v]=X.useState(a),[w,k]=X.useState(!1);if(X.useEffect(()=>{e&&(d(n),m(r),v(a))},[e,n,r,a]),!e)return null;const N=async()=>{if(l(h),u(g),f(x),h==="direct"&&g)try{(await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:g})})).ok||console.error("Failed to save API key to .env")}catch(E){console.error("Failed to save API key:",E)}t()};return b.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:b.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[b.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[b.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),b.jsx("button",{onClick:t,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(og,{className:"w-5 h-5 text-gray-400"})})]}),b.jsxs("div",{className:"p-6 space-y-6",children:[b.jsxs("div",{className:"space-y-3",children:[b.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("label",{className:`
102
- flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
103
- ${h==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
104
- `,children:[b.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:h==="proxy",onChange:()=>d("proxy"),className:"sr-only"}),b.jsx(Ej,{className:`w-5 h-5 ${h==="proxy"?"text-accent":"text-gray-400"}`}),b.jsxs("div",{className:"flex-1",children:[b.jsx("div",{className:`font-medium ${h==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),b.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),h==="proxy"&&b.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),b.jsxs("label",{className:`
105
- flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
106
- ${h==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
107
- `,children:[b.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:h==="direct",onChange:()=>d("direct"),className:"sr-only"}),b.jsx(lj,{className:`w-5 h-5 ${h==="direct"?"text-accent":"text-gray-400"}`}),b.jsxs("div",{className:"flex-1",children:[b.jsx("div",{className:`font-medium ${h==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),b.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),h==="direct"&&b.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),h==="proxy"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),b.jsx("input",{type:"text",value:x,onChange:E=>v(E.target.value),placeholder:"https://your-proxy-server.com",className:"w-full px-4 py-2.5 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),b.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),h==="direct"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),b.jsxs("div",{className:"relative",children:[b.jsx("input",{type:w?"text":"password",value:g,onChange:E=>m(E.target.value),placeholder:"sk-ant-...",className:"w-full px-4 py-2.5 pr-10 bg-surface-hover border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"}),b.jsx("button",{type:"button",onClick:()=>k(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:w?b.jsx(Q5,{className:"w-4 h-4"}):b.jsx(KS,{className:"w-4 h-4"})})]}),b.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),b.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[b.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),b.jsx("button",{onClick:N,className:"px-4 py-2 text-sm font-medium bg-accent hover:bg-accent-hover text-white rounded-lg transition-colors",children:"저장"})]})]})})}function sR(){const{workflowName:e,setWorkflowName:t,isDraft:n,nodes:r,edges:a,clearWorkflow:l,mergeExistingConfig:u}=ci(),{isRunning:f,execute:h}=B2(),[d,g]=X.useState(!1),[m,x]=X.useState(!1),[v,w]=X.useState(null),[k,N]=X.useState(!1),E=X.useCallback(async()=>{N(!0);try{const T=await H2();T.length>0&&u(T)}catch(T){console.error("Failed to reload config:",T)}finally{N(!1)}},[u]),A=()=>{const T=Vz(e,r,a,"local");w(T),g(!0)},_=()=>{g(!1),w(null)},C=()=>{f||h()},B=()=>{r.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&l()};return b.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(z5,{className:"w-5 h-5 text-gray-400"})}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("input",{type:"text",value:e,onChange:T=>t(T.target.value),className:"bg-transparent border-none text-lg font-semibold text-white focus:outline-none focus:ring-2 focus:ring-accent rounded px-2 py-1"}),n&&b.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),b.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),b.jsxs("button",{onClick:C,disabled:f,className:`
108
- flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-colors
109
- ${f?"bg-gray-500 cursor-not-allowed text-white":"bg-accent hover:bg-accent-hover text-white"}
110
- `,children:[b.jsx(gl,{className:"w-4 h-4"}),f?"Running...":"Run"]}),b.jsxs("button",{onClick:A,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[b.jsx(pm,{className:"w-4 h-4 text-gray-400"}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),b.jsxs("button",{onClick:E,disabled:k,className:`
111
- flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
112
- ${k?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-blue-500/20 hover:text-blue-400"}
113
- `,title:".claude/ 폴더에서 다시 로드",children:[b.jsx(bj,{className:`w-4 h-4 text-gray-400 ${k?"animate-spin":""}`}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Reload"})]}),b.jsxs("button",{onClick:B,disabled:r.length===0,className:`
114
- flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
115
- ${r.length===0?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-red-500/20 hover:text-red-400"}
116
- `,title:"모든 노드 삭제",children:[b.jsx(yl,{className:"w-4 h-4 text-gray-400"}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),b.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:b.jsx(wj,{className:"w-5 h-5 text-gray-400"})}),b.jsx("button",{onClick:()=>x(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:b.jsx(WS,{className:"w-5 h-5 text-gray-400"})})]}),v&&b.jsx(iR,{isOpen:d,onClose:_,config:v}),b.jsx(rR,{isOpen:m,onClose:()=>x(!1)})]})}function bl(e){const t={id:e.id,type:e.type,label:e.data.label,description:e.data.description};switch(e.type){case"skill":return{...t,skillId:e.data.skillId,skillPath:e.data.skillPath};case"subagent":return{...t,tools:e.data.tools,model:e.data.model,skills:e.data.skills,systemPrompt:e.data.systemPrompt};case"command":return{...t,commandName:e.data.commandName,commandContent:e.data.commandContent};case"hook":return{...t,hookEvent:e.data.hookEvent,hookMatcher:e.data.hookMatcher,hookCommand:e.data.hookCommand};default:return t}}async function q2(e){if(e.type==="input"||e.type==="output")return!0;try{const t=await fetch("/api/sync/node",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:bl(e)})});return t.ok?!0:(console.error("Failed to sync node:",await t.text()),!1)}catch(t){return console.error("Failed to sync node:",t),!1}}async function $2(e,t){if(e.type==="input"||e.type==="output")return!0;try{const n=await fetch("/api/sync/node",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:bl(e),nodes:t.map(bl)})});return n.ok?!0:(console.error("Failed to delete node:",await n.text()),!1)}catch(n){return console.error("Failed to delete node:",n),!1}}async function uv(e,t){const n=t.find(a=>a.id===e.source),r=t.find(a=>a.id===e.target);if(!n||!r||(n.type==="input"||n.type==="output")&&(r.type==="input"||r.type==="output"))return!0;try{const a=await fetch("/api/sync/edge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:n.type,targetType:r.type},nodes:t.map(bl)})});return a.ok?!0:(console.error("Failed to sync edge:",await a.text()),!1)}catch(a){return console.error("Failed to sync edge:",a),!1}}async function aR(e,t){const n=t.find(a=>a.id===e.source),r=t.find(a=>a.id===e.target);if(!n||!r)return!0;try{const a=await fetch("/api/sync/edge",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({edge:{source:e.source,target:e.target,sourceType:n.type,targetType:r.type},nodes:t.map(bl)})});return a.ok?!0:(console.error("Failed to remove edge:",await a.text()),!1)}catch(a){return console.error("Failed to remove edge:",a),!1}}const oR=[{type:"input",label:"User Input",icon:b.jsx(jf,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:b.jsx(Al,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:b.jsx(zf,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"command",label:"Command",icon:b.jsx(ds,{className:"w-4 h-4"}),color:"text-orange-400",hoverColor:"hover:bg-orange-500/10"},{type:"hook",label:"Hook",icon:b.jsx(sg,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:b.jsx(Af,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function lR(e){const t=Sa(),n={x:100+Math.random()*200,y:100+Math.random()*200};switch(e){case"input":return{id:t,type:"input",position:n,data:{label:"User Input",description:"Enter your input here...",inputType:"text",status:"idle",placeholder:"Enter your prompt..."}};case"subagent":return{id:t,type:"subagent",position:n,data:{label:"Sub Agent",description:"Conduct in-depth research...",role:"researcher",tools:["WebSearch","WebFetch","Read"],status:"idle",usedInputs:[]}};case"skill":return{id:t,type:"skill",position:n,data:{label:"Skill",description:"Apply a specialized skill...",skillType:"official",status:"idle",usedInputs:[]}};case"command":return{id:t,type:"command",position:n,data:{label:"Command",description:"Execute a slash command...",commandName:"",status:"idle",usedInputs:[]}};case"hook":return{id:t,type:"hook",position:n,data:{label:"Hook",description:"Configure tool lifecycle hook...",hookEvent:"PreToolUse",status:"idle",usedInputs:[]}};case"output":return{id:t,type:"output",position:n,data:{label:"Output",description:"Select to edit in editor",outputType:"auto",status:"idle",usedInputs:[]}}}}function uR(){const e=ci(n=>n.addNode),t=n=>{const r=lR(n);e(r),q2(r).catch(a=>{console.error("Failed to sync node to filesystem:",a)})};return b.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:oR.map(n=>b.jsxs("button",{onClick:()=>t(n.type),className:`
117
- flex items-center gap-2 px-4 py-2 rounded-lg
118
- bg-surface border border-border
119
- ${n.hoverColor}
120
- transition-all duration-200
121
- hover:border-gray-500
122
- `,children:[b.jsx("span",{className:n.color,children:n.icon}),b.jsx("span",{className:"text-sm font-medium text-gray-300",children:n.label})]},n.type))})}function cR({status:e}){switch(e){case"running":return b.jsx(lf,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return b.jsx(Y5,{className:"w-4 h-4 text-green-400"});case"error":return b.jsx(hm,{className:"w-4 h-4 text-red-400"});default:return b.jsx(gl,{className:"w-4 h-4"})}}function fR({data:e,selected:t,children:n,headerIcon:r,headerColor:a="bg-gray-700",showSourceHandle:l=!0,showTargetHandle:u=!0}){const f=()=>{switch(e.status){case"running":return"border-indigo-500 animate-pulse-border";case"completed":return"border-green-500";case"error":return"border-red-500";default:return""}};return b.jsxs("div",{className:Gt("workflow-node",t&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[b.jsxs("div",{className:Gt("node-header flex items-center justify-between",a),children:[b.jsxs("div",{className:"flex items-center gap-2",children:[r,b.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),b.jsx("div",{className:"flex items-center gap-1",children:b.jsx(cR,{status:e.status})})]}),b.jsxs("div",{className:"node-content",children:[e.description&&b.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),n,e.usedInputs&&e.usedInputs.length>0&&b.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[b.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),b.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(h=>b.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-gray-700/50 border border-gray-600 text-gray-300",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),h]},h))})]})]}),u&&b.jsx(wa,{type:"target",position:be.Left}),l&&b.jsx(wa,{type:"source",position:be.Right})]})}const Ca=X.memo(fR);function dR({data:e,selected:t}){return b.jsx(Ca,{data:e,selected:t,headerIcon:b.jsx(jf,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:b.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&b.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&b.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&b.jsx("select",{className:"w-full px-2 py-1 text-sm bg-gray-700 border border-gray-600 rounded text-gray-300",children:e.options.map(n=>b.jsx("option",{value:n,children:n},n))})]})})}const hR=X.memo(dR);function pR({data:e,selected:t}){return b.jsx(Ca,{data:e,selected:t,headerIcon:b.jsx(Al,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&b.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(n=>b.jsx("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:n},n)),e.tools.length>3&&b.jsxs("span",{className:"px-2 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:["+",e.tools.length-3]})]}),e.model&&b.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const mR=X.memo(pR);function gR({data:e,selected:t}){return b.jsx(Ca,{data:e,selected:t,headerIcon:b.jsx(zf,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&b.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-cyan-900/50 text-cyan-300 rounded",children:e.skillId}),e.skillCategory&&b.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const yR=X.memo(gR);function xR({data:e,selected:t}){return b.jsx(Ca,{data:e,selected:t,headerIcon:b.jsx(ds,{className:"w-4 h-4 text-orange-100"}),headerColor:"bg-gradient-to-br from-orange-500 to-orange-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.commandName&&b.jsxs("span",{className:"inline-block px-2 py-0.5 text-xs bg-orange-900/50 text-orange-300 rounded",children:["/",e.commandName]}),e.commandPath&&b.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.commandPath})]})})}const bR=X.memo(xR);function vR({data:e,selected:t}){return b.jsx(Ca,{data:e,selected:t,headerIcon:b.jsx(sg,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:b.jsxs("div",{className:"space-y-2",children:[e.hookEvent&&b.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-pink-900/50 text-pink-300 rounded",children:e.hookEvent}),e.hookMatcher&&b.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const wR=X.memo(vR);function SR(e){switch(e){case"markdown":case"document":return b.jsx(ml,{className:"w-4 h-4 text-emerald-100"});case"image":return b.jsx(JS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return b.jsx(ij,{className:"w-4 h-4 text-emerald-100"});case"link":return b.jsx(cj,{className:"w-4 h-4 text-emerald-100"});default:return b.jsx(Af,{className:"w-4 h-4 text-emerald-100"})}}function _R({data:e,selected:t}){return b.jsx(Ca,{data:e,selected:t,headerIcon:SR(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:b.jsxs("div",{className:"space-y-2",children:[e.layoutType&&b.jsx("span",{className:"inline-block px-2 py-0.5 text-xs bg-emerald-900/50 text-emerald-300 rounded",children:e.layoutType}),e.result&&b.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const kR=X.memo(_R),Hf=Rf(e=>({activeTab:"preview",isCollapsed:!1,width:400,setActiveTab:t=>e({activeTab:t}),toggleCollapsed:()=>e(t=>({isCollapsed:!t.isCollapsed})),setWidth:t=>e({width:Math.max(300,Math.min(600,t))}),openStepPanel:()=>e({activeTab:"step",isCollapsed:!1}),openConsolePanel:()=>e({activeTab:"console",isCollapsed:!1})}));function cv(e,t){const{source:n,target:r}=e;if(n===r)return!1;const a=t.find(u=>u.id===n),l=t.find(u=>u.id===r);return!a||!l?!1:a.type==="output"?(console.warn("Output nodes cannot have outgoing connections"),!1):l.type==="input"?(console.warn("Input nodes cannot have incoming connections"),!1):!0}const ER={input:hR,subagent:mR,skill:yR,command:bR,hook:wR,output:kR};function NR(){const{nodes:e,edges:t,setNodes:n,setEdges:r,addEdge:a,setSelectedNode:l}=ci(),u=Hf(C=>C.openStepPanel),[f,h]=X.useState(!1),d=X.useRef([]);X.useEffect(()=>{const C=T=>{T.key==="Shift"&&h(!0)},B=T=>{T.key==="Shift"&&(h(!1),d.current=[])};return window.addEventListener("keydown",C),window.addEventListener("keyup",B),()=>{window.removeEventListener("keydown",C),window.removeEventListener("keyup",B)}},[]);const g=X.useCallback(({nodes:C})=>{if(!f){d.current=[];return}const B=C.map(T=>T.id);if(B.length===2){const[T,L]=B;if(!t.some(Z=>Z.source===T&&Z.target===L||Z.source===L&&Z.target===T)){const Z=e.find(q=>q.id===T),H=e.find(q=>q.id===L);if(Z&&H){let q=T,P=L;(Z.position?.x??0)>(H.position?.x??0)&&(q=L,P=T);const te={source:q,target:P,sourceHandle:null,targetHandle:null};if(cv(te,e)){const O={id:`e-${q}-${P}`,source:q,target:P,animated:!0};r(om({...te,animated:!0},t)),a(O),uv(O,e).catch(U=>{console.error("Failed to sync edge to filesystem:",U)})}}}}d.current=B},[f,e,t,r,a]),[m,x]=X.useState(null),v=X.useCallback(C=>{const B=C.filter(L=>L.type==="remove"),T=C.filter(L=>L.type!=="remove");if(T.length>0&&n($c(T,e)),B.length>0){const L=B.map(G=>e.find(Z=>Z.id===G.id)).filter(G=>G!==void 0&&G.type!=="input"&&G.type!=="output");L.length>0?x({changes:B,nodesToDelete:L}):n($c(B,e))}},[e,n]),w=X.useCallback(()=>{if(!m)return;const{changes:C,nodesToDelete:B}=m;for(const T of B)$2(T,e).catch(L=>{console.error("Failed to delete node from filesystem:",L)});n($c(C,e)),x(null)},[m,e,n]),k=X.useCallback(()=>{x(null)},[]),N=X.useCallback(C=>{for(const B of C)if(B.type==="remove"){const T=t.find(L=>L.id===B.id);T&&aR(T,e).catch(L=>{console.error("Failed to remove edge from filesystem:",L)})}r(vS(C,t))},[t,e,r]),E=X.useCallback(C=>{if(!cv(C,e))return;const B={id:`e-${C.source}-${C.target}`,source:C.source,target:C.target,animated:!0};r(om({...C,animated:!0},t)),a(B),uv(B,e).catch(T=>{console.error("Failed to sync edge to filesystem:",T)})},[e,t,r,a]),A=X.useCallback((C,B)=>{l(B.id),u()},[l,u]),_=X.useCallback(()=>{l(null)},[l]);return b.jsxs(b.Fragment,{children:[b.jsxs(Q3,{nodes:e,edges:t,onNodesChange:v,onEdgesChange:N,onConnect:E,onSelectionChange:g,onNodeClick:A,onPaneClick:_,nodeTypes:ER,defaultViewport:{x:100,y:100,zoom:.7},defaultEdgeOptions:{animated:!0,style:{strokeDasharray:"5 5"}},connectionLineStyle:{strokeDasharray:"5 5"},snapToGrid:!0,snapGrid:[15,15],connectionRadius:40,connectOnClick:!0,selectionOnDrag:!1,multiSelectionKeyCode:"Shift",children:[b.jsx(t5,{variant:$i.Dots,gap:20,size:1,color:"#333333"}),b.jsx(l5,{}),b.jsx(w5,{nodeColor:C=>{switch(C.type){case"input":return"#fef3c7";case"subagent":return"#4f46e5";case"skill":return"#06b6d4";case"command":return"#f97316";case"hook":return"#ec4899";case"output":return"#10b981";default:return"#6b7280"}},maskColor:"rgba(0, 0, 0, 0.8)"})]}),m&&b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:b.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 border border-zinc-700 shadow-xl",children:[b.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[b.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:b.jsx("svg",{className:"w-5 h-5 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:b.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"노드 삭제 확인"})]}),b.jsxs("p",{className:"text-zinc-300 mb-4",children:["다음 노드를 삭제하시겠습니까? 이 작업은 ",b.jsx("span",{className:"text-red-400 font-medium",children:"파일을 삭제"}),"하며 되돌릴 수 없습니다."]}),b.jsx("ul",{className:"bg-zinc-900 rounded-md p-3 mb-6 space-y-2",children:m.nodesToDelete.map(C=>b.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[b.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${C.type==="skill"?"bg-cyan-500/20 text-cyan-300":C.type==="subagent"?"bg-indigo-500/20 text-indigo-300":C.type==="command"?"bg-orange-500/20 text-orange-300":C.type==="hook"?"bg-pink-500/20 text-pink-300":"bg-zinc-500/20 text-zinc-300"}`,children:C.type}),b.jsx("span",{className:"text-white",children:C.data.label})]},C.id))}),b.jsxs("div",{className:"flex gap-3 justify-end",children:[b.jsx("button",{onClick:k,className:"px-4 py-2 rounded-md bg-zinc-700 text-zinc-300 hover:bg-zinc-600 transition-colors",children:"취소"}),b.jsx("button",{onClick:w,className:"px-4 py-2 rounded-md bg-red-600 text-white hover:bg-red-500 transition-colors",children:"삭제"})]})]})})]})}function CR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const TR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MR={};function fv(e,t){return(MR.jsx?AR:TR).test(e)}const jR=/[ \t\n\f\r]/g;function zR(e){return typeof e=="object"?e.type==="text"?dv(e.value):!1:dv(e)}function dv(e){return e.replace(jR,"")===""}class Rl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Rl.prototype.normal={};Rl.prototype.property={};Rl.prototype.space=void 0;function P2(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Rl(n,r,t)}function km(e){return e.toLowerCase()}class ln{constructor(t,n){this.attribute=n,this.property=t}}ln.prototype.attribute="";ln.prototype.booleanish=!1;ln.prototype.boolean=!1;ln.prototype.commaOrSpaceSeparated=!1;ln.prototype.commaSeparated=!1;ln.prototype.defined=!1;ln.prototype.mustUseProperty=!1;ln.prototype.number=!1;ln.prototype.overloadedBoolean=!1;ln.prototype.property="";ln.prototype.spaceSeparated=!1;ln.prototype.space=void 0;let RR=0;const ze=hs(),_t=hs(),Em=hs(),de=hs(),at=hs(),ha=hs(),wn=hs();function hs(){return 2**++RR}const Nm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:_t,commaOrSpaceSeparated:wn,commaSeparated:ha,number:de,overloadedBoolean:Em,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),zp=Object.keys(Nm);class mg extends ln{constructor(t,n,r,a){let l=-1;if(super(t,n),hv(this,"space",a),typeof r=="number")for(;++l<zp.length;){const u=zp[l];hv(this,zp[l],(r&Nm[u])===Nm[u])}}}mg.prototype.defined=!0;function hv(e,t,n){n&&(e[t]=n)}function Ta(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const l=new mg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[km(r)]=r,n[km(l.attribute)]=r}return new Rl(t,n,e.space)}const V2=Ta({properties:{ariaActiveDescendant:null,ariaAtomic:_t,ariaAutoComplete:null,ariaBusy:_t,ariaChecked:_t,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:_t,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:_t,ariaFlowTo:at,ariaGrabbed:_t,ariaHasPopup:null,ariaHidden:_t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:de,ariaLive:null,ariaModal:_t,ariaMultiLine:_t,ariaMultiSelectable:_t,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:_t,ariaReadOnly:_t,ariaRelevant:null,ariaRequired:_t,ariaRoleDescription:at,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:_t,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function F2(e,t){return t in e?e[t]:t}function Y2(e,t){return F2(e,t.toLowerCase())}const DR=Ta({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ha,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:at,autoFocus:ze,autoPlay:ze,blocking:at,capture:null,charSet:null,checked:ze,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:_t,controls:ze,controlsList:at,coords:de|ha,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Em,draggable:_t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:at,height:de,hidden:Em,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:at,itemRef:at,itemScope:ze,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,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:de,pattern:null,ping:at,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:at,required:ze,reversed:ze,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:_t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:_t,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,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:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:_t,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Y2}),OR=Ta({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:wn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:at,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:ha,g2:ha,glyphName:ha,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wn,rev:wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wn,requiredFeatures:wn,requiredFonts:wn,requiredFormats:wn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:F2}),X2=Ta({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()}}),G2=Ta({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Y2}),Z2=Ta({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),LR={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"},BR=/[A-Z]/g,pv=/-[a-z]/g,HR=/^data[-\w.:]+$/i;function UR(e,t){const n=km(t);let r=t,a=ln;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HR.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(pv,qR);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!pv.test(l)){let u=l.replace(BR,IR);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=mg}return new a(r,t)}function IR(e){return"-"+e.toLowerCase()}function qR(e){return e.charAt(1).toUpperCase()}const $R=P2([V2,DR,X2,G2,Z2],"html"),gg=P2([V2,OR,X2,G2,Z2],"svg");function PR(e){return e.join(" ").trim()}var ia={},Rp,mv;function VR(){if(mv)return Rp;mv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
123
- `,d="/",g="*",m="",x="comment",v="declaration";function w(N,E){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];E=E||{};var A=1,_=1;function C(O){var U=O.match(t);U&&(A+=U.length);var R=O.lastIndexOf(h);_=~R?O.length-R:_+O.length}function B(){var O={line:A,column:_};return function(U){return U.position=new T(O),Z(),U}}function T(O){this.start=O,this.end={line:A,column:_},this.source=E.source}T.prototype.content=N;function L(O){var U=new Error(E.source+":"+A+":"+_+": "+O);if(U.reason=O,U.filename=E.source,U.line=A,U.column=_,U.source=N,!E.silent)throw U}function G(O){var U=O.exec(N);if(U){var R=U[0];return C(R),N=N.slice(R.length),U}}function Z(){G(n)}function H(O){var U;for(O=O||[];U=q();)U!==!1&&O.push(U);return O}function q(){var O=B();if(!(d!=N.charAt(0)||g!=N.charAt(1))){for(var U=2;m!=N.charAt(U)&&(g!=N.charAt(U)||d!=N.charAt(U+1));)++U;if(U+=2,m===N.charAt(U-1))return L("End of comment missing");var R=N.slice(2,U-2);return _+=2,C(R),N=N.slice(U),_+=2,O({type:x,comment:R})}}function P(){var O=B(),U=G(r);if(U){if(q(),!G(a))return L("property missing ':'");var R=G(l),I=O({type:v,property:k(U[0].replace(e,m)),value:R?k(R[0].replace(e,m)):m});return G(u),I}}function te(){var O=[];H(O);for(var U;U=P();)U!==!1&&(O.push(U),H(O));return O}return Z(),te()}function k(N){return N?N.replace(f,m):m}return Rp=w,Rp}var gv;function FR(){if(gv)return ia;gv=1;var e=ia&&ia.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ia,"__esModule",{value:!0}),ia.default=n;const t=e(VR());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),f=typeof a=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:g}=h;f?a(d,g,h):g&&(l=l||{},l[d]=g)}),l}return ia}var Vo={},yv;function YR(){if(yv)return Vo;yv=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(d){return!d||n.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},f=function(d,g){return"".concat(g,"-")},h=function(d,g){return g===void 0&&(g={}),l(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(a,f):d=d.replace(r,f),d.replace(t,u))};return Vo.camelCase=h,Vo}var Fo,xv;function XR(){if(xv)return Fo;xv=1;var e=Fo&&Fo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(FR()),n=YR();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(f,h){f&&h&&(u[(0,n.camelCase)(f,l)]=h)}),u}return r.default=r,Fo=r,Fo}var GR=XR();const ZR=gf(GR),Q2=K2("end"),yg=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function QR(e){const t=yg(e),n=Q2(e);if(t&&n)return{start:t,end:n}}function il(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bv(e.position):"start"in e||"end"in e?bv(e):"line"in e||"column"in e?Cm(e):""}function Cm(e){return vv(e&&e.line)+":"+vv(e&&e.column)}function bv(e){return Cm(e&&e.start)+"-"+Cm(e&&e.end)}function vv(e){return e&&typeof e=="number"?e:1}class Vt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?l.ruleId=r:(l.source=r.slice(0,h),l.ruleId=r.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const f=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=f?f.line:void 0,this.name=il(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Vt.prototype.file="";Vt.prototype.name="";Vt.prototype.reason="";Vt.prototype.message="";Vt.prototype.stack="";Vt.prototype.column=void 0;Vt.prototype.line=void 0;Vt.prototype.ancestors=void 0;Vt.prototype.cause=void 0;Vt.prototype.fatal=void 0;Vt.prototype.place=void 0;Vt.prototype.ruleId=void 0;Vt.prototype.source=void 0;const xg={}.hasOwnProperty,KR=new Map,JR=/[A-Z]/g,WR=new Set(["table","tbody","thead","tfoot","tr"]),eD=new Set(["td","th"]),J2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=uD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=lD(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gg:$R,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=W2(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function W2(e,t,n){if(t.type==="element")return nD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sD(e,t,n);if(t.type==="mdxjsEsm")return rD(e,t);if(t.type==="root")return aD(e,t,n);if(t.type==="text")return oD(e,t)}function nD(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=gg,e.schema=a),e.ancestors.push(t);const l=t_(e,t.tagName,!1),u=cD(e,t);let f=vg(e,t);return WR.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!zR(h):!0})),e_(e,u,l,t),bg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function iD(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}vl(e,t.position)}function rD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vl(e,t.position)}function sD(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=gg,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:t_(e,t.name,!0),u=fD(e,t),f=vg(e,t);return e_(e,u,l,t),bg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function aD(e,t,n){const r={};return bg(r,vg(e,t)),e.create(t,e.Fragment,r,n)}function oD(e,t){return t.value}function e_(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lD(e,t,n){return r;function r(a,l,u,f){const d=Array.isArray(u.children)?n:t;return f?d(l,u,f):d(l,u)}}function uD(e,t){return n;function n(r,a,l,u){const f=Array.isArray(l.children),h=yg(r);return t(a,l,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function cD(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&xg.call(t.properties,a)){const l=dD(e,a,t.properties[a]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&eD.has(t.tagName)?r=f:n[u]=f}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function fD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else vl(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,l=e.evaluater.evaluateExpression(f.expression)}else vl(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function vg(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:KR;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=a.get(h)||0;u=h+"-"+d,a.set(h,d+1)}}const f=W2(e,l,u);f!==void 0&&n.push(f)}return n}function dD(e,t,n){const r=UR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?CR(n):PR(n)),r.property==="style"){let a=typeof n=="object"?n:hD(e,String(n));return e.stylePropertyNameCase==="css"&&(a=pD(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?LR[r.property]||r.property:r.attribute,n]}}function hD(e,t){try{return ZR(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=J2+"#cannot-parse-style-attribute",a}}function t_(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let l=-1,u;for(;++l<a.length;){const f=fv(a[l])?{type:"Identifier",name:a[l]}:{type:"Literal",value:a[l]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(l&&f.type==="Literal"),optional:!1}:f}r=u}else r=fv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return xg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);vl(e)}function vl(e,t){const n=new Vt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=J2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pD(e){const t={};let n;for(n in e)xg.call(e,n)&&(t[mD(n)]=e[n]);return t}function mD(e){let t=e.replace(JR,gD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function gD(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"]},yD={};function wg(e,t){const n=yD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return n_(e,r,a)}function n_(e,t,n){if(xD(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return wv(e.children,t,n)}return Array.isArray(e)?wv(e,t,n):""}function wv(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=n_(e[a],t,n);return r.join("")}function xD(e){return!!(e&&typeof e=="object")}const Sv=document.createElement("i");function Sg(e){const t="&"+e+";";Sv.innerHTML=t;const n=Sv.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _n(e,t,n,r){const a=e.length;let l=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l<r.length;)u=r.slice(l,l+1e4),u.unshift(t,0),e.splice(...u),l+=1e4,t+=1e4}function On(e,t){return e.length>0?(_n(e,e.length,0,t),e):t}const _v={}.hasOwnProperty;function i_(e){const t={};let n=-1;for(;++n<e.length;)bD(t,e[n]);return t}function bD(e,t){let n;for(n in t){const a=(_v.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){_v.call(a,u)||(a[u]=[]);const f=l[u];vD(a[u],Array.isArray(f)?f:f?[f]:[])}}}function vD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_n(e,0,0,r)}function r_(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=Mr(/[A-Za-z]/),$t=Mr(/[\dA-Za-z]/),wD=Mr(/[#-'*+\--9=?A-Z^-~]/);function df(e){return e!==null&&(e<32||e===127)}const Tm=Mr(/\d/),SD=Mr(/[\dA-Fa-f]/),_D=Mr(/[!-/:-@[-`{-~]/);function Se(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function He(e){return e===-2||e===-1||e===32}const Uf=Mr(new RegExp("\\p{P}|\\p{S}","u")),fs=Mr(/\s/);function Mr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Aa(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const l=e.charCodeAt(n);let u="";if(l===37&&$t(e.charCodeAt(n+1))&&$t(e.charCodeAt(n+2)))a=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const f=e.charCodeAt(n+1);l<56320&&f>56319&&f<57344?(u=String.fromCharCode(l,f),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Fe(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(h){return He(h)?(e.enter(n),f(h)):t(h)}function f(h){return He(h)&&l++<a?(e.consume(h),f):(e.exit(n),t(h))}}const kD={tokenize:ED};function ED(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Fe(e,t,"linePrefix")}function a(f){return e.enter("paragraph"),l(f)}function l(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Se(f)?(e.consume(f),e.exit("chunkText"),l):(e.consume(f),u)}}const ND={tokenize:CD},kv={tokenize:TD};function CD(e){const t=this,n=[];let r=0,a,l,u;return f;function f(_){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,h,d)(_)}return d(_)}function h(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&A();const C=t.events.length;let B=C,T;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){T=t.events[B][1].end;break}E(r);let L=C;for(;L<t.events.length;)t.events[L][1].end={...T},L++;return _n(t.events,B+1,0,t.events.slice(C)),t.events.length=L,d(_)}return f(_)}function d(_){if(r===n.length){if(!a)return x(_);if(a.currentConstruct&&a.currentConstruct.concrete)return w(_);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(kv,g,m)(_)}function g(_){return a&&A(),E(r),x(_)}function m(_){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,w(_)}function x(_){return t.containerState={},e.attempt(kv,v,w)(_)}function v(_){return r++,n.push([t.currentConstruct,t.containerState]),x(_)}function w(_){if(_===null){a&&A(),E(0),e.consume(_);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),k(_)}function k(_){if(_===null){N(e.exit("chunkFlow"),!0),E(0),e.consume(_);return}return Se(_)?(e.consume(_),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(_),k)}function N(_,C){const B=t.sliceStream(_);if(C&&B.push(null),_.previous=l,l&&(l.next=_),l=_,a.defineSkip(_.start),a.write(B),t.parser.lazy[_.start.line]){let T=a.events.length;for(;T--;)if(a.events[T][1].start.offset<u&&(!a.events[T][1].end||a.events[T][1].end.offset>u))return;const L=t.events.length;let G=L,Z,H;for(;G--;)if(t.events[G][0]==="exit"&&t.events[G][1].type==="chunkFlow"){if(Z){H=t.events[G][1].end;break}Z=!0}for(E(r),T=L;T<t.events.length;)t.events[T][1].end={...H},T++;_n(t.events,G+1,0,t.events.slice(L)),t.events.length=T}}function E(_){let C=n.length;for(;C-- >_;){const B=n[C];t.containerState=B[1],B[0].exit.call(t,e)}n.length=_}function A(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function TD(e,t,n){return Fe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _a(e){if(e===null||st(e)||fs(e))return 1;if(Uf(e))return 2}function If(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const l=e[a].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Am={name:"attention",resolveAll:AD,tokenize:MD};function AD(e,t){let n=-1,r,a,l,u,f,h,d,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},x={...e[n][1].start};Ev(m,-h),Ev(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},l={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[r][1].end={...u.start},e[n][1].start={...f.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=On(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=On(d,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),d=On(d,If(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=On(d,[["exit",l,t],["enter",f,t],["exit",f,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,d=On(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,_n(e,r-1,n-r+3,d),n=r+d.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MD(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=_a(r);let l;return u;function u(h){return l=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===l)return e.consume(h),f;const d=e.exit("attentionSequence"),g=_a(h),m=!g||g===2&&a||n.includes(h),x=!a||a===2&&g||n.includes(r);return d._open=!!(l===42?m:m&&(a||!x)),d._close=!!(l===42?x:x&&(g||!m)),t(h)}}function Ev(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jD={name:"autolink",tokenize:zD};function zD(e,t,n){let r=0;return a;function a(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(v){return Zt(v)?(e.consume(v),u):v===64?n(v):d(v)}function u(v){return v===43||v===45||v===46||$t(v)?(r=1,f(v)):d(v)}function f(v){return v===58?(e.consume(v),r=0,h):(v===43||v===45||v===46||$t(v))&&r++<32?(e.consume(v),f):(r=0,d(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||df(v)?n(v):(e.consume(v),h)}function d(v){return v===64?(e.consume(v),g):wD(v)?(e.consume(v),d):n(v)}function g(v){return $t(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,g):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):x(v)}function x(v){if((v===45||$t(v))&&r++<63){const w=v===45?x:m;return e.consume(v),w}return n(v)}}const Dl={partial:!0,tokenize:RD};function RD(e,t,n){return r;function r(l){return He(l)?Fe(e,a,"linePrefix")(l):a(l)}function a(l){return l===null||Se(l)?t(l):n(l)}}const s_={continuation:{tokenize:OD},exit:LD,name:"blockQuote",tokenize:DD};function DD(e,t,n){const r=this;return a;function a(u){if(u===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),l}return n(u)}function l(u){return He(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function OD(e,t,n){const r=this;return a;function a(u){return He(u)?Fe(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):l(u)}function l(u){return e.attempt(s_,t,n)(u)}}function LD(e){e.exit("blockQuote")}const a_={name:"characterEscape",tokenize:BD};function BD(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),a}function a(l){return _D(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const o_={name:"characterReference",tokenize:HD};function HD(e,t,n){const r=this;let a=0,l,u;return f;function f(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),h}function h(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,u=$t,g(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=SD,g):(e.enter("characterReferenceValue"),l=7,u=Tm,g(m))}function g(m){if(m===59&&a){const x=e.exit("characterReferenceValue");return u===$t&&!Sg(r.sliceSerialize(x))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(m)&&a++<l?(e.consume(m),g):n(m)}}const Nv={partial:!0,tokenize:ID},Cv={concrete:!0,name:"codeFenced",tokenize:UD};function UD(e,t,n){const r=this,a={partial:!0,tokenize:B};let l=0,u=0,f;return h;function h(T){return d(T)}function d(T){const L=r.events[r.events.length-1];return l=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(T)}function g(T){return T===f?(u++,e.consume(T),g):u<3?n(T):(e.exit("codeFencedFenceSequence"),He(T)?Fe(e,m,"whitespace")(T):m(T))}function m(T){return T===null||Se(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(Nv,k,C)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Se(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):He(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Fe(e,v,"whitespace")(T)):T===96&&T===f?n(T):(e.consume(T),x)}function v(T){return T===null||Se(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===null||Se(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===f?n(T):(e.consume(T),w)}function k(T){return e.attempt(a,C,N)(T)}function N(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),E}function E(T){return l>0&&He(T)?Fe(e,A,"linePrefix",l+1)(T):A(T)}function A(T){return T===null||Se(T)?e.check(Nv,k,C)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||Se(T)?(e.exit("codeFlowValue"),A(T)):(e.consume(T),_)}function C(T){return e.exit("codeFenced"),t(T)}function B(T,L,G){let Z=0;return H;function H(U){return T.enter("lineEnding"),T.consume(U),T.exit("lineEnding"),q}function q(U){return T.enter("codeFencedFence"),He(U)?Fe(T,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):P(U)}function P(U){return U===f?(T.enter("codeFencedFenceSequence"),te(U)):G(U)}function te(U){return U===f?(Z++,T.consume(U),te):Z>=u?(T.exit("codeFencedFenceSequence"),He(U)?Fe(T,O,"whitespace")(U):O(U)):G(U)}function O(U){return U===null||Se(U)?(T.exit("codeFencedFence"),L(U)):G(U)}}}function ID(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Op={name:"codeIndented",tokenize:$D},qD={partial:!0,tokenize:PD};function $D(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),Fe(e,l,"linePrefix",5)(d)}function l(d){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):n(d)}function u(d){return d===null?h(d):Se(d)?e.attempt(qD,u,h)(d):(e.enter("codeFlowValue"),f(d))}function f(d){return d===null||Se(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),f)}function h(d){return e.exit("codeIndented"),t(d)}}function PD(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):Fe(e,l,"linePrefix",5)(u)}function l(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):Se(u)?a(u):n(u)}}const VD={name:"codeText",previous:YD,resolve:FD,tokenize:XD};function FD(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function YD(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function XD(e,t,n){let r=0,a,l;return u;function u(m){return e.enter("codeText"),e.enter("codeTextSequence"),f(m)}function f(m){return m===96?(e.consume(m),r++,f):(e.exit("codeTextSequence"),h(m))}function h(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),h):m===96?(l=e.enter("codeTextSequence"),a=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),h(m)):(e.consume(m),d)}function g(m){return m===96?(e.consume(m),a++,g):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",d(m))}}class GD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Yo(this.left,r),l.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),Yo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Yo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yo(this.left,n.reverse())}}}function Yo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function l_(e){const t={};let n=-1,r,a,l,u,f,h,d;const g=new GD(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ZD(g,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,a=void 0;l--;)if(u=g.get(l),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=l);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...g.get(a)[1].start},f=g.slice(a,n),f.unshift(r),g.splice(a,n-a+1,f))}}return _n(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function ZD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const l=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],d={};let g,m,x=-1,v=n,w=0,k=0;const N=[k];for(;v;){for(;e.get(++a)[1]!==v;);l.push(a),v._tokenizer||(g=r.sliceStream(v),v.next||g.push(null),m&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++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&&(k=x+1,N.push(k),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),x=N.length;x--;){const E=f.slice(N[x],N[x+1]),A=l.pop();h.push([A,A+E.length-1]),e.splice(A,2,E)}for(h.reverse(),x=-1;++x<h.length;)d[w+h[x][0]]=w+h[x][1],w+=h[x][1]-h[x][0]-1;return d}const QD={resolve:JD,tokenize:WD},KD={partial:!0,tokenize:eO};function JD(e){return l_(e),e}function WD(e,t){let n;return r;function r(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(f)}function a(f){return f===null?l(f):Se(f)?e.check(KD,u,l)(f):(e.consume(f),a)}function l(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function eO(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Fe(e,l,"linePrefix")}function l(u){if(u===null||Se(u))return n(u);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function u_(e,t,n,r,a,l,u,f,h){const d=h||Number.POSITIVE_INFINITY;let g=0;return m;function m(E){return E===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(E),e.exit(l),x):E===null||E===32||E===41||df(E)?n(E):(e.enter(r),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),k(E))}function x(E){return E===62?(e.enter(l),e.consume(E),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(f),x(E)):E===null||E===60||Se(E)?n(E):(e.consume(E),E===92?w:v)}function w(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function k(E){return!g&&(E===null||E===41||st(E))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(r),t(E)):g<d&&E===40?(e.consume(E),g++,k):E===41?(e.consume(E),g--,k):E===null||E===32||E===40||df(E)?n(E):(e.consume(E),E===92?N:k)}function N(E){return E===40||E===41||E===92?(e.consume(E),k):k(E)}}function c_(e,t,n,r,a,l){const u=this;let f=0,h;return d;function d(v){return e.enter(r),e.enter(a),e.consume(v),e.exit(a),e.enter(l),g}function g(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(l),e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):Se(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Se(v)||f++>999?(e.exit("chunkString"),g(v)):(e.consume(v),h||(h=!He(v)),v===92?x:m)}function x(v){return v===91||v===92||v===93?(e.consume(v),f++,m):m(v)}}function f_(e,t,n,r,a,l){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(r),e.enter(a),e.consume(x),e.exit(a),u=x===40?41:x,h):n(x)}function h(x){return x===u?(e.enter(a),e.consume(x),e.exit(a),e.exit(r),t):(e.enter(l),d(x))}function d(x){return x===u?(e.exit(l),h(u)):x===null?n(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Fe(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),d(x)):(e.consume(x),x===92?m:g)}function m(x){return x===u||x===92?(e.consume(x),g):g(x)}}function rl(e,t){let n;return r;function r(a){return Se(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):He(a)?Fe(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const tO={name:"definition",tokenize:iO},nO={partial:!0,tokenize:rO};function iO(e,t,n){const r=this;let a;return l;function l(v){return e.enter("definition"),u(v)}function u(v){return c_.call(r,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return a=Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return st(v)?rl(e,d)(v):d(v)}function d(v){return u_(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function g(v){return e.attempt(nO,m,m)(v)}function m(v){return He(v)?Fe(e,x,"whitespace")(v):x(v)}function x(v){return v===null||Se(v)?(e.exit("definition"),r.parser.defined.push(a),t(v)):n(v)}}function rO(e,t,n){return r;function r(f){return st(f)?rl(e,a)(f):n(f)}function a(f){return f_(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function l(f){return He(f)?Fe(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Se(f)?t(f):n(f)}}const sO={name:"hardBreakEscape",tokenize:aO};function aO(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Se(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const oO={name:"headingAtx",resolve:lO,tokenize:uO};function lO(e,t){let n=e.length-2,r=3,a,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_n(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function uO(e,t,n){let r=0;return a;function a(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&r++<6?(e.consume(g),u):g===null||st(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Se(g)?(e.exit("atxHeading"),t(g)):He(g)?Fe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function d(g){return g===null||g===35||st(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),d)}}const cO=["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"],Tv=["pre","script","style","textarea"],fO={concrete:!0,name:"htmlFlow",resolveTo:pO,tokenize:mO},dO={partial:!0,tokenize:yO},hO={partial:!0,tokenize:gO};function pO(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 mO(e,t,n){const r=this;let a,l,u,f,h;return d;function d(j){return g(j)}function g(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),m}function m(j){return j===33?(e.consume(j),x):j===47?(e.consume(j),l=!0,k):j===63?(e.consume(j),a=3,r.interrupt?t:z):Zt(j)?(e.consume(j),u=String.fromCharCode(j),N):n(j)}function x(j){return j===45?(e.consume(j),a=2,v):j===91?(e.consume(j),a=5,f=0,w):Zt(j)?(e.consume(j),a=4,r.interrupt?t:z):n(j)}function v(j){return j===45?(e.consume(j),r.interrupt?t:z):n(j)}function w(j){const ie="CDATA[";return j===ie.charCodeAt(f++)?(e.consume(j),f===ie.length?r.interrupt?t:P:w):n(j)}function k(j){return Zt(j)?(e.consume(j),u=String.fromCharCode(j),N):n(j)}function N(j){if(j===null||j===47||j===62||st(j)){const ie=j===47,ce=u.toLowerCase();return!ie&&!l&&Tv.includes(ce)?(a=1,r.interrupt?t(j):P(j)):cO.includes(u.toLowerCase())?(a=6,ie?(e.consume(j),E):r.interrupt?t(j):P(j)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):l?A(j):_(j))}return j===45||$t(j)?(e.consume(j),u+=String.fromCharCode(j),N):n(j)}function E(j){return j===62?(e.consume(j),r.interrupt?t:P):n(j)}function A(j){return He(j)?(e.consume(j),A):H(j)}function _(j){return j===47?(e.consume(j),H):j===58||j===95||Zt(j)?(e.consume(j),C):He(j)?(e.consume(j),_):H(j)}function C(j){return j===45||j===46||j===58||j===95||$t(j)?(e.consume(j),C):B(j)}function B(j){return j===61?(e.consume(j),T):He(j)?(e.consume(j),B):_(j)}function T(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),h=j,L):He(j)?(e.consume(j),T):G(j)}function L(j){return j===h?(e.consume(j),h=null,Z):j===null||Se(j)?n(j):(e.consume(j),L)}function G(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||st(j)?B(j):(e.consume(j),G)}function Z(j){return j===47||j===62||He(j)?_(j):n(j)}function H(j){return j===62?(e.consume(j),q):n(j)}function q(j){return j===null||Se(j)?P(j):He(j)?(e.consume(j),q):n(j)}function P(j){return j===45&&a===2?(e.consume(j),R):j===60&&a===1?(e.consume(j),I):j===62&&a===4?(e.consume(j),D):j===63&&a===3?(e.consume(j),z):j===93&&a===5?(e.consume(j),K):Se(j)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(dO,V,te)(j)):j===null||Se(j)?(e.exit("htmlFlowData"),te(j)):(e.consume(j),P)}function te(j){return e.check(hO,O,V)(j)}function O(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),U}function U(j){return j===null||Se(j)?te(j):(e.enter("htmlFlowData"),P(j))}function R(j){return j===45?(e.consume(j),z):P(j)}function I(j){return j===47?(e.consume(j),u="",F):P(j)}function F(j){if(j===62){const ie=u.toLowerCase();return Tv.includes(ie)?(e.consume(j),D):P(j)}return Zt(j)&&u.length<8?(e.consume(j),u+=String.fromCharCode(j),F):P(j)}function K(j){return j===93?(e.consume(j),z):P(j)}function z(j){return j===62?(e.consume(j),D):j===45&&a===2?(e.consume(j),z):P(j)}function D(j){return j===null||Se(j)?(e.exit("htmlFlowData"),V(j)):(e.consume(j),D)}function V(j){return e.exit("htmlFlow"),t(j)}}function gO(e,t,n){const r=this;return a;function a(u){return Se(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function yO(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Dl,t,n)}}const xO={name:"htmlText",tokenize:bO};function bO(e,t,n){const r=this;let a,l,u;return f;function f(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),B):z===63?(e.consume(z),_):Zt(z)?(e.consume(z),G):n(z)}function d(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),l=0,w):Zt(z)?(e.consume(z),A):n(z)}function g(z){return z===45?(e.consume(z),v):n(z)}function m(z){return z===null?n(z):z===45?(e.consume(z),x):Se(z)?(u=m,I(z)):(e.consume(z),m)}function x(z){return z===45?(e.consume(z),v):m(z)}function v(z){return z===62?R(z):z===45?x(z):m(z)}function w(z){const D="CDATA[";return z===D.charCodeAt(l++)?(e.consume(z),l===D.length?k:w):n(z)}function k(z){return z===null?n(z):z===93?(e.consume(z),N):Se(z)?(u=k,I(z)):(e.consume(z),k)}function N(z){return z===93?(e.consume(z),E):k(z)}function E(z){return z===62?R(z):z===93?(e.consume(z),E):k(z)}function A(z){return z===null||z===62?R(z):Se(z)?(u=A,I(z)):(e.consume(z),A)}function _(z){return z===null?n(z):z===63?(e.consume(z),C):Se(z)?(u=_,I(z)):(e.consume(z),_)}function C(z){return z===62?R(z):_(z)}function B(z){return Zt(z)?(e.consume(z),T):n(z)}function T(z){return z===45||$t(z)?(e.consume(z),T):L(z)}function L(z){return Se(z)?(u=L,I(z)):He(z)?(e.consume(z),L):R(z)}function G(z){return z===45||$t(z)?(e.consume(z),G):z===47||z===62||st(z)?Z(z):n(z)}function Z(z){return z===47?(e.consume(z),R):z===58||z===95||Zt(z)?(e.consume(z),H):Se(z)?(u=Z,I(z)):He(z)?(e.consume(z),Z):R(z)}function H(z){return z===45||z===46||z===58||z===95||$t(z)?(e.consume(z),H):q(z)}function q(z){return z===61?(e.consume(z),P):Se(z)?(u=q,I(z)):He(z)?(e.consume(z),q):Z(z)}function P(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),a=z,te):Se(z)?(u=P,I(z)):He(z)?(e.consume(z),P):(e.consume(z),O)}function te(z){return z===a?(e.consume(z),a=void 0,U):z===null?n(z):Se(z)?(u=te,I(z)):(e.consume(z),te)}function O(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||st(z)?Z(z):(e.consume(z),O)}function U(z){return z===47||z===62||st(z)?Z(z):n(z)}function R(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function I(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),F}function F(z){return He(z)?Fe(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):K(z)}function K(z){return e.enter("htmlTextData"),u(z)}}const _g={name:"labelEnd",resolveAll:_O,resolveTo:kO,tokenize:EO},vO={tokenize:NO},wO={tokenize:CO},SO={tokenize:TO};function _O(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&_n(e,0,e.length,n),e}function kO(e,t){let n=e.length,r=0,a,l,u,f;for(;n--;)if(a=e[n][1],l){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(l=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",d,t]],f=On(f,e.slice(l+1,l+r+3)),f=On(f,[["enter",g,t]]),f=On(f,If(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),f=On(f,[["exit",g,t],e[u-2],e[u-1],["exit",d,t]]),f=On(f,e.slice(u+1)),f=On(f,[["exit",h,t]]),_n(e,l,e.length,f),e}function EO(e,t,n){const r=this;let a=r.events.length,l,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){l=r.events[a][1];break}return f;function f(x){return l?l._inactive?m(x):(u=r.parser.defined.includes(Zn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):n(x)}function h(x){return x===40?e.attempt(vO,g,u?g:m)(x):x===91?e.attempt(wO,g,u?d:m)(x):u?g(x):m(x)}function d(x){return e.attempt(SO,g,m)(x)}function g(x){return t(x)}function m(x){return l._balanced=!0,n(x)}}function NO(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return st(m)?rl(e,l)(m):l(m)}function l(m){return m===41?g(m):u_(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return st(m)?rl(e,h)(m):g(m)}function f(m){return n(m)}function h(m){return m===34||m===39||m===40?f_(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function d(m){return st(m)?rl(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function CO(e,t,n){const r=this;return a;function a(f){return c_.call(r,e,l,u,"reference","referenceMarker","referenceString")(f)}function l(f){return r.parser.defined.includes(Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function TO(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),a}function a(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const AO={name:"labelStartImage",resolveAll:_g.resolveAll,tokenize:MO};function MO(e,t,n){const r=this;return a;function a(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),l}function l(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(f):t(f)}}const jO={name:"labelStartLink",resolveAll:_g.resolveAll,tokenize:zO};function zO(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),l}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Lp={name:"lineEnding",tokenize:RO};function RO(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Fe(e,t,"linePrefix")}}const Fc={name:"thematicBreak",tokenize:DO};function DO(e,t,n){let r=0,a;return l;function l(d){return e.enter("thematicBreak"),u(d)}function u(d){return a=d,f(d)}function f(d){return d===a?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||Se(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===a?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),He(d)?Fe(e,f,"whitespace")(d):f(d))}}const an={continuation:{tokenize:HO},exit:IO,name:"list",tokenize:BO},OO={partial:!0,tokenize:qO},LO={partial:!0,tokenize:UO};function BO(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return f;function f(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Tm(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Fc,n,d)(v):d(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return Tm(v)&&++u<10?(e.consume(v),h):(!r.interrupt||u<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),d(v)):n(v)}function d(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Dl,r.interrupt?n:g,e.attempt(OO,x,m))}function g(v){return r.containerState.initialBlankLine=!0,l++,x(v)}function m(v){return He(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function HO(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Dl,a,l);function a(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Fe(e,t,"listItemIndent",r.containerState.size+1)(f)}function l(f){return r.containerState.furtherBlankLines||!He(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(LO,t,u)(f))}function u(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,Fe(e,e.attempt(an,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function UO(e,t,n){const r=this;return Fe(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function IO(e){e.exit(this.containerState.type)}function qO(e,t,n){const r=this;return Fe(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!He(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const Av={name:"setextUnderline",resolveTo:$O,tokenize:PO};function $O(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function PO(e,t,n){const r=this;let a;return l;function l(d){let g=r.events.length,m;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){m=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),a=d,u(d)):n(d)}function u(d){return e.enter("setextHeadingLineSequence"),f(d)}function f(d){return d===a?(e.consume(d),f):(e.exit("setextHeadingLineSequence"),He(d)?Fe(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Se(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const VO={tokenize:FO};function FO(e){const t=this,n=e.attempt(Dl,r,e.attempt(this.parser.constructs.flowInitial,a,Fe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(QD,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const YO={resolveAll:h_()},XO=d_("string"),GO=d_("text");function d_(e){return{resolveAll:h_(e==="text"?ZO:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,f);return u;function u(g){return d(g)?l(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return d(g)?(n.exit("data"),l(g)):(n.consume(g),h)}function d(g){if(g===null)return!0;const m=a[g];let x=-1;if(m)for(;++x<m.length;){const v=m[x];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function h_(e){return t;function t(n,r){let a=-1,l;for(;++a<=n.length;)l===void 0?n[a]&&n[a][1].type==="data"&&(l=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==l+2&&(n[l][1].end=n[a-1][1].end,n.splice(l+2,a-l-2),a=l+2),l=void 0);return e?e(n,r):n}}function ZO(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let l=a.length,u=-1,f=0,h;for(;l--;){const d=a[l];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(d===-2)h=!0,f++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const d={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?u:r.start._bufferIndex+u,_index:r.start._index+l,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const QO={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:s_},KO={91:tO},JO={[-2]:Op,[-1]:Op,32:Op},WO={35:oO,42:Fc,45:[Av,Fc],60:fO,61:Av,95:Fc,96:Cv,126:Cv},e6={38:o_,92:a_},t6={[-5]:Lp,[-4]:Lp,[-3]:Lp,33:AO,38:o_,42:Am,60:[jD,xO],91:jO,92:[sO,a_],93:_g,95:Am,96:VD},n6={null:[Am,YO]},i6={null:[42,95]},r6={null:[]},s6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:i6,contentInitial:KO,disable:r6,document:QO,flow:WO,flowInitial:JO,insideSpan:n6,string:e6,text:t6},Symbol.toStringTag,{value:"Module"}));function a6(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},l=[];let u=[],f=[];const h={attempt:L(B),check:L(T),consume:A,enter:_,exit:C,interrupt:L(T,{interrupt:!0})},d={code:null,containerState:{},defineSkip:k,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:m};let g=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function m(q){return u=On(u,q),N(),u[u.length-1]!==null?[]:(G(t,0),d.events=If(l,d.events,d),d.events)}function x(q,P){return l6(v(q),P)}function v(q){return o6(u,q)}function w(){const{_bufferIndex:q,_index:P,line:te,column:O,offset:U}=r;return{_bufferIndex:q,_index:P,line:te,column:O,offset:U}}function k(q){a[q.line]=q.column,H()}function N(){let q;for(;r._index<u.length;){const P=u[r._index];if(typeof P=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<P.length;)E(P.charCodeAt(r._bufferIndex));else E(P)}}function E(q){g=g(q)}function A(q){Se(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,H()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=q}function _(q,P){const te=P||{};return te.type=q,te.start=w(),d.events.push(["enter",te,d]),f.push(te),te}function C(q){const P=f.pop();return P.end=w(),d.events.push(["exit",P,d]),P}function B(q,P){G(q,P.from)}function T(q,P){P.restore()}function L(q,P){return te;function te(O,U,R){let I,F,K,z;return Array.isArray(O)?V(O):"tokenize"in O?V([O]):D(O);function D(fe){return he;function he(ue){const me=ue!==null&&fe[ue],Ee=ue!==null&&fe.null,Ce=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return V(Ce)(ue)}}function V(fe){return I=fe,F=0,fe.length===0?R:j(fe[F])}function j(fe){return he;function he(ue){return z=Z(),K=fe,fe.partial||(d.currentConstruct=fe),fe.name&&d.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(d),P):d,h,ie,ce)(ue)}}function ie(fe){return q(K,z),U}function ce(fe){return z.restore(),++F<I.length?j(I[F]):R}}}function G(q,P){q.resolveAll&&!l.includes(q)&&l.push(q),q.resolve&&_n(d.events,P,d.events.length-P,q.resolve(d.events.slice(P),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function Z(){const q=w(),P=d.previous,te=d.currentConstruct,O=d.events.length,U=Array.from(f);return{from:O,restore:R};function R(){r=q,d.previous=P,d.currentConstruct=te,d.events.length=O,f=U,H()}}function H(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function o6(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,l=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,l)];else{if(u=e.slice(n,a),r>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function l6(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const l=e[n];let u;if(typeof l=="string")u=l;else switch(l){case-5:{u="\r";break}case-4:{u=`
124
- `;break}case-3:{u=`\r
125
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(l)}a=l===-2,r.push(u)}return r.join("")}function u6(e){const r={constructs:i_([s6,...(e||{}).extensions||[]]),content:a(kD),defined:[],document:a(ND),flow:a(VO),lazy:{},string:a(XO),text:a(GO)};return r;function a(l){return u;function u(f){return a6(r,l,f)}}}function c6(e){for(;!l_(e););return e}const Mv=/[\0\t\n\r]/g;function f6(){let e=1,t="",n=!0,r;return a;function a(l,u,f){const h=[];let d,g,m,x,v;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(u||void 0).decode(l)),m=0,t="",n&&(l.charCodeAt(0)===65279&&m++,n=void 0);m<l.length;){if(Mv.lastIndex=m,d=Mv.exec(l),x=d&&d.index!==void 0?d.index:l.length,v=l.charCodeAt(x),!d){t=l.slice(m);break}if(v===10&&m===x&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),m<x&&(h.push(l.slice(m,x)),e+=x-m),v){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return f&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const d6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function h6(e){return e.replace(d6,p6)}function p6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),l=a===120||a===88;return r_(n.slice(l?2:1),l?16:10)}return Sg(n)||e}const p_={}.hasOwnProperty;function m6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),g6(n)(c6(u6(n).document().write(f6()(e,t,!0))))}function g6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Ht),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:l(Qe),blockQuote:l(Ee),characterEscape:Z,characterReference:Z,codeFenced:l(Ce),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Ce,u),codeText:l(we,u),codeTextData:Z,data:Z,codeFlowValue:Z,definition:l(Ne),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(Oe),hardBreakEscape:l(Xe),hardBreakTrailing:l(Xe),htmlFlow:l(pt,u),htmlFlowData:Z,htmlText:l(pt,u),htmlTextData:Z,image:l(un),label:u,link:l(Ht),listItem:l(Bn),listItemValue:x,listOrdered:l(Qt,m),listUnordered:l(Qt),paragraph:l(pi),reference:j,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Qe),strong:l(mi),thematicBreak:l(Yi)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:h(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:h(N),codeFencedFence:k,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:H,codeIndented:h(E),codeText:h(U),codeTextData:H,data:H,definition:h(),definitionDestinationString:C,definitionLabelString:A,definitionTitleString:_,emphasis:h(),hardBreakEscape:h(P),hardBreakTrailing:h(P),htmlFlow:h(te),htmlFlowData:H,htmlText:h(O),htmlTextData:H,image:h(I),label:K,labelText:F,lineEnding:q,link:h(R),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ie,resourceDestinationString:z,resourceTitleString:D,resource:V,setextHeading:h(G),setextHeadingLineSequence:L,setextHeadingText:T,strong:h(),thematicBreak:h()}};m_(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(se){let pe={type:"root",children:[]};const _e={stack:[pe],tokenStack:[],config:t,enter:f,exit:d,buffer:u,resume:g,data:n},De=[];let Pe=-1;for(;++Pe<se.length;)if(se[Pe][1].type==="listOrdered"||se[Pe][1].type==="listUnordered")if(se[Pe][0]==="enter")De.push(Pe);else{const Ft=De.pop();Pe=a(se,Ft,Pe)}for(Pe=-1;++Pe<se.length;){const Ft=t[se[Pe][0]];p_.call(Ft,se[Pe][1].type)&&Ft[se[Pe][1].type].call(Object.assign({sliceSerialize:se[Pe][2].sliceSerialize},_e),se[Pe][1])}if(_e.tokenStack.length>0){const Ft=_e.tokenStack[_e.tokenStack.length-1];(Ft[1]||jv).call(_e,void 0,Ft[0])}for(pe.position={start:Nr(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:Nr(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe<t.transforms.length;)pe=t.transforms[Pe](pe)||pe;return pe}function a(se,pe,_e){let De=pe-1,Pe=-1,Ft=!1,Hn,zt,mt,Ut;for(;++De<=_e;){const Je=se[De];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?Pe++:Pe--,Ut=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Hn&&!Ut&&!Pe&&!mt&&(mt=De),Ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ut=void 0}if(!Pe&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||Pe===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Hn){let Jn=De;for(zt=void 0;Jn--;){const cn=se[Jn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;zt&&(se[zt][1].type="lineEndingBlank",Ft=!0),cn[1].type="lineEnding",zt=Jn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}mt&&(!zt||mt<zt)&&(Hn._spread=!0),Hn.end=Object.assign({},zt?se[zt][1].start:Je[1].end),se.splice(zt||De,0,["exit",Hn,Je[2]]),De++,_e++}if(Je[1].type==="listItemPrefix"){const Jn={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Hn=Jn,se.splice(De,0,["enter",Jn,Je[2]]),De++,_e++,mt=void 0,Ut=!0}}}return se[pe][1]._spread=Ft,_e}function l(se,pe){return _e;function _e(De){f.call(this,se(De),De),pe&&pe.call(this,De)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(se,pe,_e){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([pe,_e||void 0]),se.position={start:Nr(pe.start),end:void 0}}function h(se){return pe;function pe(_e){se&&se.call(this,_e),d.call(this,_e)}}function d(se,pe){const _e=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==se.type&&(pe?pe.call(this,se,De[0]):(De[1]||jv).call(this,se,De[0]));else throw new Error("Cannot close `"+se.type+"` ("+il({start:se.start,end:se.end})+"): it’s not open");_e.position.end=Nr(se.end)}function g(){return wg(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function x(se){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function v(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=se}function w(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=se}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/(\r?\n|\r)$/g,"")}function A(se){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Zn(this.sliceSerialize(se)).toLowerCase()}function _(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function C(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function B(se){const pe=this.stack[this.stack.length-1];if(!pe.depth){const _e=this.sliceSerialize(se).length;pe.depth=_e}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function L(se){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function G(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(se){const _e=this.stack[this.stack.length-1].children;let De=_e[_e.length-1];(!De||De.type!=="text")&&(De=Ct(),De.position={start:Nr(se.start),end:void 0},_e.push(De)),this.stack.push(De)}function H(se){const pe=this.stack.pop();pe.value+=this.sliceSerialize(se),pe.position.end=Nr(se.end)}function q(se){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=pe.children[pe.children.length-1];_e.position.end=Nr(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(Z.call(this,se),H.call(this,se))}function P(){this.data.atHardBreak=!0}function te(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function O(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function U(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se}function R(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function I(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=pe,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function F(se){const pe=this.sliceSerialize(se),_e=this.stack[this.stack.length-2];_e.label=h6(pe),_e.identifier=Zn(pe).toLowerCase()}function K(){const se=this.stack[this.stack.length-1],pe=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const De=se.children;_e.children=De}else _e.alt=pe}function z(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function D(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function V(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ie(se){const pe=this.resume(),_e=this.stack[this.stack.length-1];_e.label=pe,_e.identifier=Zn(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function ce(se){this.data.characterReferenceType=se.type}function fe(se){const pe=this.sliceSerialize(se),_e=this.data.characterReferenceType;let De;_e?(De=r_(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=Sg(pe);const Pe=this.stack[this.stack.length-1];Pe.value+=De}function he(se){const pe=this.stack.pop();pe.position.end=Nr(se.end)}function ue(se){H.call(this,se);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(se)}function me(se){H.call(this,se);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(se)}function Ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Qe(){return{type:"heading",depth:0,children:[]}}function Xe(){return{type:"break"}}function pt(){return{type:"html",value:""}}function un(){return{type:"image",title:null,url:"",alt:null}}function Ht(){return{type:"link",title:null,url:"",children:[]}}function Qt(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function Bn(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function pi(){return{type:"paragraph",children:[]}}function mi(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function Yi(){return{type:"thematicBreak"}}}function Nr(e){return{line:e.line,column:e.column,offset:e.offset}}function m_(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?m_(e,r):y6(e,r)}}function y6(e,t){let n;for(n in t)if(p_.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function jv(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+il({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+il({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+il({start:t.start,end:t.end})+") is still open")}function x6(e){const t=this;t.parser=n;function n(r){return m6(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function b6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function v6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
126
- `}]}function w6(e,t){const n=t.value?t.value+`
127
- `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function S6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Aa(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,f+=1,e.footnoteCounts.set(r,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function E6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function N6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function g_(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function C6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g_(e,t);const a={src:Aa(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function T6(e,t){const n={src:Aa(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function A6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function M6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return g_(e,t);const a={href:Aa(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function j6(e,t){const n={href:Aa(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function z6(e,t,n){const r=e.all(t),a=n?R6(n):y_(t),l={},u=[];if(typeof t.checked=="boolean"){const g=r[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const g=r[f];(a||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
128
- `}),g.type==="element"&&g.tagName==="p"&&!a?u.push(...g.children):u.push(g)}const h=r[r.length-1];h&&(a||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
129
- `});const d={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,d),e.applyData(t,d)}function R6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=y_(n[r])}return t}function y_(e){const t=e.spread;return t??e.children.length>1}function D6(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function O6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function B6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=yg(t.children[1]),h=Q2(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function U6(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let h=-1;const d=[];for(;++h<f;){const m=t.children[h],x={},v=u?u[h]:void 0;v&&(x.align=v);let w={type:"element",tagName:l,properties:x,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,g),e.applyData(t,g)}function I6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const zv=9,Rv=32;function q6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const l=[];for(;r;)l.push(Dv(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(Dv(t.slice(a),a>0,!1)),l.join("")}function Dv(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===zv||l===Rv;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===zv||l===Rv;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function $6(e,t){const n={type:"text",value:q6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function P6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const V6={blockquote:b6,break:v6,code:w6,delete:S6,emphasis:_6,footnoteReference:k6,heading:E6,html:N6,imageReference:C6,image:T6,inlineCode:A6,linkReference:M6,link:j6,listItem:z6,list:D6,paragraph:O6,root:L6,strong:B6,table:H6,tableCell:I6,tableRow:U6,text:$6,thematicBreak:P6,toml:jc,yaml:jc,definition:jc,footnoteDefinition:jc};function jc(){}const x_=-1,qf=0,sl=1,hf=2,kg=3,Eg=4,Ng=5,Cg=6,b_=7,v_=8,Ov=typeof self=="object"?self:globalThis,F6=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case qf:case x_:return n(u,a);case sl:{const f=n([],a);for(const h of u)f.push(r(h));return f}case hf:{const f=n({},a);for(const[h,d]of u)f[r(h)]=r(d);return f}case kg:return n(new Date(u),a);case Eg:{const{source:f,flags:h}=u;return n(new RegExp(f,h),a)}case Ng:{const f=n(new Map,a);for(const[h,d]of u)f.set(r(h),r(d));return f}case Cg:{const f=n(new Set,a);for(const h of u)f.add(r(h));return f}case b_:{const{name:f,message:h}=u;return n(new Ov[f](h),a)}case v_:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new Ov[l](u),a)};return r},Lv=e=>F6(new Map,e)(0),ra="",{toString:Y6}={},{keys:X6}=Object,Xo=e=>{const t=typeof e;if(t!=="object"||!e)return[qf,t];const n=Y6.call(e).slice(8,-1);switch(n){case"Array":return[sl,ra];case"Object":return[hf,ra];case"Date":return[kg,ra];case"RegExp":return[Eg,ra];case"Map":return[Ng,ra];case"Set":return[Cg,ra];case"DataView":return[sl,n]}return n.includes("Array")?[sl,n]:n.includes("Error")?[b_,n]:[hf,n]},zc=([e,t])=>e===qf&&(t==="function"||t==="symbol"),G6=(e,t,n,r)=>{const a=(u,f)=>{const h=r.push(u)-1;return n.set(f,h),h},l=u=>{if(n.has(u))return n.get(u);let[f,h]=Xo(u);switch(f){case qf:{let g=u;switch(h){case"bigint":f=v_,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return a([x_],u)}return a([f,g],u)}case sl:{if(h){let x=u;return h==="DataView"?x=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(u)),a([h,[...x]],u)}const g=[],m=a([f,g],u);for(const x of u)g.push(l(x));return m}case hf:{if(h)switch(h){case"BigInt":return a([h,u.toString()],u);case"Boolean":case"Number":case"String":return a([h,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const g=[],m=a([f,g],u);for(const x of X6(u))(e||!zc(Xo(u[x])))&&g.push([l(x),l(u[x])]);return m}case kg:return a([f,u.toISOString()],u);case Eg:{const{source:g,flags:m}=u;return a([f,{source:g,flags:m}],u)}case Ng:{const g=[],m=a([f,g],u);for(const[x,v]of u)(e||!(zc(Xo(x))||zc(Xo(v))))&&g.push([l(x),l(v)]);return m}case Cg:{const g=[],m=a([f,g],u);for(const x of u)(e||!zc(Xo(x)))&&g.push(l(x));return m}}const{message:d}=u;return a([f,{name:h,message:d}],u)};return l},Bv=(e,{json:t,lossy:n}={})=>{const r=[];return G6(!(t||n),!!t,new Map,r)(e),r},pf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Lv(Bv(e,t)):structuredClone(e):(e,t)=>Lv(Bv(e,t));function Z6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Q6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function K6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Z6,r=e.options.footnoteBackLabel||Q6,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=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 g=e.all(d),m=String(d.identifier).toUpperCase(),x=Aa(m.toLowerCase());let v=0;const w=[],k=e.footnoteCounts.get(m);for(;k!==void 0&&++v<=k;){w.length>0&&w.push({type:"text",value:" "});let A=typeof n=="string"?n:n(h,v);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,v),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const A=N.children[N.children.length-1];A&&A.type==="text"?A.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(d,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...pf(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
130
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
131
- `}]}}const $f=(function(e){if(e==null)return tL;if(typeof e=="function")return Pf(e);if(typeof e=="object")return Array.isArray(e)?J6(e):W6(e);if(typeof e=="string")return eL(e);throw new Error("Expected function, string, or object as test")});function J6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=$f(e[n]);return Pf(r);function r(...a){let l=-1;for(;++l<t.length;)if(t[l].apply(this,a))return!0;return!1}}function W6(e){const t=e;return Pf(n);function n(r){const a=r;let l;for(l in e)if(a[l]!==t[l])return!1;return!0}}function eL(e){return Pf(t);function t(n){return n&&n.type===e}}function Pf(e){return t;function t(n,r,a){return!!(nL(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function tL(){return!0}function nL(e){return e!==null&&typeof e=="object"&&"type"in e}const w_=[],iL=!0,Mm=!1,rL="skip";function S_(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=$f(a),u=r?-1:1;f(e,void 0,[])();function f(h,d,g){const m=h&&typeof h=="object"?h:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return x;function x(){let v=w_,w,k,N;if((!t||l(h,d,g[g.length-1]||void 0))&&(v=sL(n(h,g)),v[0]===Mm))return v;if("children"in h&&h.children){const E=h;if(E.children&&v[0]!==rL)for(k=(r?E.children.length:-1)+u,N=g.concat(E);k>-1&&k<E.children.length;){const A=E.children[k];if(w=f(A,k,N)(),w[0]===Mm)return w;k=typeof w[1]=="number"?w[1]:k+u}}return v}}}function sL(e){return Array.isArray(e)?e:typeof e=="number"?[iL,e]:e==null?w_:[e]}function Tg(e,t,n,r){let a,l,u;typeof t=="function"&&typeof n!="function"?(l=void 0,u=t,a=n):(l=t,u=n,a=r),S_(e,l,f,a);function f(h,d){const g=d[d.length-1],m=g?g.children.indexOf(h):void 0;return u(h,m,g)}}const jm={}.hasOwnProperty,aL={};function oL(e,t){const n=t||aL,r=new Map,a=new Map,l=new Map,u={...V6,...n.handlers},f={all:d,applyData:uL,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:h,options:n,patch:lL,wrap:fL};return Tg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?r:a,x=String(g.identifier).toUpperCase();m.has(x)||m.set(x,g)}}),f;function h(g,m){const x=g.type,v=f.handlers[x];if(jm.call(f.handlers,x)&&v)return v(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:k,...N}=g,E=pf(N);return E.children=f.all(g),E}return pf(g)}return(f.options.unknownHandler||cL)(f,g,m)}function d(g){const m=[];if("children"in g){const x=g.children;let v=-1;for(;++v<x.length;){const w=f.one(x[v],g);if(w){if(v&&x[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Hv(w.value)),!Array.isArray(w)&&w.type==="element")){const k=w.children[0];k&&k.type==="text"&&(k.value=Hv(k.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function lL(e,t){e.position&&(t.position=QR(e))}function uL(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&l&&Object.assign(n.properties,pf(l)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function cL(e,t){const n=t.data||{},r="value"in t&&!(jm.call(n,"hProperties")||jm.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function fL(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
132
- `});++r<e.length;)r&&n.push({type:"text",value:`
133
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
134
- `}),n}function Hv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Uv(e,t){const n=oL(e,t),r=n.one(e,void 0),a=K6(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:`
135
- `},a),l}function dL(e,t){return e&&"run"in e?async function(n,r){const a=Uv(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Uv(n,{file:r,...e||t})}}function Iv(e){if(e)throw e}var Bp,qv;function hL(){if(qv)return Bp;qv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!m)return!1;var x;for(x in d);return typeof x>"u"||e.call(d,x)},u=function(d,g){n&&g.name==="__proto__"?n(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},f=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(r)return r(d,g).value}else return;return d[g]};return Bp=function h(){var d,g,m,x,v,w,k=arguments[0],N=1,E=arguments.length,A=!1;for(typeof k=="boolean"&&(A=k,k=arguments[1]||{},N=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});N<E;++N)if(d=arguments[N],d!=null)for(g in d)m=f(k,g),x=f(d,g),k!==x&&(A&&x&&(l(x)||(v=a(x)))?(v?(v=!1,w=m&&a(m)?m:[]):w=m&&l(m)?m:{},u(k,{name:g,newValue:h(A,w,x)})):typeof x<"u"&&u(k,{name:g,newValue:x}));return k},Bp}var pL=hL();const Hp=gf(pL);function zm(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 mL(){const e=[],t={run:n,use:r};return t;function n(...a){let l=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...a);function f(h,...d){const g=e[++l];let m=-1;if(h){u(h);return}for(;++m<a.length;)(d[m]===null||d[m]===void 0)&&(d[m]=a[m]);a=d,g?gL(g,f)(...d):u(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function gL(e,t){let n;return r;function r(...u){const f=e.length>u.length;let h;f&&u.push(a);try{h=e.apply(this,u)}catch(d){const g=d;if(f&&n)throw g;return a(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(l,a):h instanceof Error?a(h):l(h))}function a(u,...f){n||(n=!0,t(u,...f))}function l(u){a(null,u)}}const ri={basename:yL,dirname:xL,extname:bL,join:vL,sep:"/"};function yL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ol(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,f=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),f>-1&&(e.codePointAt(a)===t.codePointAt(f--)?f<0&&(r=a):(f=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function xL(e){if(Ol(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function bL(e){Ol(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function vL(...e){let t=-1,n;for(;++t<e.length;)Ol(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":wL(n)}function wL(e){Ol(e);const t=e.codePointAt(0)===47;let n=SL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function SL(e,t){let n="",r=0,a=-1,l=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(a===u-1||l===1))if(a!==u-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else f===46&&l>-1?l++:l=-1}return n}function Ol(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const _L={cwd:kL};function kL(){return"/"}function Rm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EL(e){if(typeof e=="string")e=new URL(e);else if(!Rm(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 NL(e)}function NL(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Up=["history","path","basename","stem","extname","dirname"];class __{constructor(t){let n;t?Rm(t)?n={path:t}:typeof t=="string"||CL(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":_L.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Up.length;){const l=Up[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let a;for(a in n)Up.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ri.basename(this.path):void 0}set basename(t){qp(t,"basename"),Ip(t,"basename"),this.path=ri.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ri.dirname(this.path):void 0}set dirname(t){$v(this.basename,"dirname"),this.path=ri.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ri.extname(this.path):void 0}set extname(t){if(Ip(t,"extname"),$v(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=ri.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rm(t)&&(t=EL(t)),qp(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ri.basename(this.path,this.extname):void 0}set stem(t){qp(t,"stem"),Ip(t,"stem"),this.path=ri.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Vt(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ip(e,t){if(e&&e.includes(ri.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ri.sep+"`")}function qp(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $v(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function CL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TL=(function(e){const r=this.constructor.prototype,a=r[e],l=function(){return a.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),AL={}.hasOwnProperty;class Ag extends TL{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=mL()}copy(){const t=new Ag;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Hp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vp("data",this.frozen),this.namespace[t]=n,this):AL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Rc(t),r=this.parser||this.Parser;return $p("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$p("process",this.parser||this.Parser),Pp("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const f=Rc(t),h=r.parse(f);r.run(h,f,function(g,m,x){if(g||!m||!x)return d(g);const v=m,w=r.stringify(v,x);zL(w)?x.value=w:x.result=w,d(g,x)});function d(g,m){g||!m?u(g):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),$p("processSync",this.parser||this.Parser),Pp("processSync",this.compiler||this.Compiler),this.process(t,a),Vv("processSync","process",n),r;function a(l,u){n=!0,Iv(l),r=u}}run(t,n,r){Pv(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(u,f){const h=Rc(n);a.run(t,h,d);function d(g,m,x){const v=m||t;g?f(g):u?u(v):r(void 0,v,x)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),Vv("runSync","run",r),a;function l(u,f){Iv(u),a=f,r=!0}}stringify(t,n){this.freeze();const r=Rc(n),a=this.compiler||this.Compiler;return Pp("stringify",a),Pv(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Vp("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...m]=d;h(g,m)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(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&&(a.settings=Hp(!0,a.settings,d.settings))}function f(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const m=d[g];l(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,g){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===d){x=m;break}if(x===-1)r.push([d,...g]);else if(g.length>0){let[v,...w]=g;const k=r[x][1];zm(k)&&zm(v)&&(v=Hp(!0,k,v)),r[x]=[d,v,...w]}}}}const ML=new Ag().freeze();function $p(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vp(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 Pv(e){if(!zm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Vv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rc(e){return jL(e)?e:new __(e)}function jL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zL(e){return typeof e=="string"||RL(e)}function RL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Fv=[],Yv={allowDangerousHtml:!0},OL=/^(https?|ircs?|mailto|xmpp)$/i,LL=[{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 Xv(e){const t=BL(e),n=HL(e);return UL(t.runSync(t.parse(n),n),e)}function BL(e){const t=e.rehypePlugins||Fv,n=e.remarkPlugins||Fv,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yv}:Yv;return ML().use(x6).use(n).use(dL,r).use(t)}function HL(e){const t=e.children||"",n=new __;return typeof t=="string"&&(n.value=t),n}function UL(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||IL;for(const g of LL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+DL+g.id,void 0);return Tg(e,d),tD(e,{Fragment:b.Fragment,components:a,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function d(g,m,x){if(g.type==="raw"&&x&&typeof m=="number")return u?x.children.splice(m,1):x.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let v;for(v in Dp)if(Object.hasOwn(Dp,v)&&Object.hasOwn(g.properties,v)){const w=g.properties[v],k=Dp[v];(k===null||k.includes(g.tagName))&&(g.properties[v]=h(String(w||""),v,g))}}if(g.type==="element"){let v=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(g,m,x)),v&&x&&typeof m=="number")return f&&g.children?x.children.splice(m,1,...g.children):x.children.splice(m,1),m}}}function IL(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||OL.test(e.slice(0,t))?e:""}function Gv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function qL(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function $L(e,t,n){const a=$f((n||{}).ignore||[]),l=PL(t);let u=-1;for(;++u<l.length;)S_(e,"text",f);function f(d,g){let m=-1,x;for(;++m<g.length;){const v=g[m],w=x?x.children:void 0;if(a(v,w?w.indexOf(v):void 0,x))return;x=v}if(x)return h(d,g)}function h(d,g){const m=g[g.length-1],x=l[u][0],v=l[u][1];let w=0;const N=m.children.indexOf(d);let E=!1,A=[];x.lastIndex=0;let _=x.exec(d.value);for(;_;){const C=_.index,B={index:_.index,input:_.input,stack:[...g,d]};let T=v(..._,B);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?x.lastIndex=C+1:(w!==C&&A.push({type:"text",value:d.value.slice(w,C)}),Array.isArray(T)?A.push(...T):T&&A.push(T),w=C+_[0].length,E=!0),!x.global)break;_=x.exec(d.value)}return E?(w<d.value.length&&A.push({type:"text",value:d.value.slice(w)}),m.children.splice(N,1,...A)):A=[d],N+A.length}}function PL(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([VL(a[0]),FL(a[1])])}return t}function VL(e){return typeof e=="string"?new RegExp(qL(e),"g"):e}function FL(e){return typeof e=="function"?e:function(){return e}}const Fp="phrasing",Yp=["autolink","link","image","label"];function YL(){return{transforms:[WL],enter:{literalAutolink:GL,literalAutolinkEmail:Xp,literalAutolinkHttp:Xp,literalAutolinkWww:Xp},exit:{literalAutolink:JL,literalAutolinkEmail:KL,literalAutolinkHttp:ZL,literalAutolinkWww:QL}}}function XL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fp,notInConstruct:Yp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fp,notInConstruct:Yp},{character:":",before:"[ps]",after:"\\/",inConstruct:Fp,notInConstruct:Yp}]}}function GL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xp(e){this.config.enter.autolinkProtocol.call(this,e)}function ZL(e){this.config.exit.autolinkProtocol.call(this,e)}function QL(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function KL(e){this.config.exit.autolinkEmail.call(this,e)}function JL(e){this.exit(e)}function WL(e){$L(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,eB],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tB]],{ignore:["link","linkReference"]})}function eB(e,t,n,r,a){let l="";if(!k_(a)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!nB(n)))return!1;const u=iB(n+r);if(!u[0])return!1;const f={type:"link",title:null,url:l+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function tB(e,t,n,r){return!k_(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function nB(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function iB(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Gv(e,"(");let l=Gv(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function k_(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fs(n)||Uf(n))&&(!t||n!==47)}E_.peek=dB;function rB(){this.buffer()}function sB(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function aB(){this.buffer()}function oB(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function uB(e){this.exit(e)}function cB(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fB(e){this.exit(e)}function dB(){return"["}function E_(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),f(),u(),l+=a.move("]"),l}function hB(){return{enter:{gfmFootnoteCallString:rB,gfmFootnoteCall:sB,gfmFootnoteDefinitionLabelString:aB,gfmFootnoteDefinition:oB},exit:{gfmFootnoteCallString:lB,gfmFootnoteCall:uB,gfmFootnoteDefinitionLabelString:cB,gfmFootnoteDefinition:fB}}}function pB(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:E_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const f=l.createTracker(u);let h=f.move("[^");const d=l.enter("footnoteDefinition"),g=l.enter("label");return h+=f.move(l.safe(l.associationId(r),{before:h,after:"]"})),g(),h+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),h+=f.move((t?`
136
- `:" ")+l.indentLines(l.containerFlow(r,f.current()),t?N_:mB))),d(),h}}function mB(e,t,n){return t===0?e:N_(e,t,n)}function N_(e,t,n){return(n?"":" ")+e}const gB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];C_.peek=wB;function yB(){return{canContainEols:["delete"],enter:{strikethrough:bB},exit:{strikethrough:vB}}}function xB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gB}],handlers:{delete:C_}}}function bB(e){this.enter({type:"delete",children:[]},e)}function vB(e){this.exit(e)}function C_(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function wB(){return"~"}function SB(e){return e.length}function _B(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||SB,l=[],u=[],f=[],h=[];let d=0,g=-1;for(;++g<e.length;){const k=[],N=[];let E=-1;for(e[g].length>d&&(d=e[g].length);++E<e[g].length;){const A=kB(e[g][E]);if(n.alignDelimiters!==!1){const _=a(A);N[E]=_,(h[E]===void 0||_>h[E])&&(h[E]=_)}k.push(A)}u[g]=k,f[g]=N}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)l[m]=Zv(r[m]);else{const k=Zv(r);for(;++m<d;)l[m]=k}m=-1;const x=[],v=[];for(;++m<d;){const k=l[m];let N="",E="";k===99?(N=":",E=":"):k===108?N=":":k===114&&(E=":");let A=n.alignDelimiters===!1?1:Math.max(1,h[m]-N.length-E.length);const _=N+"-".repeat(A)+E;n.alignDelimiters!==!1&&(A=N.length+A+E.length,A>h[m]&&(h[m]=A),v[m]=A),x[m]=_}u.splice(1,0,x),f.splice(1,0,v),g=-1;const w=[];for(;++g<u.length;){const k=u[g],N=f[g];m=-1;const E=[];for(;++m<d;){const A=k[m]||"";let _="",C="";if(n.alignDelimiters!==!1){const B=h[m]-(N[m]||0),T=l[m];T===114?_=" ".repeat(B):T===99?B%2?(_=" ".repeat(B/2+.5),C=" ".repeat(B/2-.5)):(_=" ".repeat(B/2),C=_):C=" ".repeat(B)}n.delimiterStart!==!1&&!m&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||m)&&E.push(" "),n.alignDelimiters!==!1&&E.push(_),E.push(A),n.alignDelimiters!==!1&&E.push(C),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&E.push("|")}w.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return w.join(`
137
- `)}function kB(e){return e==null?"":String(e)}function Zv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function EB(e,t,n,r){const a=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),NB);return a(),u}function NB(e,t,n){return">"+(n?"":" ")+e}function CB(e,t){return Qv(e,t.inConstruct,!0)&&!Qv(e,t.notInConstruct,!1)}function Qv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Kv(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
138
- `&&CB(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
139
- `}function TB(e,t){const n=String(e);let r=n.indexOf(t),a=r,l=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++l>u&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function AB(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function MB(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function jB(e,t,n,r){const a=MB(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(AB(e,n)){const m=n.enter("codeIndented"),x=n.indentLines(l,zB);return m(),x}const f=n.createTracker(r),h=a.repeat(Math.max(TB(l,a)+1,3)),d=n.enter("codeFenced");let g=f.move(h);if(e.lang){const m=n.enter(`codeFencedLang${u}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
140
- `,encode:["`"],...f.current()})),m()}return g+=f.move(`
141
- `),l&&(g+=f.move(l+`
142
- `)),g+=f.move(h),d(),g}function zB(e,t,n){return(n?"":" ")+e}function Mg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function RB(e,t,n,r){const a=Mg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const h=n.createTracker(r);let d=h.move("[");return d+=h.move(n.safe(n.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
143
- `,...h.current()}))),f(),e.title&&(f=n.enter(`title${l}`),d+=h.move(" "+a),d+=h.move(n.safe(e.title,{before:d,after:a,...h.current()})),d+=h.move(a),f()),u(),d}function DB(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function wl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function mf(e,t,n){const r=_a(e),a=_a(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}T_.peek=OB;function T_(e,t,n,r){const a=DB(n),l=n.enter("emphasis"),u=n.createTracker(r),f=u.move(a);let h=u.move(n.containerPhrasing(e,{after:a,before:f,...u.current()}));const d=h.charCodeAt(0),g=mf(r.before.charCodeAt(r.before.length-1),d,a);g.inside&&(h=wl(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=mf(r.after.charCodeAt(0),m,a);x.inside&&(h=h.slice(0,-1)+wl(m));const v=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+v}function OB(e,t,n){return n.options.emphasis||"*"}function LB(e,t){let n=!1;return Tg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Mm}),!!((!e.depth||e.depth<3)&&wg(e)&&(t.options.setext||n))}function BB(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(LB(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),x=n.containerPhrasing(e,{...l.current(),before:`
144
- `,after:`
145
- `});return m(),g(),x+`
146
- `+(a===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
147
- `))+1))}const u="#".repeat(a),f=n.enter("headingAtx"),h=n.enter("phrasing");l.move(u+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
148
- `,...l.current()});return/^[\t ]/.test(d)&&(d=wl(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,n.options.closeAtx&&(d+=" "+u),h(),f(),d}A_.peek=HB;function A_(e){return e.value||""}function HB(){return"<"}M_.peek=UB;function M_(e,t,n,r){const a=Mg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const h=n.createTracker(r);let d=h.move("![");return d+=h.move(n.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(f=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=n.enter(`title${l}`),d+=h.move(" "+a),d+=h.move(n.safe(e.title,{before:d,after:a,...h.current()})),d+=h.move(a),f()),d+=h.move(")"),u(),d}function UB(){return"!"}j_.peek=IB;function j_(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(r);let h=f.move("![");const d=n.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return u(),n.stack=g,l(),a==="full"||!d||d!==m?h+=f.move(m+"]"):a==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function IB(){return"!"}z_.peek=qB;function z_(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const u=n.unsafe[l],f=n.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(r);){let d=h.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(h.index+1)}}return a+r+a}function qB(){return"`"}function R_(e,t){const n=wg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}D_.peek=$B;function D_(e,t,n,r){const a=Mg(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let f,h;if(R_(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let m=u.move("<");return m+=u.move(n.containerPhrasing(e,{before:m,after:">",...u.current()})),m+=u.move(">"),f(),n.stack=g,m}f=n.enter("link"),h=n.enter("label");let d=u.move("[");return d+=u.move(n.containerPhrasing(e,{before:d,after:"](",...u.current()})),d+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(n.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(h=n.enter("destinationRaw"),d+=u.move(n.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=n.enter(`title${l}`),d+=u.move(" "+a),d+=u.move(n.safe(e.title,{before:d,after:a,...u.current()})),d+=u.move(a),h()),d+=u.move(")"),f(),d}function $B(e,t,n){return R_(e,n)?"<":"["}O_.peek=PB;function O_(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(r);let h=f.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(d+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return u(),n.stack=g,l(),a==="full"||!d||d!==m?h+=f.move(m+"]"):a==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function PB(){return"["}function jg(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function VB(e){const t=jg(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function FB(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function L_(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function YB(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?FB(n):jg(n);const f=e.ordered?u==="."?")":".":VB(n);let h=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),L_(n)===u&&g){let m=-1;for(;++m<e.children.length;){const x=e.children[m];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),n.bulletCurrent=u;const d=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),d}function XB(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function GB(e,t,n,r){const a=XB(n);let l=n.bulletCurrent||jg(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(r);f.move(l+" ".repeat(u-l.length)),f.shift(u);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,f.current()),g);return h(),d;function g(m,x,v){return x?(v?"":" ".repeat(u))+m:(v?l:l+" ".repeat(u-l.length))+m}}function ZB(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const QB=$f(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function KB(e,t,n,r){return(e.children.some(function(u){return QB(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function JB(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}B_.peek=WB;function B_(e,t,n,r){const a=JB(n),l=n.enter("strong"),u=n.createTracker(r),f=u.move(a+a);let h=u.move(n.containerPhrasing(e,{after:a,before:f,...u.current()}));const d=h.charCodeAt(0),g=mf(r.before.charCodeAt(r.before.length-1),d,a);g.inside&&(h=wl(d)+h.slice(1));const m=h.charCodeAt(h.length-1),x=mf(r.after.charCodeAt(0),m,a);x.inside&&(h=h.slice(0,-1)+wl(m));const v=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+h+v}function WB(e,t,n){return n.options.strong||"*"}function e8(e,t,n,r){return n.safe(e.value,r)}function t8(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function n8(e,t,n){const r=(L_(n)+(n.options.ruleSpaces?" ":"")).repeat(t8(n));return n.options.ruleSpaces?r.slice(0,-1):r}const H_={blockquote:EB,break:Kv,code:jB,definition:RB,emphasis:T_,hardBreak:Kv,heading:BB,html:A_,image:M_,imageReference:j_,inlineCode:z_,link:D_,linkReference:O_,list:YB,listItem:GB,paragraph:ZB,root:KB,strong:B_,text:e8,thematicBreak:n8};function i8(){return{enter:{table:r8,tableData:Jv,tableHeader:Jv,tableRow:a8},exit:{codeText:o8,table:s8,tableData:Gp,tableHeader:Gp,tableRow:Gp}}}function r8(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function s8(e){this.exit(e),this.data.inTable=void 0}function a8(e){this.enter({type:"tableRow",children:[]},e)}function Gp(e){this.exit(e)}function Jv(e){this.enter({type:"tableCell",children:[]},e)}function o8(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,l8));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function l8(e,t){return t==="|"?t:e}function u8(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
149
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:h,tableRow:f}};function u(v,w,k,N){return d(g(v,k,N),v.align)}function f(v,w,k,N){const E=m(v,k,N),A=d([E]);return A.slice(0,A.indexOf(`
150
- `))}function h(v,w,k,N){const E=k.enter("tableCell"),A=k.enter("phrasing"),_=k.containerPhrasing(v,{...N,before:l,after:l});return A(),E(),_}function d(v,w){return _B(v,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function g(v,w,k){const N=v.children;let E=-1;const A=[],_=w.enter("table");for(;++E<N.length;)A[E]=m(N[E],w,k);return _(),A}function m(v,w,k){const N=v.children;let E=-1;const A=[],_=w.enter("tableRow");for(;++E<N.length;)A[E]=h(N[E],v,w,k);return _(),A}function x(v,w,k){let N=H_.inlineCode(v,w,k);return k.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function c8(){return{exit:{taskListCheckValueChecked:Wv,taskListCheckValueUnchecked:Wv,paragraph:d8}}}function f8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:h8}}}function Wv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function d8(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let l=-1,u;for(;++l<a.length;){const f=a[l];if(f.type==="paragraph"){u=f;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function h8(e,t,n,r){const a=e.children[0],l=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(r);l&&f.move(u);let h=H_.listItem(e,t,n,{...r,...f.current()});return l&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(g){return g+u}}function p8(){return[YL(),hB(),yB(),i8(),c8()]}function m8(e){return{extensions:[XL(),pB(e),xB(),u8(e),f8()]}}const g8={tokenize:S8,partial:!0},U_={tokenize:_8,partial:!0},I_={tokenize:k8,partial:!0},q_={tokenize:E8,partial:!0},y8={tokenize:N8,partial:!0},$_={name:"wwwAutolink",tokenize:v8,previous:V_},P_={name:"protocolAutolink",tokenize:w8,previous:F_},Fi={name:"emailAutolink",tokenize:b8,previous:Y_},hi={};function x8(){return{text:hi}}let ts=48;for(;ts<123;)hi[ts]=Fi,ts++,ts===58?ts=65:ts===91&&(ts=97);hi[43]=Fi;hi[45]=Fi;hi[46]=Fi;hi[95]=Fi;hi[72]=[Fi,P_];hi[104]=[Fi,P_];hi[87]=[Fi,$_];hi[119]=[Fi,$_];function b8(e,t,n){const r=this;let a,l;return u;function u(m){return!Dm(m)||!Y_.call(r,r.previous)||zg(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return Dm(m)?(e.consume(m),f):m===64?(e.consume(m),h):n(m)}function h(m){return m===46?e.check(y8,g,d)(m):m===45||m===95||$t(m)?(l=!0,e.consume(m),h):g(m)}function d(m){return e.consume(m),a=!0,h}function g(m){return l&&a&&Zt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function v8(e,t,n){const r=this;return a;function a(u){return u!==87&&u!==119||!V_.call(r,r.previous)||zg(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(g8,e.attempt(U_,e.attempt(I_,l),n),n)(u))}function l(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function w8(e,t,n){const r=this;let a="",l=!1;return u;function u(m){return(m===72||m===104)&&F_.call(r,r.previous)&&!zg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),f):n(m)}function f(m){if(Zt(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),f;if(m===58){const x=a.toLowerCase();if(x==="http"||x==="https")return e.consume(m),h}return n(m)}function h(m){return m===47?(e.consume(m),l?d:(l=!0,h)):n(m)}function d(m){return m===null||df(m)||st(m)||fs(m)||Uf(m)?n(m):e.attempt(U_,e.attempt(I_,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function S8(e,t,n){let r=0;return a;function a(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),a):u===46&&r===3?(e.consume(u),l):n(u)}function l(u){return u===null?n(u):t(u)}}function _8(e,t,n){let r,a,l;return u;function u(d){return d===46||d===95?e.check(q_,h,f)(d):d===null||st(d)||fs(d)||d!==45&&Uf(d)?h(d):(l=!0,e.consume(d),u)}function f(d){return d===95?r=!0:(a=r,r=void 0),e.consume(d),u}function h(d){return a||r||!l?n(d):t(d)}}function k8(e,t){let n=0,r=0;return a;function a(u){return u===40?(n++,e.consume(u),a):u===41&&r<n?l(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(q_,t,l)(u):u===null||st(u)||fs(u)?t(u):(e.consume(u),a)}function l(u){return u===41&&r++,e.consume(u),a}}function E8(e,t,n){return r;function r(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),r):f===38?(e.consume(f),l):f===93?(e.consume(f),a):f===60||f===null||st(f)||fs(f)?t(f):n(f)}function a(f){return f===null||f===40||f===91||st(f)||fs(f)?t(f):r(f)}function l(f){return Zt(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),r):Zt(f)?(e.consume(f),u):n(f)}}function N8(e,t,n){return r;function r(l){return e.consume(l),a}function a(l){return $t(l)?n(l):t(l)}}function V_(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function F_(e){return!Zt(e)}function Y_(e){return!(e===47||Dm(e))}function Dm(e){return e===43||e===45||e===46||e===95||$t(e)}function zg(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const C8={tokenize:O8,partial:!0};function T8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:z8,continuation:{tokenize:R8},exit:D8}},text:{91:{name:"gfmFootnoteCall",tokenize:j8},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:A8,resolveTo:M8}}}}function A8(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const h=r.events[a][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return n(h);const d=Zn(r.sliceSerialize({start:u.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function M8(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},f=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...f),e}function j8(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return f;function f(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),h}function h(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(l>999||m===93&&!u||m===null||m===91||st(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return a.includes(Zn(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return st(m)||(u=!0),l++,e.consume(m),m===92?g:d}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function z8(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,f;return h;function h(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||st(w))return n(w);if(w===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return l=Zn(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return st(w)||(f=!0),u++,e.consume(w),w===92?m:g}function m(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(l)||a.push(l),Fe(e,v,"gfmFootnoteDefinitionWhitespace")):n(w)}function v(w){return t(w)}}function R8(e,t,n){return e.check(Dl,t,e.attempt(C8,t,n))}function D8(e){e.exit("gfmFootnoteDefinition")}function O8(e,t,n){const r=this;return Fe(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function L8(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let d=h;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[h][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[h][1].end)},m={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[h][1].start)},x=[["enter",g,f],["enter",u[d][1],f],["exit",u[d][1],f],["enter",m,f]],v=f.parser.constructs.insideSpan.null;v&&_n(x,x.length,0,If(v,u.slice(d+1,h),f)),_n(x,x.length,0,[["exit",m,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",g,f]]),_n(u,d-1,h-d+3,x),h=d+x.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function l(u,f,h){const d=this.previous,g=this.events;let m=0;return x;function x(w){return d===126&&g[g.length-1][1].type!=="characterEscape"?h(w):(u.enter("strikethroughSequenceTemporary"),v(w))}function v(w){const k=_a(d);if(w===126)return m>1?h(w):(u.consume(w),m++,v);if(m<2&&!n)return h(w);const N=u.exit("strikethroughSequenceTemporary"),E=_a(w);return N._open=!E||E===2&&!!k,N._close=!k||k===2&&!!E,f(w)}}}class B8{constructor(){this.map=[]}add(t,n,r){H8(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function H8(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function U8(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function I8(){return{flow:{null:{name:"table",tokenize:q8,resolveAll:$8}}}}function q8(e,t,n){const r=this;let a=0,l=0,u;return f;function f(H){let q=r.events.length-1;for(;q>-1;){const O=r.events[q][1].type;if(O==="lineEnding"||O==="linePrefix")q--;else break}const P=q>-1?r.events[q][1].type:null,te=P==="tableHead"||P==="tableRow"?T:h;return te===T&&r.parser.lazy[r.now().line]?n(H):te(H)}function h(H){return e.enter("tableHead"),e.enter("tableRow"),d(H)}function d(H){return H===124||(u=!0,l+=1),g(H)}function g(H){return H===null?n(H):Se(H)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),v):n(H):He(H)?Fe(e,g,"whitespace")(H):(l+=1,u&&(u=!1,a+=1),H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),m(H)))}function m(H){return H===null||H===124||st(H)?(e.exit("data"),g(H)):(e.consume(H),H===92?x:m)}function x(H){return H===92||H===124?(e.consume(H),m):m(H)}function v(H){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(H):(e.enter("tableDelimiterRow"),u=!1,He(H)?Fe(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):w(H))}function w(H){return H===45||H===58?N(H):H===124?(u=!0,e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),k):B(H)}function k(H){return He(H)?Fe(e,N,"whitespace")(H):N(H)}function N(H){return H===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),E):H===45?(l+=1,E(H)):H===null||Se(H)?C(H):B(H)}function E(H){return H===45?(e.enter("tableDelimiterFiller"),A(H)):B(H)}function A(H){return H===45?(e.consume(H),A):H===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(H),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(H))}function _(H){return He(H)?Fe(e,C,"whitespace")(H):C(H)}function C(H){return H===124?w(H):H===null||Se(H)?!u||a!==l?B(H):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(H)):B(H)}function B(H){return n(H)}function T(H){return e.enter("tableRow"),L(H)}function L(H){return H===124?(e.enter("tableCellDivider"),e.consume(H),e.exit("tableCellDivider"),L):H===null||Se(H)?(e.exit("tableRow"),t(H)):He(H)?Fe(e,L,"whitespace")(H):(e.enter("data"),G(H))}function G(H){return H===null||H===124||st(H)?(e.exit("data"),L(H)):(e.consume(H),H===92?Z:G)}function Z(H){return H===92||H===124?(e.consume(H),G):G(H)}}function $8(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,d,g,m;const x=new B8;for(;++n<e.length;){const v=e[n],w=v[1];v[0]==="enter"?w.type==="tableHead"?(f=!1,h!==0&&(ew(x,t,h,d,g),g=void 0,h=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,m=void 0,l=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",g,t]])),a=w.type==="tableDelimiterRow"?2:g?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(l[1]!==0&&(u[0]=u[1],m=Dc(x,t,l,a,void 0,m),l=[0,0,0,0]),u[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(u[0]=u[1],m=Dc(x,t,l,a,void 0,m)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(f=!0,h=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(h=n,l[1]!==0?(u[0]=u[1],m=Dc(x,t,l,a,n,m)):u[1]!==0&&(m=Dc(x,t,u,a,n,m)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(h!==0&&ew(x,t,h,d,g),x.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=U8(t.events,n))}return e}function Dc(e,t,n,r,a,l){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(l.end=Object.assign({},oa(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const h=oa(t.events,n[1]);if(l={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=oa(t.events,n[2]),g=oa(t.events,n[3]),m={type:f,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const x=t.events[n[2]],v=t.events[n[3]];if(x[1].end=Object.assign({},v[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,k=n[3]-n[2]-1;e.add(w,k,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(l.end=Object.assign({},oa(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function ew(e,t,n,r,a){const l=[],u=oa(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function oa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const P8={name:"tasklistCheck",tokenize:F8};function V8(){return{text:{91:P8}}}function F8(e,t,n){const r=this;return a;function a(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),l)}function l(h){return st(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):n(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(h)}function f(h){return Se(h)?t(h):He(h)?e.check({tokenize:Y8},t,n)(h):n(h)}}function Y8(e,t,n){return Fe(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function X8(e){return i_([x8(),T8(),L8(e),I8(),V8()])}const G8={};function tw(e){const t=this,n=e||G8,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(X8(n)),l.push(p8()),u.push(m8(n))}function Z8(){const{isRunning:e,results:t,workflowResults:n,logs:r}=ka(),{nodes:a,selectedNodeId:l,updateNode:u}=ci(),f=ci(t2),{execute:h,savedOutputDir:d}=B2(),[g,m]=X.useState("");X.useEffect(()=>{if(f?.type==="input"){const A=f.data;m(A.value||"")}},[l,f]);const x=a.filter(A=>A.type==="output"),v=x.length>0?t.get(x[0].id):null,w=f?.type==="input",k=w?f.data:null,N=A=>{m(A),l&&u(l,{value:A})},E=()=>{h()};return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(KS,{className:"w-5 h-5 text-gray-400"}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&b.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&b.jsx("div",{className:"p-4 border-b border-border",children:b.jsx("div",{className:"space-y-3",children:a.map(A=>b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:`w-2 h-2 rounded-full ${A.data.status==="completed"?"bg-green-500":A.data.status==="running"?"bg-blue-500 animate-pulse":A.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),b.jsx("span",{className:"text-sm text-gray-300",children:A.data.label}),A.data.status==="running"&&A.data.progress!==void 0&&b.jsxs("span",{className:"text-xs text-gray-500",children:[A.data.progress,"%"]})]},A.id))})}),b.jsxs("div",{className:"p-4 border-b border-border",children:[b.jsxs("button",{onClick:E,disabled:e||a.length===0,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-amber-600 hover:bg-amber-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors",children:[b.jsx(gl,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),a.length===0&&b.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),b.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[w&&k&&b.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(jf,{className:"w-5 h-5 text-amber-500"}),b.jsx("h4",{className:"text-md font-medium text-white",children:k.label})]}),k.inputType==="text"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm text-gray-400",children:k.description||"Enter your input"}),b.jsx("textarea",{className:"w-full h-32 px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-amber-500 focus:border-transparent resize-none",placeholder:k.placeholder||"Type your message here...",value:g||k.value||"",onChange:A=>N(A.target.value)})]}),k.inputType==="file"&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm text-gray-400",children:k.description||"Upload a file"}),b.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-gray-600 rounded-lg hover:border-amber-500 transition-colors cursor-pointer",children:[b.jsx(Oj,{className:"w-8 h-8 text-gray-500 mb-2"}),b.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),k.fileTypes&&b.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",k.fileTypes.join(", ")]})]})]}),k.inputType==="select"&&k.options&&b.jsxs("div",{className:"space-y-2",children:[b.jsx("label",{className:"text-sm text-gray-400",children:k.description||"Select an option"}),b.jsxs("select",{className:"w-full px-3 py-2 text-sm bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-amber-500",value:g||k.value||"",onChange:A=>N(A.target.value),children:[b.jsx("option",{value:"",children:"Select..."}),k.options.map(A=>b.jsx("option",{value:A,children:A},A))]})]})]}),d&&b.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.jsx(mm,{className:"w-5 h-5 text-green-400"}),b.jsx("h4",{className:"text-sm font-medium text-green-300",children:"파일 저장 완료"})]}),b.jsx("p",{className:"text-xs text-gray-400 break-all",children:d})]}),n.length>0?b.jsx("div",{className:"space-y-4",children:n.map(A=>b.jsxs("div",{className:`p-4 rounded-lg border ${A.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[b.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[A.success?b.jsx(Mf,{className:"w-5 h-5 text-green-500"}):b.jsx(ag,{className:"w-5 h-5 text-red-500"}),b.jsx("h5",{className:"text-sm font-medium text-white",children:A.label})]}),A.error&&b.jsx("p",{className:"text-sm text-red-400 mb-3",children:A.error}),A.files&&A.files.length>0&&b.jsxs("div",{className:"space-y-2 mb-3",children:[b.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),A.files.map((_,C)=>b.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[_.type==="image"?b.jsx(JS,{className:"w-4 h-4 text-purple-400"}):b.jsx(ml,{className:"w-4 h-4 text-blue-400"}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm text-white truncate",children:_.name}),b.jsx("p",{className:"text-xs text-gray-500 truncate",children:_.path})]})]},C))]}),A.result&&b.jsxs("details",{className:"group",open:!0,children:[b.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),b.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:b.jsx("div",{className:"markdown-content text-sm",children:b.jsx(Xv,{remarkPlugins:[tw],children:A.result.length>2e3?A.result.substring(0,2e3)+"...":A.result})})})]})]},A.nodeId))}):v?b.jsx("div",{className:"markdown-content",children:b.jsx(Xv,{remarkPlugins:[tw],children:typeof v=="string"?v:JSON.stringify(v,null,2)})}):r.length>0?b.jsxs("div",{className:"space-y-2",children:[b.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),r.slice(-20).map(A=>b.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[b.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(A.timestamp).toLocaleTimeString("ko-KR")}),b.jsx("span",{className:A.level==="error"?"text-red-400":A.level==="warning"?"text-yellow-400":A.level==="success"?"text-green-400":"text-gray-300",children:A.message})]},A.id))]}):b.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[b.jsx(ml,{className:"w-12 h-12 mb-4 opacity-50"}),b.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),b.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]})]})}function X_({level:e}){switch(e){case"success":return b.jsx(Mf,{className:"w-4 h-4 text-green-400"});case"error":return b.jsx(ag,{className:"w-4 h-4 text-red-400"});case"warning":return b.jsx(Rj,{className:"w-4 h-4 text-yellow-400"});default:return b.jsx(aj,{className:"w-4 h-4 text-blue-400"})}}function G_(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Q8({isOpen:e,onClose:t}){const{logs:n,clearLogs:r,isRunning:a}=ka(),[l,u]=X.useState(!1),[f,h]=X.useState(250),d=X.useRef(null);X.useEffect(()=>{d.current&&!l&&d.current.scrollIntoView({behavior:"smooth"})},[n,l]);const g=m=>{m.preventDefault();const x=m.clientY,v=f,w=N=>{const E=x-N.clientY,A=Math.min(Math.max(v+E,100),500);h(A)},k=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",k)};return e?b.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-[#1a1a1a] border-t border-gray-700 z-50 shadow-2xl",style:{height:l?40:f},children:[!l&&b.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),b.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(ds,{className:"w-4 h-4 text-amber-500"}),b.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),a&&b.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[b.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),b.jsxs("span",{className:"text-xs text-gray-500",children:["(",n.length," logs)"]})]}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("button",{onClick:r,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:b.jsx(yl,{className:"w-4 h-4 text-gray-400"})}),b.jsx("button",{onClick:()=>u(!l),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:l?"Expand":"Minimize",children:l?b.jsx($5,{className:"w-4 h-4 text-gray-400"}):b.jsx(QS,{className:"w-4 h-4 text-gray-400"})}),b.jsx("button",{onClick:()=>h(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?b.jsx(gj,{className:"w-4 h-4 text-gray-400"}):b.jsx(hj,{className:"w-4 h-4 text-gray-400"})}),b.jsx("button",{onClick:t,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:b.jsx(og,{className:"w-4 h-4 text-gray-400"})})]})]}),!l&&b.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:n.length===0?b.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:b.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):b.jsxs("div",{className:"space-y-1",children:[n.map(m=>b.jsxs("div",{className:Gt("flex items-start gap-2 px-2 py-1 rounded hover:bg-gray-800/50",m.level==="error"&&"bg-red-500/10",m.level==="warning"&&"bg-yellow-500/10",m.level==="success"&&"bg-green-500/10"),children:[b.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",G_(m.timestamp),"]"]}),b.jsx(X_,{level:m.level}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("span",{className:Gt("text-xs",m.level==="error"&&"text-red-400",m.level==="warning"&&"text-yellow-400",m.level==="success"&&"text-green-400",m.level==="info"&&"text-gray-300"),children:m.message}),m.nodeId&&b.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&b.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof m.details=="string"?m.details:JSON.stringify(m.details,null,2)})]})]},m.id)),b.jsx("div",{ref:d})]})})]}):null}function K8(){const{logs:e,clearLogs:t,isRunning:n}=ka(),r=X.useRef(null);return X.useEffect(()=>{r.current&&r.current.scrollIntoView({behavior:"smooth"})},[e]),b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(ds,{className:"w-5 h-5 text-amber-500"}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),n&&b.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[b.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),b.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),b.jsx("button",{onClick:t,className:"p-2 text-gray-400 hover:text-white hover:bg-surface-hover rounded-lg transition-colors",title:"Clear logs",children:b.jsx(yl,{className:"w-4 h-4"})})]}),b.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?b.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:b.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):b.jsxs("div",{className:"space-y-1",children:[e.map(a=>b.jsxs("div",{className:Gt("flex items-start gap-2 px-2 py-1 rounded hover:bg-surface-hover",a.level==="error"&&"bg-red-500/10",a.level==="warning"&&"bg-yellow-500/10",a.level==="success"&&"bg-green-500/10"),children:[b.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",G_(a.timestamp),"]"]}),b.jsx(X_,{level:a.level}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("span",{className:Gt("text-xs",a.level==="error"&&"text-red-400",a.level==="warning"&&"text-yellow-400",a.level==="success"&&"text-green-400",a.level==="info"&&"text-gray-300"),children:a.message}),a.nodeId&&b.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",a.nodeId.slice(0,8),"]"]}),a.details&&b.jsx("pre",{className:"mt-1 p-2 bg-black/30 rounded text-xs text-gray-400 overflow-x-auto",children:typeof a.details=="string"?a.details:JSON.stringify(a.details,null,2)})]})]},a.id)),b.jsx("div",{ref:r})]})})]})}const J8=["Read","Write","Edit","Bash","Glob","Grep","WebSearch","WebFetch","Task","TodoWrite"],W8=[{id:"image-gen-nanobanana",name:"Image Generator",description:"Google Gemini API를 사용한 AI 이미지 생성",keywords:["이미지","image","그림","사진","picture","illustration","graphic"]},{id:"ppt-generator",name:"PPT Generator",description:"한국어에 최적화된 미니멀 프레젠테이션 생성",keywords:["ppt","발표","presentation","slides","powerpoint","슬라이드"]},{id:"video-gen-veo3",name:"Video Generator",description:"Google Veo3 API를 사용한 AI 영상 생성",keywords:["영상","video","동영상","animation","애니메이션"]},{id:"pdf",name:"PDF",description:"PDF 텍스트 추출, 생성, 병합/분할, 폼 처리",keywords:["pdf","문서","document"]},{id:"docx",name:"Word Document",description:"Word 문서 생성, 편집, 변경 추적, 주석",keywords:["워드","docx","word","한글","문서"]},{id:"xlsx",name:"Excel",description:"스프레드시트 생성, 편집, 수식, 데이터 분석",keywords:["엑셀","xlsx","excel","스프레드시트","spreadsheet","표"]},{id:"pptx",name:"PowerPoint",description:"PPT 생성, 편집, 레이아웃, 스피커 노트",keywords:["pptx","powerpoint","presentation"]},{id:"git-commit-push",name:"Git Commit/Push",description:"Git 변경사항 분석, 커밋 메시지 작성, 푸시/PR 생성",keywords:["git","commit","push","pr","pull request","커밋","푸시"]}],e9=[{id:"sonnet",name:"Claude 4 Sonnet",description:"Fast, cost-efficient"},{id:"opus",name:"Claude 4.5 Opus",description:"Best for complex tasks"},{id:"haiku",name:"Claude 3.5 Haiku",description:"Fastest, for simple tasks"}];function t9(e){switch(e){case"input":return b.jsx(jf,{className:"w-5 h-5 text-yellow-400"});case"subagent":return b.jsx(Al,{className:"w-5 h-5 text-purple-400"});case"skill":return b.jsx(zf,{className:"w-5 h-5 text-cyan-400"});case"command":return b.jsx(ds,{className:"w-5 h-5 text-orange-400"});case"hook":return b.jsx(sg,{className:"w-5 h-5 text-pink-400"});case"output":return b.jsx(Af,{className:"w-5 h-5 text-emerald-400"});default:return null}}function n9(e){switch(e){case"input":return"User Input";case"subagent":return"Sub Agent";case"skill":return"Skill";case"command":return"Command";case"hook":return"Hook";case"output":return"Output";default:return"Node"}}function i9({node:e}){const{updateNode:t,removeNode:n,nodes:r}=ci(),[a,l]=X.useState(!1),u=X.useRef(null),f=X.useCallback(v=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{q2(v).catch(w=>{console.error("Failed to sync node to filesystem:",w)})},500)},[]);if(X.useEffect(()=>(e&&e.type!=="input"&&e.type!=="output"&&f(e),()=>{u.current&&clearTimeout(u.current)}),[e,f]),!e)return b.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[b.jsx(Cj,{className:"w-12 h-12 mb-4 opacity-50"}),b.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const h=()=>{e.type!=="input"&&e.type!=="output"?l(!0):n(e.id)},d=()=>{$2(e,r).catch(v=>{console.error("Failed to delete node from filesystem:",v)}),n(e.id),l(!1)},g=()=>{l(!1)},m=v=>{t(e.id,{label:v})},x=v=>{t(e.id,{description:v})};return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("div",{className:"p-2 rounded-lg bg-surface",children:t9(e.type)}),b.jsxs("div",{children:[b.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),b.jsx("p",{className:"text-xs text-gray-500",children:n9(e.type)})]})]}),b.jsx("button",{onClick:h,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:b.jsx(yl,{className:"w-4 h-4"})})]}),b.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),b.jsx("input",{type:"text",value:e.data.label,onChange:v=>m(v.target.value),className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),b.jsx("textarea",{value:e.data.description||"",onChange:v=>x(v.target.value),rows:4,placeholder:e.type==="subagent"?"Enter instructions for this agent...":"Describe what this step does...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent transition-all resize-none"})]}),e.type==="input"&&b.jsx(r9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="subagent"&&b.jsx(s9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="skill"&&b.jsx(a9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="command"&&b.jsx(o9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="hook"&&b.jsx(l9,{data:e.data,onUpdate:v=>t(e.id,v)}),e.type==="output"&&b.jsx(u9,{onUpdate:v=>t(e.id,v)})]}),a&&b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:b.jsxs("div",{className:"bg-zinc-800 rounded-lg p-6 max-w-md w-full mx-4 border border-zinc-700 shadow-xl",children:[b.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[b.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/20 flex items-center justify-center",children:b.jsx(yl,{className:"w-5 h-5 text-red-400"})}),b.jsx("h3",{className:"text-lg font-semibold text-white",children:"노드 삭제 확인"})]}),b.jsxs("p",{className:"text-zinc-300 mb-4",children:[b.jsx("span",{className:"font-medium text-white",children:e.data.label})," 노드를 삭제하시겠습니까?",b.jsx("br",{}),b.jsx("span",{className:"text-red-400 text-sm",children:"이 작업은 파일을 삭제하며 되돌릴 수 없습니다."})]}),b.jsxs("div",{className:"flex gap-3 justify-end",children:[b.jsx("button",{onClick:g,className:"px-4 py-2 rounded-md bg-zinc-700 text-zinc-300 hover:bg-zinc-600 transition-colors",children:"취소"}),b.jsx("button",{onClick:d,className:"px-4 py-2 rounded-md bg-red-600 text-white hover:bg-red-500 transition-colors",children:"삭제"})]})]})})]})}function r9({data:e,onUpdate:t}){return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),b.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(n=>b.jsx("button",{onClick:()=>t({inputType:n}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.inputType===n?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),b.jsx("textarea",{value:e.value||"",onChange:n=>t({value:n.target.value}),rows:3,placeholder:"Enter default value...",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function s9({data:e,onUpdate:t}){return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),b.jsx("div",{className:"space-y-2",children:e9.map(n=>b.jsxs("button",{onClick:()=>t({model:n.id}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors ${e.model===n.id?"bg-accent/20 border-accent":"bg-surface-hover border-border hover:border-gray-500"}`,children:[b.jsx(Al,{className:"w-5 h-5 text-purple-400"}),b.jsxs("div",{className:"text-left",children:[b.jsx("div",{className:"font-medium text-white",children:n.name}),b.jsx("div",{className:"text-xs text-gray-500",children:n.description})]})]},n.id))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),b.jsx("div",{className:"grid grid-cols-2 gap-2",children:J8.map(n=>b.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[b.jsx("input",{type:"checkbox",checked:e.tools?.includes(n)??!1,onChange:r=>{const a=r.target.checked?[...e.tools||[],n]:(e.tools||[]).filter(l=>l!==n);t({tools:a})},className:"rounded border-gray-600 bg-surface text-accent focus:ring-accent"}),b.jsx("span",{className:"text-sm text-gray-300",children:n})]},n))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),b.jsx("textarea",{value:e.systemPrompt||"",onChange:n=>t({systemPrompt:n.target.value}),rows:4,placeholder:"Enter custom instructions for this agent...",className:"w-full px-3 py-2 bg-surface-hover border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent resize-none"})]})]})}function a9({data:e,onUpdate:t}){const[n,r]=X.useState([]),[a,l]=X.useState(!1),[u,f]=X.useState(null),[h,d]=X.useState(""),[g,m]=X.useState(!1),[x,v]=X.useState(null);X.useEffect(()=>{e.skillType==="generated"&&e.skillPath&&(l(!0),fetch(`/api/skill/files?path=${encodeURIComponent(e.skillPath)}`).then(k=>k.json()).then(k=>{r(k.files||[]),k.files?.length>0&&f(k.files[0].name)}).catch(k=>{console.error("Failed to load skill files:",k)}).finally(()=>l(!1)))},[e.skillPath,e.skillType]);const w=async()=>{if(e.skillPath){m(!0),v(null);try{const k=h.trim()?h.trim().split(/\s+/):[],E=await(await fetch("/api/skill/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillPath:e.skillPath,args:k})})).json();v(E)}catch(k){v({success:!1,error:k instanceof Error?k.message:"Unknown error"})}finally{m(!1)}}};return e.skillType==="generated"&&e.skillPath?b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Path"}),b.jsx("div",{className:"px-3 py-2 bg-surface border border-border rounded-lg text-gray-400 text-sm font-mono break-all",children:e.skillPath})]}),b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[b.jsx(W5,{className:"w-4 h-4 inline mr-1"}),"Files Preview"]}),a?b.jsxs("div",{className:"flex items-center justify-center py-8 text-gray-500",children:[b.jsx(lf,{className:"w-5 h-5 animate-spin mr-2"}),"파일 로딩 중..."]}):n.length===0?b.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"파일을 찾을 수 없습니다"}):b.jsx("div",{className:"space-y-2",children:n.map(k=>b.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[b.jsxs("button",{onClick:()=>f(u===k.name?null:k.name),className:"w-full flex items-center justify-between px-3 py-2 bg-surface-hover hover:bg-border transition-colors",children:[b.jsx("span",{className:"text-sm text-white font-medium",children:k.name}),u===k.name?b.jsx(QS,{className:"w-4 h-4 text-gray-400"}):b.jsx(I5,{className:"w-4 h-4 text-gray-400"})]}),u===k.name&&b.jsx("pre",{className:"p-3 bg-[#0d1117] text-xs text-gray-300 overflow-x-auto max-h-64 overflow-y-auto font-mono",children:k.content})]},k.name))})]}),b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[b.jsx(gl,{className:"w-4 h-4 inline mr-1"}),"Test Skill"]}),b.jsxs("div",{className:"space-y-3",children:[b.jsx("div",{children:b.jsx("input",{type:"text",value:h,onChange:k=>d(k.target.value),placeholder:"Arguments (optional, space-separated)",className:"w-full px-3 py-2 bg-surface border border-border rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-accent"})}),b.jsx("button",{onClick:w,disabled:g,className:`w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-lg font-medium transition-colors ${g?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-cyan-600 hover:bg-cyan-700 text-white"}`,children:g?b.jsxs(b.Fragment,{children:[b.jsx(lf,{className:"w-4 h-4 animate-spin"}),"실행 중..."]}):b.jsxs(b.Fragment,{children:[b.jsx(gl,{className:"w-4 h-4"}),"테스트 실행"]})}),x&&b.jsxs("div",{className:`p-3 rounded-lg border ${x.success?"bg-green-500/10 border-green-500/30":"bg-red-500/10 border-red-500/30"}`,children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.success?b.jsx(Mf,{className:"w-4 h-4 text-green-400"}):b.jsx(ag,{className:"w-4 h-4 text-red-400"}),b.jsxs("span",{className:`text-sm font-medium ${x.success?"text-green-400":"text-red-400"}`,children:[x.success?"성공":"실패",x.exitCode!==void 0&&` (exit code: ${x.exitCode})`]})]}),x.stdout&&b.jsxs("div",{className:"mb-2",children:[b.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output:"}),b.jsx("pre",{className:"p-2 bg-black/30 rounded text-xs text-gray-300 overflow-x-auto max-h-32 overflow-y-auto font-mono whitespace-pre-wrap",children:x.stdout})]}),x.stderr&&b.jsxs("div",{children:[b.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Error:"}),b.jsx("pre",{className:"p-2 bg-black/30 rounded text-xs text-red-400 overflow-x-auto max-h-32 overflow-y-auto font-mono whitespace-pre-wrap",children:x.stderr})]}),x.error&&b.jsx("div",{className:"text-sm text-red-400",children:x.error})]})]})]})]}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),b.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(k=>b.jsx("button",{onClick:()=>t({skillType:k}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===k?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:k.charAt(0).toUpperCase()+k.slice(1)},k))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),b.jsx("div",{className:"space-y-2",children:W8.map(k=>b.jsxs("button",{onClick:()=>t({skillId:k.id,description:k.description}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===k.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[b.jsx(zf,{className:"w-5 h-5 text-cyan-400"}),b.jsxs("div",{children:[b.jsx("div",{className:"font-medium text-white",children:k.name}),b.jsx("div",{className:"text-xs text-gray-500",children:k.description})]})]},k.id))})]})]})}function o9({data:e,onUpdate:t}){return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Name"}),b.jsx("input",{type:"text",value:e.commandName||"",onChange:n=>t({commandName:n.target.value}),placeholder:"e.g., commit, review-pr",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"}),b.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Slash command to execute (without /)"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Path (optional)"}),b.jsx("input",{type:"text",value:e.commandPath||"",onChange:n=>t({commandPath:n.target.value}),placeholder:"e.g., .claude/commands/my-command.md",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"})]})]})}function l9({data:e,onUpdate:t}){const n=["PreToolUse","PostToolUse","Notification","Stop"];return b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Event"}),b.jsx("div",{className:"grid grid-cols-2 gap-2",children:n.map(r=>b.jsx("button",{onClick:()=>t({hookEvent:r}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.hookEvent===r?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:r},r))})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),b.jsx("input",{type:"text",value:e.hookMatcher||"",onChange:r=>t({hookMatcher:r.target.value}),placeholder:"e.g., Bash, Write, Edit",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"}),b.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),b.jsx("input",{type:"text",value:e.hookCommand||"",onChange:r=>t({hookCommand:r.target.value}),placeholder:"e.g., npm run lint",className:"w-full px-3 py-2.5 bg-surface border border-border rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-accent"}),b.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Shell command to execute"})]})]})}function u9({onUpdate:e}){const t=[{id:"auto",name:"Auto Format",description:"Automatically format output"},{id:"markdown",name:"Markdown",description:"Plain markdown text"},{id:"document",name:"Document",description:"Formatted document output"}];return b.jsxs("div",{children:[b.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),b.jsx("div",{className:"space-y-2",children:t.map(n=>b.jsxs("button",{onClick:()=>e({layoutType:n.id}),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-surface-hover border-border hover:border-gray-500 transition-colors text-left",children:[b.jsx(Af,{className:"w-5 h-5 text-emerald-400"}),b.jsxs("div",{children:[b.jsx("div",{className:"font-medium text-white",children:n.name}),b.jsx("div",{className:"text-xs text-gray-500",children:n.description})]})]},n.id))})]})}const c9=[{id:"preview",label:"Preview"},{id:"console",label:"Console"},{id:"step",label:"Step"},{id:"theme",label:"Theme"}];function f9(){const{activeTab:e,setActiveTab:t}=Hf(),n=ci(t2);return b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:c9.map(r=>b.jsx("button",{onClick:()=>t(r.id),className:Gt("px-4 py-2 text-sm font-medium rounded-lg transition-colors",e===r.id?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:r.label},r.id))}),b.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&b.jsx(Z8,{}),e==="console"&&b.jsx(K8,{}),e==="step"&&b.jsx(i9,{node:n}),e==="theme"&&b.jsx("div",{className:"p-4 text-gray-500",children:"Theme customization coming soon..."})]})]})}async function d9(e){let t;const{apiMode:n,apiKey:r,proxyUrl:a}=pg.getState(),l={"Content-Type":"application/json","X-API-Mode":n};n==="direct"&&r?l["X-API-Key"]=r:n==="proxy"&&a&&(l["X-Proxy-URL"]=a);try{t=await fetch("/api/generate/workflow",{method:"POST",headers:l,body:JSON.stringify({prompt:e})})}catch{throw new Error("서버에 연결할 수 없습니다. 서버가 실행 중인지 확인하세요.")}if(!t.ok){let h=`서버 오류 (${t.status})`;try{h=(await t.json()).message||h}catch{}throw new Error(h)}let u;try{u=await t.json()}catch{throw new Error("서버 응답을 파싱할 수 없습니다.")}return{workflow:p9(u),workflowName:u.workflowName}}function h9(e,t){if(e.length===0)return e;const n=300,r=150,a=100,l=100,u=new Map,f=new Map;e.forEach(w=>{u.set(w.id,[]),f.set(w.id,[])}),t.forEach(w=>{const k=u.get(w.target)||[];k.push(w.source),u.set(w.target,k);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const h=e.filter(w=>(u.get(w.id)||[]).length===0),d=new Map,g=[];for(h.forEach(w=>{d.set(w.id,0),g.push({id:w.id,depth:0})}),h.length===0&&e.length>0&&(d.set(e[0].id,0),g.push({id:e[0].id,depth:0}));g.length>0;){const w=g.shift();(f.get(w.id)||[]).forEach(N=>{const E=d.get(N),A=w.depth+1;(E===void 0||A>E)&&(d.set(N,A),g.push({id:N,depth:A}))})}const m=new Map;d.forEach((w,k)=>{const N=m.get(w)||[];N.push(k),m.set(w,N)});const x=Math.max(...Array.from(d.values()),0),v=new Map;for(let w=0;w<=x;w++){const k=m.get(w)||[],E=(k.length-1)*r,A=l+(300-E)/2;k.forEach((_,C)=>{v.set(_,{x:a+w*n,y:A+C*r})})}return e.map(w=>{const k=v.get(w.id)||w.position;return{...w,position:k}})}function p9(e){const t=[],n=new Map,r={x:0,y:0};e.nodes.forEach((u,f)=>{const h=Sa();n.set(f,h);const d={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":t.push({id:h,type:"input",position:{...r},data:{...d,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":t.push({id:h,type:"subagent",position:{...r},data:{...d,role:u.config.role||"custom",tools:u.config.tools||["Read","Write"],model:u.config.model||"sonnet",systemPrompt:u.config.systemPrompt}});break;case"skill":t.push({id:h,type:"skill",position:{...r},data:{...d,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"command":t.push({id:h,type:"command",position:{...r},data:{...d,commandName:u.config.commandName||u.label,commandPath:u.config.commandPath}});break;case"hook":t.push({id:h,type:"hook",position:{...r},data:{...d,hookEvent:u.config.hookEvent||"PreToolUse",hookMatcher:u.config.hookMatcher,hookCommand:u.config.hookCommand}});break;case"output":t.push({id:h,type:"output",position:{...r},data:{...d,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=n.get(u.to),h=n.get(u.from);if(f&&h){const d=t.find(g=>g.id===f);d&&d.data.usedInputs&&d.data.usedInputs.push(h)}});const a=e.edges.map(u=>{const f=n.get(u.from),h=n.get(u.to);return!f||!h?null:{id:`e-${f}-${h}`,source:f,target:h,animated:!0}}).filter(u=>u!==null);return{nodes:h9(t,a),edges:a}}function m9(e){const t=e.toLowerCase();if(t.includes("스킬")||t.includes("skill"))return!0;const n=[/만들어\s*(줘|주세요|줘요)/,/작성해\s*(줘|주세요|줘요)/,/생성해\s*(줘|주세요|줘요)/];for(const r of n)if(r.test(e))return!0;return!1}const fi=Object.create(null);fi.open="0";fi.close="1";fi.ping="2";fi.pong="3";fi.message="4";fi.upgrade="5";fi.noop="6";const Yc=Object.create(null);Object.keys(fi).forEach(e=>{Yc[fi[e]]=e});const Om={type:"error",data:"parser error"},Z_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Q_=typeof ArrayBuffer=="function",K_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Rg=({type:e,data:t},n,r)=>Z_&&t instanceof Blob?n?r(t):nw(t,r):Q_&&(t instanceof ArrayBuffer||K_(t))?n?r(t):nw(new Blob([t]),r):r(fi[e]+(t||"")),nw=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function iw(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Zp;function g9(e,t){if(Z_&&e.data instanceof Blob)return e.data.arrayBuffer().then(iw).then(t);if(Q_&&(e.data instanceof ArrayBuffer||K_(e.data)))return t(iw(e.data));Rg(e,!1,n=>{Zp||(Zp=new TextEncoder),t(Zp.encode(n))})}const rw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",el=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<rw.length;e++)el[rw.charCodeAt(e)]=e;const y9=e=>{let t=e.length*.75,n=e.length,r,a=0,l,u,f,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),g=new Uint8Array(d);for(r=0;r<n;r+=4)l=el[e.charCodeAt(r)],u=el[e.charCodeAt(r+1)],f=el[e.charCodeAt(r+2)],h=el[e.charCodeAt(r+3)],g[a++]=l<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|h&63;return d},x9=typeof ArrayBuffer=="function",Dg=(e,t)=>{if(typeof e!="string")return{type:"message",data:J_(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:b9(e.substring(1),t)}:Yc[n]?e.length>1?{type:Yc[n],data:e.substring(1)}:{type:Yc[n]}:Om},b9=(e,t)=>{if(x9){const n=y9(e);return J_(n,t)}else return{base64:!0,data:e}},J_=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,W_="",v9=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((l,u)=>{Rg(l,!1,f=>{r[u]=f,++a===n&&t(r.join(W_))})})},w9=(e,t)=>{const n=e.split(W_),r=[];for(let a=0;a<n.length;a++){const l=Dg(n[a],t);if(r.push(l),l.type==="error")break}return r};function S9(){return new TransformStream({transform(e,t){g9(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const l=new DataView(a.buffer);l.setUint8(0,126),l.setUint16(1,r)}else{a=new Uint8Array(9);const l=new DataView(a.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let Qp;function Oc(e){return e.reduce((t,n)=>t+n.length,0)}function Lc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function _9(e,t){Qp||(Qp=new TextDecoder);const n=[];let r=0,a=-1,l=!1;return new TransformStream({transform(u,f){for(n.push(u);;){if(r===0){if(Oc(n)<1)break;const h=Lc(n,1);l=(h[0]&128)===128,a=h[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(Oc(n)<2)break;const h=Lc(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(Oc(n)<8)break;const h=Lc(n,8),d=new DataView(h.buffer,h.byteOffset,h.length),g=d.getUint32(0);if(g>Math.pow(2,21)-1){f.enqueue(Om);break}a=g*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Oc(n)<a)break;const h=Lc(n,a);f.enqueue(Dg(l?h:Qp.decode(h),t)),r=0}if(a===0||a>e){f.enqueue(Om);break}}}})}const ek=4;function kt(e){if(e)return k9(e)}function k9(e){for(var t in kt.prototype)e[t]=kt.prototype[t];return e}kt.prototype.on=kt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};kt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};kt.prototype.off=kt.prototype.removeListener=kt.prototype.removeAllListeners=kt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};kt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};kt.prototype.emitReserved=kt.prototype.emit;kt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};kt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Vf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ln=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),E9="arraybuffer";function tk(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const N9=Ln.setTimeout,C9=Ln.clearTimeout;function Ff(e,t){t.useNativeTimers?(e.setTimeoutFn=N9.bind(Ln),e.clearTimeoutFn=C9.bind(Ln)):(e.setTimeoutFn=Ln.setTimeout.bind(Ln),e.clearTimeoutFn=Ln.clearTimeout.bind(Ln))}const T9=1.33;function A9(e){return typeof e=="string"?M9(e):Math.ceil((e.byteLength||e.size)*T9)}function M9(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function nk(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function j9(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function z9(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let l=n[r].split("=");t[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return t}class R9 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Og extends kt{constructor(t){super(),this.writable=!1,Ff(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new R9(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Dg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=j9(t);return n.length?"?"+n:""}}class D9 extends Og{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};w9(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,v9(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=nk()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let ik=!1;try{ik=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const O9=ik;function L9(){}class B9 extends D9{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,l)=>{this.onError("xhr post error",a,l)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class li extends kt{constructor(t,n,r){super(),this.createRequest=t,Ff(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=tk(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=li.requestsCount++,li.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=L9,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete li.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}li.requestsCount=0;li.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sw);else if(typeof addEventListener=="function"){const e="onpagehide"in Ln?"pagehide":"unload";addEventListener(e,sw,!1)}}function sw(){for(let e in li.requests)li.requests.hasOwnProperty(e)&&li.requests[e].abort()}const H9=(function(){const e=rk({xdomain:!1});return e&&e.responseType!==null})();class U9 extends B9{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=H9&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new li(rk,this.uri(),t)}}function rk(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||O9))return new XMLHttpRequest}catch{}if(!t)try{return new Ln[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const sk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class I9 extends Og{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=sk?{}:tk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;Rg(r,this.supportsBinary,l=>{try{this.doWrite(r,l)}catch{}a&&Vf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=nk()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Kp=Ln.WebSocket||Ln.MozWebSocket;class q9 extends I9{createSocket(t,n,r){return sk?new Kp(t,n,r):n?new Kp(t,n):new Kp(t)}doWrite(t,n){this.ws.send(n)}}class $9 extends Og{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=_9(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=S9();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const l=()=>{r.read().then(({done:f,value:h})=>{f||(this.onPacket(h),l())}).catch(f=>{})};l();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&Vf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const P9={websocket:q9,webtransport:$9,polling:U9},V9=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,F9=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Lm(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=V9.exec(e||""),l={},u=14;for(;u--;)l[F9[u]]=a[u]||"";return n!=-1&&r!=-1&&(l.source=t,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=Y9(l,l.path),l.queryKey=X9(l,l.query),l}function Y9(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function X9(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,l){a&&(n[a]=l)}),n}const Bm=typeof addEventListener=="function"&&typeof removeEventListener=="function",Xc=[];Bm&&addEventListener("offline",()=>{Xc.forEach(e=>e())},!1);class Ar extends kt{constructor(t,n){if(super(),this.binaryType=E9,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Lm(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Lm(n.host).host);Ff(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=z9(this.opts.query)),Bm&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Xc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=ek,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ar.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ar.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=A9(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Vf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const l={type:t,data:n,options:r};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ar.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Bm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Xc.indexOf(this._offlineEventListener);r!==-1&&Xc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ar.protocol=ek;class G9 extends Ar{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ar.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",m=>{if(!r)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ar.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(g(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=n.name,this.emitReserved("upgradeError",x)}}))};function l(){r||(r=!0,g(),n.close(),n=null)}const u=m=>{const x=new Error("probe error: "+m);x.transport=n.name,l(),this.emitReserved("upgradeError",x)};function f(){u("transport closed")}function h(){u("socket closed")}function d(m){n&&m.name!==n.name&&l()}const g=()=>{n.removeListener("open",a),n.removeListener("error",u),n.removeListener("close",f),this.off("close",h),this.off("upgrading",d)};n.once("open",a),n.once("error",u),n.once("close",f),this.once("close",h),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let Z9=class extends G9{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(a=>P9[a]).filter(a=>!!a)),super(t,r)}};function Q9(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Lm(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const l=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+l+":"+r.port+t,r.href=r.protocol+"://"+l+(n&&n.port===r.port?"":":"+r.port),r}const K9=typeof ArrayBuffer=="function",J9=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,ak=Object.prototype.toString,W9=typeof Blob=="function"||typeof Blob<"u"&&ak.call(Blob)==="[object BlobConstructor]",eH=typeof File=="function"||typeof File<"u"&&ak.call(File)==="[object FileConstructor]";function Lg(e){return K9&&(e instanceof ArrayBuffer||J9(e))||W9&&e instanceof Blob||eH&&e instanceof File}function Gc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Gc(e[n]))return!0;return!1}if(Lg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Gc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Gc(e[n]))return!0;return!1}function tH(e){const t=[],n=e.data,r=e;return r.data=Hm(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Hm(e,t){if(!e)return e;if(Lg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Hm(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Hm(e[r],t));return n}return e}function nH(e,t){return e.data=Um(e.data,t),delete e.attachments,e}function Um(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Um(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Um(e[n],t));return e}const iH=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var $e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})($e||($e={}));class rH{constructor(t){this.replacer=t}encode(t){return(t.type===$e.EVENT||t.type===$e.ACK)&&Gc(t)?this.encodeAsBinary({type:t.type===$e.EVENT?$e.BINARY_EVENT:$e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===$e.BINARY_EVENT||t.type===$e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=tH(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}class Bg extends kt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===$e.BINARY_EVENT;r||n.type===$e.BINARY_ACK?(n.type=r?$e.EVENT:$e.ACK,this.reconstructor=new sH(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Lg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if($e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===$e.BINARY_EVENT||r.type===$e.BINARY_ACK){const l=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const u=t.substring(l,n);if(u!=Number(u)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(u)}if(t.charAt(n+1)==="/"){const l=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(l,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const l=n+1;for(;++n;){const u=t.charAt(n);if(u==null||Number(u)!=u){--n;break}if(n===t.length)break}r.id=Number(t.substring(l,n+1))}if(t.charAt(++n)){const l=this.tryParse(t.substr(n));if(Bg.isPayloadValid(r.type,l))r.data=l;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case $e.CONNECT:return aw(n);case $e.DISCONNECT:return n===void 0;case $e.CONNECT_ERROR:return typeof n=="string"||aw(n);case $e.EVENT:case $e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&iH.indexOf(n[0])===-1);case $e.ACK:case $e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class sH{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=nH(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function aw(e){return Object.prototype.toString.call(e)==="[object Object]"}const aH=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bg,Encoder:rH,get PacketType(){return $e}},Symbol.toStringTag,{value:"Module"}));function Vn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const oH=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ok extends kt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Vn(t,"open",this.onopen.bind(this)),Vn(t,"packet",this.onpacket.bind(this)),Vn(t,"error",this.onerror.bind(this)),Vn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,l;if(oH.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const u={type:$e.EVENT,data:n};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const g=this.ids++,m=n.pop();this._registerAckCallback(g,m),u.id=g}const f=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,h=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!f||(h?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===t&&this.sendBuffer.splice(f,1);n.call(this,new Error("operation has timed out"))},a),u=(...f)=>{this.io.clearTimeoutFn(l),n.apply(this,f)};u.withError=!0,this.acks[t]=u}emitWithAck(t,...n){return new Promise((r,a)=>{const l=(u,f)=>u?a(u):r(f);l.withError=!0,n.push(l),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...l)=>(this._queue[0],a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...l)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:$e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case $e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case $e.EVENT:case $e.BINARY_EVENT:this.onevent(t);break;case $e.ACK:case $e.BINARY_ACK:this.onack(t);break;case $e.DISCONNECT:this.ondisconnect();break;case $e.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:$e.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:$e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ma(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ma.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Ma.prototype.reset=function(){this.attempts=0};Ma.prototype.setMin=function(e){this.ms=e};Ma.prototype.setMax=function(e){this.max=e};Ma.prototype.setJitter=function(e){this.jitter=e};class Im extends kt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ff(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ma({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||aH;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Z9(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Vn(n,"open",function(){r.onopen(),t&&t()}),l=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),t?t(f):this.maybeReconnectOnOpen()},u=Vn(n,"error",l);if(this._timeout!==!1){const f=this._timeout,h=this.setTimeoutFn(()=>{a(),l(new Error("timeout")),n.close()},f);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(a),this.subs.push(u),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Vn(t,"ping",this.onping.bind(this)),Vn(t,"data",this.ondata.bind(this)),Vn(t,"error",this.onerror.bind(this)),Vn(t,"close",this.onclose.bind(this)),Vn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Vf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new ok(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Go={};function Zc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Q9(e,t.path||"/socket.io"),r=n.source,a=n.id,l=n.path,u=Go[a]&&l in Go[a].nsps,f=t.forceNew||t["force new connection"]||t.multiplex===!1||u;let h;return f?h=new Im(r,t):(Go[a]||(Go[a]=new Im(r,t)),h=Go[a]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(Zc,{Manager:Im,Socket:ok,io:Zc,connect:Zc});const ow=window.location.origin;class lH{socket;constructor(){this.socket=Zc(ow,{autoConnect:!0,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("[Socket] Connected to server:",ow)}),this.socket.on("disconnect",()=>{console.log("Disconnected from server")}),this.socket.on("connect_error",t=>{console.error("Socket connection error:",t.message)})}on(t,n){this.socket.on(t,n)}off(t,n){n?this.socket.off(t,n):this.socket.off(t)}emit(t,n){this.socket.connected||console.warn("Socket not connected, queuing emit:",t),this.socket.emit(t,n)}executeWorkflow(t){this.emit("execute:workflow",t)}cancelExecution(){this.emit("execute:cancel")}generateSkill(t){console.log("[Socket] Generating skill:",t.prompt.slice(0,50),"connected:",this.socket.connected),this.emit("generate:skill",t)}isConnected(){return this.socket.connected}disconnect(){this.socket.disconnect()}connect(){this.socket.connected||this.socket.connect()}}const Cr=new lH;function uH(){const[e,t]=X.useState(""),[n,r]=X.useState(!1),[a,l]=X.useState(null),[u,f]=X.useState(null),[h,d]=X.useState("workflow"),{loadWorkflow:g,addNode:m,setSelectedNode:x,nodes:v}=ci(),{openConsolePanel:w,openStepPanel:k}=Hf(),{addLog:N,clearLogs:E}=ka(),{apiMode:A,apiKey:_,proxyUrl:C}=pg(),B=X.useCallback(H=>{console.log("[PromptBar] Skill progress:",H.step,H.message);const q=H.step==="error"?"error":H.step==="completed"?"success":"info";N(q,H.message,void 0,H.detail)},[N]),T=X.useCallback(H=>{r(!1),f(`스킬 "${H.skill.skillName}"이 ${H.savedPath}에 저장되었습니다!`),t(""),setTimeout(()=>f(null),5e3);const q=Sa(),P=v.length,te={id:q,type:"skill",position:{x:100+P%3*300,y:100+Math.floor(P/3)*200},data:{label:H.skill.skillName,description:H.skill.description,status:"idle",skillType:"generated",skillId:H.skill.skillId,skillPath:H.savedPath}};m(te),x(q),k()},[v,m,x,k]),L=X.useCallback(H=>{r(!1),l(H.error)},[]);X.useEffect(()=>(Cr.on("skill:progress",B),Cr.on("skill:completed",T),Cr.on("skill:error",L),()=>{Cr.off("skill:progress",B),Cr.off("skill:completed",T),Cr.off("skill:error",L)}),[B,T,L]);const G=async()=>{if(!e.trim()||n)return;r(!0),l(null),f(null);const H=m9(e);d(H?"skill":"workflow");try{if(H)E(),w(),Cr.isConnected()||N("warning","⚠️ 서버 연결 대기 중...",void 0,"잠시 후 자동으로 연결됩니다"),Cr.generateSkill({prompt:e,apiMode:A,apiKey:A==="direct"?_:void 0,proxyUrl:A==="proxy"?C:void 0});else{const{workflow:q,workflowName:P}=await d9(e);g({nodes:q.nodes,edges:q.edges,name:P}),t(""),r(!1)}}catch(q){console.error("Generation failed:",q);const P=q instanceof Error?q.message:"생성에 실패했습니다.";l(P),r(!1)}},Z=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),G())};return b.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[b.jsx(Al,{className:"w-5 h-5 text-accent flex-shrink-0"}),b.jsx("input",{type:"text",value:e,onChange:H=>t(H.target.value),onKeyDown:Z,placeholder:"Describe your workflow... (e.g., 'Create an HTML page with images')",className:"flex-1 bg-transparent border-none outline-none text-white placeholder-gray-500 text-sm",disabled:n}),b.jsx("button",{onClick:G,disabled:!e.trim()||n,className:`p-2 rounded-full transition-all duration-200 ${e.trim()&&!n?"bg-accent text-white hover:bg-accent-hover hover:scale-105":"bg-surface-hover text-gray-500"}`,title:"Generate Workflow",children:n?b.jsx(lf,{className:"w-5 h-5 animate-spin"}):b.jsx(_j,{className:"w-5 h-5"})}),b.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:a?b.jsx("span",{className:"text-red-400",children:a}):u?b.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[b.jsx(Mf,{className:"w-3 h-3"}),u]}):n?b.jsxs("span",{className:"text-accent",children:["AI가 ",h==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):b.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function cH(){const{isCollapsed:e,width:t}=Hf(),{isRunning:n,logs:r}=ka(),{mergeExistingConfig:a}=ci(),[l,u]=X.useState(!1),f=X.useRef(!1);return X.useEffect(()=>{f.current||(f.current=!0,H2().then(h=>{h.length>0&&(console.log(`Loaded ${h.length} nodes from .claude/`),a(h))}).catch(h=>{console.error("Failed to load initial config:",h)}))},[a]),X.useEffect(()=>{n&&u(!0)},[n]),b.jsx(FS,{children:b.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[b.jsx(sR,{}),b.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[b.jsxs("div",{className:"flex-1 flex flex-col",children:[b.jsx(uR,{}),b.jsxs("div",{className:"flex-1 relative",children:[b.jsx(NR,{}),b.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:b.jsx(uH,{})})]})]}),!e&&b.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${t}px`},children:b.jsx(f9,{})})]}),b.jsxs("button",{onClick:()=>u(!l),className:`fixed bottom-4 left-4 z-40 flex items-center gap-2 px-3 py-2 rounded-lg shadow-lg transition-all ${l?"bg-amber-600 text-white":"bg-gray-800 text-gray-300 hover:bg-gray-700"} ${l?"opacity-0 pointer-events-none":"opacity-100"}`,children:[b.jsx(ds,{className:"w-4 h-4"}),b.jsx("span",{className:"text-sm font-medium",children:"Console"}),r.length>0&&!l&&b.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:r.length}),n&&b.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),b.jsx(Q8,{isOpen:l,onClose:()=>u(!1)})]})})}wN.createRoot(document.getElementById("root")).render(b.jsx(X.StrictMode,{children:b.jsx(cH,{})}));