makecc 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,150 @@
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 hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ip={exports:{}},Eo={};var bb;function hN(){if(bb)return Eo;bb=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 vb;function pN(){return vb||(vb=1,ip.exports=hN()),ip.exports}var v=pN(),rp={exports:{}},Te={};var wb;function mN(){if(wb)return Te;wb=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"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function k(O,V,A){this.props=O,this.context=V,this.refs=N,this.updater=A||w}k.prototype.isReactComponent={},k.prototype.setState=function(O,V){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,V,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(O,V,A){this.props=O,this.context=V,this.refs=N,this.updater=A||w}var R=_.prototype=new C;R.constructor=_,E(R,k.prototype),R.isPureReactComponent=!0;var B=Array.isArray;function M(){}var L={H:null,A:null,T:null,S:null},G=Object.prototype.hasOwnProperty;function Z(O,V,A){var ie=A.ref;return{$$typeof:e,type:O,key:V,ref:ie!==void 0?ie:null,props:A}}function H(O,V){return Z(O.type,V,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function P(O){var V={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(A){return V[A]})}var te=/\/+/g;function D(O,V){return typeof O=="object"&&O!==null&&O.key!=null?P(""+O.key):V.toString(36)}function U(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(M,M):(O.status="pending",O.then(function(V){O.status==="pending"&&(O.status="fulfilled",O.value=V)},function(V){O.status==="pending"&&(O.status="rejected",O.reason=V)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function z(O,V,A,ie,ce){var fe=typeof O;(fe==="undefined"||fe==="boolean")&&(O=null);var he=!1;if(O===null)he=!0;else switch(fe){case"bigint":case"string":case"number":he=!0;break;case"object":switch(O.$$typeof){case e:case t:he=!0;break;case g:return he=O._init,z(he(O._payload),V,A,ie,ce)}}if(he)return ce=ce(O),he=ie===""?"."+D(O,0):ie,B(ce)?(A="",he!=null&&(A=he.replace(te,"$&/")+"/"),z(ce,V,A,"",function(Ee){return Ee})):ce!=null&&($(ce)&&(ce=H(ce,A+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(te,"$&/")+"/")+he)),V.push(ce)),1;he=0;var ue=ie===""?".":ie+":";if(B(O))for(var me=0;me<O.length;me++)ie=O[me],fe=ue+D(ie,me),he+=z(ie,V,A,fe,ce);else if(me=b(O),typeof me=="function")for(O=me.call(O),me=0;!(ie=O.next()).done;)ie=ie.value,fe=ue+D(ie,me++),he+=z(ie,V,A,fe,ce);else if(fe==="object"){if(typeof O.then=="function")return z(U(O),V,A,ie,ce);throw V=String(O),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return he}function I(O,V,A){if(O==null)return O;var ie=[],ce=0;return z(O,ie,"","",function(fe){return V.call(A,fe,ce++)}),ie}function F(O){if(O._status===-1){var V=O._result;V=V(),V.then(function(A){(O._status===0||O._status===-1)&&(O._status=1,O._result=A)},function(A){(O._status===0||O._status===-1)&&(O._status=2,O._result=A)}),O._status===-1&&(O._status=0,O._result=V)}if(O._status===1)return O._result.default;throw O._result}var K=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},j={map:I,forEach:function(O,V,A){I(O,function(){V.apply(this,arguments)},A)},count:function(O){var V=0;return I(O,function(){V++}),V},toArray:function(O){return I(O,function(V){return V})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Te.Activity=m,Te.Children=j,Te.Component=k,Te.Fragment=n,Te.Profiler=a,Te.PureComponent=_,Te.StrictMode=r,Te.Suspense=d,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Te.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},Te.cache=function(O){return function(){return O.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(O,V,A){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ie=E({},O.props),ce=O.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=A;else if(1<fe){for(var he=Array(fe),ue=0;ue<fe;ue++)he[ue]=arguments[ue+2];ie.children=he}return Z(O.type,ce,ie)},Te.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:l,_context:O},O},Te.createElement=function(O,V,A){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=A;else if(1<he){for(var ue=Array(he),me=0;me<he;me++)ue[me]=arguments[me+2];ce.children=ue}if(O&&O.defaultProps)for(ie in he=O.defaultProps,he)ce[ie]===void 0&&(ce[ie]=he[ie]);return Z(O,fe,ce)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(O){return{$$typeof:f,render:O}},Te.isValidElement=$,Te.lazy=function(O){return{$$typeof:g,_payload:{_status:-1,_result:O},_init:F}},Te.memo=function(O,V){return{$$typeof:h,type:O,compare:V===void 0?null:V}},Te.startTransition=function(O){var V=L.T,A={};L.T=A;try{var ie=O(),ce=L.S;ce!==null&&ce(A,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(M,K)}catch(fe){K(fe)}finally{V!==null&&A.types!==null&&(V.types=A.types),L.T=V}},Te.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Te.use=function(O){return L.H.use(O)},Te.useActionState=function(O,V,A){return L.H.useActionState(O,V,A)},Te.useCallback=function(O,V){return L.H.useCallback(O,V)},Te.useContext=function(O){return L.H.useContext(O)},Te.useDebugValue=function(){},Te.useDeferredValue=function(O,V){return L.H.useDeferredValue(O,V)},Te.useEffect=function(O,V){return L.H.useEffect(O,V)},Te.useEffectEvent=function(O){return L.H.useEffectEvent(O)},Te.useId=function(){return L.H.useId()},Te.useImperativeHandle=function(O,V,A){return L.H.useImperativeHandle(O,V,A)},Te.useInsertionEffect=function(O,V){return L.H.useInsertionEffect(O,V)},Te.useLayoutEffect=function(O,V){return L.H.useLayoutEffect(O,V)},Te.useMemo=function(O,V){return L.H.useMemo(O,V)},Te.useOptimistic=function(O,V){return L.H.useOptimistic(O,V)},Te.useReducer=function(O,V,A){return L.H.useReducer(O,V,A)},Te.useRef=function(O){return L.H.useRef(O)},Te.useState=function(O){return L.H.useState(O)},Te.useSyncExternalStore=function(O,V,A){return L.H.useSyncExternalStore(O,V,A)},Te.useTransition=function(){return L.H.useTransition()},Te.version="19.2.3",Te}var Sb;function vl(){return Sb||(Sb=1,rp.exports=mN()),rp.exports}var X=vl();const Zo=hf(X);var sp={exports:{}},No={},ap={exports:{}},op={};var _b;function gN(){return _b||(_b=1,(function(e){function t(z,I){var F=z.length;z.push(I);e:for(;0<F;){var K=F-1>>>1,j=z[K];if(0<a(j,I))z[K]=I,z[F]=j,F=K;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var I=z[0],F=z.pop();if(F!==I){z[0]=F;e:for(var K=0,j=z.length,O=j>>>1;K<O;){var V=2*(K+1)-1,A=z[V],ie=V+1,ce=z[ie];if(0>a(A,F))ie<j&&0>a(ce,A)?(z[K]=ce,z[ie]=F,K=ie):(z[K]=A,z[V]=F,K=V);else if(ie<j&&0>a(ce,F))z[K]=ce,z[ie]=F,K=ie;else break e}}return I}function a(z,I){var F=z.sortIndex-I.sortIndex;return F!==0?F:z.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 d=[],h=[],g=1,m=null,x=3,b=!1,w=!1,E=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function R(z){for(var I=n(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=z)r(h),I.sortIndex=I.expirationTime,t(d,I);else break;I=n(h)}}function B(z){if(E=!1,R(z),!w)if(n(d)!==null)w=!0,M||(M=!0,P());else{var I=n(h);I!==null&&U(B,I.startTime-z)}}var M=!1,L=-1,G=5,Z=-1;function H(){return N?!0:!(e.unstable_now()-Z<G)}function $(){if(N=!1,M){var z=e.unstable_now();Z=z;var I=!0;try{e:{w=!1,E&&(E=!1,C(L),L=-1),b=!0;var F=x;try{t:{for(R(z),m=n(d);m!==null&&!(m.expirationTime>z&&H());){var K=m.callback;if(typeof K=="function"){m.callback=null,x=m.priorityLevel;var j=K(m.expirationTime<=z);if(z=e.unstable_now(),typeof j=="function"){m.callback=j,R(z),I=!0;break t}m===n(d)&&r(d),R(z)}else r(d);m=n(d)}if(m!==null)I=!0;else{var O=n(h);O!==null&&U(B,O.startTime-z),I=!1}}break e}finally{m=null,x=F,b=!1}I=void 0}}finally{I?P():M=!1}}}var P;if(typeof _=="function")P=function(){_($)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,D=te.port2;te.port1.onmessage=$,P=function(){D.postMessage(null)}}else P=function(){k($,0)};function U(z,I){L=k(function(){z(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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(z){switch(x){case 1:case 2:case 3:var I=3;break;default:I=x}var F=x;x=I;try{return z()}finally{x=F}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(z,I){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var F=x;x=z;try{return I()}finally{x=F}},e.unstable_scheduleCallback=function(z,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,z){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=F+j,z={id:g++,callback:I,priorityLevel:z,startTime:F,expirationTime:j,sortIndex:-1},F>K?(z.sortIndex=F,t(h,z),n(d)===null&&z===n(h)&&(E?(C(L),L=-1):E=!0,U(B,F-K))):(z.sortIndex=j,t(d,z),w||b||(w=!0,M||(M=!0,P()))),z},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(z){var I=x;return function(){var F=x;x=I;try{return z.apply(this,arguments)}finally{x=F}}}})(op)),op}var kb;function yN(){return kb||(kb=1,ap.exports=gN()),ap.exports}var lp={exports:{}},qt={};var Eb;function xN(){if(Eb)return qt;Eb=1;var e=vl();function t(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+h+" 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(d,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:d,containerInfo:h,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,qt.createPortal=function(d,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(d,h,null,g)},qt.flushSync=function(d){var h=u.T,g=r.p;try{if(u.T=null,r.p=2,d)return d()}finally{u.T=h,r.p=g,r.d.f()}},qt.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},qt.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},qt.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var g=h.as,m=f(g,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:b}):g==="script"&&r.d.X(d,{crossOrigin:m,integrity:x,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},qt.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=f(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},qt.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=f(g,h.crossOrigin);r.d.L(d,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},qt.preloadModule=function(d,h){if(typeof d=="string")if(h){var g=f(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},qt.requestFormReset=function(d){r.d.r(d)},qt.unstable_batchedUpdates=function(d,h){return d(h)},qt.useFormState=function(d,h,g){return u.H.useFormState(d,h,g)},qt.useFormStatus=function(){return u.H.useHostTransitionStatus()},qt.version="19.2.3",qt}var Nb;function ow(){if(Nb)return lp.exports;Nb=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(),lp.exports=xN(),lp.exports}var Cb;function bN(){if(Cb)return No;Cb=1;var e=yN(),t=vl(),n=ow();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 d(i){if(l(i)!==i)throw Error(r(188))}function h(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 d(p),i;if(y===c)return d(p),s;y=y.sibling}throw Error(r(188))}if(o.return!==c.return)o=p,c=y;else{for(var S=!1,T=p.child;T;){if(T===o){S=!0,o=p,c=y;break}if(T===c){S=!0,c=p,o=y;break}T=T.sibling}if(!S){for(T=y.child;T;){if(T===o){S=!0,o=y,c=p;break}if(T===c){S=!0,c=y,o=p;break}T=T.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"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),_=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),M=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"),$=Symbol.iterator;function P(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||i["@@iterator"],typeof i=="function"?i:null)}var te=Symbol.for("react.client.reference");function D(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 E:return"Fragment";case k:return"Profiler";case N:return"StrictMode";case B:return"Suspense";case M:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case _:return i.displayName||"Context";case C:return(i._context.displayName||"Context")+".Consumer";case R: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:D(i.type)||"Memo";case G:s=i._payload,i=i._init;try{return D(i(s))}catch{}}return null}var U=Array.isArray,z=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=[],j=-1;function O(i){return{current:i}}function V(i){0>j||(i.current=K[j],K[j]=null,j--)}function A(i,s){j++,K[j]=i.current,i.current=s}var ie=O(null),ce=O(null),fe=O(null),he=O(null);function ue(i,s){switch(A(fe,s),A(ce,i),A(ie,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?$x(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=$x(s),i=Px(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}V(ie),A(ie,i)}function me(){V(ie),V(ce),V(fe)}function Ee(i){i.memoizedState!==null&&A(he,i);var s=ie.current,o=Px(s,i.type);s!==o&&(A(ce,i),A(ie,o))}function Ce(i){ce.current===i&&(V(ie),V(ce)),he.current===i&&(V(he),wo._currentValue=F)}var we,Ne;function De(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],T=y[1];if(S&&T){var q=S.split(`
4
+ `),W=T.split(`
5
+ `);for(p=c=0;c<q.length&&!q[c].includes("DetermineComponentFrameRoot");)c++;for(;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;if(c===q.length||p===W.length)for(c=q.length-1,p=W.length-1;1<=c&&0<=p&&q[c]!==W[p];)p--;for(;1<=c&&0<=p;c--,p--)if(q[c]!==W[p]){if(c!==1||p!==1)do if(c--,p--,0>p||q[c]!==W[p]){var ae=`
6
+ `+q[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:"")?De(o):""}function pt(i,s){switch(i.tag){case 26:case 27:case 5:return De(i.type);case 16:return De("Lazy");case 13:return i.child!==s&&s!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("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 De("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,Oe=e.unstable_LowPriority,Pe=e.unstable_IdlePriority,Ft=e.log,Hn=e.unstable_setDisableYieldValue,jt=null,mt=null;function Ut(i){if(typeof Ft=="function"&&Hn(i),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(jt,i)}catch{}}var Je=Math.clz32?Math.clz32:Ff,Jn=Math.log,cn=Math.LN2;function Ff(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 T=c&134217727;return T!==0?(c=T&~y,c!==0?p=gi(c):(S&=T,S!==0?p=gi(S):o||(o=T&~i,o!==0&&(p=gi(o))))):(T=c&~y,T!==0?p=gi(T):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 Rr(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Yf(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 Ol(){var i=gs;return gs<<=1,(gs&62914560)===0&&(gs=4194304),i}function Ra(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function jr(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Xf(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 T=i.entanglements,q=i.expirationTimes,W=i.hiddenUpdates;for(o=S&~o;0<o;){var ae=31-Je(o),le=1<<ae;T[ae]=0,q[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&&Dl(i,c,0),y!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=y&~(S&~s))}function Dl(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 Ll(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 Bl(i,s){var o=s&-s;return o=(o&42)!==0?1:ja(o),(o&(i.suspendedLanes|s))!==0?0:o}function ja(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 za(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Hl(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:db(i.type))}function Ul(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,Il="__reactListeners$"+Wn,Gf="__reactHandles$"+Wn,ql="__reactResources$"+Wn,zr="__reactMarker$"+Wn;function Oa(i){delete i[Tt],delete i[It],delete i[xs],delete i[Il],delete i[Gf]}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=Qx(i);i!==null;){if(o=i[Tt])return o;i=Qx(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[ql];return s||(s=i[ql]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function xt(i){i[zr]=!0}var $l=new Set,Pl={};function xi(i,s){Ki(i,s),Ki(i+"Capture",s)}function Ki(i,s){for(Pl[i]=s,i=0;i<s.length;i++)$l.add(s[i])}var Zf=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]*$"),Da={},Vl={};function Qf(i){return Ht.call(Vl,i)?!0:Ht.call(Da,i)?!1:Zf.test(i)?Vl[i]=!0:(Da[i]=!0,!1)}function bs(i,s,o){if(Qf(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 Fl(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Kf(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=Fl(i)?"checked":"value";i._valueTracker=Kf(i,s,""+i[s])}}function Yl(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),c="";return i&&(c=Fl(i)?i.checked?"true":"false":i.value),i=c,i!==o?(s.setValue(i),!0):!1}function Or(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 Jf=/[\n"\\]/g;function Jt(i){return i.replace(Jf,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Dr(i,s,o,c,p,y,S,T){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"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?i.name=""+Kt(T):i.removeAttribute("name")}function Xl(i,s,o,c,p,y,S,T){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,T||s===i.value||(i.value=s),i.defaultValue=s}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=T?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"&&Or(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 Bg(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 Hg(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 Ug(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 Ig(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&&Ug(i,p,c)}else for(var y in s)s.hasOwnProperty(y)&&Ug(i,y,s[y])}function Wf(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 Gl(i){return ck.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function vi(){}var ed=null;function td(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 qg(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(Dr(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));Dr(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&&Yl(c)}break e;case"textarea":Bg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&bi(i,!!o.multiple,s,!1)}}}var nd=!1;function $g(i,s,o){if(nd)return i(s,o);nd=!0;try{var c=i(s);return c}finally{if(nd=!1,(_s!==null||ks!==null)&&(Du(),_s&&(s=_s,i=ks,ks=_s=null,qg(s),i)))for(s=0;s<i.length;s++)qg(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"),id=!1;if(wi)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){id=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{id=!1}var Ji=null,rd=null,Zl=null;function Pg(){if(Zl)return Zl;var i,s=rd,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 Zl=p.slice(i,1<c?1-c:void 0)}function Ql(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 Kl(){return!0}function Vg(){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 T in i)i.hasOwnProperty(T)&&(o=i[T],this[T]=o?o(y):y[T]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Kl:Vg,this.isPropagationStopped=Vg,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=Kl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Kl)},persist:function(){},isPersistent:Kl}),s}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jl=Wt(Lr),Ua=m({},Lr,{view:0,detail:0}),fk=Wt(Ua),sd,ad,Ia,Wl=m({},Ua,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ld,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"?(sd=i.screenX-Ia.screenX,ad=i.screenY-Ia.screenY):ad=sd=0,Ia=i),sd)},movementY:function(i){return"movementY"in i?i.movementY:ad}}),Fg=Wt(Wl),dk=m({},Wl,{dataTransfer:0}),hk=Wt(dk),pk=m({},Ua,{relatedTarget:0}),od=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}),Yg=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 ld(){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=Ql(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:ld,charCode:function(i){return i.type==="keypress"?Ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Ek=Wt(kk),Nk=m({},Wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xg=Wt(Nk),Ck=m({},Ua,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ld}),Tk=Wt(Ck),Ak=m({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mk=Wt(Ak),Rk=m({},Wl,{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}),jk=Wt(Rk),zk=m({},Lr,{newState:0,oldState:0}),Ok=Wt(zk),Dk=[9,13,27,32],ud=wi&&"CompositionEvent"in window,qa=null;wi&&"documentMode"in document&&(qa=document.documentMode);var Lk=wi&&"TextEvent"in window&&!qa,Gg=wi&&(!ud||qa&&8<qa&&11>=qa),Zg=" ",Qg=!1;function Kg(i,s){switch(i){case"keyup":return Dk.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jg(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 Jg(s);case"keypress":return s.which!==32?null:(Qg=!0,Zg);case"textInput":return i=s.data,i===Zg&&Qg?null:i;default:return null}}function Hk(i,s){if(Es)return i==="compositionend"||!ud&&Kg(i,s)?(i=Pg(),Zl=rd=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 Gg&&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 Wg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!Uk[i.type]:s==="textarea"}function ey(i,s,o,c){_s?ks?ks.push(c):ks=[c]:_s=c,s=$u(s,"onChange"),0<s.length&&(o=new Jl("onChange","change",null,o,c),i.push({event:o,listeners:s}))}var $a=null,Pa=null;function Ik(i){Lx(i,0)}function eu(i){var s=Zi(i);if(Yl(s))return i}function ty(i,s){if(i==="change")return s}var ny=!1;if(wi){var cd;if(wi){var fd="oninput"in document;if(!fd){var iy=document.createElement("div");iy.setAttribute("oninput","return;"),fd=typeof iy.oninput=="function"}cd=fd}else cd=!1;ny=cd&&(!document.documentMode||9<document.documentMode)}function ry(){$a&&($a.detachEvent("onpropertychange",sy),Pa=$a=null)}function sy(i){if(i.propertyName==="value"&&eu(Pa)){var s=[];ey(s,Pa,i,td(i)),$g(Ik,s)}}function qk(i,s,o){i==="focusin"?(ry(),$a=s,Pa=o,$a.attachEvent("onpropertychange",sy)):i==="focusout"&&ry()}function $k(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return eu(Pa)}function Pk(i,s){if(i==="click")return eu(s)}function Vk(i,s){if(i==="input"||i==="change")return eu(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 ay(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function oy(i,s){var o=ay(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=ay(o)}}function ly(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?ly(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function uy(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Or(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=Or(i.document)}return s}function dd(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,hd=null,Fa=null,pd=!1;function cy(i,s,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;pd||Ns==null||Ns!==Or(c)||(c=Ns,"selectionStart"in c&&dd(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=$u(hd,"onSelect"),0<c.length&&(s=new Jl("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")},md={},fy={};wi&&(fy=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(md[i])return md[i];if(!Cs[i])return i;var s=Cs[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in fy)return md[i]=s[o];return i}var dy=Hr("animationend"),hy=Hr("animationiteration"),py=Hr("animationstart"),Xk=Hr("transitionrun"),Gk=Hr("transitionstart"),Zk=Hr("transitioncancel"),my=Hr("transitionend"),gy=new Map,gd="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(" ");gd.push("scrollEnd");function In(i,s){gy.set(i,s),xi(s,[i])}var tu=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,yd=0;function nu(){for(var i=Ts,s=yd=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&&yy(o,p,y)}}function iu(i,s,o,c){En[Ts++]=i,En[Ts++]=s,En[Ts++]=o,En[Ts++]=c,yd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function xd(i,s,o,c){return iu(i,s,o,c),ru(i)}function Ur(i,s){return iu(i,null,null,s),ru(i)}function yy(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 ru(i){if(50<po)throw po=0,Ch=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 bd(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 xy(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 su(i,s,o,c,p,y){var S=0;if(c=i,typeof i=="function")bd(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 E:return Ir(o.children,p,y,s);case N:S=8,p|=24;break;case k:return i=dn(12,o,s,p|2),i.elementType=k,i.lanes=y,i;case B:return i=dn(13,o,s,p),i.elementType=B,i.lanes=y,i;case M:return i=dn(19,o,s,p),i.elementType=M,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case _:S=10;break e;case C:S=9;break e;case R: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 vd(i,s,o){return i=dn(6,i,null,s),i.lanes=o,i}function by(i){var s=dn(18,null,null,0);return s.stateNode=i,s}function wd(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 vy=new WeakMap;function Nn(i,s){if(typeof i=="object"&&i!==null){var o=vy.get(i);return o!==void 0?o:(s={value:i,source:s,stack:un(s)},vy.set(i,s),s)}return{value:i,source:s,stack:un(s)}}var Ms=[],Rs=0,au=null,Ya=0,Cn=[],Tn=0,Wi=null,ei=1,ti="";function _i(i,s){Ms[Rs++]=Ya,Ms[Rs++]=au,au=i,Ya=s}function wy(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 Sd(i){i.return!==null&&(_i(i,1),wy(i,1,0))}function _d(i){for(;i===au;)au=Ms[--Rs],Ms[Rs]=null,Ya=Ms[--Rs],Ms[Rs]=null;for(;i===Wi;)Wi=Cn[--Tn],Cn[Tn]=null,ti=Cn[--Tn],Cn[Tn]=null,ei=Cn[--Tn],Cn[Tn]=null}function Sy(i,s){Cn[Tn++]=ei,Cn[Tn++]=ti,Cn[Tn++]=Wi,ei=s.id,ti=s.overflow,Wi=i}var zt=null,ot=null,qe=!1,er=null,An=!1,kd=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)),kd}function _y(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),Xl(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),Hg(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||Ix(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 ky(i){for(zt=i.return;zt;)switch(zt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:zt=zt.return}}function js(i){if(i!==zt)return!1;if(!qe)return ky(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")||$h(i.type,i.memoizedProps)),o=!o),o&&ot&&tr(i),ky(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ot=Zx(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));ot=Zx(i)}else s===27?(s=ot,mr(i.type)?(i=Xh,Xh=null,ot=i):ot=s):ot=zt?Rn(i.stateNode.nextSibling):null;return!0}function qr(){ot=zt=null,qe=!1}function Ed(){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 Nd=O(null),$r=null,ki=null;function nr(i,s,o){A(Nd,s._currentValue),s._currentValue=o}function Ei(i){i._currentValue=Nd.current,V(Nd)}function Cd(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 Td(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 T=y;y=p;for(var q=0;q<s.length;q++)if(T.context===s[q]){y.lanes|=o,T=y.alternate,T!==null&&(T.lanes|=o),Cd(y.return,o,i),c||(S=null);break e}y=T.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),Cd(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 zs(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 T=p.type;fn(p.pendingProps.value,S.value)||(i!==null?i.push(T):i=[T])}}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&&Td(s,i,o,c),s.flags|=262144}function ou(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 Ot(i){return Ey($r,i)}function lu(i,s){return $r===null&&Pr(i),Ey(i,s)}function Ey(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 Ad(){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,Md=0,Os=0,Ds=null;function eE(i,s){if(Za===null){var o=Za=[];Md=0,Os=zh(),Ds={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Md++,s.then(Ny,Ny),s}function Ny(){if(--Md===0&&Za!==null){Ds!==null&&(Ds.status="fulfilled");var i=Za;Za=null,Os=0,Ds=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 Cy=z.S;z.S=function(i,s){cx=Ct(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&eE(i,s),Cy!==null&&Cy(i,s)};var Vr=O(null);function Rd(){var i=Vr.current;return i!==null?i:rt.pooledCache}function uu(i,s){s===null?A(Vr,Vr.current):A(Vr,s.pool)}function Ty(){var i=Rd();return i===null?null:{parent:bt._currentValue,pool:i}}var Ls=Error(r(460)),jd=Error(r(474)),cu=Error(r(542)),fu={then:function(){}};function Ay(i){return i=i.status,i==="fulfilled"||i==="rejected"}function My(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,jy(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,jy(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 Ry(){if(Yr===null)throw Error(r(459));var i=Yr;return Yr=null,i}function jy(i){if(i===Ls||i===cu)throw Error(r(483))}var Bs=null,Qa=0;function du(i){var s=Qa;return Qa+=1,Bs===null&&(Bs=[]),My(Bs,i,s)}function Ka(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function hu(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 zy(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 T(Q,Y,J,oe){return Y===null||Y.tag!==6?(Y=vd(J,Q.mode,oe),Y.return=Q,Y):(Y=p(Y,J),Y.return=Q,Y)}function q(Q,Y,J,oe){var ve=J.type;return ve===E?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=su(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=wd(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=vd(""+Y,Q.mode,J),Y.return=Q,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return J=su(Y.type,Y.key,Y.props,null,Q.mode,J),Ka(J,Y),J.return=Q,J;case w:return Y=wd(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,du(Y),J);if(Y.$$typeof===_)return le(Q,lu(Q,Y),J);hu(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:T(Q,Y,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===ve?q(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,du(J),oe);if(J.$$typeof===_)return ee(Q,Y,lu(Q,J),oe);hu(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,T(Y,Q,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Q=Q.get(oe.key===null?J:oe.key)||null,q(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,du(oe),ve);if(oe.$$typeof===_)return re(Q,Y,J,lu(Y,oe),ve);hu(Y,oe)}return null}function ye(Q,Y,J,oe){for(var ve=null,Ge=null,xe=Y,Re=Y=0,Ie=null;xe!==null&&Re<J.length;Re++){xe.index>Re?(Ie=xe,xe=null):Ie=xe.sibling;var Ze=ee(Q,xe,J[Re],oe);if(Ze===null){xe===null&&(xe=Ie);break}i&&xe&&Ze.alternate===null&&s(Q,xe),Y=y(Ze,Y,Re),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze,xe=Ie}if(Re===J.length)return o(Q,xe),qe&&_i(Q,Re),ve;if(xe===null){for(;Re<J.length;Re++)xe=le(Q,J[Re],oe),xe!==null&&(Y=y(xe,Y,Re),Ge===null?ve=xe:Ge.sibling=xe,Ge=xe);return qe&&_i(Q,Re),ve}for(xe=c(xe);Re<J.length;Re++)Ie=re(xe,Q,Re,J[Re],oe),Ie!==null&&(i&&Ie.alternate!==null&&xe.delete(Ie.key===null?Re:Ie.key),Y=y(Ie,Y,Re),Ge===null?ve=Ie:Ge.sibling=Ie,Ge=Ie);return i&&xe.forEach(function(vr){return s(Q,vr)}),qe&&_i(Q,Re),ve}function ke(Q,Y,J,oe){if(J==null)throw Error(r(151));for(var ve=null,Ge=null,xe=Y,Re=Y=0,Ie=null,Ze=J.next();xe!==null&&!Ze.done;Re++,Ze=J.next()){xe.index>Re?(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,Re),Ge===null?ve=vr:Ge.sibling=vr,Ge=vr,xe=Ie}if(Ze.done)return o(Q,xe),qe&&_i(Q,Re),ve;if(xe===null){for(;!Ze.done;Re++,Ze=J.next())Ze=le(Q,Ze.value,oe),Ze!==null&&(Y=y(Ze,Y,Re),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze);return qe&&_i(Q,Re),ve}for(xe=c(xe);!Ze.done;Re++,Ze=J.next())Ze=re(xe,Q,Re,Ze.value,oe),Ze!==null&&(i&&Ze.alternate!==null&&xe.delete(Ze.key===null?Re:Ze.key),Y=y(Ze,Y,Re),Ge===null?ve=Ze:Ge.sibling=Ze,Ge=Ze);return i&&xe.forEach(function(dN){return s(Q,dN)}),qe&&_i(Q,Re),ve}function it(Q,Y,J,oe){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var ve=J.key;Y!==null;){if(Y.key===ve){if(ve=J.type,ve===E){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===E?(oe=Ir(J.props.children,Q.mode,oe,J.key),oe.return=Q,Q=oe):(oe=su(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=wd(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,du(J),oe);if(J.$$typeof===_)return it(Q,Y,lu(Q,J),oe);hu(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=vd(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===cu)throw xe;var Ge=dn(29,xe,null,Q.mode);return Ge.lanes=oe,Ge.return=Q,Ge}}}var Xr=zy(!0),Oy=zy(!1),ir=!1;function zd(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=ru(i),yy(i,null,o),s}return iu(i,c,s,o),ru(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,Ll(i,o)}}function Dd(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 Ld=!1;function Wa(){if(Ld){var i=Ds;if(i!==null)throw i}}function eo(i,s,o,c){Ld=!1;var p=i.updateQueue;ir=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,T=p.shared.pending;if(T!==null){p.shared.pending=null;var q=T,W=q.next;q.next=null,S===null?y=W:S.next=W,S=q;var ae=i.alternate;ae!==null&&(ae=ae.updateQueue,T=ae.lastBaseUpdate,T!==S&&(T===null?ae.firstBaseUpdate=W:T.next=W,ae.lastBaseUpdate=q))}if(y!==null){var le=p.baseState;S=0,ae=W=q=null,T=y;do{var ee=T.lane&-536870913,re=ee!==T.lane;if(re?(Ue&ee)===ee:(c&ee)===ee){ee!==0&&ee===Os&&(Ld=!0),ae!==null&&(ae=ae.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var ye=i,ke=T;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=T.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:T.tag,payload:T.payload,callback:T.callback,next:null},ae===null?(W=ae=re,q=le):ae=ae.next=re,S|=ee;if(T=T.next,T===null){if(T=p.shared.pending,T===null)break;re=T,T=re.next,re.next=null,p.lastBaseUpdate=re,p.shared.pending=null}}while(!0);ae===null&&(q=le),p.baseState=q,p.firstBaseUpdate=W,p.lastBaseUpdate=ae,y===null&&(p.shared.lanes=0),cr|=S,i.lanes=S,i.memoizedState=le}}function Dy(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Ly(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Dy(o[i],s)}var Hs=O(null),pu=O(0);function By(i,s){i=Oi,A(pu,i),A(Hs,s),Oi=i|s.baseLanes}function Bd(){A(pu,Oi),A(Hs,Hs.current)}function Hd(){Oi=pu.current,V(Hs),V(pu)}var hn=O(null),Mn=null;function ar(i){var s=i.alternate;A(gt,gt.current&1),A(hn,i),Mn===null&&(s===null||Hs.current!==null||s.memoizedState!==null)&&(Mn=i)}function Ud(i){A(gt,gt.current),A(hn,i),Mn===null&&(Mn=i)}function Hy(i){i.tag===22?(A(gt,gt.current),A(hn,i),Mn===null&&(Mn=i)):or()}function or(){A(gt,gt.current),A(hn,hn.current)}function pn(i){V(hn),Mn===i&&(Mn=null),V(gt)}var gt=O(0);function mu(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Fh(o)||Yh(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,gu=!1,Us=!1,Gr=!1,yu=0,to=0,Is=null,nE=0;function dt(){throw Error(r(321))}function Id(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 qd(i,s,o,c,p,y){return Ni=y,Me=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,z.H=i===null||i.memoizedState===null?w0:nh,Gr=!1,y=o(c,p),Gr=!1,Us&&(y=Iy(s,o,c,p)),Uy(i),y}function Uy(i){z.H=ro;var s=tt!==null&&tt.next!==null;if(Ni=0,vt=tt=Me=null,gu=!1,to=0,Is=null,s)throw Error(r(300));i===null||wt||(i=i.dependencies,i!==null&&ou(i)&&(wt=!0))}function Iy(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)}z.H=S0,y=s(o,c)}while(Us);return y}function iE(){var i=z.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 $d(){var i=yu!==0;return yu=0,i}function Pd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function Vd(i){if(gu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}gu=!1}Ni=0,vt=tt=Me=null,Us=!1,to=yu=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 xu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function no(i){var s=to;return to+=1,Is===null&&(Is=[]),i=My(Is,i,s),s=Me,(vt===null?s.memoizedState:vt.next)===null&&(s=s.alternate,z.H=s===null||s.memoizedState===null?w0:nh),i}function bu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return no(i);if(i.$$typeof===_)return Ot(i)}throw Error(r(438,String(i)))}function Fd(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=xu(),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 vu(i){var s=yt();return Yd(s,tt,i)}function Yd(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 T=S=null,q=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)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),le===Os&&(ae=!0);else if((Ni&ee)===ee){W=W.next,ee===Os&&(ae=!0);continue}else le={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},q===null?(T=q=le,S=y):q=q.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},q===null?(T=q=ee,S=y):q=q.next=ee,Me.lanes|=le,cr|=le;W=W.next}while(W!==null&&W!==s);if(q===null?S=y:q.next=T,!fn(y,i.memoizedState)&&(wt=!0,ae&&(o=Ds,o!==null)))throw o;i.memoizedState=y,i.baseState=S,i.baseQueue=q,c.lastRenderedState=y}return p===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function Xd(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 qy(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,Qd(Vy.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},Py.bind(null,c,p,o,s),null),rt===null)throw Error(r(349));y||(Ni&127)!==0||$y(c,s,o)}return o}function $y(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=Me.updateQueue,s===null?(s=xu(),Me.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function Py(i,s,o,c){s.value=o,s.getSnapshot=c,Fy(s)&&Yy(i)}function Vy(i,s,o){return o(function(){Fy(s)&&Yy(i)})}function Fy(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!fn(i,o)}catch{return!0}}function Yy(i){var s=Ur(i,2);s!==null&&sn(s,i,2)}function Gd(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 Xy(i,s,o,c){return i.baseState=o,Yd(i,tt,typeof c=="function"?c:Ci)}function rE(i,s,o,c,p){if(_u(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)}};z.T!==null?o(!0):y.isTransition=!1,c(y),o=s.pending,o===null?(y.next=s.pending=y,Gy(s,y)):(y.next=o.next,s.pending=o.next=y)}}function Gy(i,s){var o=s.action,c=s.payload,p=i.state;if(s.isTransition){var y=z.T,S={};z.T=S;try{var T=o(p,c),q=z.S;q!==null&&q(S,T),Zy(i,s,T)}catch(W){Zd(i,s,W)}finally{y!==null&&S.types!==null&&(y.types=S.types),z.T=y}}else try{y=o(p,c),Zy(i,s,y)}catch(W){Zd(i,s,W)}}function Zy(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Qy(i,s,c)},function(c){return Zd(i,s,c)}):Qy(i,s,o)}function Qy(i,s,o){s.status="fulfilled",s.value=o,Ky(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Gy(i,o)))}function Zd(i,s,o){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=o,Ky(s),s=s.next;while(s!==c)}i.action=null}function Ky(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Jy(i,s){return s}function Wy(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=Rn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){ot=Rn(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:Jy,lastRenderedState:s},o.queue=c,o=x0.bind(null,Me,c),c.dispatch=o,c=Gd(!1),y=th.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 e0(i){var s=yt();return t0(s,tt,i)}function t0(i,s,o){if(s=Yd(i,s,Jy)[0],i=vu(Ci)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=no(s)}catch(S){throw S===Ls?cu: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 n0(i){var s=yt(),o=tt;if(o!==null)return t0(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=xu(),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 i0(){return yt().memoizedState}function wu(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 Su(i,s,o,c){var p=yt();c=c===void 0?null:c;var y=p.memoizedState.inst;tt!==null&&c!==null&&Id(c,tt.memoizedState.deps)?p.memoizedState=qs(s,y,o,c):(Me.flags|=i,p.memoizedState=qs(1|s,y,o,c))}function r0(i,s){wu(8390656,8,i,s)}function Qd(i,s){Su(2048,8,i,s)}function aE(i){Me.flags|=4;var s=Me.updateQueue;if(s===null)s=xu(),Me.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function s0(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 a0(i,s){return Su(4,2,i,s)}function o0(i,s){return Su(4,4,i,s)}function l0(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 u0(i,s,o){o=o!=null?o.concat([i]):null,Su(4,4,l0.bind(null,s,i),o)}function Kd(){}function c0(i,s){var o=yt();s=s===void 0?null:s;var c=o.memoizedState;return s!==null&&Id(s,c[1])?c[0]:(o.memoizedState=[i,s],i)}function f0(i,s){var o=yt();s=s===void 0?null:s;var c=o.memoizedState;if(s!==null&&Id(s,c[1]))return c[0];if(c=i(),Gr){Ut(!0);try{i()}finally{Ut(!1)}}return o.memoizedState=[c,s],c}function Jd(i,s,o){return o===void 0||(Ni&1073741824)!==0&&(Ue&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=dx(),Me.lanes|=i,cr|=i,o)}function d0(i,s,o,c){return fn(o,s)?o:Hs.current!==null?(i=Jd(i,o,c),fn(i,s)||(wt=!0),i):(Ni&42)===0||(Ni&1073741824)!==0&&(Ue&261930)===0?(wt=!0,i.memoizedState=o):(i=dx(),Me.lanes|=i,cr|=i,s)}function h0(i,s,o,c,p){var y=I.p;I.p=y!==0&&8>y?y:8;var S=z.T,T={};z.T=T,th(i,!1,s,o);try{var q=p(),W=z.S;if(W!==null&&W(T,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ae=tE(q,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&&T.types!==null&&(S.types=T.types),z.T=S}}function oE(){}function Wd(i,s,o,c){if(i.tag!==5)throw Error(r(476));var p=p0(i).queue;h0(i,p,s,F,o===null?oE:function(){return m0(i),o(c)})}function p0(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 m0(i){var s=p0(i);s.next===null&&(s=i.alternate.memoizedState),io(i,s.next.queue,{},yn())}function eh(){return Ot(wo)}function g0(){return yt().memoizedState}function y0(){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:Ad()},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},_u(i)?b0(s,o):(o=xd(i,s,o,c),o!==null&&(sn(o,i,c),v0(o,s,c)))}function x0(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(_u(i))b0(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,T=y(S,o);if(p.hasEagerState=!0,p.eagerState=T,fn(T,S))return iu(i,s,p,0),rt===null&&nu(),!1}catch{}if(o=xd(i,s,p,c),o!==null)return sn(o,i,c),v0(o,s,c),!0}return!1}function th(i,s,o,c){if(c={lane:2,revertLane:zh(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},_u(i)){if(s)throw Error(r(479))}else s=xd(i,o,c,2),s!==null&&sn(s,i,2)}function _u(i){var s=i.alternate;return i===Me||s!==null&&s===Me}function b0(i,s){Us=gu=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function v0(i,s,o){if((o&4194048)!==0){var c=s.lanes;c&=i.pendingLanes,o|=c,s.lanes=o,Ll(i,o)}}var ro={readContext:Ot,use:bu,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 w0={readContext:Ot,use:bu,useCallback:function(i,s){return Yt().memoizedState=[i,s===void 0?null:s],i},useContext:Ot,useEffect:r0,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,wu(4194308,4,l0.bind(null,s,i),o)},useLayoutEffect:function(i,s){return wu(4194308,4,i,s)},useInsertionEffect:function(i,s){wu(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=Gd(i);var s=i.queue,o=x0.bind(null,Me,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Kd,useDeferredValue:function(i,s){var o=Yt();return Jd(o,i,s)},useTransition:function(){var i=Gd(!1);return i=h0.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||$y(c,s,o)}p.memoizedState=o;var y={value:o,getSnapshot:s};return p.queue=y,r0(Vy.bind(null,c,y,i),[i]),c.flags|=2048,qs(9,{destroy:void 0},Py.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=yu++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=nE++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:eh,useFormState:Wy,useActionState:Wy,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=th.bind(null,Me,!0,o),o.dispatch=s,[i,s]},useMemoCache:Fd,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)}}},nh={readContext:Ot,use:bu,useCallback:c0,useContext:Ot,useEffect:Qd,useImperativeHandle:u0,useInsertionEffect:a0,useLayoutEffect:o0,useMemo:f0,useReducer:vu,useRef:i0,useState:function(){return vu(Ci)},useDebugValue:Kd,useDeferredValue:function(i,s){var o=yt();return d0(o,tt.memoizedState,i,s)},useTransition:function(){var i=vu(Ci)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:no(i),s]},useSyncExternalStore:qy,useId:g0,useHostTransitionStatus:eh,useFormState:e0,useActionState:e0,useOptimistic:function(i,s){var o=yt();return Xy(o,tt,i,s)},useMemoCache:Fd,useCacheRefresh:y0};nh.useEffectEvent=s0;var S0={readContext:Ot,use:bu,useCallback:c0,useContext:Ot,useEffect:Qd,useImperativeHandle:u0,useInsertionEffect:a0,useLayoutEffect:o0,useMemo:f0,useReducer:Xd,useRef:i0,useState:function(){return Xd(Ci)},useDebugValue:Kd,useDeferredValue:function(i,s){var o=yt();return tt===null?Jd(o,i,s):d0(o,tt.memoizedState,i,s)},useTransition:function(){var i=Xd(Ci)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:no(i),s]},useSyncExternalStore:qy,useId:g0,useHostTransitionStatus:eh,useFormState:n0,useActionState:n0,useOptimistic:function(i,s){var o=yt();return tt!==null?Xy(o,tt,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:Fd,useCacheRefresh:y0};S0.useEffectEvent=s0;function ih(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 rh={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 _0(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 k0(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&&rh.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 E0(i){tu(i)}function N0(i){console.error(i)}function C0(i){tu(i)}function ku(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function T0(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 sh(i,s,o){return o=rr(o),o.tag=3,o.payload={element:null},o.callback=function(){ku(i,s)},o}function A0(i){return i=rr(i),i.tag=3,i}function M0(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(){T0(s,o,c)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){T0(s,o,c),typeof p!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}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&&zs(s,o,p,!0),o=hn.current,o!==null){switch(o.tag){case 31:case 13:return Mn===null?Lu():o.alternate===null&&ht===0&&(ht=3),o.flags&=-257,o.flags|=65536,o.lanes=p,c===fu?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([c]):s.add(c),Mh(i,c,p)),!1;case 22:return o.flags|=65536,c===fu?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)),Mh(i,c,p)),!1}throw Error(r(435,o.tag))}return Mh(i,c,p),Lu(),!1}if(qe)return s=hn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=p,c!==kd&&(i=Error(r(422),{cause:c}),Xa(Nn(i,o)))):(c!==kd&&(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=sh(i.stateNode,c,p),Dd(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=sh(o.stateNode,c,i),Dd(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=A0(p),M0(p,i,o,c),Dd(o,p),!1}o=o.return}while(o!==null);return!1}var ah=Error(r(461)),wt=!1;function Dt(i,s,o,c){s.child=i===null?Oy(s,null,o,c):Xr(s,i.child,o,c)}function R0(i,s,o,c,p){o=o.render;var y=s.ref;if("ref"in c){var S={};for(var T in c)T!=="ref"&&(S[T]=c[T])}else S=c;return Pr(s),c=qd(i,s,o,S,y,p),T=$d(),i!==null&&!wt?(Pd(i,s,p),Ti(i,s,p)):(qe&&T&&Sd(s),s.flags|=1,Dt(i,s,c,p),s.child)}function j0(i,s,o,c,p){if(i===null){var y=o.type;return typeof y=="function"&&!bd(y)&&y.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=y,z0(i,s,y,c,p)):(i=su(o.type,null,c,s,s.mode,p),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!ph(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 z0(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,ph(i,p))(i.flags&131072)!==0&&(wt=!0);else return s.lanes=i.lanes,Ti(i,s,p)}return oh(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 D0(i,s,y,o,c)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&uu(s,y!==null?y.cachePool:null),y!==null?By(s,y):Bd(),Hy(s);else return c=s.lanes=536870912,D0(i,s,y!==null?y.baseLanes|o:o,o,c)}else y!==null?(uu(s,y.cachePool),By(s,y),or(),s.memoizedState=null):(i!==null&&uu(s,null),Bd(),or());return Dt(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 D0(i,s,o,c,p){var y=Rd();return y=y===null?null:{parent:bt._currentValue,pool:y},s.memoizedState={baseLanes:o,cachePool:y},i!==null&&uu(s,null),Bd(),Hy(s),i!==null&&zs(i,s,c,!0),s.childLanes=p,null}function Eu(i,s){return s=Cu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function L0(i,s,o){return Xr(s,i.child,null,o),i=Eu(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=Eu(s,c),s.lanes=536870912,so(null,i);if(Ud(s),(i=ot)?(i=Gx(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=by(i),o.return=s,s.child=o,zt=s,ot=null)):i=null,i===null)throw tr(s);return s.lanes=536870912,null}return Eu(s,c)}var y=i.memoizedState;if(y!==null){var S=y.dehydrated;if(Ud(s),p)if(s.flags&256)s.flags&=-257,s=L0(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||zs(i,s,o,!1),p=(o&i.childLanes)!==0,wt||p){if(c=rt,c!==null&&(S=Bl(c,o),S!==0&&S!==y.retryLane))throw y.retryLane=S,Ur(i,S),sn(c,i,S),ah;Lu(),s=L0(i,s,o)}else i=y.treeContext,ot=Rn(S.nextSibling),zt=s,qe=!0,er=null,An=!1,i!==null&&Sy(s,i),s=Eu(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 Nu(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 oh(i,s,o,c,p){return Pr(s),o=qd(i,s,o,c,void 0,p),c=$d(),i!==null&&!wt?(Pd(i,s,p),Ti(i,s,p)):(qe&&c&&Sd(s),s.flags|=1,Dt(i,s,o,p),s.child)}function B0(i,s,o,c,p,y){return Pr(s),s.updateQueue=null,o=Iy(s,c,o,p),Uy(i),c=$d(),i!==null&&!wt?(Pd(i,s,y),Ti(i,s,y)):(qe&&c&&Sd(s),s.flags|=1,Dt(i,s,o,y),s.child)}function H0(i,s,o,c,p){if(Pr(s),s.stateNode===null){var y=As,S=o.contextType;typeof S=="object"&&S!==null&&(y=Ot(S)),y=new o(c,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=rh,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=c,y.state=s.memoizedState,y.refs={},zd(s),S=o.contextType,y.context=typeof S=="object"&&S!==null?Ot(S):As,y.state=s.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(ih(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&&rh.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 T=s.memoizedProps,q=Zr(o,T);y.props=q;var W=y.context,ae=o.contextType;S=As,typeof ae=="object"&&ae!==null&&(S=Ot(ae));var le=o.getDerivedStateFromProps;ae=typeof le=="function"||typeof y.getSnapshotBeforeUpdate=="function",T=s.pendingProps!==T,ae||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T||W!==S)&&k0(s,y,c,S),ir=!1;var ee=s.memoizedState;y.state=ee,eo(s,c,y,p),Wa(),W=s.memoizedState,T||ee!==W||ir?(typeof le=="function"&&(ih(s,o,le,c),W=s.memoizedState),(q=ir||_0(s,o,q,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=q):(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,q=As,typeof W=="object"&&W!==null&&(q=Ot(W)),T=o.getDerivedStateFromProps,(W=typeof T=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(S!==le||ee!==q)&&k0(s,y,c,q),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&&ou(i.dependencies)?(typeof T=="function"&&(ih(s,o,T,c),re=s.memoizedState),(ae=ir||_0(s,o,ae,c,ee,re,q)||i!==null&&i.dependencies!==null&&ou(i.dependencies))?(W||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,re,q),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,re,q)),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=q,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,Nu(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)):Dt(i,s,o,p),s.memoizedState=y.state,i=s.child):i=Ti(i,s,p),i}function U0(i,s,o,c){return qr(),s.flags|=256,Dt(i,s,o,c),s.child}var lh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uh(i){return{baseLanes:i,cachePool:Ty()}}function ch(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=gn),i}function I0(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=Gx(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=by(i),o.return=s,s.child=o,zt=s,ot=null)):i=null,i===null)throw tr(s);return Yh(i)?s.lanes=32:s.lanes=536870912,null}var T=c.children;return c=c.fallback,p?(or(),p=s.mode,T=Cu({mode:"hidden",children:T},p),c=Ir(c,p,o,null),T.return=s,c.return=s,T.sibling=c,s.child=T,c=s.child,c.memoizedState=uh(o),c.childLanes=ch(i,S,o),s.memoizedState=lh,so(null,c)):(ar(s),fh(s,T))}var q=i.memoizedState;if(q!==null&&(T=q.dehydrated,T!==null)){if(y)s.flags&256?(ar(s),s.flags&=-257,s=dh(i,s,o)):s.memoizedState!==null?(or(),s.child=i.child,s.flags|=128,s=null):(or(),T=c.fallback,p=s.mode,c=Cu({mode:"visible",children:c.children},p),T=Ir(T,p,o,null),T.flags|=2,c.return=s,T.return=s,c.sibling=T,s.child=c,Xr(s,i.child,null,o),c=s.child,c.memoizedState=uh(o),c.childLanes=ch(i,S,o),s.memoizedState=lh,s=so(null,c));else if(ar(s),Yh(T)){if(S=T.nextSibling&&T.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=dh(i,s,o)}else if(wt||zs(i,s,o,!1),S=(o&i.childLanes)!==0,wt||S){if(S=rt,S!==null&&(c=Bl(S,o),c!==0&&c!==q.retryLane))throw q.retryLane=c,Ur(i,c),sn(S,i,c),ah;Fh(T)||Lu(),s=dh(i,s,o)}else Fh(T)?(s.flags|=192,s.child=i.child,s=null):(i=q.treeContext,ot=Rn(T.nextSibling),zt=s,qe=!0,er=null,An=!1,i!==null&&Sy(s,i),s=fh(s,c.children),s.flags|=4096);return s}return p?(or(),T=c.fallback,p=s.mode,q=i.child,W=q.sibling,c=Si(q,{mode:"hidden",children:c.children}),c.subtreeFlags=q.subtreeFlags&65011712,W!==null?T=Si(W,T):(T=Ir(T,p,o,null),T.flags|=2),T.return=s,c.return=s,c.sibling=T,s.child=c,so(null,c),c=s.child,T=i.child.memoizedState,T===null?T=uh(o):(p=T.cachePool,p!==null?(q=bt._currentValue,p=p.parent!==q?{parent:q,pool:q}:p):p=Ty(),T={baseLanes:T.baseLanes|o,cachePool:p}),c.memoizedState=T,c.childLanes=ch(i,S,o),s.memoizedState=lh,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 fh(i,s){return s=Cu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Cu(i,s){return i=dn(22,i,null,s),i.lanes=0,i}function dh(i,s,o){return Xr(s,i.child,null,o),i=fh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function q0(i,s,o){i.lanes|=s;var c=i.alternate;c!==null&&(c.lanes|=s),Cd(i.return,s,o)}function hh(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 $0(i,s,o){var c=s.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var S=gt.current,T=(S&2)!==0;if(T?(S=S&1|2,s.flags|=128):S&=1,A(gt,S),Dt(i,s,c,o),c=qe?Ya:0,!T&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&q0(i,o,s);else if(i.tag===19)q0(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&&mu(i)===null&&(p=o),o=o.sibling;o=p,o===null?(p=s.child,s.child=null):(p=o.sibling,o.sibling=null),hh(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&&mu(i)===null){s.child=p;break}i=p.sibling,p.sibling=o,o=p,p=i}hh(s,!0,o,null,y,c);break;case"together":hh(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(zs(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 ph(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&ou(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,Ud(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?I0(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||(zs(i,s,o,!1),c=(o&s.childLanes)!==0),p){if(c)return $0(i,s,o);s.flags|=128}if(p=s.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),A(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 P0(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)wt=!0;else{if(!ph(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&&wy(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")bd(i)?(c=Zr(i,c),s.tag=1,s=H0(null,s,i,c,o)):(s.tag=0,s=oh(null,s,i,c,o));else{if(i!=null){var p=i.$$typeof;if(p===R){s.tag=11,s=R0(null,s,i,c,o);break e}else if(p===L){s.tag=14,s=j0(null,s,i,c,o);break e}}throw s=D(i)||i,Error(r(306,s,""))}}return s;case 0:return oh(i,s,s.type,s.pendingProps,o);case 1:return c=s.type,p=Zr(c,s.pendingProps),H0(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&&Td(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=U0(i,s,c,o);break e}else if(c!==p){p=Nn(Error(r(424)),s),Xa(p),s=U0(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=Rn(i.firstChild),zt=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}Dt(i,s,c,o)}s=s.child}return s;case 26:return Nu(i,s),i===null?(o=eb(s.type,null,s.pendingProps,null))?s.memoizedState=o:qe||(o=s.type,i=s.pendingProps,c=Pu(fe.current).createElement(o),c[Tt]=s,c[It]=i,Lt(c,o,i),xt(c),s.stateNode=c):s.memoizedState=eb(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ee(s),i===null&&qe&&(c=s.stateNode=Kx(s.type,s.pendingProps,fe.current),zt=s,An=!0,p=ot,mr(s.type)?(Xh=p,ot=Rn(c.firstChild)):ot=p),Dt(i,s,s.pendingProps.children,o),Nu(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,zt=s,ot=Rn(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,$h(p,y)?c=null:S!==null&&$h(p,S)&&(s.flags|=32),s.memoizedState!==null&&(p=qd(i,s,iE,null,null,o),wo._currentValue=p),Nu(i,s),Dt(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,zt=s,ot=null,i=!0):i=!1),i||tr(s)),null;case 13:return I0(i,s,o);case 4:return ue(s,s.stateNode.containerInfo),c=s.pendingProps,i===null?s.child=Xr(s,null,c,o):Dt(i,s,c,o),s.child;case 11:return R0(i,s,s.type,s.pendingProps,o);case 7:return Dt(i,s,s.pendingProps,o),s.child;case 8:return Dt(i,s,s.pendingProps.children,o),s.child;case 12:return Dt(i,s,s.pendingProps.children,o),s.child;case 10:return c=s.pendingProps,nr(s,s.type,c.value),Dt(i,s,c.children,o),s.child;case 9:return p=s.type._context,c=s.pendingProps.children,Pr(s),p=Ot(p),c=c(p),s.flags|=1,Dt(i,s,c,o),s.child;case 14:return j0(i,s,s.type,s.pendingProps,o);case 15:return z0(i,s,s.type,s.pendingProps,o);case 19:return $0(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=Ot(bt),i===null?(p=Rd(),p===null&&(p=rt,y=Ad(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=o),p=y),s.memoizedState={parent:c,cache:p},zd(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&&Td(s,[bt],o,!0))),Dt(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 mh(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(gx())i.flags|=8192;else throw Yr=fu,jd}else i.flags&=-16777217}function V0(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!sb(s))if(gx())i.flags|=8192;else throw Yr=fu,jd}function Tu(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Ol():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(_d(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)&&(js(s)?Ai(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Ed())),lt(s),null;case 26:var p=s.type,y=s.memoizedState;return i===null?(Ai(s),y!==null?(lt(s),V0(s,y)):(lt(s),mh(s,p,null,c,o))):y?y!==i.memoizedState?(Ai(s),lt(s),V0(s,y)):(lt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==c&&Ai(s),lt(s),mh(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,js(s)?_y(s):(i=Kx(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,js(s))_y(s);else{var S=Pu(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),mh(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,js(s)){if(i=s.stateNode,o=s.memoizedProps,c=null,p=zt,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}i[Tt]=s,i=!!(i.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||Ix(i.nodeValue,o)),i||tr(s,!0)}else i=Pu(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=js(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=Ed(),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=js(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=Ed(),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),Tu(s,s.updateQueue),lt(s),null);case 4:return me(),i===null&&Bh(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=mu(i),y!==null){for(s.flags|=128,ao(c,!1),i=y.updateQueue,s.updateQueue=i,Tu(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)xy(o,i),o=o.sibling;return A(gt,gt.current&1|2),qe&&_i(s,c.treeForkCount),s.child}i=i.sibling}c.tail!==null&&Ct()>zu&&(s.flags|=128,p=!0,ao(c,!1),s.lanes=4194304)}else{if(!p)if(i=mu(y),i!==null){if(s.flags|=128,p=!0,i=i.updateQueue,s.updateQueue=i,Tu(s,i),ao(c,!0),c.tail===null&&c.tailMode==="hidden"&&!y.alternate&&!qe)return lt(s),null}else 2*Ct()-c.renderingStartTime>zu&&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,A(gt,p?o&1|2:o&1),qe&&_i(s,c.treeForkCount),i):(lt(s),null);case 22:case 23:return pn(s),Hd(),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&&Tu(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(_d(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),Hd(),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 F0(i,s){switch(_d(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),Hd(),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(T){et(s,s.return,T)}}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,T=S.destroy;if(T!==void 0){S.destroy=void 0,p=s;var q=o,W=T;try{W()}catch(ae){et(p,q,ae)}}}c=c.next}while(c!==y)}}catch(ae){et(s,s.return,ae)}}function Y0(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Ly(s,o)}catch(c){et(i,i.return,c)}}}function X0(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 G0(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 gh(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 Z0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&mr(i.type)||i.tag===4}function yh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Z0(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 xh(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(xh(i,s,o),i=i.sibling;i!==null;)xh(i,s,o),i=i.sibling}function Au(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(Au(i,s,o),i=i.sibling;i!==null;)Au(i,s,o),i=i.sibling}function Q0(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,bh=!1,K0=typeof WeakSet=="function"?WeakSet:Set,Rt=null;function mE(i,s){if(i=i.containerInfo,Ih=Qu,i=uy(i),dd(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,T=-1,q=-1,W=0,ae=0,le=i,ee=null;t:for(;;){for(var re;le!==o||p!==0&&le.nodeType!==3||(T=S+p),le!==y||c!==0&&le.nodeType!==3||(q=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&&(T=S),ee===y&&++ae===c&&(q=S),(re=le.nextSibling)!==null)break;le=ee,ee=le.parentNode}le=re}o=T===-1||q===-1?null:{start:T,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(qh={focusedElem:i,selectionRange:o},Qu=!1,Rt=s;Rt!==null;)if(s=Rt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Rt=i;else for(;Rt!==null;){switch(s=Rt,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)Vh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Vh(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,Rt=i;break}Rt=s.return}}function J0(i,s,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:ji(i,o),c&4&&oo(5,o);break;case 1:if(ji(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&&Y0(o),c&512&&lo(o,o.return);break;case 3:if(ji(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{Ly(i,s)}catch(S){et(o,o.return,S)}}break;case 27:s===null&&c&4&&Q0(o);case 26:case 5:ji(i,o),s===null&&c&4&&G0(o),c&512&&lo(o,o.return);break;case 12:ji(i,o);break;case 31:ji(i,o),c&4&&tx(i,o);break;case 13:ji(i,o),c&4&&nx(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?zi(i,o,(o.subtreeFlags&8772)!==0):ji(i,o),Mi=p,St=y}break;case 30:break;default:ji(i,o)}}function W0(i){var s=i.alternate;s!==null&&(i.alternate=null,W0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Oa(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 Ri(i,s,o){for(o=o.child;o!==null;)ex(i,s,o),o=o.sibling}function ex(i,s,o){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(jt,o)}catch{}switch(o.tag){case 26:St||ni(o,s),Ri(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),Ri(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,Ri(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,Yx(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Ws(i)):Yx(ut,o.stateNode));break;case 4:c=ut,p=en,ut=o.stateNode.containerInfo,en=!0,Ri(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),Ri(i,s,o);break;case 1:St||(ni(o,s),c=o.stateNode,typeof c.componentWillUnmount=="function"&&X0(o,s,c)),Ri(i,s,o);break;case 21:Ri(i,s,o);break;case 22:St=(c=St)||o.memoizedState!==null,Ri(i,s,o),St=c;break;default:Ri(i,s,o)}}function tx(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 nx(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 K0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new K0),s;default:throw Error(r(435,i.tag))}}function Mu(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,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(mr(T.type)){ut=T.stateNode,en=!1;break e}break;case 5:ut=T.stateNode,en=!1;break e;case 3:case 4:ut=T.stateNode.containerInfo,en=!0;break e}T=T.return}if(ut===null)throw Error(r(160));ex(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;)ix(s,i),s=s.sibling}var qn=null;function ix(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[zr]||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=ib("link","href",p).get(c+(o.href||""));if(S){for(var T=0;T<S.length;T++)if(y=S[T],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(T,1);break t}}y=p.createElement(c),Lt(y,c,o),p.head.appendChild(y);break;case"meta":if(S=ib("meta","content",p).get(c+(o.content||""))){for(T=0;T<S.length;T++)if(y=S[T],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(T,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 rb(p,i.type,i.stateNode);else i.stateNode=nb(p,c,i.memoizedProps);else y!==c?(y===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):y.count--,c===null?rb(p,i.type,i.stateNode):nb(p,c,i.memoizedProps)):c===null&&i.stateNode!==null&&gh(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&&gh(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,gh(i,p,o!==null?o.memoizedProps:p)),c&1024&&(bh=!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(Yu=null,p=qn,qn=Vu(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)}bh&&(bh=!1,rx(i));break;case 4:c=qn,qn=Vu(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,Mu(i,c)));break;case 13:tn(s,i),nn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(ju=Ct()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Mu(i,c)));break;case 22:p=i.memoizedState!==null;var q=o!==null&&o.memoizedState!==null,W=Mi,ae=St;if(Mi=W||p,St=ae||q,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||q||Mi||St||Qr(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){q=o=s;try{if(y=q.stateNode,p)S=y.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=q.stateNode;var le=q.memoizedProps.style,ee=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(ye){et(q,q.return,ye)}}}else if(s.tag===6){if(o===null){q=s;try{q.stateNode.nodeValue=p?"":q.memoizedProps}catch(ye){et(q,q.return,ye)}}}else if(s.tag===18){if(o===null){q=s;try{var re=q.stateNode;p?Xx(re,!0):Xx(q.stateNode,!1)}catch(ye){et(q,q.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,Mu(i,o))));break;case 19:tn(s,i),nn(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,Mu(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(Z0(c)){o=c;break}c=c.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var p=o.stateNode,y=yh(i);Au(i,y,p);break;case 5:var S=o.stateNode;o.flags&32&&(Ss(S,""),o.flags&=-33);var T=yh(i);Au(i,T,S);break;case 3:case 4:var q=o.stateNode.containerInfo,W=yh(i);xh(i,W,q);break;default:throw Error(r(161))}}catch(ae){et(i,i.return,ae)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function rx(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;rx(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function ji(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)J0(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"&&X0(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 zi(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:zi(p,y,o),oo(4,y);break;case 1:if(zi(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 T=c.stateNode;try{var q=p.shared.hiddenCallbacks;if(q!==null)for(p.shared.hiddenCallbacks=null,p=0;p<q.length;p++)Dy(q[p],T)}catch(W){et(c,c.return,W)}}o&&S&64&&Y0(y),lo(y,y.return);break;case 27:Q0(y);case 26:case 5:zi(p,y,o),o&&c===null&&S&4&&G0(y),lo(y,y.return);break;case 12:zi(p,y,o);break;case 31:zi(p,y,o),o&&S&4&&tx(p,y);break;case 13:zi(p,y,o),o&&S&4&&nx(p,y);break;case 22:y.memoizedState===null&&zi(p,y,o),lo(y,y.return);break;case 30:break;default:zi(p,y,o)}s=s.sibling}}function vh(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 wh(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;)sx(i,s,o,c),s=s.sibling}function sx(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,T=y.onPostCommit;typeof T=="function"&&T(S,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(q){et(s,s.return,q)}}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&&vh(S,s);break;case 24:$n(i,s,o,c),p&2048&&wh(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,T=o,q=c,W=S.flags;switch(S.tag){case 0:case 11:case 15:$s(y,S,T,q,p),oo(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?$s(y,S,T,q,p):uo(y,S):(ae._visibility|=2,$s(y,S,T,q,p)),p&&W&2048&&vh(S.alternate,S);break;case 24:$s(y,S,T,q,p),p&&W&2048&&wh(S.alternate,S);break;default:$s(y,S,T,q,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&&vh(c.alternate,c);break;case 24:uo(o,c),p&2048&&wh(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;)ax(i,s,o),i=i.sibling}function ax(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=Vu(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 ox(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];Rt=c,ux(c,i)}ox(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)lx(i),i=i.sibling}function lx(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];Rt=c,ux(c,i)}ox(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 ux(i,s){for(;Rt!==null;){var o=Rt;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,Rt=c;else e:for(o=i;Rt!==null;){c=Rt;var p=c.sibling,y=c.return;if(W0(c),c===o){Rt=null;break e}if(p!==null){p.return=y,Rt=p;break e}Rt=y}}}var yE={getCacheForType:function(i){var s=Ot(bt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return Ot(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,Sh=!1,Oi=0,ht=0,cr=0,Kr=0,_h=0,gn=0,Fs=0,ho=null,rn=null,kh=!1,ju=0,cx=0,zu=1/0,Ou=null,fr=null,At=0,dr=null,Ys=null,Di=0,Eh=0,Nh=null,fx=null,po=0,Ch=null;function yn(){return(Ke&2)!==0&&Ue!==0?Ue&-Ue:z.T!==null?zh():Hl()}function dx(){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)),jr(i,o),((Ke&2)===0||i!==rt)&&(i===rt&&((Ke&2)===0&&(Kr|=o),ht===4&&hr(i,Ue,gn,!1)),ii(i))}function hx(i,s,o){if((Ke&6)!==0)throw Error(r(327));var c=!o&&(s&127)===0&&(s&i.expiredLanes)===0||Rr(i,s),p=c?wE(i,s):Ah(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=Ah(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 T=i;p=ho;var q=T.current.memoizedState.isDehydrated;if(q&&(Xs(T,S).flags|=256),S=Ah(T,S,!1),S!==2){if(Sh&&!q){T.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=ju+300-Ct(),10<p)){if(hr(c,s,gn,!ur),ys(c,0,!0)!==0)break e;Di=s,c.timeoutHandle=Vx(px.bind(null,c,o,rn,Ou,kh,s,gn,Kr,Fs,ur,y,"Throttled",-0,0),p);break e}px(c,o,rn,Ou,kh,s,gn,Kr,Fs,ur,y,null,-0,0)}}break}while(!0);ii(i)}function px(i,s,o,c,p,y,S,T,q,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},ax(s,y,le);var ye=(y&62914560)===y?ju-Ct():(y&4194048)===y?cx-Ct():0;if(ye=iN(le,ye),ye!==null){Di=y,i.cancelPendingCommit=ye(Sx.bind(null,i,s,y,o,c,p,S,T,q,ae,le,null,ee,re)),hr(i,y,S,!W);return}}Sx(i,s,y,o,c,p,S,T,q)}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&=~_h,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&&Dl(i,o,s)}function Du(){return(Ke&6)===0?(mo(0),!1):!0}function Th(){if(Le!==null){if(We===0)var i=Le.return;else i=Le,ki=$r=null,Vd(i),Bs=null,Qa=0,i=Le;for(;i!==null;)F0(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()),Di=0,Th(),rt=i,Le=o=Si(i.current,null),Ue=s,We=0,mn=null,ur=!1,Vs=Rr(i,s),Sh=!1,Fs=gn=_h=Kr=cr=ht=0,rn=ho=null,kh=!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 Oi=s,nu(),o}function mx(i,s){Me=null,z.H=ro,s===Ls||s===cu?(s=Ry(),We=3):s===jd?(s=Ry(),We=4):We=s===ah?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,mn=s,Le===null&&(ht=1,ku(i,Nn(s,i.current)))}function gx(){var i=hn.current;return i===null?!0:(Ue&4194048)===Ue?Mn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?i===Mn:!1}function yx(){var i=z.H;return z.H=ro,i===null?ro:i}function xx(){var i=z.A;return z.A=yE,i}function Lu(){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 Ah(i,s,o){var c=Ke;Ke|=2;var p=yx(),y=xx();(rt!==i||Ue!==s)&&(Ou=null,Xs(i,s)),s=!1;var S=ht;e:do try{if(We!==0&&Le!==null){var T=Le,q=mn;switch(We){case 8:Th(),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,T,q,W),o&&Vs){S=0;break e}break;default:W=We,We=0,mn=null,Gs(i,T,q,W)}}vE(),S=ht;break}catch(ae){mx(i,ae)}while(!0);return s&&i.shellSuspendCounter++,ki=$r=null,Ke=c,z.H=p,z.A=y,Le===null&&(rt=null,Ue=0,nu()),S}function vE(){for(;Le!==null;)bx(Le)}function wE(i,s){var o=Ke;Ke|=2;var c=yx(),p=xx();rt!==i||Ue!==s?(Ou=null,zu=Ct()+500,Xs(i,s)):Vs=Rr(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(Ay(y)){We=0,mn=null,vx(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:Ay(y)?(We=0,mn=null,vx(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 T=Le;if(S?sb(S):T.stateNode.complete){We=0,mn=null;var q=T.sibling;if(q!==null)Le=q;else{var W=T.return;W!==null?(Le=W,Bu(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:Th(),ht=6;break e;default:throw Error(r(462))}}SE();break}catch(ae){mx(i,ae)}while(!0);return ki=$r=null,z.H=c,z.A=p,Ke=o,Le!==null?0:(rt=null,Ue=0,nu(),ht)}function SE(){for(;Le!==null&&!pi();)bx(Le)}function bx(i){var s=P0(i.alternate,i,Oi);i.memoizedProps=i.pendingProps,s===null?Bu(i):Le=s}function vx(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=B0(o,s,s.pendingProps,s.type,void 0,Ue);break;case 11:s=B0(o,s,s.pendingProps,s.type.render,s.ref,Ue);break;case 5:Vd(s);default:F0(o,s),s=Le=xy(s,Oi),s=P0(o,s,Oi)}i.memoizedProps=i.pendingProps,s===null?Bu(i):Le=s}function Gs(i,s,o,c){ki=$r=null,Vd(s),Bs=null,Qa=0;var p=s.return;try{if(cE(i,p,s,o,Ue)){ht=1,ku(i,Nn(o,i.current)),Le=null;return}}catch(y){if(p!==null)throw Le=p,y;ht=1,ku(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))),wx(s,i)):Bu(s)}function Bu(i){var s=i;do{if((s.flags&32768)!==0){wx(s,ur);return}i=s.return;var o=hE(s.alternate,s,Oi);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 wx(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 Sx(i,s,o,c,p,y,S,T,q){i.cancelPendingCommit=null;do Hu();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|=yd,Xf(i,o,y,S,T,q),i===rt&&(Le=rt=null,Ue=0),Ys=s,dr=i,Di=o,Eh=y,Nh=p,fx=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,NE(_e,function(){return Cx(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=z.T,z.T=null,p=I.p,I.p=2,S=Ke,Ke|=4;try{mE(i,s,o)}finally{Ke=S,I.p=p,z.T=c}}At=1,_x(),kx(),Ex()}}function _x(){if(At===1){At=0;var i=dr,s=Ys,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=z.T,z.T=null;var c=I.p;I.p=2;var p=Ke;Ke|=4;try{ix(s,i);var y=qh,S=uy(i.containerInfo),T=y.focusedElem,q=y.selectionRange;if(S!==T&&T&&T.ownerDocument&&ly(T.ownerDocument.documentElement,T)){if(q!==null&&dd(T)){var W=q.start,ae=q.end;if(ae===void 0&&(ae=W),"selectionStart"in T)T.selectionStart=W,T.selectionEnd=Math.min(ae,T.value.length);else{var le=T.ownerDocument||document,ee=le&&le.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),ye=T.textContent.length,ke=Math.min(q.start,ye),it=q.end===void 0?ke:Math.min(q.end,ye);!re.extend&&ke>it&&(S=it,it=ke,ke=S);var Q=oy(T,ke),Y=oy(T,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=T;re=re.parentNode;)re.nodeType===1&&le.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var oe=le[T];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Qu=!!Ih,qh=Ih=null}finally{Ke=p,I.p=c,z.T=o}}i.current=s,At=2}}function kx(){if(At===2){At=0;var i=dr,s=Ys,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=z.T,z.T=null;var c=I.p;I.p=2;var p=Ke;Ke|=4;try{J0(i,s.alternate,s)}finally{Ke=p,I.p=c,z.T=o}}At=3}}function Ex(){if(At===4||At===3){At=0,mi();var i=dr,s=Ys,o=Di,c=fx;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?At=5:(At=0,Ys=dr=null,Nx(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(fr=null),za(o),s=s.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(jt,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=z.T,p=I.p,I.p=2,z.T=null;try{for(var y=i.onRecoverableError,S=0;S<c.length;S++){var T=c[S];y(T.value,{componentStack:T.stack})}}finally{z.T=s,I.p=p}}(Di&3)!==0&&Hu(),ii(i),p=i.pendingLanes,(o&261930)!==0&&(p&42)!==0?i===Ch?po++:(po=0,Ch=i):po=0,mo(0)}}function Nx(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Ga(s)))}function Hu(){return _x(),kx(),Ex(),Cx()}function Cx(){if(At!==5)return!1;var i=dr,s=Eh;Eh=0;var o=za(Di),c=z.T,p=I.p;try{I.p=32>o?32:o,z.T=null,o=Nh,Nh=null;var y=dr,S=Di;if(At=0,Ys=dr=null,Di=0,(Ke&6)!==0)throw Error(r(331));var T=Ke;if(Ke|=4,lx(y.current),sx(y,y.current,S,o),Ke=T,mo(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(jt,y)}catch{}return!0}finally{I.p=p,z.T=c,Nx(i,s)}}function Tx(i,s,o){s=Nn(o,s),s=sh(i.stateNode,s,2),i=sr(i,s,2),i!==null&&(jr(i,2),ii(i))}function et(i,s,o){if(i.tag===3)Tx(i,i,o);else for(;s!==null;){if(s.tag===3){Tx(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=A0(2),c=sr(s,o,2),c!==null&&(M0(o,c,s,i),jr(c,2),ii(c));break}}s=s.return}}function Mh(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)||(Sh=!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()-ju?(Ke&2)===0&&Xs(i,0):_h|=o,Fs===Ue&&(Fs=0)),ii(i)}function Ax(i,s){s===0&&(s=Ol()),i=Ur(i,s),i!==null&&(jr(i,s),ii(i))}function kE(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),Ax(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),Ax(i,o)}function NE(i,s){return Qt(i,s)}var Uu=null,Zs=null,Rh=!1,Iu=!1,jh=!1,pr=0;function ii(i){i!==Zs&&i.next===null&&(Zs===null?Uu=Zs=i:Zs=Zs.next=i),Iu=!0,Rh||(Rh=!0,TE())}function mo(i,s){if(!jh&&Iu){jh=!0;do for(var o=!1,c=Uu;c!==null;){if(i!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var S=c.suspendedLanes,T=c.pingedLanes;y=(1<<31-Je(42|i)+1)-1,y&=p&~(S&~T),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(o=!0,zx(c,y))}else y=Ue,y=ys(c,c===rt?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||Rr(c,y)||(o=!0,zx(c,y));c=c.next}while(o);jh=!1}}function CE(){Mx()}function Mx(){Iu=Rh=!1;var i=0;pr!==0&&HE()&&(i=pr);for(var s=Ct(),o=null,c=Uu;c!==null;){var p=c.next,y=Rx(c,s);y===0?(c.next=null,o===null?Uu=p:o.next=p,p===null&&(Zs=o)):(o=c,(i!==0||(y&3)!==0)&&(Iu=!0)),c=p}At!==0&&At!==5||mo(i),pr!==0&&(pr=0)}function Rx(i,s){for(var o=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var S=31-Je(y),T=1<<S,q=p[S];q===-1?((T&o)===0||(T&c)!==0)&&(p[S]=Yf(T,s)):q<=s&&(i.expiredLanes|=T),y&=~T}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||Rr(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(c!==null&&Bn(c),za(o)){case 2:case 8:o=pe;break;case 32:o=_e;break;case 268435456:o=Pe;break;default:o=_e}return c=jx.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 jx(i,s){if(At!==0&&At!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Hu()&&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:(hx(i,c,s),Rx(i,Ct()),i.callbackNode!=null&&i.callbackNode===o?jx.bind(null,i):null)}function zx(i,s){if(Hu())return null;hx(i,s,!0)}function TE(){IE(function(){(Ke&6)!==0?Qt(se,CE):Mx()})}function zh(){if(pr===0){var i=Os;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:Gl(""+i)}function Dx(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 T=new Jl("action","action",null,c,p);i.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(pr!==0){var q=S?Dx(p,S):new FormData(p);Wd(o,{pending:!0,data:q,method:p.method,action:y},null,q)}}else typeof y=="function"&&(T.preventDefault(),q=S?Dx(p,S):new FormData(p),Wd(o,{pending:!0,data:q,method:p.method,action:y},y,q))},currentTarget:p}]})}}for(var Oh=0;Oh<gd.length;Oh++){var Dh=gd[Oh],ME=Dh.toLowerCase(),RE=Dh[0].toUpperCase()+Dh.slice(1);In(ME,"on"+RE)}In(dy,"onAnimationEnd"),In(hy,"onAnimationIteration"),In(py,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(Xk,"onTransitionRun"),In(Gk,"onTransitionStart"),In(Zk,"onTransitionCancel"),In(my,"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(" "),jE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(go));function Lx(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 T=c[S],q=T.instance,W=T.currentTarget;if(T=T.listener,q!==y&&p.isPropagationStopped())break e;y=T,p.currentTarget=W;try{y(p)}catch(ae){tu(ae)}p.currentTarget=null,y=q}else for(S=0;S<c.length;S++){if(T=c[S],q=T.instance,W=T.currentTarget,T=T.listener,q!==y&&p.isPropagationStopped())break e;y=T,p.currentTarget=W;try{y(p)}catch(ae){tu(ae)}p.currentTarget=null,y=q}}}}function Be(i,s){var o=s[xs];o===void 0&&(o=s[xs]=new Set);var c=i+"__bubble";o.has(c)||(Bx(s,i,2,!1),o.add(c))}function Lh(i,s,o){var c=0;s&&(c|=4),Bx(o,i,c,s)}var qu="_reactListening"+Math.random().toString(36).slice(2);function Bh(i){if(!i[qu]){i[qu]=!0,$l.forEach(function(o){o!=="selectionchange"&&(jE.has(o)||Lh(o,!1,i),Lh(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[qu]||(s[qu]=!0,Lh("selectionchange",!1,s))}}function Bx(i,s,o,c){switch(db(s)){case 2:var p=aN;break;case 8:p=oN;break;default:p=Jh}o=p.bind(null,s,o,i),p=void 0,!id||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 Hh(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 T=c.stateNode.containerInfo;if(T===p)break;if(S===4)for(S=c.return;S!==null;){var q=S.tag;if((q===3||q===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;T!==null;){if(S=Xi(T),S===null)return;if(q=S.tag,q===5||q===6||q===26||q===27){c=y=S;continue e}T=T.parentNode}}c=c.return}$g(function(){var W=y,ae=td(o),le=[];e:{var ee=gy.get(i);if(ee!==void 0){var re=Jl,ye=i;switch(i){case"keypress":if(Ql(o)===0)break e;case"keydown":case"keyup":re=Ek;break;case"focusin":ye="focus",re=od;break;case"focusout":ye="blur",re=od;break;case"beforeblur":case"afterblur":re=od;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=Fg;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 dy:case hy:case py:re=gk;break;case my:re=Mk;break;case"scroll":case"scrollend":re=fk;break;case"wheel":re=jk;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=Xg;break;case"toggle":case"beforetoggle":re=Ok}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!==ed&&(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=Fg,oe="onMouseLeave",Q="onMouseEnter",Y="mouse",(i==="pointerout"||i==="pointerover")&&(ke=Xg,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=zE,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&&Hx(le,ee,re,ke,!1),ye!==null&&it!==null&&Hx(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=ty;else if(Wg(ee))if(ny)Ge=Vk;else{Ge=$k;var xe=qk}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Wf(W.elementType)&&(Ge=ty):Ge=Pk;if(Ge&&(Ge=Ge(i,W))){ey(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":(Wg(xe)||xe.contentEditable==="true")&&(Ns=xe,hd=W,Fa=null);break;case"focusout":Fa=hd=Ns=null;break;case"mousedown":pd=!0;break;case"contextmenu":case"mouseup":case"dragend":pd=!1,cy(le,o,ae);break;case"selectionchange":if(Yk)break;case"keydown":case"keyup":cy(le,o,ae)}var Re;if(ud)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?Kg(i,o)&&(Ie="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(Ie="onCompositionStart");Ie&&(Gg&&o.locale!=="ko"&&(Es||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Es&&(Re=Pg()):(Ji=ae,rd="value"in Ji?Ji.value:Ji.textContent,Es=!0)),xe=$u(W,Ie),0<xe.length&&(Ie=new Yg(Ie,i,null,o,ae),le.push({event:Ie,listeners:xe}),Re?Ie.data=Re:(Re=Jg(o),Re!==null&&(Ie.data=Re)))),(Re=Lk?Bk(i,o):Hk(i,o))&&(Ie=$u(W,"onBeforeInput"),0<Ie.length&&(xe=new Yg("onBeforeInput","beforeinput",null,o,ae),le.push({event:xe,listeners:Ie}),xe.data=Re)),AE(le,i,W,o,ae)}Lx(le,s)})}function yo(i,s,o){return{instance:i,listener:s,currentTarget:o}}function $u(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 zE(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Hx(i,s,o,c,p){for(var y=s._reactName,S=[];o!==null&&o!==c;){var T=o,q=T.alternate,W=T.stateNode;if(T=T.tag,q!==null&&q===c)break;T!==5&&T!==26&&T!==27||W===null||(q=W,p?(W=Ba(o,y),W!=null&&S.unshift(yo(o,W,q))):p||(W=Ba(o,y),W!=null&&S.push(yo(o,W,q)))),o=o.return}S.length!==0&&i.push({event:s,listeners:S})}var OE=/\r\n?/g,DE=/\u0000|\uFFFD/g;function Ux(i){return(typeof i=="string"?i:""+i).replace(OE,`
9
+ `).replace(DE,"")}function Ix(i,s){return s=Ux(s),Ux(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":Ig(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=Gl(""+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=Gl(""+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=Gl(""+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 Uh(i,s,o,c,p,y){switch(o){case"style":Ig(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(!Pl.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 T=y=S=p=null,q=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":q=ae;break;case"defaultChecked":W=ae;break;case"value":y=ae;break;case"defaultValue":T=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:nt(i,s,c,ae,o,null)}}Xl(i,y,T,q,W,S,p,!1);return;case"select":Be("invalid",i),c=S=y=null;for(p in o)if(o.hasOwnProperty(p)&&(T=o[p],T!=null))switch(p){case"value":y=T;break;case"defaultValue":S=T;break;case"multiple":c=T;default:nt(i,s,p,T,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)&&(T=o[S],T!=null))switch(S){case"value":c=T;break;case"defaultValue":p=T;break;case"children":y=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:nt(i,s,S,T,o,null)}Hg(i,c,p,y);return;case"option":for(q in o)o.hasOwnProperty(q)&&(c=o[q],c!=null)&&(q==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":nt(i,s,q,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(Wf(s)){for(ae in o)o.hasOwnProperty(ae)&&(c=o[ae],c!==void 0&&Uh(i,s,ae,c,o,void 0));return}}for(T in o)o.hasOwnProperty(T)&&(c=o[T],c!=null&&nt(i,s,T,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,T=null,q=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":q=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":T=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)}}Dr(i,S,T,q,W,ae,y,p);return;case"select":re=S=T=ee=null;for(y in o)if(q=o[y],o.hasOwnProperty(y)&&q!=null)switch(y){case"value":break;case"multiple":re=q;default:c.hasOwnProperty(y)||nt(i,s,y,null,c,q)}for(p in c)if(y=c[p],q=o[p],c.hasOwnProperty(p)&&(y!=null||q!=null))switch(p){case"value":ee=y;break;case"defaultValue":T=y;break;case"multiple":S=y;default:y!==q&&nt(i,s,p,y,c,q)}s=T,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(T in o)if(p=o[T],o.hasOwnProperty(T)&&p!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:nt(i,s,T,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)}Bg(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(q in c)ee=c[q],re=o[q],c.hasOwnProperty(q)&&ee!==re&&(ee!=null||re!=null)&&(q==="selected"?i.selected=ee&&typeof ee!="function"&&typeof ee!="symbol":nt(i,s,q,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(Wf(s)){for(var it in o)ee=o[it],o.hasOwnProperty(it)&&ee!==void 0&&!c.hasOwnProperty(it)&&Uh(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||Uh(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 qx(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,T=p.duration;if(y&&T&&qx(S)){for(S=0,T=p.responseEnd,c+=1;c<o.length;c++){var q=o[c],W=q.startTime;if(W>T)break;var ae=q.transferSize,le=q.initiatorType;ae&&qx(le)&&(q=q.responseEnd,S+=ae*(q<T?1:(T-W)/(q-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 Ih=null,qh=null;function Pu(i){return i.nodeType===9?i:i.ownerDocument}function $x(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 Px(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 $h(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 Ph=null;function HE(){var i=window.event;return i&&i.type==="popstate"?i===Ph?!1:(Ph=i,!0):(Ph=null,!1)}var Vx=typeof setTimeout=="function"?setTimeout:void 0,UE=typeof clearTimeout=="function"?clearTimeout:void 0,Fx=typeof Promise=="function"?Promise:void 0,IE=typeof queueMicrotask=="function"?queueMicrotask:typeof Fx<"u"?function(i){return Fx.resolve(null).then(i).catch(qE)}:Vx;function qE(i){setTimeout(function(){throw i})}function mr(i){return i==="head"}function Yx(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,T=y.nodeName;y[zr]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&y.rel.toLowerCase()==="stylesheet"||o.removeChild(y),y=S}}else o==="body"&&xo(i.ownerDocument.body);o=p}while(o);Ws(s)}function Xx(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 Vh(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":Vh(o),Oa(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[zr])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=Rn(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=Rn(i.nextSibling),i===null))return null;return i}function Gx(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Rn(i.nextSibling),i===null))return null;return i}function Fh(i){return i.data==="$?"||i.data==="$~"}function Yh(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 Rn(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 Xh=null;function Zx(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return Rn(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function Qx(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 Kx(i,s,o){switch(s=Pu(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]);Oa(i)}var jn=new Map,Jx=new Set;function Vu(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=Du();return i||s}function YE(i){var s=Gi(i);s!==null&&s.tag===5&&s.type==="form"?m0(s):Li.r(i)}var Qs=typeof document>"u"?null:document;function Wx(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+'"]'),Jx.has(p)||(Jx.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),Wx("dns-prefetch",i,null)}function GE(i,s){Li.C(i,s),Wx("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)}jn.has(y)||(i=m({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),jn.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(!jn.has(y)&&(i=m({rel:"modulepreload",href:i},s),jn.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 T={loading:0,preload:null};if(S=c.querySelector(bo(y)))T.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},o),(o=jn.get(y))&&Gh(i,o);var q=S=c.createElement("link");xt(q),Lt(q,"link",i),q._p=new Promise(function(W,ae){q.onload=W,q.onerror=ae}),q.addEventListener("load",function(){T.loading|=1}),q.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Fu(S,s,c)}S={type:"stylesheet",instance:S,count:1,state:T},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=jn.get(p))&&Zh(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=jn.get(p))&&Zh(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 eb(i,s,o,c){var p=(p=fe.current)?Vu(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),jn.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},jn.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 tb(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 nb(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),Fu(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=tb(o),(p=jn.get(p))&&Gh(c,p),y=(i.ownerDocument||i).createElement("link"),xt(y);var S=y;return S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),Lt(y,"link",c),s.state.loading|=4,Fu(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=jn.get(y))&&(c=m({},o),Zh(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,Fu(c,o.precedence,i));return s.instance}function Fu(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 T=c[S];if(T.dataset.precedence===s)y=T;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 Gh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Zh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Yu=null;function ib(i,s,o){if(Yu===null){var c=new Map,p=Yu=new Map;p.set(o,c)}else p=Yu,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[zr]||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 T=c.get(S);T?T.push(y):c.set(S,[y])}}return c}function rb(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 sb(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=Xu.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=y,xt(y);return}y=s.ownerDocument||s,c=tb(c),(p=jn.get(p))&&Gh(c,p),y=y.createElement("link"),xt(y);var S=y;S._p=new Promise(function(T,q){S.onload=T,S.onerror=q}),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=Xu.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var Qh=0;function iN(i,s){return i.stylesheets&&i.count===0&&Zu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var c=setTimeout(function(){if(i.stylesheets&&Zu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Qh===0&&(Qh=62500*BE());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Zu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Qh?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function Xu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Gu=null;function Zu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Gu=new Map,s.forEach(rN,i),Gu=null,Xu.call(i))}function rN(i,s){if(!(s.state.loading&4)){var o=Gu.get(i);if(o)var c=o.get(null);else{o=new Map,Gu.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=Xu.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,T,q){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=Ra(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ra(0),this.hiddenUpdates=Ra(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function ab(i,s,o,c,p,y,S,T,q,W,ae,le){return i=new sN(i,s,o,S,q,W,ae,le,T),s=1,y===!0&&(s|=24),y=dn(3,null,null,s),i.current=y,y.stateNode=i,s=Ad(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:c,isDehydrated:o,cache:s},zd(y),i}function ob(i){return i?(i=As,i):As}function lb(i,s,o,c,p,y){p=ob(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 ub(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Kh(i,s){ub(i,s),(i=i.alternate)&&ub(i,s)}function cb(i){if(i.tag===13||i.tag===31){var s=Ur(i,67108864);s!==null&&sn(s,i,67108864),Kh(i,67108864)}}function fb(i){if(i.tag===13||i.tag===31){var s=yn();s=ja(s);var o=Ur(i,s);o!==null&&sn(o,i,s),Kh(i,s)}}var Qu=!0;function aN(i,s,o,c){var p=z.T;z.T=null;var y=I.p;try{I.p=2,Jh(i,s,o,c)}finally{I.p=y,z.T=p}}function oN(i,s,o,c){var p=z.T;z.T=null;var y=I.p;try{I.p=8,Jh(i,s,o,c)}finally{I.p=y,z.T=p}}function Jh(i,s,o,c){if(Qu){var p=Wh(c);if(p===null)Hh(i,s,c,Ku,o),hb(i,c);else if(uN(p,i,s,o,c))c.stopPropagation();else if(hb(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 T=y;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var q=1<<31-Je(S);T.entanglements[1]|=q,S&=~q}ii(y),(Ke&6)===0&&(zu=Ct()+500,mo(0))}}break;case 31:case 13:T=Ur(y,2),T!==null&&sn(T,y,2),Du(),Kh(y,2)}if(y=Wh(c),y===null&&Hh(i,s,c,Ku,o),y===p)break;p=y}p!==null&&c.stopPropagation()}else Hh(i,s,c,null,o)}}function Wh(i){return i=td(i),ep(i)}var Ku=null;function ep(i){if(Ku=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 Ku=i,null}function db(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 Oe:return 32;case Pe:return 268435456;default:return 32}default:return 32}}var tp=!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 hb(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&&cb(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 pb(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,Ul(i.priority,function(){fb(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,Ul(i.priority,function(){fb(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 Ju(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=Wh(i.nativeEvent);if(o===null){o=i.nativeEvent;var c=new o.constructor(o.type,o);ed=c,o.target.dispatchEvent(c),ed=null}else return s=Gi(o),s!==null&&cb(s),i.blockedOn=o,!1;s.shift()}return!0}function mb(i,s,o){Ju(i)&&o.delete(s)}function cN(){tp=!1,gr!==null&&Ju(gr)&&(gr=null),yr!==null&&Ju(yr)&&(yr=null),xr!==null&&Ju(xr)&&(xr=null),So.forEach(mb),_o.forEach(mb)}function Wu(i,s){i.blockedOn===s&&(i.blockedOn=null,tp||(tp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,cN)))}var ec=null;function gb(i){ec!==i&&(ec=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ec===i&&(ec=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(ep(c||o)===null)continue;break}var y=Gi(o);y!==null&&(i.splice(s,3),s-=3,Wd(y,{pending:!0,data:p,method:o.method,action:c},c,p))}}))}function Ws(i){function s(q){return Wu(q,i)}gr!==null&&Wu(gr,i),yr!==null&&Wu(yr,i),xr!==null&&Wu(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);)pb(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||gb(o);else if(S){var T=null;if(y&&y.hasAttribute("formAction")){if(p=y,S=y[It]||null)T=S.formAction;else if(ep(p)!==null)continue}else T=S.action;typeof T=="function"?o[c+1]=T:(o.splice(c,3),c-=3),gb(o)}}}function yb(){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 np(i){this._internalRoot=i}tc.prototype.render=np.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,c=yn();lb(o,c,i,s,null,null)},tc.prototype.unmount=np.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;lb(i.current,2,null,i,null,null),Du(),s[yi]=null}};function tc(i){this._internalRoot=i}tc.prototype.unstable_scheduleHydration=function(i){if(i){var s=Hl();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&&pb(i)}};var xb=t.version;if(xb!=="19.2.3")throw Error(r(527,xb,"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=h(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:z,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{jt=nc.inject(fN),mt=nc}catch{}}return No.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,c="",p=E0,y=N0,S=C0;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=ab(i,1,!1,null,null,o,c,null,p,y,S,yb),i[yi]=s.current,Bh(i),new np(s)},No.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var c=!1,p="",y=E0,S=N0,T=C0,q=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&&(T=o.onRecoverableError),o.formState!==void 0&&(q=o.formState)),s=ab(i,1,!0,s,o??null,c,p,q,y,S,T,yb),s.context=ob(null),o=s.current,c=yn(),c=ja(c),p=rr(c),p.callback=null,sr(o,p,c),o=c,s.current.lanes=o,jr(s,o),ii(s),i[yi]=s.current,Bh(i),new tc(s)},No.version="19.2.3",No}var Tb;function vN(){if(Tb)return sp.exports;Tb=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(),sp.exports=bN(),sp.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 pf(){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 Dc(n)}function Dc(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}})}Dc.prototype=pf.prototype={constructor:Dc,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]=Ab(n[a],e.name,t);else if(t==null)for(a in n)n[a]=Ab(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 Dc(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 Ab(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 Kp="http://www.w3.org/1999/xhtml";const Mb={svg:"http://www.w3.org/2000/svg",xhtml:Kp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mf(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mb.hasOwnProperty(t)?{space:Mb[t],local:e}:e}function EN(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Kp&&t.documentElement.namespaceURI===Kp?t.createElement(e):t.createElementNS(n,e)}}function NN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function lw(e){var t=mf(e);return(t.local?NN:EN)(t)}function CN(){}function Im(e){return e==null?CN:function(){return this.querySelector(e)}}function TN(e){typeof e!="function"&&(e=Im(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),d,h,g=0;g<u;++g)(d=l[g])&&(h=e.call(d,d.__data__,g,l))&&("__data__"in d&&(h.__data__=d.__data__),f[g]=h);return new kn(r,this._parents)}function AN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function MN(){return[]}function uw(e){return e==null?MN:function(){return this.querySelectorAll(e)}}function RN(e){return function(){return AN(e.apply(this,arguments))}}function jN(e){typeof e=="function"?e=RN(e):e=uw(e);for(var t=this._groups,n=t.length,r=[],a=[],l=0;l<n;++l)for(var u=t[l],f=u.length,d,h=0;h<f;++h)(d=u[h])&&(r.push(e.call(d,d.__data__,h,u)),a.push(d));return new kn(r,a)}function cw(e){return function(){return this.matches(e)}}function fw(e){return function(t){return t.matches(e)}}var zN=Array.prototype.find;function ON(e){return function(){return zN.call(this.children,e)}}function DN(){return this.firstElementChild}function LN(e){return this.select(e==null?DN:ON(typeof e=="function"?e:fw(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:fw(e)))}function qN(e){typeof e!="function"&&(e=cw(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]=[],d,h=0;h<u;++h)(d=l[h])&&e.call(d,d.__data__,h,l)&&f.push(d);return new kn(r,this._parents)}function dw(e){return new Array(e.length)}function $N(){return new kn(this._enter||this._groups.map(dw),this._parents)}function Xc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xc.prototype={constructor:Xc,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,d=t.length,h=l.length;u<h;++u)(f=t[u])?(f.__data__=l[u],r[u]=f):n[u]=new Xc(e,l[u]);for(;u<d;++u)(f=t[u])&&(a[u]=f)}function FN(e,t,n,r,a,l,u){var f,d,h=new Map,g=t.length,m=l.length,x=new Array(g),b;for(f=0;f<g;++f)(d=t[f])&&(x[f]=b=u.call(d,d.__data__,f,t)+"",h.has(b)?a[f]=d:h.set(b,d));for(f=0;f<m;++f)b=u.call(e,l[f],f,l)+"",(d=h.get(b))?(r[f]=d,d.__data__=l[f],h.delete(b)):n[f]=new Xc(e,l[f]);for(f=0;f<g;++f)(d=t[f])&&h.get(x[f])===d&&(a[f]=d)}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),d=new Array(l),h=0;h<l;++h){var g=r[h],m=a[h],x=m.length,b=GN(e.call(g,g&&g.__data__,h,r)),w=b.length,E=f[h]=new Array(w),N=u[h]=new Array(w),k=d[h]=new Array(x);n(g,m,E,N,k,b,t);for(var C=0,_=0,R,B;C<w;++C)if(R=E[C]){for(C>=_&&(_=C+1);!(B=N[_])&&++_<w;);R._next=B||null}}return u=new kn(u,r),u._enter=f,u._exit=d,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(dw),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),d=0;d<u;++d)for(var h=n[d],g=r[d],m=h.length,x=f[d]=new Array(m),b,w=0;w<m;++w)(b=h[w]||g[w])&&(x[w]=b);for(;d<a;++d)f[d]=n[d];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,d=a[l]=new Array(f),h,g=0;g<f;++g)(h=u[g])&&(d[g]=h);d.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=mf(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 hw(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)||hw(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 pw(e){return e.trim().split(/^|\s+/)}function qm(e){return e.classList||new mw(e)}function mw(e){this._node=e,this._names=pw(e.getAttribute("class")||"")}mw.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 gw(e,t){for(var n=qm(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function yw(e,t){for(var n=qm(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function SC(e){return function(){gw(this,e)}}function _C(e){return function(){yw(this,e)}}function kC(e,t){return function(){(t.apply(this,arguments)?gw:yw)(this,e)}}function EC(e,t){var n=pw(e+"");if(arguments.length<2){for(var r=qm(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 RC(e){return function(){this.innerHTML=e}}function jC(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zC(e){return arguments.length?this.each(e==null?MC:(typeof e=="function"?jC:RC)(e)):this.node().innerHTML}function OC(){this.nextSibling&&this.parentNode.appendChild(this)}function DC(){return this.each(OC)}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:lw(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:lw(e),r=t==null?UC:typeof t=="function"?t:Im(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 d=0,h=f.length,g;d<h;++d)for(a=0,g=f[d];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 xw(e,t,n){var r=hw(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 xw(this,e,t)}}function WC(e,t){return function(){return xw(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 bw=[null];function kn(e,t){this._groups=e,this._parents=t}function wl(){return new kn([[document.documentElement]],bw)}function nT(){return this}kn.prototype=wl.prototype={constructor:kn,select:TN,selectAll:jN,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:zC,raise:DC,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]],bw)}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 up(e){e.stopImmediatePropagation()}function ca(e){e.preventDefault(),e.stopImmediatePropagation()}function vw(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 ww(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 ic=e=>()=>e;function Jp(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:f,dx:d,dy:h,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:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Jp.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 Sw(){var e=sT,t=aT,n=oT,r=lT,a={},l=pf("start","drag","end"),u=0,f,d,h,g,m=0;function x(R){R.on("mousedown.drag",b).filter(r).on("touchstart.drag",N).on("touchmove.drag",k,rT).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(R,B){if(!(g||!e.call(this,R,B))){var M=_(this,t.call(this,R,B),R,B,"mouse");M&&(Sn(R.view).on("mousemove.drag",w,al).on("mouseup.drag",E,al),vw(R.view),up(R),h=!1,f=R.clientX,d=R.clientY,M("start",R))}}function w(R){if(ca(R),!h){var B=R.clientX-f,M=R.clientY-d;h=B*B+M*M>m}a.mouse("drag",R)}function E(R){Sn(R.view).on("mousemove.drag mouseup.drag",null),ww(R.view,h),ca(R),a.mouse("end",R)}function N(R,B){if(e.call(this,R,B)){var M=R.changedTouches,L=t.call(this,R,B),G=M.length,Z,H;for(Z=0;Z<G;++Z)(H=_(this,L,R,B,M[Z].identifier,M[Z]))&&(up(R),H("start",R,M[Z]))}}function k(R){var B=R.changedTouches,M=B.length,L,G;for(L=0;L<M;++L)(G=a[B[L].identifier])&&(ca(R),G("drag",R,B[L]))}function C(R){var B=R.changedTouches,M=B.length,L,G;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),L=0;L<M;++L)(G=a[B[L].identifier])&&(up(R),G("end",R,B[L]))}function _(R,B,M,L,G,Z){var H=l.copy(),$=Pn(Z||M,B),P,te,D;if((D=n.call(R,new Jp("beforestart",{sourceEvent:M,target:x,identifier:G,active:u,x:$[0],y:$[1],dx:0,dy:0,dispatch:H}),L))!=null)return P=D.x-$[0]||0,te=D.y-$[1]||0,function U(z,I,F){var K=$,j;switch(z){case"start":a[G]=U,j=u++;break;case"end":delete a[G],--u;case"drag":$=Pn(F||I,B),j=u;break}H.call(z,R,new Jp(z,{sourceEvent:I,subject:D,target:x,identifier:G,active:j,x:$[0]+P,y:$[1]+te,dx:$[0]-K[0],dy:$[1]-K[1],dispatch:H}),L)}}return x.filter=function(R){return arguments.length?(e=typeof R=="function"?R:ic(!!R),x):e},x.container=function(R){return arguments.length?(t=typeof R=="function"?R:ic(R),x):t},x.subject=function(R){return arguments.length?(n=typeof R=="function"?R:ic(R),x):n},x.touchable=function(R){return arguments.length?(r=typeof R=="function"?R:ic(!!R),x):r},x.on=function(){var R=l.on.apply(l,arguments);return R===l?x:R},x.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,x):Math.sqrt(m)},x}function $m(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _w(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Sl(){}var ol=.7,Gc=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}\\)$`),Rb={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};$m(Sl,os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jb,formatHex:jb,formatHex8:gT,formatHsl:yT,formatRgb:zb,toString:zb});function jb(){return this.rgb().formatHex()}function gT(){return this.rgb().formatHex8()}function yT(){return kw(this).formatHsl()}function zb(){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?rc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rc(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))?rc(t[1],t[2],t[3],t[4]):(t=hT.exec(e))?rc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pT.exec(e))?Bb(t[1],t[2]/100,t[3]/100,1):(t=mT.exec(e))?Bb(t[1],t[2]/100,t[3]/100,t[4]):Rb.hasOwnProperty(e)?Ob(Rb[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 rc(e,t,n,r){return r<=0&&(e=t=n=NaN),new on(e,t,n,r)}function xT(e){return e instanceof Sl||(e=os(e)),e?(e=e.rgb(),new on(e.r,e.g,e.b,e.opacity)):new on}function Wp(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}$m(on,Wp,_w(Sl,{brighter(e){return e=e==null?Gc:Math.pow(Gc,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),Zc(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:Db,formatHex:Db,formatHex8:bT,formatRgb:Lb,toString:Lb}));function Db(){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 Lb(){const e=Zc(this.opacity);return`${e===1?"rgb(":"rgba("}${ss(this.r)}, ${ss(this.g)}, ${ss(this.b)}${e===1?")":`, ${e})`}`}function Zc(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 Bb(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 kw(e){if(e instanceof Fn)return new Fn(e.h,e.s,e.l,e.opacity);if(e instanceof Sl||(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,d=(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/=d<.5?l+a:2-l-a,u*=60):f=d>0&&d<1?0:u,new Fn(u,f,d,e.opacity)}function vT(e,t,n,r){return arguments.length===1?kw(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}$m(Fn,vT,_w(Sl,{brighter(e){return e=e==null?Gc:Math.pow(Gc,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(cp(e>=240?e-240:e+120,a,r),cp(e,a,r),cp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Fn(Hb(this.h),sc(this.s),sc(this.l),Zc(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=Zc(this.opacity);return`${e===1?"hsl(":"hsla("}${Hb(this.h)}, ${sc(this.s)*100}%, ${sc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Hb(e){return e=(e||0)%360,e<0?e+360:e}function sc(e){return Math.max(0,Math.min(1,e||0))}function cp(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 Pm=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?Ew:function(t,n){return n-t?ST(t,n,e):Pm(isNaN(t)?n:t)}}function Ew(e,t){var n=t-e;return n?wT(e,n):Pm(isNaN(e)?t:e)}const Qc=(function e(t){var n=_T(t);function r(a,l){var u=n((a=Wp(a)).r,(l=Wp(l)).r),f=n(a.g,l.g),d=n(a.b,l.b),h=Ew(a.opacity,l.opacity);return function(g){return a.r=u(g),a.g=f(g),a.b=d(g),a.opacity=h(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 em=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fp=new RegExp(em.source,"g");function AT(e){return function(){return e}}function MT(e){return function(t){return e(t)+""}}function Nw(e,t){var n=em.lastIndex=fp.lastIndex=0,r,a,l,u=-1,f=[],d=[];for(e=e+"",t=t+"";(r=em.exec(e))&&(a=fp.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,d.push({i:u,x:si(r,a)})),n=fp.lastIndex;return n<t.length&&(l=t.slice(n),f[u]?f[u]+=l:f[++u]=l),f.length<2?d[0]?MT(d[0].x):AT(t):(t=d.length,function(h){for(var g=0,m;g<t;++g)f[(m=d[g]).i]=m.x(h);return f.join("")})}function tl(e,t){var n=typeof t,r;return t==null||n==="boolean"?Pm(t):(n==="number"?si:n==="string"?(r=os(t))?(t=r,Qc):Nw:t instanceof os?Qc: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 Ub=180/Math.PI,tm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cw(e,t,n,r,a,l){var u,f,d;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(f=Math.sqrt(n*n+r*r))&&(n/=f,r/=f,d/=f),e*r<t*n&&(e=-e,t=-t,d=-d,u=-u),{translateX:a,translateY:l,rotate:Math.atan2(t,e)*Ub,skewX:Math.atan(d)*Ub,scaleX:u,scaleY:f}}var ac;function RT(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?tm:Cw(t.a,t.b,t.c,t.d,t.e,t.f)}function jT(e){return e==null||(ac||(ac=document.createElementNS("http://www.w3.org/2000/svg","g")),ac.setAttribute("transform",e),!(e=ac.transform.baseVal.consolidate()))?tm:(e=e.matrix,Cw(e.a,e.b,e.c,e.d,e.e,e.f))}function Tw(e,t,n,r){function a(h){return h.length?h.pop()+" ":""}function l(h,g,m,x,b,w){if(h!==m||g!==x){var E=b.push("translate(",null,t,null,n);w.push({i:E-4,x:si(h,m)},{i:E-2,x:si(g,x)})}else(m||x)&&b.push("translate("+m+t+x+n)}function u(h,g,m,x){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),x.push({i:m.push(a(m)+"rotate(",null,r)-2,x:si(h,g)})):g&&m.push(a(m)+"rotate("+g+r)}function f(h,g,m,x){h!==g?x.push({i:m.push(a(m)+"skewX(",null,r)-2,x:si(h,g)}):g&&m.push(a(m)+"skewX("+g+r)}function d(h,g,m,x,b,w){if(h!==m||g!==x){var E=b.push(a(b)+"scale(",null,",",null,")");w.push({i:E-4,x:si(h,m)},{i:E-2,x:si(g,x)})}else(m!==1||x!==1)&&b.push(a(b)+"scale("+m+","+x+")")}return function(h,g){var m=[],x=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,m,x),u(h.rotate,g.rotate,m,x),f(h.skewX,g.skewX,m,x),d(h.scaleX,h.scaleY,g.scaleX,g.scaleY,m,x),h=g=null,function(b){for(var w=-1,E=x.length,N;++w<E;)m[(N=x[w]).i]=N.x(b);return m.join("")}}}var zT=Tw(RT,"px, ","px)","deg)"),OT=Tw(jT,", ",")",")"),DT=1e-12;function Ib(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 Lc=(function e(t,n,r){function a(l,u){var f=l[0],d=l[1],h=l[2],g=u[0],m=u[1],x=u[2],b=g-f,w=m-d,E=b*b+w*w,N,k;if(E<DT)k=Math.log(x/h)/t,N=function(L){return[f+L*b,d+L*w,h*Math.exp(t*L*k)]};else{var C=Math.sqrt(E),_=(x*x-h*h+r*E)/(2*h*n*C),R=(x*x-h*h-r*E)/(2*x*n*C),B=Math.log(Math.sqrt(_*_+1)-_),M=Math.log(Math.sqrt(R*R+1)-R);k=(M-B)/t,N=function(L){var G=L*k,Z=Ib(B),H=h/(n*C)*(Z*BT(t*G+B)-LT(B));return[f+H*b,d+H*w,h*Z/Ib(t*G+B)]}}return N.duration=k*1e3*t/Math.SQRT2,N}return a.rho=function(l){var u=Math.max(.001,+l),f=u*u,d=f*f;return e(u,f,d)},a})(Math.SQRT2,2,4);var ma=0,Qo=0,Co=0,Aw=1e3,Kc,Ko,Jc=0,ls=0,gf=0,ul=typeof performance=="object"&&performance.now?performance:Date,Mw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vm(){return ls||(Mw(HT),ls=ul.now()+gf)}function HT(){ls=0}function Wc(){this._call=this._time=this._next=null}Wc.prototype=Rw.prototype={constructor:Wc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vm():+n)+(t==null?0:+t),!this._next&&Ko!==this&&(Ko?Ko._next=this:Kc=this,Ko=this),this._call=e,this._time=n,nm()},stop:function(){this._call&&(this._call=null,this._time=1/0,nm())}};function Rw(e,t,n){var r=new Wc;return r.restart(e,t,n),r}function UT(){Vm(),++ma;for(var e=Kc,t;e;)(t=ls-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ma}function qb(){ls=(Jc=ul.now())+gf,ma=Qo=0;try{UT()}finally{ma=0,qT(),ls=0}}function IT(){var e=ul.now(),t=e-Jc;t>Aw&&(gf-=t,Jc=e)}function qT(){for(var e,t=Kc,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:Kc=n);Ko=e,nm(r)}function nm(e){if(!ma){Qo&&(Qo=clearTimeout(Qo));var t=e-ls;t>24?(e<1/0&&(Qo=setTimeout(qb,e-ul.now()-gf)),Co&&(Co=clearInterval(Co))):(Co||(Jc=ul.now(),Co=setInterval(IT,Aw)),ma=1,Mw(qb))}}function $b(e,t,n){var r=new Wc;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var $T=pf("start","end","cancel","interrupt"),PT=[],jw=0,Pb=1,im=2,Bc=3,Vb=4,rm=5,Hc=6;function yf(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:jw})}function Fm(e,t){var n=Qn(e,t);if(n.state>jw)throw new Error("too late; already scheduled");return n}function di(e,t){var n=Qn(e,t);if(n.state>Bc)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=Rw(l,0,n.time);function l(h){n.state=Pb,n.timer.restart(u,n.delay,n.time),n.delay<=h&&u(h-n.delay)}function u(h){var g,m,x,b;if(n.state!==Pb)return d();for(g in r)if(b=r[g],b.name===n.name){if(b.state===Bc)return $b(u);b.state===Vb?(b.state=Hc,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[g]):+g<t&&(b.state=Hc,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[g])}if($b(function(){n.state===Bc&&(n.state=Vb,n.timer.restart(f,n.delay,n.time),f(h))}),n.state=im,n.on.call("start",e,e.__data__,n.index,n.group),n.state===im){for(n.state=Bc,a=new Array(x=n.tween.length),g=0,m=-1;g<x;++g)(b=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=b);a.length=m+1}}function f(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(d),n.state=rm,1),m=-1,x=a.length;++m<x;)a[m].call(e,g);n.state===rm&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=Hc,n.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function Uc(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>im&&r.state<rm,r.state=Hc,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(){Uc(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},d=0,h=a.length;d<h;++d)if(a[d].name===t){a[d]=f;break}d===h&&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 Ym(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 zw(e,t){var n;return(typeof t=="number"?si:t instanceof os?Qc:(n=os(t))?(t=n,Qc):Nw)(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),d;return f==null?void this.removeAttribute(e):(u=this.getAttribute(e),d=f+"",u===d?null:u===r&&d===a?l:(a=d,l=t(r=u,f)))}}function e4(e,t,n){var r,a,l;return function(){var u,f=n(this),d;return f==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),d=f+"",u===d?null:u===r&&d===a?l:(a=d,l=t(r=u,f)))}}function t4(e,t){var n=mf(e),r=n==="transform"?OT:zw;return this.attrTween(e,typeof t=="function"?(n.local?e4:WT)(n,r,Ym(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=mf(e);return this.tween(n,(r.local?r4:s4)(r,t))}function o4(e,t){return function(){Fm(this,e).delay=+t.apply(this,arguments)}}function l4(e,t){return t=+t,function(){Fm(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=cw(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]=[],d,h=0;h<u;++h)(d=l[h])&&e.call(d,d.__data__,h,l)&&f.push(d);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 d=t[f],h=n[f],g=d.length,m=u[f]=new Array(g),x,b=0;b<g;++b)(x=d[b]||h[b])&&(m[b]=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)?Fm: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=Im(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u<a;++u)for(var f=r[u],d=f.length,h=l[u]=new Array(d),g,m,x=0;x<d;++x)(g=f[x])&&(m=e.call(g,g.__data__,x,f))&&("__data__"in g&&(m.__data__=g.__data__),h[x]=m,yf(h[x],t,n,x,h,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=uw(e));for(var r=this._groups,a=r.length,l=[],u=[],f=0;f<a;++f)for(var d=r[f],h=d.length,g,m=0;m<h;++m)if(g=d[m]){for(var x=e.call(g,g.__data__,m,d),b,w=Qn(g,n),E=0,N=x.length;E<N;++E)(b=x[E])&&yf(b,t,n,E,x,w);l.push(x),u.push(g)}return new Pi(l,u,t,n)}var N4=wl.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),d=f+"";return f==null&&(d=f=(this.style.removeProperty(e),pa(this,e))),u===d?null:u===r&&d===a?l:(a=d,l=t(r=u,f))}}function R4(e,t){var n,r,a,l="style."+t,u="end."+l,f;return function(){var d=di(this,e),h=d.on,g=d.value[l]==null?f||(f=Ow(t)):void 0;(h!==n||a!==g)&&(r=(n=h).copy()).on(u,a=g),d.on=r}}function j4(e,t,n){var r=(e+="")=="transform"?zT:zw;return t==null?this.styleTween(e,T4(e,r)).on("end.style."+e,Ow(e)):typeof t=="function"?this.styleTween(e,M4(e,r,Ym(this,"style."+e,t))).each(R4(this._id,e)):this.styleTween(e,A4(e,r,t),n).on("end.style."+e,null)}function z4(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function O4(e,t,n){var r,a;function l(){var u=t.apply(this,arguments);return u!==a&&(r=(a=u)&&z4(e,u,n)),r}return l._value=t,l}function D4(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,O4(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(Ym(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=Dw(),r=this._groups,a=r.length,l=0;l<a;++l)for(var u=r[l],f=u.length,d,h=0;h<f;++h)if(d=u[h]){var g=Qn(d,t);yf(d,e,n,h,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},d={value:function(){--a===0&&l()}};n.each(function(){var h=di(this,r),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(f),t._.interrupt.push(f),t._.end.push(d)),h.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 Dw(){return++V4}var Bi=wl.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:j4,styleTween:D4,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=Dw(),(n=Y4).time=Vm(),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,d,h=0;h<f;++h)(d=u[h])&&yf(d,e,t,h,u,n||X4(d,t));return new Pi(r,this._parents,e,t)}wl.prototype.interrupt=FT;wl.prototype.transition=G4;const oc=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 xf=new qi(1,0,0);Lw.prototype=qi.prototype;function Lw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xf;return e.__zoom}function dp(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 Fb(){return this.__zoom||xf}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 Bw(){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,d=Lc,h=pf("start","zoom","end"),g,m,x,b=500,w=150,E=0,N=10;function k(D){D.property("__zoom",Fb).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",Z).on("dblclick.zoom",H).filter(a).on("touchstart.zoom",$).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(D,U,z,I){var F=D.selection?D.selection():D;F.property("__zoom",Fb),D!==F?B(D,U,z,I):F.interrupt().each(function(){M(this,arguments).event(I).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},k.scaleBy=function(D,U,z,I){k.scaleTo(D,function(){var F=this.__zoom.k,K=typeof U=="function"?U.apply(this,arguments):U;return F*K},z,I)},k.scaleTo=function(D,U,z,I){k.transform(D,function(){var F=t.apply(this,arguments),K=this.__zoom,j=z==null?R(F):typeof z=="function"?z.apply(this,arguments):z,O=K.invert(j),V=typeof U=="function"?U.apply(this,arguments):U;return n(_(C(K,V),j,O),F,u)},z,I)},k.translateBy=function(D,U,z,I){k.transform(D,function(){return n(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),u)},null,I)},k.translateTo=function(D,U,z,I,F){k.transform(D,function(){var K=t.apply(this,arguments),j=this.__zoom,O=I==null?R(K):typeof I=="function"?I.apply(this,arguments):I;return n(xf.translate(O[0],O[1]).scale(j.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof z=="function"?-z.apply(this,arguments):-z),K,u)},I,F)};function C(D,U){return U=Math.max(l[0],Math.min(l[1],U)),U===D.k?D:new qi(U,D.x,D.y)}function _(D,U,z){var I=U[0]-z[0]*D.k,F=U[1]-z[1]*D.k;return I===D.x&&F===D.y?D:new qi(D.k,I,F)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function B(D,U,z,I){D.on("start.zoom",function(){M(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(I).end()}).tween("zoom",function(){var F=this,K=arguments,j=M(F,K).event(I),O=t.apply(F,K),V=z==null?R(O):typeof z=="function"?z.apply(F,K):z,A=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),ie=F.__zoom,ce=typeof U=="function"?U.apply(F,K):U,fe=d(ie.invert(V).concat(A/ie.k),ce.invert(V).concat(A/ce.k));return function(he){if(he===1)he=ce;else{var ue=fe(he),me=A/ue[2];he=new qi(me,V[0]-ue[0]*me,V[1]-ue[1]*me)}j.zoom(null,he)}})}function M(D,U,z){return!z&&D.__zooming||new L(D,U)}function L(D,U){this.that=D,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,U),this.taps=0}L.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,U){return this.mouse&&D!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&D!=="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(D){var U=Sn(this.that).datum();h.call(D,this.that,new Z4(D,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:h}),U)}};function G(D,...U){if(!e.apply(this,arguments))return;var z=M(this,U).event(D),I=this.__zoom,F=Math.max(l[0],Math.min(l[1],I.k*Math.pow(2,r.apply(this,arguments)))),K=Pn(D);if(z.wheel)(z.mouse[0][0]!==K[0]||z.mouse[0][1]!==K[1])&&(z.mouse[1]=I.invert(z.mouse[0]=K)),clearTimeout(z.wheel);else{if(I.k===F)return;z.mouse=[K,I.invert(K)],Uc(this),z.start()}To(D),z.wheel=setTimeout(j,w),z.zoom("mouse",n(_(C(I,F),z.mouse[0],z.mouse[1]),z.extent,u));function j(){z.wheel=null,z.end()}}function Z(D,...U){if(x||!e.apply(this,arguments))return;var z=D.currentTarget,I=M(this,U,!0).event(D),F=Sn(D.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",A,!0),K=Pn(D,z),j=D.clientX,O=D.clientY;vw(D.view),dp(D),I.mouse=[K,this.__zoom.invert(K)],Uc(this),I.start();function V(ie){if(To(ie),!I.moved){var ce=ie.clientX-j,fe=ie.clientY-O;I.moved=ce*ce+fe*fe>E}I.event(ie).zoom("mouse",n(_(I.that.__zoom,I.mouse[0]=Pn(ie,z),I.mouse[1]),I.extent,u))}function A(ie){F.on("mousemove.zoom mouseup.zoom",null),ww(ie.view,I.moved),To(ie),I.event(ie).end()}}function H(D,...U){if(e.apply(this,arguments)){var z=this.__zoom,I=Pn(D.changedTouches?D.changedTouches[0]:D,this),F=z.invert(I),K=z.k*(D.shiftKey?.5:2),j=n(_(C(z,K),I,F),t.apply(this,U),u);To(D),f>0?Sn(this).transition().duration(f).call(B,j,I,D):Sn(this).call(k.transform,j,I,D)}}function $(D,...U){if(e.apply(this,arguments)){var z=D.touches,I=z.length,F=M(this,U,D.changedTouches.length===I).event(D),K,j,O,V;for(dp(D),j=0;j<I;++j)O=z[j],V=Pn(O,this),V=[V,this.__zoom.invert(V),O.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},b)),Uc(this),F.start())}}function P(D,...U){if(this.__zooming){var z=M(this,U).event(D),I=D.changedTouches,F=I.length,K,j,O,V;for(To(D),K=0;K<F;++K)j=I[K],O=Pn(j,this),z.touch0&&z.touch0[2]===j.identifier?z.touch0[0]=O:z.touch1&&z.touch1[2]===j.identifier&&(z.touch1[0]=O);if(j=z.that.__zoom,z.touch1){var A=z.touch0[0],ie=z.touch0[1],ce=z.touch1[0],fe=z.touch1[1],he=(he=ce[0]-A[0])*he+(he=ce[1]-A[1])*he,ue=(ue=fe[0]-ie[0])*ue+(ue=fe[1]-ie[1])*ue;j=C(j,Math.sqrt(he/ue)),O=[(A[0]+ce[0])/2,(A[1]+ce[1])/2],V=[(ie[0]+fe[0])/2,(ie[1]+fe[1])/2]}else if(z.touch0)O=z.touch0[0],V=z.touch0[1];else return;z.zoom("touch",n(_(j,O,V),z.extent,u))}}function te(D,...U){if(this.__zooming){var z=M(this,U).event(D),I=D.changedTouches,F=I.length,K,j;for(dp(D),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),K=0;K<F;++K)j=I[K],z.touch0&&z.touch0[2]===j.identifier?delete z.touch0:z.touch1&&z.touch1[2]===j.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(j=Pn(j,this),Math.hypot(m[0]-j[0],m[1]-j[1])<N)){var O=Sn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return k.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:oc(+D),k):r},k.filter=function(D){return arguments.length?(e=typeof D=="function"?D:oc(!!D),k):e},k.touchable=function(D){return arguments.length?(a=typeof D=="function"?D:oc(!!D),k):a},k.extent=function(D){return arguments.length?(t=typeof D=="function"?D:oc([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),k):t},k.scaleExtent=function(D){return arguments.length?(l[0]=+D[0],l[1]=+D[1],k):[l[0],l[1]]},k.translateExtent=function(D){return arguments.length?(u[0][0]=+D[0][0],u[1][0]=+D[1][0],u[0][1]=+D[0][1],u[1][1]=+D[1][1],k):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},k.constrain=function(D){return arguments.length?(n=D,k):n},k.duration=function(D){return arguments.length?(f=+D,k):f},k.interpolate=function(D){return arguments.length?(d=D,k):d},k.on=function(){var D=h.on.apply(h,arguments);return D===h?k:D},k.clickDistance=function(D){return arguments.length?(E=(D=+D)*D,k):Math.sqrt(E)},k.tapDistance=function(D){return arguments.length?(N=+D,k):N},k}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]],Hw=["Enter"," ","Escape"],Uw={"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 Iw={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 ef;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ef||(ef={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const Yb={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function qw(e){return e===null?null:e?"valid":"invalid"}const $w=e=>"id"in e&&"source"in e&&"target"in e,tA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_l=(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):Xm(a)?a:t.nodeLookup.get(a.id));const f=u?tf(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bf(r,f)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return vf(n)},kl=(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=bf(n,tf(a)),r=!0)}),r?vf(n):{x:0,y:0,width:0,height:0}},Gm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const f={...Nl(t,[n,r,a]),width:t.width/a,height:t.height/a},d=[];for(const h of e.values()){const{measured:g,selectable:m=!0,hidden:x=!1}=h;if(u&&!m||x)continue;const b=g.width??h.width??h.initialWidth??null,w=g.height??h.height??h.initialHeight??null,E=dl(f,xa(h)),N=(b??0)*(w??0),k=l&&E>0;(!h.internals.handleBounds||k||E>=N||h.dragging)&&d.push(h)}return d},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),d=kl(f),h=Zm(d,t,n,u?.minZoom??a,u?.maxZoom??l,u?.padding??.1);return await r.setViewport(h,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),Promise.resolve(!0)}function Pw({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:d,y:h}=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 b=f.measured.width,w=f.measured.height;b&&w&&(m=[[d,h],[d+b,h+w]])}else f&&ba(u.extent)&&(m=[[u.extent[0][0]+d,u.extent[0][1]+h],[u.extent[1][0]+d,u.extent[1][1]+h]]);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-d+(u.measured.width??0)*g[0],y:x.y-h+(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 b=l.has(x.id),w=!b&&x.parentId&&u.find(E=>E.id===x.parentId);(b||w)&&u.push(x)}const f=new Set(t.map(x=>x.id)),d=r.filter(x=>x.deletable!==!1),g=iA(u,d);for(const x of d)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 Vw(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 Xb=(e,t,n)=>e<t?ya(Math.abs(e-t),1,t)/t:e>n?-ya(Math.abs(e-n),1,t)/t:0,Fw=(e,t,n=15,r=40)=>{const a=Xb(e.x,r,t.width-r)*n,l=Xb(e.y,r,t.height-r)*n;return[a,l]},bf=(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)}),sm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),vf=({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}=Xm(e)?e.internals.positionAbsolute:_l(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}},tf=(e,t=[0,0])=>{const{x:n,y:r}=Xm(e)?e.internals.positionAbsolute:_l(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)}},Yw=(e,t)=>vf(bf(sm(e),sm(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)},Gb=e=>Yn(e.width)&&Yn(e.height)&&Yn(e.x)&&Yn(e.y),Yn=e=>!isNaN(e)&&isFinite(e),oA=(e,t)=>{},El=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Nl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const f={x:(e-n)/a,y:(t-r)/a};return l?El(f,u):f},nf=({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}=nf(e,[t,n,r]),{x:d,y:h}=nf({x:e.x+e.width,y:e.y+e.height},[t,n,r]),g=a-d,m=l-h;return{left:Math.floor(u),top:Math.floor(f),right:Math.floor(g),bottom:Math.floor(m)}}const Zm=(e,t,n,r,a,l)=>{const u=lA(l,t,n),f=(t-u.x)/e.width,d=(n-u.y)/e.height,h=Math.min(f,d),g=ya(h,r,a),m=e.x+e.width/2,x=e.y+e.height/2,b=t/2-m*g,w=n/2-x*g,E=uA(e,b,w,g,t,n),N={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:b-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 Xw(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Gw(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 Zb(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{...Uw,...e||{}}}function nl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Xn(e),f=Nl({x:l-(a?.left??0),y:u-(a?.top??0)},r),{x:d,y:h}=n?El(f,t):f;return{xSnapped:d,ySnapped:h,...f}}const Qm=e=>({width:e.offsetWidth,height:e.offsetHeight}),Zw=e=>e?.getRootNode?.()||window?.document,dA=["INPUT","SELECT","TEXTAREA"];function Qw(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:dA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Kw=e=>"clientX"in e,Xn=(e,t)=>{const n=Kw(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)}},Qb=(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,...Qm(u)}})};function Jw({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:f}){const d=e*.125+a*.375+u*.375+n*.125,h=t*.125+l*.375+f*.375+r*.125,g=Math.abs(d-e),m=Math.abs(h-t);return[d,h,g,m]}function lc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Kb({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case be.Left:return[t-lc(t-r,l),n];case be.Right:return[t+lc(r-t,l),n];case be.Top:return[t,n-lc(n-a,l)];case be.Bottom:return[t,n+lc(a-n,l)]}}function Ww({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top,curvature:u=.25}){const[f,d]=Kb({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[h,g]=Kb({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[m,x,b,w]=Jw({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:f,sourceControlY:d,targetControlX:h,targetControlY:g});return[`M${e},${t} C${f},${d} ${h},${g} ${r},${a}`,m,x,b,w]}function eS({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=bf(tf(e),tf(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,vf(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)),am=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||mA;let a;return $w(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 tS({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,f]=eS({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,f]}const Jb={[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},Wb=(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=Jb[t],d=Jb[r],h={x:e.x+f.x*l,y:e.y+f.y*l},g={x:n.x+d.x*l,y:n.y+d.y*l},m=yA({source:h,sourcePosition:t,target:g}),x=m.x!==0?"x":"y",b=m[x];let w=[],E,N;const k={x:0,y:0},C={x:0,y:0},[,,_,R]=eS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(f[x]*d[x]===-1){x==="x"?(E=a.x??h.x+(g.x-h.x)*u,N=a.y??(h.y+g.y)/2):(E=a.x??(h.x+g.x)/2,N=a.y??h.y+(g.y-h.y)*u);const M=[{x:E,y:h.y},{x:E,y:g.y}],L=[{x:h.x,y:N},{x:g.x,y:N}];f[x]===b?w=x==="x"?M:L:w=x==="x"?L:M}else{const M=[{x:h.x,y:g.y}],L=[{x:g.x,y:h.y}];if(x==="x"?w=f.x===b?L:M:w=f.y===b?M:L,t===r){const P=Math.abs(e[x]-n[x]);if(P<=l){const te=Math.min(l-1,l-P);f[x]===b?k[x]=(h[x]>e[x]?-1:1)*te:C[x]=(g[x]>n[x]?-1:1)*te}}if(t!==r){const P=x==="x"?"y":"x",te=f[x]===d[P],D=h[P]>g[P],U=h[P]<g[P];(f[x]===1&&(!te&&D||te&&U)||f[x]!==1&&(!te&&U||te&&D))&&(w=x==="x"?M:L)}const G={x:h.x+k.x,y:h.y+k.y},Z={x:g.x+C.x,y:g.y+C.y},H=Math.max(Math.abs(G.x-w[0].x),Math.abs(Z.x-w[0].x)),$=Math.max(Math.abs(G.y-w[0].y),Math.abs(Z.y-w[0].y));H>=$?(E=(G.x+Z.x)/2,N=w[0].y):(E=w[0].x,N=(G.y+Z.y)/2)}return[[e,{x:h.x+k.x,y:h.y+k.y},...w,{x:g.x+C.x,y:g.y+C.y},n],E,N,_,R]}function bA(e,t,n,r){const a=Math.min(Wb(e,t)/2,Wb(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 h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+a*h},${u}Q ${l},${u} ${l},${u+a*g}`}const f=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${l},${u+a*d}Q ${l},${u} ${l+a*f},${u}`}function om({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:r,targetY:a,targetPosition:l=be.Top,borderRadius:u=5,centerX:f,centerY:d,offset:h=20,stepPosition:g=.5}){const[m,x,b,w,E]=xA({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:l,center:{x:f,y:d},offset:h,stepPosition:g});return[m.reduce((k,C,_)=>{let R="";return _>0&&_<m.length-1?R=bA(m[_-1],C,m[_+1],u):R=`${_===0?"M":"L"}${C.x} ${C.y}`,k+=R,k},""),x,b,w,E]}function e1(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(!e1(t)||!e1(n))return null;const r=t.internals.handleBounds||t1(t.handles),a=n.internals.handleBounds||t1(n.handles),l=n1(r?.source??[],e.sourceHandle),u=n1(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,d=u?.position||be.Top,h=cs(t,l,f),g=cs(n,u,d);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:f,targetPosition:d}}function t1(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 n1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function lm(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(d=>{if(d&&typeof d=="object"){const h=lm(d,t);l.has(h)||(u.push({id:h,color:d.color||n,...d}),l.add(h))}}),u),[]).sort((u,f)=>u.id.localeCompare(f.id))}const nS=1e3,SA=10,Km={nodeOrigin:[0,0],nodeExtent:cl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_A={...Km,checkEquality:!0};function Jm(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=Jm(Km,n);for(const a of e.values())if(a.parentId)eg(a,e,t,r);else{const l=_l(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 Wm(e){return e==="manual"}function um(e,t,n,r={}){const a=Jm(_A,r),l={i:0},u=new Map(t),f=a?.elevateNodesOnSelect&&!Wm(a.zIndexMode)?nS:0;let d=e.length>0;t.clear(),n.clear();for(const h of e){let g=u.get(h.id);if(a.checkEquality&&h===g?.internals.userNode)t.set(h.id,g);else{const m=_l(h,a.nodeOrigin),x=ba(h.extent)?h.extent:a.nodeExtent,b=us(m,x,Vi(h));g={...a.defaults,...h,measured:{width:h.measured?.width,height:h.measured?.height},internals:{positionAbsolute:b,handleBounds:EA(h,g),z:iS(h,f,a.zIndexMode),userNode:h}},t.set(h.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),h.parentId&&eg(g,t,n,r,l)}return d}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 eg(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:f,zIndexMode:d}=Jm(Km,r),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} 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&&d==="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&&!Wm(d)?nS:0,{x,y:b,z:w}=CA(e,g,u,f,m,d),{positionAbsolute:E}=e.internals,N=x!==E.x||b!==E.y;(N||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x,y:b}:E,z:w}})}function iS(e,t,n){const r=Yn(e.zIndex)?e.zIndex:0;return Wm(n)?r:r+(e.selected?t:0)}function CA(e,t,n,r,a,l){const{x:u,y:f}=t.internals.positionAbsolute,d=Vi(e),h=_l(e,n),g=ba(e.extent)?us(h,e.extent,d):h;let m=us({x:u+g.x,y:f+g.y},r,d);e.extent==="parent"&&(m=Vw(m,d,t));const x=iS(e,a,l),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=x?b+1:x}}function tg(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 d=l.get(u.parentId)?.expandedRect??xa(f),h=Yw(d,u.rect);l.set(u.parentId,{expandedRect:h,parent:f})}return l.size>0&&l.forEach(({expandedRect:u,parent:f},d)=>{const h=f.internals.positionAbsolute,g=Vi(f),m=f.origin??r,x=u.x<h.x?Math.round(Math.abs(h.x-u.x)):0,b=u.y<h.y?Math.round(Math.abs(h.y-u.y)):0,w=Math.max(g.width,Math.round(u.width)),E=Math.max(g.height,Math.round(u.height)),N=(w-g.width)*m[0],k=(E-g.height)*m[1];(x>0||b>0||N||k)&&(a.push({id:d,type:"position",position:{x:f.position.x-x+N,y:f.position.y-b+k}}),n.get(d)?.forEach(C=>{e.some(_=>_.id===C.id)||a.push({id:C.id,type:"position",position:{x:C.position.x+x,y:C.position.y+b}})})),(g.width<u.width||g.height<u.height||x||b)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?m[0]*x-N:0),height:E+(b?m[1]*b-k:0)}})}),a}function TA(e,t,n,r,a,l,u){const f=r?.querySelector(".xyflow__viewport");let d=!1;if(!f)return{changes:[],updatedInternals:d};const h=[],g=window.getComputedStyle(f),{m22:m}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const b of e.values()){const w=t.get(b.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),d=!0;continue}const E=Qm(b.nodeElement),N=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(N||!w.internals.handleBounds||b.force))){const C=b.nodeElement.getBoundingClientRect(),_=ba(w.extent)?w.extent:l;let{positionAbsolute:R}=w.internals;w.parentId&&w.extent==="parent"?R=Vw(R,E,t.get(w.parentId)):_&&(R=us(R,_,E));const B={...w,measured:E,internals:{...w.internals,positionAbsolute:R,handleBounds:{source:Qb("source",b.nodeElement,C,m,w.id),target:Qb("target",b.nodeElement,C,m,w.id)}}};t.set(w.id,B),w.parentId&&eg(B,t,n,{nodeOrigin:a,zIndexMode:u}),d=!0,N&&(h.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:xa(B,a)}))}}if(x.length>0){const b=tg(x,t,n,a);h.push(...b)}return{changes:h,updatedInternals:d}}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 i1(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 d=r.get(u)||new Map;if(r.set(u,d.set(n,t)),l){u=`${a}-${e}-${l}`;const h=r.get(u)||new Map;r.set(u,h.set(n,t))}}function rS(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:f=null}=r,d={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:f},h=`${a}-${u}--${l}-${f}`,g=`${l}-${f}--${a}-${u}`;i1("source",d,g,e,a,u),i1("target",d,h,e,l,f),t.set(r.id,r)}}function sS(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:sS(n,t):!1}function r1(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||!sS(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 hp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const a=[];for(const[u,f]of t){const d=n.get(u)?.internals.userNode;d&&a.push({...d,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 RA({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=El(l,t);return{x:u.x-l.x,y:u.y-l.y}}function jA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,f=new Map,d=!1,h={x:0,y:0},g=null,m=!1,x=null,b=!1,w=!1,E=null;function N({noDragClassName:C,handleSelector:_,domNode:R,isSelectable:B,nodeId:M,nodeClickDistance:L=0}){x=Sn(R);function G({x:P,y:te}){const{nodeLookup:D,nodeExtent:U,snapGrid:z,snapToGrid:I,nodeOrigin:F,onNodeDrag:K,onSelectionDrag:j,onError:O,updateNodePositions:V}=t();l={x:P,y:te};let A=!1;const ie=f.size>1,ce=ie&&U?sm(kl(f)):null,fe=ie&&I?RA({dragItems:f,snapGrid:z,x:P,y:te}):null;for(const[he,ue]of f){if(!D.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)}:El(me,z));let Ee=null;if(ie&&U&&!ue.extent&&ce){const{positionAbsolute:Ne}=ue.internals,De=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=[[De,Xe],[Qe,pt]]}const{position:Ce,positionAbsolute:we}=Pw({nodeId:he,nextPosition:me,nodeLookup:D,nodeExtent:Ee||U,nodeOrigin:F,onError:O});A=A||ue.position.x!==Ce.x||ue.position.y!==Ce.y,ue.position=Ce,ue.internals.positionAbsolute=we}if(w=w||A,!!A&&(V(f,!0),E&&(r||K||!M&&j))){const[he,ue]=hp({nodeId:M,dragItems:f,nodeLookup:D});r?.(E,f,he,ue),K?.(E,he,ue),M||j?.(E,ue)}}async function Z(){if(!g)return;const{transform:P,panBy:te,autoPanSpeed:D,autoPanOnNodeDrag:U}=t();if(!U){d=!1,cancelAnimationFrame(u);return}const[z,I]=Fw(h,g,D);(z!==0||I!==0)&&(l.x=(l.x??0)-z/P[2],l.y=(l.y??0)-I/P[2],await te({x:z,y:I})&&G(l)),u=requestAnimationFrame(Z)}function H(P){const{nodeLookup:te,multiSelectionActive:D,nodesDraggable:U,transform:z,snapGrid:I,snapToGrid:F,selectNodesOnDrag:K,onNodeDragStart:j,onSelectionDragStart:O,unselectNodesAndEdges:V}=t();m=!0,(!K||!B)&&!D&&M&&(te.get(M)?.selected||V()),B&&K&&M&&e?.(M);const A=nl(P.sourceEvent,{transform:z,snapGrid:I,snapToGrid:F,containerBounds:g});if(l=A,f=MA(te,U,A,M),f.size>0&&(n||j||!M&&O)){const[ie,ce]=hp({nodeId:M,dragItems:f,nodeLookup:te});n?.(P.sourceEvent,f,ie,ce),j?.(P.sourceEvent,ie,ce),M||O?.(P.sourceEvent,ce)}}const $=Sw().clickDistance(L).on("start",P=>{const{domNode:te,nodeDragThreshold:D,transform:U,snapGrid:z,snapToGrid:I}=t();g=te?.getBoundingClientRect()||null,b=!1,w=!1,E=P.sourceEvent,D===0&&H(P),l=nl(P.sourceEvent,{transform:U,snapGrid:z,snapToGrid:I,containerBounds:g}),h=Xn(P.sourceEvent,g)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:D,snapGrid:U,snapToGrid:z,nodeDragThreshold:I,nodeLookup:F}=t(),K=nl(P.sourceEvent,{transform:D,snapGrid:U,snapToGrid:z,containerBounds:g});if(E=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||M&&!F.has(M))&&(b=!0),!b){if(!d&&te&&m&&(d=!0,Z()),!m){const j=Xn(P.sourceEvent,g),O=j.x-h.x,V=j.y-h.y;Math.sqrt(O*O+V*V)>I&&H(P)}(l.x!==K.xSnapped||l.y!==K.ySnapped)&&f&&m&&(h=Xn(P.sourceEvent,g),G(K))}}).on("end",P=>{if(!(!m||b)&&(d=!1,m=!1,cancelAnimationFrame(u),f.size>0)){const{nodeLookup:te,updateNodePositions:D,onNodeDragStop:U,onSelectionDragStop:z}=t();if(w&&(D(f,!1),w=!1),a||U||!M&&z){const[I,F]=hp({nodeId:M,dragItems:f,nodeLookup:te,dragging:!1});a?.(P.sourceEvent,f,I,F),U?.(P.sourceEvent,I,F),M||z?.(P.sourceEvent,F)}}}).filter(P=>{const te=P.target;return!P.button&&(!C||!r1(te,`.${C}`,R))&&(!_||r1(te,_,R))});x.call($)}function k(){x?.on(".drag",null)}return{update:N,destroy:k}}function zA(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 OA=250;function DA(e,t,n,r){let a=[],l=1/0;const u=zA(e,n,t+OA);for(const f of u){const d=[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]];for(const h of d){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:g,y:m}=cs(f,h,h.position,!0),x=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(m-e.y,2));x>t||(x<l?(a=[{...h,x:g,y:m}],l=x):x===l&&a.push({...h,x:g,y:m}))}}if(!a.length)return null;if(a.length>1){const f=r.type==="source"?"target":"source";return a.find(d=>d.type===f)??a[0]}return a[0]}function aS(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??[]],d=(n?f?.find(h=>h.id===n):f?.[0])??null;return d&&l?{...d,...cs(u,d,d.position,!0)}:d}function oS(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 lS=()=>!0;function BA(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:f,nodeLookup:d,lib:h,autoPanOnConnect:g,flowId:m,panBy:x,cancelConnection:b,onConnectStart:w,onConnect:E,onConnectEnd:N,isValidConnection:k=lS,onReconnectEnd:C,updateConnection:_,getTransform:R,getFromHandle:B,autoPanSpeed:M,dragThreshold:L=1,handleDomNode:G}){const Z=Zw(e.target);let H=0,$;const{x:P,y:te}=Xn(e),D=oS(l,G),U=f?.getBoundingClientRect();let z=!1;if(!U||!D)return;const I=aS(a,D,r,d,t);if(!I)return;let F=Xn(e,U),K=!1,j=null,O=!1,V=null;function A(){if(!g||!U)return;const[Ce,we]=Fw(F,U,M);x({x:Ce,y:we}),H=requestAnimationFrame(A)}const ie={...I,nodeId:a,type:D,position:I.position},ce=d.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:Yb[ie.position],toNode:null,pointer:F};function ue(){z=!0,_(he),w?.(e,{nodeId:a,handleId:r,handleType:D})}L===0&&ue();function me(Ce){if(!z){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=R();F=Xn(Ce,U),$=DA(Nl(F,we,!1,[1,1]),n,d,ie),K||(A(),K=!0);const Ne=uS(Ce,{handle:$,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:k,doc:Z,lib:h,flowId:m,nodeLookup:d});V=Ne.handleDomNode,j=Ne.connection,O=LA(!!$,Ne.isValid);const De=d.get(a),Qe=De?cs(De,ie,be.Left,!0):he.from,Xe={...he,from:Qe,isValid:O,to:Ne.toHandle&&O?nf({x:Ne.toHandle.x,y:Ne.toHandle.y},we):F,toHandle:Ne.toHandle,toPosition:O&&Ne.toHandle?Ne.toHandle.position:Yb[ie.position],toNode:Ne.toHandle?d.get(Ne.toHandle.nodeId):null,pointer:F};_(Xe),he=Xe}function Ee(Ce){if(!("touches"in Ce&&Ce.touches.length>0)){if(z){($||V)&&j&&O&&E?.(j);const{inProgress:we,...Ne}=he,De={...Ne,toPosition:he.toHandle?he.toPosition:null};N?.(Ce,De),l&&C?.(Ce,De)}b(),cancelAnimationFrame(H),K=!1,O=!1,j=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 uS(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:f,flowId:d,isValidConnection:h=lS,nodeLookup:g}){const m=l==="target",x=t?u.querySelector(`.${f}-flow__handle[data-id="${d}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:b,y:w}=Xn(e),E=u.elementFromPoint(b,w),N=E?.classList.contains(`${f}-flow__handle`)?E:x,k={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const C=oS(void 0,N),_=N.getAttribute("data-nodeid"),R=N.getAttribute("data-handleid"),B=N.classList.contains("connectable"),M=N.classList.contains("connectableend");if(!_||!C)return k;const L={source:m?_:r,sourceHandle:m?R:a,target:m?r:_,targetHandle:m?a:R};k.connection=L;const Z=B&&M&&(n===ga.Strict?m&&C==="source"||!m&&C==="target":_!==r||R!==a);k.isValid=Z&&h(L),k.toHandle=aS(_,C,R,g,n,!0)}return k}const cm={onPointerDown:BA,isValid:uS};function HA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=Sn(e);function l({translateExtent:f,width:d,height:h,zoomStep:g=1,pannable:m=!0,zoomable:x=!0,inversePan:b=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const R=n(),B=_.sourceEvent.ctrlKey&&hl()?10:1,M=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*g,L=R[2]*Math.pow(2,M*B);t.scaleTo(L)};let E=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(E=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},k=_=>{const R=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const B=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],M=[B[0]-E[0],B[1]-E[1]];E=B;const L=r()*Math.max(R[2],Math.log(R[2]))*(b?-1:1),G={x:R[0]-M[0]*L,y:R[1]-M[1]*L},Z=[[0,0],[d,h]];t.setViewportConstrained({x:G.x,y:G.y,zoom:R[2]},Z,f)},C=Bw().on("start",N).on("zoom",m?k:null).on("zoom.wheel",x?w:null);a.call(C,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Pn}}const wf=e=>({x:e.x,y:e.y,zoom:e.k}),pp=({x:e,y:t,zoom:n})=>xf.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),cS=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),UA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,mp=(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},fS=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:d,onPanZoomEnd:h}){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),k=fS(g),C=m*Math.pow(2,k);r.scaleTo(n,C,N,g);return}const x=g.deltaMode===1?20:1;let b=a===as.Vertical?0:g.deltaX*x,w=a===as.Horizontal?0:g.deltaY*x;!hl()&&g.shiftKey&&a!==as.Vertical&&(b=g.deltaY*x,w=0),r.translateBy(n,-(b/m)*l,-(w/m)*l,{internal:!0});const E=wf(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(d?.(g,E),e.panScrollTimeout=setTimeout(()=>{h?.(g,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,f?.(g,E))}}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=wf(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&&cS(t,e.mouseButton??0)),l.sourceEvent?.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!l.sourceEvent?.internal&&a?.(l.sourceEvent,wf(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&&cS(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const f=wf(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:d,lib:h,connectionInProgress:g}){return m=>{const x=e||t,b=n&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(la(m,`${h}-flow__node`)||la(m,`${h}-flow__edge`)))return!0;if(!r&&!x&&!a&&!l&&!n||u||g&&!w||la(m,f)&&w||la(m,d)&&(!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&&!b&&w||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&E}}function YA({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:f,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=Bw().scaleExtent([t,n]).translateExtent(r),x=Sn(e).call(m);C({x:a.x,y:a.y,zoom:ya(a.zoom,t,n)},[[0,0],[g.width,g.height]],r);const b=x.on("wheel.zoom"),w=x.on("dblclick.zoom");m.wheelDelta(fS);function E($,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?tl:Lc).transform(mp(x,P?.duration,P?.ease,()=>te(!0)),$)}):Promise.resolve(!1)}function N({noWheelClassName:$,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:D,panOnScroll:U,panOnDrag:z,panOnScrollMode:I,panOnScrollSpeed:F,preventScrolling:K,zoomOnPinch:j,zoomOnScroll:O,zoomOnDoubleClick:V,zoomActivationKeyPressed:A,lib:ie,onTransformChange:ce,connectionInProgress:fe,paneClickDistance:he,selectionOnDrag:ue}){D&&!h.isZoomingOrPanning&&k();const me=U&&!A&&!D;m.clickDistance(ue?1/0:!Yn(he)||he<0?0:he);const Ee=me?IA({zoomPanValues:h,noWheelClassName:$,d3Selection:x,d3Zoom:m,panOnScrollMode:I,panOnScrollSpeed:F,zoomOnPinch:j,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:f}):qA({noWheelClassName:$,preventScrolling:K,d3ZoomHandler:b});if(x.on("wheel.zoom",Ee,{passive:!1}),!D){const we=$A({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:u});m.on("start",we);const Ne=PA({zoomPanValues:h,panOnDrag:z,onPaneContextMenu:!!te,onPanZoom:l,onTransformChange:ce});m.on("zoom",Ne);const De=VA({zoomPanValues:h,panOnDrag:z,panOnScroll:U,onPaneContextMenu:te,onPanZoomEnd:f,onDraggingChange:d});m.on("end",De)}const Ce=FA({zoomActivationKeyPressed:A,panOnDrag:z,zoomOnScroll:O,panOnScroll:U,zoomOnDoubleClick:V,zoomOnPinch:j,userSelectionActive:D,noPanClassName:P,noWheelClassName:$,lib:ie,connectionInProgress:fe});m.filter(Ce),V?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function k(){m.on("zoom",null)}async function C($,P,te){const D=pp($),U=m?.constrain()(D,P,te);return U&&await E(U),new Promise(z=>z(U))}async function _($,P){const te=pp($);return await E(te,P),new Promise(D=>D(te))}function R($){if(x){const P=pp($),te=x.property("__zoom");(te.k!==$.zoom||te.x!==$.x||te.y!==$.y)&&m?.transform(x,P,null,{sync:!0})}}function B(){const $=x?Lw(x.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function M($,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?tl:Lc).scaleTo(mp(x,P?.duration,P?.ease,()=>te(!0)),$)}):Promise.resolve(!1)}function L($,P){return x?new Promise(te=>{m?.interpolate(P?.interpolate==="linear"?tl:Lc).scaleBy(mp(x,P?.duration,P?.ease,()=>te(!0)),$)}):Promise.resolve(!1)}function G($){m?.scaleExtent($)}function Z($){m?.translateExtent($)}function H($){const P=!Yn($)||$<0?0:$;m?.clickDistance(P)}return{update:N,destroy:k,setViewport:_,setViewportConstrained:C,getViewport:B,scaleTo:M,scaleBy:L,setScaleExtent:G,setTranslateExtent:Z,syncViewport:R,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,d=[u>0?1:u<0?-1:0,f>0?1:f<0?-1:0];return u&&a&&(d[0]=d[0]*-1),f&&l&&(d[1]=d[1]*-1),d}function s1(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 uc(e,t,n){return Math.max(0,t-e,e-n)}function a1(e,t){return e?!t:t}function GA(e,t,n,r,a,l,u,f){let{affectsX:d,affectsY:h}=t;const{isHorizontal:g,isVertical:m}=t,x=g&&m,{xSnapped:b,ySnapped:w}=n,{minWidth:E,maxWidth:N,minHeight:k,maxHeight:C}=r,{x:_,y:R,width:B,height:M,aspectRatio:L}=e;let G=Math.floor(g?b-e.pointerX:0),Z=Math.floor(m?w-e.pointerY:0);const H=B+(d?-G:G),$=M+(h?-Z:Z),P=-l[0]*B,te=-l[1]*M;let D=uc(H,E,N),U=uc($,k,C);if(u){let F=0,K=0;d&&G<0?F=wr(_+G+P,u[0][0]):!d&&G>0&&(F=Sr(_+H+P,u[1][0])),h&&Z<0?K=wr(R+Z+te,u[0][1]):!h&&Z>0&&(K=Sr(R+$+te,u[1][1])),D=Math.max(D,F),U=Math.max(U,K)}if(f){let F=0,K=0;d&&G>0?F=Sr(_+G,f[0][0]):!d&&G<0&&(F=wr(_+H,f[1][0])),h&&Z>0?K=Sr(R+Z,f[0][1]):!h&&Z<0&&(K=wr(R+$,f[1][1])),D=Math.max(D,F),U=Math.max(U,K)}if(a){if(g){const F=uc(H/L,k,C)*L;if(D=Math.max(D,F),u){let K=0;!d&&!h||d&&!h&&x?K=Sr(R+te+H/L,u[1][1])*L:K=wr(R+te+(d?G:-G)/L,u[0][1])*L,D=Math.max(D,K)}if(f){let K=0;!d&&!h||d&&!h&&x?K=wr(R+H/L,f[1][1])*L:K=Sr(R+(d?G:-G)/L,f[0][1])*L,D=Math.max(D,K)}}if(m){const F=uc($*L,E,N)/L;if(U=Math.max(U,F),u){let K=0;!d&&!h||h&&!d&&x?K=Sr(_+$*L+P,u[1][0])/L:K=wr(_+(h?Z:-Z)*L+P,u[0][0])/L,U=Math.max(U,K)}if(f){let K=0;!d&&!h||h&&!d&&x?K=wr(_+$*L,f[1][0])/L:K=Sr(_+(h?Z:-Z)*L,f[0][0])/L,U=Math.max(U,K)}}}Z=Z+(Z<0?U:-U),G=G+(G<0?D:-D),a&&(x?H>$*L?Z=(a1(d,h)?-G:G)/L:G=(a1(d,h)?-Z:Z)*L:g?(Z=G/L,h=d):(G=Z*L,d=h));const z=d?_+G:_,I=h?R+Z:R;return{width:B+(d?-G:G),height:M+(h?-Z:Z),x:l[0]*G*(d?-1:1)+z,y:l[1]*Z*(h?-1:1)+I}}const dS={width:0,height:0,x:0,y:0},ZA={...dS,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,d=n[1]*u;return[[r-f,a-d],[r+l-f,a+u-d]]}function JA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=Sn(e);let u={controlDirection:s1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function f({controlPosition:h,boundaries:g,keepAspectRatio:m,resizeDirection:x,onResizeStart:b,onResize:w,onResizeEnd:E,shouldResize:N}){let k={...dS},C={...ZA};u={boundaries:g,resizeDirection:x,keepAspectRatio:m,controlDirection:s1(h)};let _,R=null,B=[],M,L,G,Z=!1;const H=Sw().on("start",$=>{const{nodeLookup:P,transform:te,snapGrid:D,snapToGrid:U,nodeOrigin:z,paneDomNode:I}=n();if(_=P.get(t),!_)return;R=I?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:K}=nl($.sourceEvent,{transform:te,snapGrid:D,snapToGrid:U,containerBounds:R});k={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},C={...k,pointerX:F,pointerY:K,aspectRatio:k.width/k.height},M=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(M=P.get(_.parentId),L=M&&_.extent==="parent"?QA(M):void 0),B=[],G=void 0;for(const[j,O]of P)if(O.parentId===t&&(B.push({id:j,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const V=KA(O,_,O.origin??z);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}b?.($,{...k})}).on("drag",$=>{const{transform:P,snapGrid:te,snapToGrid:D,nodeOrigin:U}=n(),z=nl($.sourceEvent,{transform:P,snapGrid:te,snapToGrid:D,containerBounds:R}),I=[];if(!_)return;const{x:F,y:K,width:j,height:O}=k,V={},A=_.origin??U,{width:ie,height:ce,x:fe,y:he}=GA(C,u.controlDirection,z,u.boundaries,u.keepAspectRatio,A,L,G),ue=ie!==j,me=ce!==O,Ee=fe!==F&&ue,Ce=he!==K&&me;if(!Ee&&!Ce&&!ue&&!me)return;if((Ee||Ce||A[0]===1||A[1]===1)&&(V.x=Ee?fe:k.x,V.y=Ce?he:k.y,k.x=V.x,k.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+A[0]*(ie-j),y:pt.position.y-Xe+A[1]*(ce-O)},I.push(pt)}if((ue||me)&&(V.width=ue&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:k.width,V.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?ce:k.height,k.width=V.width,k.height=V.height),M&&_.expandParent){const Qe=A[0]*(V.width??0);V.x&&V.x<Qe&&(k.x=Qe,C.x=C.x-(V.x-Qe));const Xe=A[1]*(V.height??0);V.y&&V.y<Xe&&(k.y=Xe,C.y=C.y-(V.y-Xe))}const we=XA({width:k.width,prevWidth:j,height:k.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={...k,direction:we};N?.($,Ne)!==!1&&(Z=!0,w?.($,Ne),r(V,I))}).on("end",$=>{Z&&(E?.($,{...k}),a?.({...k}),Z=!1)});l.call(H)}function d(){l.on(".drag",null)}return{update:f,destroy:d}}var gp={exports:{}},yp={},xp={exports:{}},bp={};var o1;function WA(){if(o1)return bp;o1=1;var e=vl();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 b=x(),w=r({inst:{value:b,getSnapshot:x}}),E=w[0].inst,N=w[1];return l(function(){E.value=b,E.getSnapshot=x,d(E)&&N({inst:E})},[m,b,x]),a(function(){return d(E)&&N({inst:E}),m(function(){d(E)&&N({inst:E})})},[m]),u(b),b}function d(m){var x=m.getSnapshot;m=m.value;try{var b=x();return!n(m,b)}catch{return!0}}function h(m,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:f;return bp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,bp}var l1;function eM(){return l1||(l1=1,xp.exports=WA()),xp.exports}var u1;function tM(){if(u1)return yp;u1=1;var e=vl(),t=eM();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,d=e.useDebugValue;return yp.useSyncExternalStoreWithSelector=function(h,g,m,x,b){var w=l(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=f(function(){function k(M){if(!C){if(C=!0,_=M,M=x(M),b!==void 0&&E.hasValue){var L=E.value;if(b(L,M))return R=L}return R=M}if(L=R,r(_,M))return L;var G=x(M);return b!==void 0&&b(L,G)?(_=M,L):(_=M,R=G)}var C=!1,_,R,B=m===void 0?null:m;return[function(){return k(g())},B===null?void 0:function(){return k(B())}]},[g,m,x,b]);var N=a(h,w[0],w[1]);return u(function(){E.hasValue=!0,E.value=N},[N]),d(N),N},yp}var c1;function nM(){return c1||(c1=1,gp.exports=tM()),gp.exports}var iM=nM();const rM=hf(iM),sM={},f1=e=>{let t;const n=new Set,r=(g,m)=>{const x=typeof g=="function"?g(t):g;if(!Object.is(x,t)){const b=t;t=m??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(w=>w(t,b))}},a=()=>t,d={setState:r,getState:a,getInitialState:()=>h,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()}},h=t=e(r,a,d);return d},aM=e=>e?f1(e):f1,{useDebugValue:oM}=Zo,{useSyncExternalStoreWithSelector:lM}=rM,uM=e=>e;function hS(e,t=uM,n){const r=lM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oM(r),r}const d1=(e,t)=>{const n=aM(e),r=(a,l=t)=>hS(n,a,l);return Object.assign(r,n),r},cM=(e,t)=>e?d1(e,t):d1;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}ow();const Sf=X.createContext(null),fM=Sf.Provider,pS=ui.error001();function Ye(e,t){const n=X.useContext(Sf);if(n===null)throw new Error(pS);return hS(n,e,t)}function ft(){const e=X.useContext(Sf);if(e===null)throw new Error(pS);return X.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const h1={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%)"},mS="react-flow__node-desc",gS="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 v.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 v.jsxs(v.Fragment,{children:[v.jsx("div",{id:`${mS}-${e}`,style:h1,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),v.jsx("div",{id:`${gS}-${e}`,style:h1,children:n["edge.a11yDescription.default"]}),!t&&v.jsx(gM,{rfId:e})]})}const _f=X.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return v.jsx("div",{className:Et(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});_f.displayName="Panel";function xM({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:v.jsx(_f,{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:v.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}},cc=e=>e.id;function vM(e,t){return ct(e.selectedNodes.map(cc),t.selectedNodes.map(cc))&&ct(e.selectedEdges.map(cc),t.selectedEdges.map(cc))}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?v.jsx(wM,{onSelectionChange:e}):null}const yS=[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"],p1=[...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}),m1={translateExtent:cl,nodeOrigin:yS,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:d}=Ye(NM,ct),h=ft();X.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{g.current=m1,f()}),[]);const g=X.useRef(m1);return X.useEffect(()=>{for(const m of p1){const x=e[m],b=g.current[m];x!==b&&(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"?h.setState({ariaLabelConfig:fA(x)}):m==="fitView"?h.setState({fitViewQueued:x}):m==="fitViewOptions"?h.setState({fitViewOptions:x}):h.setState({[m]:x})))}g.current=e},p1.map(m=>e[m])),null}function g1(){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=g1(),a=()=>n(r?.matches?"dark":"light");return a(),r?.addEventListener("change",a),()=>{r?.removeEventListener("change",a)}},[e]),t!==null?t:g1()?.matches?"dark":"light"}const y1=typeof document<"u"?document:null;function pl(e=null,t={target:y1,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 h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `)),g=h.reduce((m,x)=>m.concat(...x),[]);return[h,g]}return[[],[]]},[e]);return X.useEffect(()=>{const d=t?.target??y1,h=t?.actInsideInputWithModifier??!0;if(e!==null){const g=b=>{if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!h)&&Qw(b))return!1;const E=b1(b.code,f);if(l.current.add(b[E]),x1(u,l.current,!1)){const N=b.composedPath?.()?.[0]||b.target,k=N?.nodeName==="BUTTON"||N?.nodeName==="A";t.preventDefault!==!1&&(a.current||!k)&&b.preventDefault(),r(!0)}},m=b=>{const w=b1(b.code,f);x1(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(b[w]),b.key==="Meta"&&l.current.clear(),a.current=!1},x=()=>{l.current.clear(),r(!1)};return d?.addEventListener("keydown",g),d?.addEventListener("keyup",m),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{d?.removeEventListener("keydown",g),d?.removeEventListener("keyup",m),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,r]),n}function x1(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function b1(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(),d=Zm(t,r,a,l,u,n?.padding??.1);return f?(await f.setViewport(d,{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:d}=u.getBoundingClientRect(),h={x:t.x-f,y:t.y-d},g=n.snapGrid??a,m=n.snapToGrid??l;return Nl(h,r,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=nf(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function xS(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 d of u)MM(d,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 bS(e,t){return xS(e,t)}function vS(e,t){return xS(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 v1({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 w1(e){return{id:e.id,type:"remove"}}const S1=e=>tA(e),RM=e=>$w(e);function wS(e){return X.forwardRef(e)}const jM=typeof window<"u"?X.useLayoutEffect:X.useEffect;function _1(e){const[t,n]=X.useState(BigInt(0)),[r]=X.useState(()=>zM(()=>n(a=>a+BigInt(1))));return jM(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function zM(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const SS=X.createContext(null);function OM({children:e}){const t=ft(),n=X.useCallback(f=>{const{nodes:d=[],setNodes:h,hasDefaultNodes:g,onNodesChange:m,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:w}=t.getState();let E=d;for(const k of f)E=typeof k=="function"?k(E):k;let N=v1({items:E,lookup:x});for(const k of w.values())N=k(N);g&&h(E),N.length>0?m?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:C,setNodes:_}=t.getState();k&&_(C)})},[]),r=_1(n),a=X.useCallback(f=>{const{edges:d=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:x}=t.getState();let b=d;for(const w of f)b=typeof w=="function"?w(b):w;g?h(b):m&&m(v1({items:b,lookup:x}))},[]),l=_1(a),u=X.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return v.jsx(SS.Provider,{value:u,children:e})}function DM(){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 ng(){const e=AM(),t=ft(),n=DM(),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)},d=m=>{const{nodeLookup:x,nodeOrigin:b}=t.getState(),w=S1(m)?m:x.get(m.id),E=w.parentId?Gw(w.position,w.measured,w.parentId,x,b):w.position,N={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return xa(N)},h=(m,x,b={replace:!1})=>{u(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&S1(N)?N:{...E,...N}}return E}))},g=(m,x,b={replace:!1})=>{f(w=>w.map(E=>{if(E.id===m){const N=typeof x=="function"?x(E):x;return b.replace&&RM(N)?N:{...E,...N}}return E}))};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(b=>[...b,...x])},addEdges:m=>{const x=Array.isArray(m)?m:[m];n.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:m=[],edges:x=[],transform:b}=t.getState(),[w,E,N]=b;return{nodes:m.map(k=>({...k})),edges:x.map(k=>({...k})),viewport:{x:w,y:E,zoom:N}}},deleteElements:async({nodes:m=[],edges:x=[]})=>{const{nodes:b,edges:w,onNodesDelete:E,onEdgesDelete:N,triggerNodeChanges:k,triggerEdgeChanges:C,onDelete:_,onBeforeDelete:R}=t.getState(),{nodes:B,edges:M}=await aA({nodesToRemove:m,edgesToRemove:x,nodes:b,edges:w,onBeforeDelete:R}),L=M.length>0,G=B.length>0;if(L){const Z=M.map(w1);N?.(M),C(Z)}if(G){const Z=B.map(w1);E?.(B),k(Z)}return(G||L)&&_?.({nodes:B,edges:M}),{deletedNodes:B,deletedEdges:M}},getIntersectingNodes:(m,x=!0,b)=>{const w=Gb(m),E=w?m:d(m),N=b!==void 0;return E?(b||t.getState().nodes).filter(k=>{const C=t.getState().nodeLookup.get(k.id);if(C&&!w&&(k.id===m.id||!C.internals.positionAbsolute))return!1;const _=xa(N?k:C),R=dl(_,E);return x&&R>0||R>=_.width*_.height||R>=E.width*E.height}):[]},isNodeIntersecting:(m,x,b=!0)=>{const E=Gb(m)?m:d(m);if(!E)return!1;const N=dl(E,x);return b&&N>0||N>=x.width*x.height||N>=E.width*E.height},updateNode:h,updateNodeData:(m,x,b={replace:!1})=>{h(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},updateEdge:g,updateEdgeData:(m,x,b={replace:!1})=>{g(m,w=>{const E=typeof x=="function"?x(w):x;return b.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},b)},getNodesBounds:m=>{const{nodeLookup:x,nodeOrigin:b}=t.getState();return nA(m,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:m,id:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}-${m}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:x,nodeId:b})=>Array.from(t.getState().connectionLookup.get(`${b}${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(b=>[...b]),x.promise}}},[]);return X.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const k1=e=>e.selected,BM=typeof window<"u"?window:void 0;function HM({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ft(),{deleteElements:r}=ng(),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(k1),edges:u.filter(k1)}),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=Qm(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 kf={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:d,translateExtent:h,minZoom:g,maxZoom:m,zoomActivationKeyCode:x,preventScrolling:b=!0,children:w,noWheelClassName:E,noPanClassName:N,onViewportChange:k,isControlledViewport:C,paneClickDistance:_,selectionOnDrag:R}){const B=ft(),M=X.useRef(null),{userSelectionActive:L,lib:G,connectionInProgress:Z}=Ye(IM,ct),H=pl(x),$=X.useRef();UM(M);const P=X.useCallback(te=>{k?.({x:te[0],y:te[1],zoom:te[2]}),C||B.setState({transform:te})},[k,C]);return X.useEffect(()=>{if(M.current){$.current=YA({domNode:M.current,minZoom:g,maxZoom:m,translateExtent:h,viewport:d,onDraggingChange:z=>B.setState({paneDragging:z}),onPanZoomStart:(z,I)=>{const{onViewportChangeStart:F,onMoveStart:K}=B.getState();K?.(z,I),F?.(I)},onPanZoom:(z,I)=>{const{onViewportChange:F,onMove:K}=B.getState();K?.(z,I),F?.(I)},onPanZoomEnd:(z,I)=>{const{onViewportChangeEnd:F,onMoveEnd:K}=B.getState();K?.(z,I),F?.(I)}});const{x:te,y:D,zoom:U}=$.current.getViewport();return B.setState({panZoom:$.current,transform:[te,D,U],domNode:M.current.closest(".react-flow")}),()=>{$.current?.destroy()}}},[]),X.useEffect(()=>{$.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:f,zoomActivationKeyPressed:H,preventScrolling:b,noPanClassName:N,userSelectionActive:L,noWheelClassName:E,lib:G,onTransformChange:P,connectionInProgress:Z,selectionOnDrag:R,paneClickDistance:_})},[e,t,n,r,a,l,u,f,H,b,N,L,E,G,P,Z,R,_]),v.jsx("div",{className:"react-flow__renderer",ref:M,style:kf,children:w})}const $M=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function PM(){const{userSelectionActive:e,userSelectionRect:t}=Ye($M,ct);return e&&t?v.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 vp=(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:d,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:x,onPaneMouseLeave:b,children:w}){const E=ft(),{userSelectionActive:N,elementsSelectable:k,dragging:C,connectionInProgress:_}=Ye(VM,ct),R=k&&(e||N),B=X.useRef(null),M=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}d?.(F),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},$=F=>{if(Array.isArray(r)&&r?.includes(2)){F.preventDefault();return}h?.(F)},P=g?F=>g(F):void 0,te=F=>{Z.current&&(F.stopPropagation(),Z.current=!1)},D=F=>{const{domNode:K}=E.getState();if(M.current=K?.getBoundingClientRect(),!M.current)return;const j=F.target===B.current;if(!j&&!!F.target.closest(".nokey")||!e||!(l&&j||t)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),Z.current=!1;const{x:A,y:ie}=Xn(F.nativeEvent,M.current);E.setState({userSelectionRect:{width:0,height:0,startX:A,startY:ie,x:A,y:ie}}),j||(F.stopPropagation(),F.preventDefault())},U=F=>{const{userSelectionRect:K,transform:j,nodeLookup:O,edgeLookup:V,connectionLookup:A,triggerNodeChanges:ie,triggerEdgeChanges:ce,defaultEdgeOptions:fe,resetSelectedElements:he}=E.getState();if(!M.current||!K)return;const{x:ue,y:me}=Xn(F.nativeEvent,M.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,De=G.current;L.current=new Set(Gm(O,we,j,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=A.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(!Zb(Ne,L.current)){const Xe=ua(O,L.current,!0);ie(Xe)}if(!Zb(De,G.current)){const Xe=ua(V,G.current);ce(Xe)}E.setState({userSelectionRect:we,userSelectionActive:!0,nodesSelectionActive:!1})},z=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!N&&F.target===B.current&&E.getState().userSelectionRect&&H?.(F),E.setState({userSelectionActive:!1,userSelectionRect:null}),Z.current&&(f?.(F),E.setState({nodesSelectionActive:L.current.size>0})))},I=r===!0||Array.isArray(r)&&r.includes(0);return v.jsxs("div",{className:Et(["react-flow__pane",{draggable:I,dragging:C,selection:e}]),onClick:R?void 0:vp(H,B),onContextMenu:vp($,B),onWheel:vp(P,B),onPointerEnter:R?void 0:m,onPointerMove:R?U:x,onPointerUp:R?z:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?te:void 0,onPointerLeave:b,ref:B,style:kf,children:[w,v.jsx(PM,{})]})}function fm({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:f,onError:d}=t.getState(),h=f.get(e);if(!h){d?.("012",ui.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&u)&&(l({nodes:[h],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(),[d,h]=X.useState(!1),g=X.useRef();return X.useEffect(()=>{g.current=jA({getStoreItems:()=>f.getState(),onNodeMouseDown:m=>{fm({id:m,store:f,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!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]),d}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:d,nodeLookup:h,nodeOrigin:g}=e.getState(),m=new Map,x=YM(u),b=a?l[0]:5,w=a?l[1]:5,E=n.direction.x*b*n.factor,N=n.direction.y*w*n.factor;for(const[,k]of h){if(!x(k))continue;let C={x:k.internals.positionAbsolute.x+E,y:k.internals.positionAbsolute.y+N};a&&(C=El(C,l));const{position:_,positionAbsolute:R}=Pw({nodeId:k.id,nextPosition:C,nodeLookup:h,nodeExtent:r,nodeOrigin:g,onError:f});k.position=_,k.internals.positionAbsolute=R,m.set(k.id,k)}d(m)},[])}const ig=X.createContext(null),XM=ig.Provider;ig.Consumer;const ES=()=>X.useContext(ig),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:d,isValid:h}=u,g=d?.nodeId===e&&d?.id===t&&d?.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&&h}};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:d,className:h,onMouseDown:g,onTouchStart:m,...x},b){const w=u||null,E=e==="target",N=ft(),k=ES(),{connectOnClick:C,noPanClassName:_,rfId:R}=Ye(GM,ct),{connectingFrom:B,connectingTo:M,clickConnecting:L,isPossibleEndHandle:G,connectionInProcess:Z,clickConnectionInProcess:H,valid:$}=Ye(ZM(k,w,e),ct);k||N.getState().onError?.("010",ui.error010());const P=U=>{const{defaultEdgeOptions:z,onConnect:I,hasDefaultEdges:F}=N.getState(),K={...z,...U};if(F){const{edges:j,setEdges:O}=N.getState();O(am(K,j))}I?.(K),f?.(K)},te=U=>{if(!k)return;const z=Kw(U.nativeEvent);if(a&&(z&&U.button===0||!z)){const I=N.getState();cm.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:E,handleId:w,nodeId:k,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})}z?g?.(U):m?.(U)},D=U=>{const{onClickConnectStart:z,onClickConnectEnd:I,connectionClickStartHandle:F,connectionMode:K,isValidConnection:j,lib:O,rfId:V,nodeLookup:A,connection:ie}=N.getState();if(!k||!F&&!a)return;if(!F){z?.(U.nativeEvent,{nodeId:k,handleId:w,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:k,type:e,id:w}});return}const ce=Zw(U.target),fe=n||j,{connection:he,isValid:ue}=cm.isValid(U.nativeEvent,{handle:{nodeId:k,id:w,type:e},connectionMode:K,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:fe,flowId:V,doc:ce,lib:O,nodeLookup:A});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 v.jsx("div",{"data-handleid":w,"data-nodeid":k,"data-handlepos":t,"data-id":`${R}-${k}-${w}-${e}`,className:Et(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,h,{source:!E,target:E,connectable:r,connectablestart:a,connectableend:l,clickconnecting:L,connectingfrom:B,connectingto:M,valid:$,connectionindicator:r&&(!Z||G)&&(Z||H?l:a)}]),onMouseDown:te,onTouchStart:te,onClick:C?D:void 0,ref:b,...x,children:d})}const wa=X.memo(wS(QM));function KM({data:e,isConnectable:t,sourcePosition:n=be.Bottom}){return v.jsxs(v.Fragment,{children:[e?.label,v.jsx(wa,{type:"source",position:n,isConnectable:t})]})}function JM({data:e,isConnectable:t,targetPosition:n=be.Top,sourcePosition:r=be.Bottom}){return v.jsxs(v.Fragment,{children:[v.jsx(wa,{type:"target",position:n,isConnectable:t}),e?.label,v.jsx(wa,{type:"source",position:r,isConnectable:t})]})}function WM(){return null}function e3({data:e,isConnectable:t,targetPosition:n=be.Top}){return v.jsxs(v.Fragment,{children:[v.jsx(wa,{type:"target",position:n,isConnectable:t}),e?.label]})}const rf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},E1={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}=kl(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),d=kS(),h=X.useRef(null);if(X.useEffect(()=>{n||h.current?.focus({preventScroll:!0})},[n]),_S({nodeRef:h}),f||!a||!l)return null;const g=e?x=>{const b=r.getState().nodes.filter(w=>w.selected);e(x,b)}:void 0,m=x=>{Object.prototype.hasOwnProperty.call(rf,x.key)&&(x.preventDefault(),d({direction:rf[x.key],factor:x.shiftKey?4:1}))};return v.jsx("div",{className:Et(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:v.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:l}})})}const N1=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:d,selectionKeyCode:h,selectionOnDrag:g,selectionMode:m,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:k,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:M,zoomOnDoubleClick:L,panOnDrag:G,defaultViewport:Z,translateExtent:H,minZoom:$,maxZoom:P,preventScrolling:te,onSelectionContextMenu:D,noWheelClassName:U,noPanClassName:z,disableKeyboardA11y:I,onViewportChange:F,isControlledViewport:K}){const{nodesSelectionActive:j,userSelectionActive:O}=Ye(r3,ct),V=pl(h,{target:N1}),A=pl(E,{target:N1}),ie=A||G,ce=A||R,fe=g&&ie!==!0,he=V||O||fe;return HM({deleteKeyCode:d,multiSelectionKeyCode:w}),v.jsx(qM,{onPaneContextMenu:l,elementsSelectable:k,zoomOnScroll:C,zoomOnPinch:_,panOnScroll:ce,panOnScrollSpeed:B,panOnScrollMode:M,zoomOnDoubleClick:L,panOnDrag:!V&&ie,defaultViewport:Z,translateExtent:H,minZoom:$,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:te,noWheelClassName:U,noPanClassName:z,onViewportChange:F,isControlledViewport:K,paneClickDistance:f,selectionOnDrag:fe,children:v.jsxs(FM,{onSelectionStart:x,onSelectionEnd:b,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,j&&v.jsx(i3,{onSelectionContextMenu:D,noPanClassName:z,disableKeyboardA11y:I})]})})}NS.displayName="FlowRenderer";const s3=X.memo(NS),a3=e=>t=>e?Gm(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),d=X.useRef(e.targetPosition),h=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=h.current!==t,x=f.current!==e.sourcePosition,b=d.current!==e.targetPosition;(m||x||b)&&(h.current=t,f.current=e.sourcePosition,d.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:d,nodesConnectable:h,nodesFocusable:g,resizeObserver:m,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:w,rfId:E,nodeTypes:N,nodeClickDistance:k,onError:C}){const{node:_,internals:R,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 M=_.type||"default",L=N?.[M]||E1[M];L===void 0&&(C?.("003",ui.error003(M)),M="default",L=N?.default||E1.default);const G=!!(_.draggable||f&&typeof _.draggable>"u"),Z=!!(_.selectable||d&&typeof _.selectable>"u"),H=!!(_.connectable||h&&typeof _.connectable>"u"),$=!!(_.focusable||g&&typeof _.focusable>"u"),P=ft(),te=Xw(_),D=c3({node:_,nodeType:M,hasDimensions:te,resizeObserver:m}),U=_S({nodeRef:D,disabled:_.hidden||!G,noDragClassName:x,handleSelector:_.dragHandle,nodeId:e,isSelectable:Z,nodeClickDistance:k}),z=kS();if(_.hidden)return null;const I=Vi(_),F=t3(_),K=Z||G||t||n||r||a,j=n?ue=>n(ue,{...R.userNode}):void 0,O=r?ue=>r(ue,{...R.userNode}):void 0,V=a?ue=>a(ue,{...R.userNode}):void 0,A=l?ue=>l(ue,{...R.userNode}):void 0,ie=u?ue=>u(ue,{...R.userNode}):void 0,ce=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:Ee}=P.getState();Z&&(!me||!G||Ee>0)&&fm({id:e,store:P,nodeRef:D}),t&&t(ue,{...R.userNode})},fe=ue=>{if(!(Qw(ue.nativeEvent)||w)){if(Hw.includes(ue.key)&&Z){const me=ue.key==="Escape";fm({id:e,store:P,unselect:me,nodeRef:D})}else if(G&&_.selected&&Object.prototype.hasOwnProperty.call(rf,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),z({direction:rf[ue.key],factor:ue.shiftKey?4:1})}}},he=()=>{if(w||!D.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:Ee,autoPanOnNodeFocus:Ce,setCenter:we}=P.getState();if(!Ce)return;Gm(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 v.jsx("div",{className:Et(["react-flow__node",`react-flow__node-${M}`,{[b]:G},_.className,{selected:_.selected,selectable:Z,parent:B,draggable:G,dragging:U}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:te?"visible":"hidden",..._.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:O,onMouseLeave:V,onContextMenu:A,onClick:ce,onDoubleClick:ie,onKeyDown:$?fe:void 0,tabIndex:$?0:void 0,onFocus:$?he:void 0,role:_.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${mS}-${E}`,"aria-label":_.ariaLabel,..._.domAttributes,children:v.jsx(XM,{value:e,children:v.jsx(L,{id:e,data:_.data,type:M,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:_.selected??!1,selectable:Z,draggable:G,deletable:_.deletable??!0,isConnectable:H,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:U,dragHandle:_.dragHandle,zIndex:R.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 v.jsx("div",{className:"react-flow__nodes",style:kf,children:u.map(d=>v.jsx(d3,{id:d,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},d))})}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 v.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 v.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},C1={[ef.Arrow]:g3,[ef.ArrowClosed]:y3};function x3(e){const t=ft();return X.useMemo(()=>Object.prototype.hasOwnProperty.call(C1,e)?C1[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 d=x3(t);return d?v.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:v.jsx(d,{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?v.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:v.jsx("defs",{children:a.map(l=>v.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:d,className:h,...g}){const[m,x]=X.useState({x:1,y:0,width:0,height:0}),b=Et(["react-flow__edge-textwrapper",h]),w=X.useRef(null);return X.useEffect(()=>{if(w.current){const E=w.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),n?v.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[a&&v.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}),v.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:r,children:n}),d]}):null}AS.displayName="EdgeText";const w3=X.memo(AS);function Ef({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d,interactionWidth:h=20,...g}){return v.jsxs(v.Fragment,{children:[v.jsx("path",{...g,d:e,fill:"none",className:Et(["react-flow__edge-path",g.className])}),h?v.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&Yn(t)&&Yn(n)?v.jsx(w3,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:f,labelBgBorderRadius:d}):null]})}function T1({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]=T1({pos:n,x1:e,y1:t,x2:r,y2:a}),[d,h]=T1({pos:l,x1:r,y1:a,x2:e,y2:t}),[g,m,x,b]=Jw({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:h});return[`M${e},${t} C${u},${f} ${d},${h} ${r},${a}`,g,m,x,b]}function RS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:f,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:k})=>{const[C,_,R]=MS({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:f}),B=e.isInternal?void 0:t;return v.jsx(Ef,{id:B,path:C,labelX:_,labelY:R,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:k})})}const S3=RS({isInternal:!1}),jS=RS({isInternal:!0});S3.displayName="SimpleBezierEdge";jS.displayName="SimpleBezierEdgeInternal";function zS(e){return X.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,sourcePosition:b=be.Bottom,targetPosition:w=be.Top,markerEnd:E,markerStart:N,pathOptions:k,interactionWidth:C})=>{const[_,R,B]=om({sourceX:n,sourceY:r,sourcePosition:b,targetX:a,targetY:l,targetPosition:w,borderRadius:k?.borderRadius,offset:k?.offset,stepPosition:k?.stepPosition}),M=e.isInternal?void 0:t;return v.jsx(Ef,{id:M,path:_,labelX:R,labelY:B,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:E,markerStart:N,interactionWidth:C})})}const OS=zS({isInternal:!1}),DS=zS({isInternal:!0});OS.displayName="SmoothStepEdge";DS.displayName="SmoothStepEdgeInternal";function LS(e){return X.memo(({id:t,...n})=>{const r=e.isInternal?void 0:t;return v.jsx(OS,{...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:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})=>{const[N,k,C]=tS({sourceX:n,sourceY:r,targetX:a,targetY:l}),_=e.isInternal?void 0:t;return v.jsx(Ef,{id:_,path:N,labelX:k,labelY:C,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:x,markerEnd:b,markerStart:w,interactionWidth:E})})}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:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,pathOptions:k,interactionWidth:C})=>{const[_,R,B]=Ww({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:f,curvature:k?.curvature}),M=e.isInternal?void 0:t;return v.jsx(Ef,{id:M,path:_,labelX:R,labelY:B,label:d,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:x,labelBgBorderRadius:b,style:w,markerEnd:E,markerStart:N,interactionWidth:C})})}const E3=IS({isInternal:!1}),qS=IS({isInternal:!0});E3.displayName="BezierEdge";qS.displayName="BezierEdgeInternal";const A1={default:qS,straight:US,step:BS,smoothstep:DS,simplebezier:jS},M1={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,R1="react-flow__edgeupdater";function j1({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:f}){return v.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:Et([R1,`${R1}-${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:d,onReconnect:h,onReconnectStart:g,onReconnectEnd:m,setReconnecting:x,setUpdateHover:b}){const w=ft(),E=(R,B)=>{if(R.button!==0)return;const{autoPanOnConnect:M,domNode:L,isValidConnection:G,connectionMode:Z,connectionRadius:H,lib:$,onConnectStart:P,onConnectEnd:te,cancelConnection:D,nodeLookup:U,rfId:z,panBy:I,updateConnection:F}=w.getState(),K=B.type==="target",j=(A,ie)=>{x(!1),m?.(A,n,B.type,ie)},O=A=>h?.(n,A),V=(A,ie)=>{x(!0),g?.(R,n,B.type),P?.(A,ie)};cm.onPointerDown(R.nativeEvent,{autoPanOnConnect:M,connectionMode:Z,connectionRadius:H,domNode:L,handleId:B.id,nodeId:B.nodeId,nodeLookup:U,isTarget:K,edgeUpdaterType:B.type,lib:$,flowId:z,cancelConnection:D,panBy:I,isValidConnection:G,onConnect:O,onConnectStart:V,onConnectEnd:te,onReconnectEnd:j,updateConnection:F,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},N=R=>E(R,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=R=>E(R,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>b(!0),_=()=>b(!1);return v.jsxs(v.Fragment,{children:[(e===!0||e==="source")&&v.jsx(j1,{position:f,centerX:r,centerY:a,radius:t,onMouseDown:N,onMouseEnter:C,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&v.jsx(j1,{position:d,centerX:l,centerY:u,radius:t,onMouseDown:k,onMouseEnter:C,onMouseOut:_,type:"target"})]})}function A3({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,rfId:w,edgeTypes:E,noPanClassName:N,onError:k,disableKeyboardA11y:C}){let _=Ye(we=>we.edgeLookup.get(e));const R=Ye(we=>we.defaultEdgeOptions);_=R?{...R,..._}:_;let B=_.type||"default",M=E?.[B]||A1[B];M===void 0&&(k?.("011",ui.error011(B)),B="default",M=E?.default||A1.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),[$,P]=X.useState(!1),[te,D]=X.useState(!1),U=ft(),{zIndex:z,sourceX:I,sourceY:F,targetX:K,targetY:j,sourcePosition:O,targetPosition:V}=Ye(X.useCallback(we=>{const Ne=we.nodeLookup.get(_.source),De=we.nodeLookup.get(_.target);if(!Ne||!De)return{zIndex:_.zIndex,...M1};const Qe=vA({id:e,sourceNode:Ne,targetNode:De,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:we.connectionMode,onError:k});return{zIndex:hA({selected:_.selected,zIndex:_.zIndex,sourceNode:Ne,targetNode:De,elevateOnSelect:we.elevateEdgesOnSelect,zIndexMode:we.zIndexMode}),...Qe||M1}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),ct),A=X.useMemo(()=>_.markerStart?`url('#${lm(_.markerStart,w)}')`:void 0,[_.markerStart,w]),ie=X.useMemo(()=>_.markerEnd?`url('#${lm(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||I===null||F===null||K===null||j===null)return null;const ce=we=>{const{addSelectedEdges:Ne,unselectNodesAndEdges:De,multiSelectionActive:Qe}=U.getState();Z&&(U.setState({nodesSelectionActive:!1}),_.selected&&Qe?(De({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=d?we=>{d(we,{..._})}:void 0,Ee=h?we=>{h(we,{..._})}:void 0,Ce=we=>{if(!C&&Hw.includes(we.key)&&Z){const{unselectNodesAndEdges:Ne,addSelectedEdges:De}=U.getState();we.key==="Escape"?(H.current?.blur(),Ne({edges:[_]})):De([e])}};return v.jsx("svg",{style:{zIndex:z},children:v.jsxs("g",{className:Et(["react-flow__edge",`react-flow__edge-${B}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!Z&&!a,updating:$,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?`${gS}-${w}`:void 0,ref:H,..._.domAttributes,children:[!te&&v.jsx(M,{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:j,sourcePosition:O,targetPosition:V,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:A,markerEnd:ie,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),G&&v.jsx(T3,{edge:_,isReconnectable:G,reconnectRadius:g,onReconnect:m,onReconnectStart:x,onReconnectEnd:b,sourceX:I,sourceY:F,targetX:K,targetY:j,sourcePosition:O,targetPosition:V,setUpdateHover:P,setReconnecting:D})]})})}var M3=X.memo(A3);const R3=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:d,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:N,edgesReconnectable:k,elementsSelectable:C,onError:_}=Ye(R3,ct),R=m3(t);return v.jsxs("div",{className:"react-flow__edges",children:[v.jsx(v3,{defaultColor:e,rfId:n}),R.map(B=>v.jsx(M3,{id:B,edgesFocusable:N,edgesReconnectable:k,elementsSelectable:C,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,onClick:g,reconnectRadius:m,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:w,rfId:n,onError:_,edgeTypes:r,disableKeyboardA11y:E},B))]})}$S.displayName="EdgeRenderer";const j3=X.memo($S),z3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function O3({children:e}){const t=Ye(z3);return v.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function D3(e){const t=ng(),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:Nl(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:d}=Ye(q3,ct);return!(l&&a&&d)?null:v.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:v.jsx("g",{className:Et(["react-flow__connection",qw(f)]),children:v.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:d,to:h,toNode:g,toHandle:m,toPosition:x,pointer:b}=I3();if(!a)return;if(n)return v.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:f,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:d,toPosition:x,connectionStatus:qw(r),toNode:g,toHandle:m,pointer:b});let w="";const E={sourceX:l.x,sourceY:l.y,sourcePosition:d,targetX:h.x,targetY:h.y,targetPosition:x};switch(t){case Tr.Bezier:[w]=Ww(E);break;case Tr.SimpleBezier:[w]=MS(E);break;case Tr.Step:[w]=om({...E,borderRadius:0});break;case Tr.SmoothStep:[w]=om(E);break;default:[w]=tS(E)}return v.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};PS.displayName="ConnectionLine";const P3={};function z1(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:d,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:x,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:N,connectionLineContainerStyle:k,selectionKeyCode:C,selectionOnDrag:_,selectionMode:R,multiSelectionKeyCode:B,panActivationKeyCode:M,zoomActivationKeyCode:L,deleteKeyCode:G,onlyRenderVisibleElements:Z,elementsSelectable:H,defaultViewport:$,translateExtent:P,minZoom:te,maxZoom:D,preventScrolling:U,defaultMarkerColor:z,zoomOnScroll:I,zoomOnPinch:F,panOnScroll:K,panOnScrollSpeed:j,panOnScrollMode:O,zoomOnDoubleClick:V,panOnDrag:A,onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:Ee,nodeClickDistance:Ce,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:De,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 z1(e),z1(t),V3(),D3(n),B3(se),v.jsx(s3,{onPaneClick:ie,onPaneMouseEnter:ce,onPaneMouseMove:fe,onPaneMouseLeave:he,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:G,selectionKeyCode:C,selectionOnDrag:_,selectionMode:R,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:B,panActivationKeyCode:M,zoomActivationKeyCode:L,elementsSelectable:H,zoomOnScroll:I,zoomOnPinch:F,zoomOnDoubleClick:V,panOnScroll:K,panOnScrollSpeed:j,panOnScrollMode:O,panOnDrag:A,defaultViewport:$,translateExtent:P,minZoom:te,maxZoom:D,onSelectionContextMenu:m,preventScrolling:U,noDragClassName:Qt,noWheelClassName:Bn,noPanClassName:pi,disableKeyboardA11y:mi,onViewportChange:pe,isControlledViewport:!!se,children:v.jsxs(O3,{children:[v.jsx(j3,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:pt,onReconnectStart:un,onReconnectEnd:Ht,onlyRenderVisibleElements:Z,onEdgeContextMenu:we,onEdgeMouseEnter:Ne,onEdgeMouseMove:De,onEdgeMouseLeave:Qe,reconnectRadius:Xe,defaultMarkerColor:z,noPanClassName:pi,disableKeyboardA11y:mi,rfId:Yi}),v.jsx($3,{style:E,type:w,component:N,containerStyle:k}),v.jsx("div",{className:"react-flow__edgelabel-renderer"}),v.jsx(p3,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:Ce,onlyRenderVisibleElements:Z,noPanClassName:pi,noDragClassName:Qt,disableKeyboardA11y:mi,nodeExtent:Ct,rfId:Yi}),v.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:d=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:m,zIndexMode:x="basic"}={})=>{const b=new Map,w=new Map,E=new Map,N=new Map,k=r??t??[],C=n??e??[],_=g??[0,0],R=m??cl;rS(E,N,k);const B=um(C,b,w,{nodeOrigin:_,nodeExtent:R,zIndexMode:x});let M=[0,0,1];if(u&&a&&l){const L=kl(b,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:G,y:Z,zoom:H}=Zm(L,a,l,d,h,f?.padding??.1);M=[G,Z,H]}return{rfId:"1",width:a??0,height:l??0,transform:M,nodes:C,nodesInitialized:B,nodeLookup:b,parentLookup:w,edges:k,edgeLookup:N,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:d,maxZoom:h,translateExtent:cl,nodeExtent:R,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:{...Iw},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:Uw,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:d,maxZoom:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x})=>cM((b,w)=>{async function E(){const{nodeLookup:N,panZoom:k,fitViewOptions:C,fitViewResolver:_,width:R,height:B,minZoom:M,maxZoom:L}=w();k&&(await sA({nodes:N,width:R,height:B,panZoom:k,minZoom:M,maxZoom:L},C),_?.resolve(!0),b({fitViewResolver:null}))}return{...O1({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:f,minZoom:d,maxZoom:h,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:x}),setNodes:N=>{const{nodeLookup:k,parentLookup:C,nodeOrigin:_,elevateNodesOnSelect:R,fitViewQueued:B,zIndexMode:M}=w(),L=um(N,k,C,{nodeOrigin:_,nodeExtent:m,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:M});B&&L?(E(),b({nodes:N,nodesInitialized:L,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:L})},setEdges:N=>{const{connectionLookup:k,edgeLookup:C}=w();rS(k,C,N),b({edges:N})},setDefaultNodesAndEdges:(N,k)=>{if(N){const{setNodes:C}=w();C(N),b({hasDefaultNodes:!0})}if(k){const{setEdges:C}=w();C(k),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:k,nodeLookup:C,parentLookup:_,domNode:R,nodeOrigin:B,nodeExtent:M,debug:L,fitViewQueued:G,zIndexMode:Z}=w(),{changes:H,updatedInternals:$}=TA(N,C,_,R,B,M,Z);$&&(kA(C,_,{nodeOrigin:B,nodeExtent:M,zIndexMode:Z}),G?(E(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),H?.length>0&&(L&&console.log("React Flow: trigger node changes",H),k?.(H)))},updateNodePositions:(N,k=!1)=>{const C=[];let _=[];const{nodeLookup:R,triggerNodeChanges:B,connection:M,updateConnection:L,onNodesChangeMiddlewareMap:G}=w();for(const[Z,H]of N){const $=R.get(Z),P=!!($?.expandParent&&$?.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:k};if($&&M.inProgress&&M.fromNode.id===$.id){const D=cs($,M.fromHandle,be.Left,!0);L({...M,from:D})}P&&$.parentId&&C.push({id:Z,parentId:$.parentId,rect:{...H.internals.positionAbsolute,width:H.measured.width??0,height:H.measured.height??0}}),_.push(te)}if(C.length>0){const{parentLookup:Z,nodeOrigin:H}=w(),$=tg(C,R,Z,H);_.push(...$)}for(const Z of G.values())_=Z(_);B(_)},triggerNodeChanges:N=>{const{onNodesChange:k,setNodes:C,nodes:_,hasDefaultNodes:R,debug:B}=w();if(N?.length){if(R){const M=bS(N,_);C(M)}B&&console.log("React Flow: trigger node changes",N),k?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:k,setEdges:C,edges:_,hasDefaultEdges:R,debug:B}=w();if(N?.length){if(R){const M=vS(N,_);C(M)}B&&console.log("React Flow: trigger edge changes",N),k?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:k,edgeLookup:C,nodeLookup:_,triggerNodeChanges:R,triggerEdgeChanges:B}=w();if(k){const M=N.map(L=>ns(L,!0));R(M);return}R(ua(_,new Set([...N]),!0)),B(ua(C))},addSelectedEdges:N=>{const{multiSelectionActive:k,edgeLookup:C,nodeLookup:_,triggerNodeChanges:R,triggerEdgeChanges:B}=w();if(k){const M=N.map(L=>ns(L,!0));B(M);return}B(ua(C,new Set([...N]))),R(ua(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:k}={})=>{const{edges:C,nodes:_,nodeLookup:R,triggerNodeChanges:B,triggerEdgeChanges:M}=w(),L=N||_,G=k||C,Z=L.map($=>{const P=R.get($.id);return P&&(P.selected=!1),ns($.id,!1)}),H=G.map($=>ns($.id,!1));B(Z),M(H)},setMinZoom:N=>{const{panZoom:k,maxZoom:C}=w();k?.setScaleExtent([N,C]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:k,minZoom:C}=w();k?.setScaleExtent([C,N]),b({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:k,triggerNodeChanges:C,triggerEdgeChanges:_,elementsSelectable:R}=w();if(!R)return;const B=k.reduce((L,G)=>G.selected?[...L,ns(G.id,!1)]:L,[]),M=N.reduce((L,G)=>G.selected?[...L,ns(G.id,!1)]:L,[]);C(B),_(M)},setNodeExtent:N=>{const{nodes:k,nodeLookup:C,parentLookup:_,nodeOrigin:R,elevateNodesOnSelect:B,nodeExtent:M,zIndexMode:L}=w();N[0][0]===M[0][0]&&N[0][1]===M[0][1]&&N[1][0]===M[1][0]&&N[1][1]===M[1][1]||(um(k,C,_,{nodeOrigin:R,nodeExtent:N,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:L}),b({nodeExtent:N}))},panBy:N=>{const{transform:k,width:C,height:_,panZoom:R,translateExtent:B}=w();return AA({delta:N,panZoom:R,transform:k,translateExtent:B,width:C,height:_})},setCenter:async(N,k,C)=>{const{width:_,height:R,maxZoom:B,panZoom:M}=w();if(!M)return Promise.resolve(!1);const L=typeof C?.zoom<"u"?C.zoom:B;return await M.setViewport({x:_/2-N*L,y:R/2-k*L,zoom:L},{duration:C?.duration,ease:C?.ease,interpolate:C?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...Iw}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...O1()})}},Object.is);function FS({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:f,initialFitViewOptions:d,fitView:h,nodeOrigin:g,nodeExtent:m,zIndexMode:x,children:b}){const[w]=X.useState(()=>Y3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:h,minZoom:u,maxZoom:f,fitViewOptions:d,nodeOrigin:g,nodeExtent:m,zIndexMode:x}));return v.jsx(fM,{value:w,children:v.jsx(OM,{children:b})})}function X3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:f,fitViewOptions:d,minZoom:h,maxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b}){return X.useContext(Sf)?v.jsx(v.Fragment,{children:e}):v.jsx(FS,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:f,initialFitViewOptions:d,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:m,nodeExtent:x,zIndexMode:b,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:d,onInit:h,onMove:g,onMoveStart:m,onMoveEnd:x,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:k,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:R,onNodeContextMenu:B,onNodeDoubleClick:M,onNodeDragStart:L,onNodeDrag:G,onNodeDragStop:Z,onNodesDelete:H,onEdgesDelete:$,onDelete:P,onSelectionChange:te,onSelectionDragStart:D,onSelectionDrag:U,onSelectionDragStop:z,onSelectionContextMenu:I,onSelectionStart:F,onSelectionEnd:K,onBeforeDelete:j,connectionMode:O,connectionLineType:V=Tr.Bezier,connectionLineStyle:A,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:De,onlyRenderVisibleElements:Qe=!1,selectNodesOnDrag:Xe,nodesDraggable:pt,autoPanOnNodeFocus:un,nodesConnectable:Ht,nodesFocusable:Qt,nodeOrigin:Bn=yS,edgesFocusable:pi,edgesReconnectable:mi,elementsSelectable:Ct=!0,defaultViewport:Yi=kM,minZoom:se=.5,maxZoom:pe=2,translateExtent:_e=cl,preventScrolling:Oe=!0,nodeExtent:Pe,defaultMarkerColor:Ft="#b1b1b7",zoomOnScroll:Hn=!0,zoomOnPinch:jt=!0,panOnScroll:mt=!1,panOnScrollSpeed:Ut=.5,panOnScrollMode:Je=as.Free,zoomOnDoubleClick:Jn=!0,panOnDrag:cn=!0,onPaneClick:Ff,onPaneMouseEnter:ps,onPaneMouseMove:ms,onPaneMouseLeave:gs,onPaneScroll:gi,onPaneContextMenu:ys,paneClickDistance:Rr=1,nodeClickDistance:Yf=0,children:Ol,onReconnect:Ra,onReconnectStart:jr,onReconnectEnd:Xf,onEdgeContextMenu:Dl,onEdgeDoubleClick:Ll,onEdgeMouseEnter:Bl,onEdgeMouseMove:ja,onEdgeMouseLeave:za,reconnectRadius:Hl=10,onNodesChange:Ul,onEdgesChange:Wn,noDragClassName:Tt="nodrag",noWheelClassName:It="nowheel",noPanClassName:yi="nopan",fitView:xs,fitViewOptions:Il,connectOnClick:Gf,attributionPosition:ql,proOptions:zr,defaultEdgeOptions:Oa,elevateNodesOnSelect:Xi=!0,elevateEdgesOnSelect:Gi=!1,disableKeyboardA11y:Zi=!1,autoPanOnConnect:Qi,autoPanOnNodeDrag:xt,autoPanSpeed:$l,connectionRadius:Pl,isValidConnection:xi,onError:Ki,style:Zf,id:Da,nodeDragThreshold:Vl,connectionDragThreshold:Qf,viewport:bs,onViewportChange:vs,width:Un,height:Kt,colorMode:Fl="light",debug:Kf,onScroll:ws,ariaLabelConfig:Yl,zIndexMode:Or="basic",...Jf},Jt){const Dr=Da||"1",Xl=TM(Fl),La=X.useCallback(bi=>{bi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ws?.(bi)},[ws]);return v.jsx("div",{"data-testid":"rf__wrapper",...Jf,onScroll:La,style:{...Zf,...G3},ref:Jt,className:Et(["react-flow",a,Xl]),id:Da,role:"application",children:v.jsxs(X3,{nodes:e,edges:t,width:Un,height:Kt,fitView:xs,fitViewOptions:Il,minZoom:se,maxZoom:pe,nodeOrigin:Bn,nodeExtent:Pe,zIndexMode:Or,children:[v.jsx(F3,{onInit:h,onNodeClick:f,onEdgeClick:d,onNodeMouseEnter:C,onNodeMouseMove:_,onNodeMouseLeave:R,onNodeContextMenu:B,onNodeDoubleClick:M,nodeTypes:l,edgeTypes:u,connectionLineType:V,connectionLineStyle:A,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:Oe,zoomOnScroll:Hn,zoomOnPinch:jt,zoomOnDoubleClick:Jn,panOnScroll:mt,panOnScrollSpeed:Ut,panOnScrollMode:Je,panOnDrag:cn,onPaneClick:Ff,onPaneMouseEnter:ps,onPaneMouseMove:ms,onPaneMouseLeave:gs,onPaneScroll:gi,onPaneContextMenu:ys,paneClickDistance:Rr,nodeClickDistance:Yf,onSelectionContextMenu:I,onSelectionStart:F,onSelectionEnd:K,onReconnect:Ra,onReconnectStart:jr,onReconnectEnd:Xf,onEdgeContextMenu:Dl,onEdgeDoubleClick:Ll,onEdgeMouseEnter:Bl,onEdgeMouseMove:ja,onEdgeMouseLeave:za,reconnectRadius:Hl,defaultMarkerColor:Ft,noDragClassName:Tt,noWheelClassName:It,noPanClassName:yi,rfId:Dr,disableKeyboardA11y:Zi,nodeExtent:Pe,viewport:bs,onViewportChange:vs}),v.jsx(CM,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:w,onConnectEnd:E,onClickConnectStart:N,onClickConnectEnd:k,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:Ul,onEdgesChange:Wn,snapToGrid:Ne,snapGrid:De,connectionMode:O,translateExtent:_e,connectOnClick:Gf,defaultEdgeOptions:Oa,fitView:xs,fitViewOptions:Il,onNodesDelete:H,onEdgesDelete:$,onDelete:P,onNodeDragStart:L,onNodeDrag:G,onNodeDragStop:Z,onSelectionDrag:U,onSelectionDragStart:D,onSelectionDragStop:z,onMove:g,onMoveStart:m,onMoveEnd:x,noPanClassName:yi,nodeOrigin:Bn,rfId:Dr,autoPanOnConnect:Qi,autoPanOnNodeDrag:xt,autoPanSpeed:$l,onError:Ki,connectionRadius:Pl,isValidConnection:xi,selectNodesOnDrag:Xe,nodeDragThreshold:Vl,connectionDragThreshold:Qf,onBeforeDelete:j,debug:Kf,ariaLabelConfig:Yl,zIndexMode:Or}),v.jsx(_M,{onSelectionChange:te}),Ol,v.jsx(xM,{proOptions:zr,position:ql}),v.jsx(yM,{rfId:Dr,disableKeyboardA11y:Zi})]})})}var Q3=wS(Z3);function K3({dimensions:e,lineWidth:t,variant:n,className:r}){return v.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 v.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:d,className:h,patternClassName:g}){const m=X.useRef(null),{transform:x,patternId:b}=Ye(e5,ct),w=r||W3[t],E=t===$i.Dots,N=t===$i.Cross,k=Array.isArray(n)?n:[n,n],C=[k[0]*x[2]||1,k[1]*x[2]||1],_=w*x[2],R=Array.isArray(l)?l:[l,l],B=N?[_,_]:C,M=[R[0]*x[2]||1+B[0]/2,R[1]*x[2]||1+B[1]/2],L=`${b}${e||""}`;return v.jsxs("svg",{className:Et(["react-flow__background",h]),style:{...d,...kf,"--xy-background-color-props":f,"--xy-background-pattern-color-props":u},ref:m,"data-testid":"rf__background",children:[v.jsx("pattern",{id:L,x:x[0]%C[0],y:x[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:E?v.jsx(J3,{radius:_/2,className:g}):v.jsx(K3,{dimensions:B,lineWidth:a,variant:t,className:g})}),v.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}YS.displayName="Background";const t5=X.memo(YS);function n5(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:v.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function i5(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:v.jsx("path",{d:"M0 0h32v4.2H0z"})})}function r5(){return v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:v.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 v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:v.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 fc({children:e,className:t,...n}){return v.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:d,className:h,children:g,position:m="bottom-left",orientation:x="vertical","aria-label":b}){const w=ft(),{isInteractive:E,minZoomReached:N,maxZoomReached:k,ariaLabelConfig:C}=Ye(o5,ct),{zoomIn:_,zoomOut:R,fitView:B}=ng(),M=()=>{_(),l?.()},L=()=>{R(),u?.()},G=()=>{B(a),f?.()},Z=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),d?.(!E)},H=x==="horizontal"?"horizontal":"vertical";return v.jsxs(_f,{className:Et(["react-flow__controls",H,h]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??C["controls.ariaLabel"],children:[t&&v.jsxs(v.Fragment,{children:[v.jsx(fc,{onClick:M,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:k,children:v.jsx(n5,{})}),v.jsx(fc,{onClick:L,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:N,children:v.jsx(i5,{})})]}),n&&v.jsx(fc,{className:"react-flow__controls-fitview",onClick:G,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:v.jsx(r5,{})}),r&&v.jsx(fc,{className:"react-flow__controls-interactive",onClick:Z,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:E?v.jsx(a5,{}):v.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:d,className:h,borderRadius:g,shapeRendering:m,selected:x,onClick:b}){const{background:w,backgroundColor:E}=l||{},N=u||w||E;return v.jsx("rect",{className:Et(["react-flow__minimap-node",{selected:x},h]),x:t,y:n,rx:g,ry:g,width:r,height:a,style:{fill:N,stroke:f,strokeWidth:d},shapeRendering:m,onClick:b?k=>b(k,e):void 0})}const c5=X.memo(u5),f5=e=>e.nodes.map(t=>t.id),wp=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),d=wp(t),h=wp(e),g=wp(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return v.jsx(v.Fragment,{children:f.map(x=>v.jsx(p5,{id:x,nodeColorFunc:d,nodeStrokeColorFunc:h,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:d}){const{node:h,x:g,y:m,width:x,height:b}=Ye(w=>{const{internals:E}=w.nodeLookup.get(e),N=E.userNode,{x:k,y:C}=E.positionAbsolute,{width:_,height:R}=Vi(N);return{node:N,x:k,y:C,width:_,height:R}},ct);return!h||h.hidden||!Xw(h)?null:v.jsx(f,{x:g,y:m,width:x,height:b,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:l,shapeRendering:u,onClick:d,id:h.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?Yw(kl(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:d,maskColor:h,maskStrokeColor:g,maskStrokeWidth:m,position:x="bottom-right",onClick:b,onNodeClick:w,pannable:E=!1,zoomable:N=!1,ariaLabel:k,inversePan:C,zoomStep:_=1,offsetScale:R=5}){const B=ft(),M=X.useRef(null),{boundingRect:L,viewBB:G,rfId:Z,panZoom:H,translateExtent:$,flowWidth:P,flowHeight:te,ariaLabelConfig:D}=Ye(b5,ct),U=e?.width??g5,z=e?.height??y5,I=L.width/U,F=L.height/z,K=Math.max(I,F),j=K*U,O=K*z,V=R*K,A=L.x-(j-L.width)/2-V,ie=L.y-(O-L.height)/2-V,ce=j+V*2,fe=O+V*2,he=`${v5}-${Z}`,ue=X.useRef(0),me=X.useRef();ue.current=K,X.useEffect(()=>{if(M.current&&H)return me.current=HA({domNode:M.current,panZoom:H,getTransform:()=>B.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[H]),X.useEffect(()=>{me.current?.update({translateExtent:$,width:P,height:te,inversePan:C,pannable:E,zoomStep:_,zoomable:N})},[E,N,C,_,$,P,te]);const Ee=b?Ne=>{const[De,Qe]=me.current?.pointer(Ne)||[0,0];b(Ne,{x:De,y:Qe})}:void 0,Ce=w?X.useCallback((Ne,De)=>{const Qe=B.getState().nodeLookup.get(De).internals.userNode;w(Ne,Qe)},[]):void 0,we=k??D["minimap.ariaLabel"];return v.jsx(_f,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h: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:v.jsxs("svg",{width:U,height:z,viewBox:`${A} ${ie} ${ce} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":he,ref:M,onClick:Ee,children:[we&&v.jsx("title",{id:he,children:we}),v.jsx(m5,{onClick:Ce,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:f}),v.jsx("path",{className:"react-flow__minimap-mask",d:`M${A-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:d=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:x,autoScale:b=!0,shouldResize:w,onResizeStart:E,onResize:N,onResizeEnd:k}){const C=ES(),_=typeof e=="string"?e:C,R=ft(),B=X.useRef(null),M=n===va.Handle,L=Ye(X.useCallback(S5(M&&b),[M,b]),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:$,transform:P,snapGrid:te,snapToGrid:D,nodeOrigin:U,domNode:z}=R.getState();return{nodeLookup:$,transform:P,snapGrid:te,snapToGrid:D,nodeOrigin:U,paneDomNode:z}},onChange:($,P)=>{const{triggerNodeChanges:te,nodeLookup:D,parentLookup:U,nodeOrigin:z}=R.getState(),I=[],F={x:$.x,y:$.y},K=D.get(_);if(K&&K.expandParent&&K.parentId){const j=K.origin??z,O=$.width??K.measured.width??0,V=$.height??K.measured.height??0,A={id:K.id,parentId:K.parentId,rect:{width:O,height:V,...Gw({x:$.x??K.position.x,y:$.y??K.position.y},{width:O,height:V},K.parentId,D,j)}},ie=tg([A],D,U,z);I.push(...ie),F.x=$.x?Math.max(j[0]*O,$.x):void 0,F.y=$.y?Math.max(j[1]*V,$.y):void 0}if(F.x!==void 0&&F.y!==void 0){const j={id:_,type:"position",position:{...F}};I.push(j)}if($.width!==void 0&&$.height!==void 0){const O={id:_,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};I.push(O)}for(const j of P){const O={...j,type:"position"};I.push(O)}te(I)},onEnd:({width:$,height:P})=>{const te={id:_,type:"dimensions",resizing:!1,dimensions:{width:$,height:P}};R.getState().triggerNodeChanges([te])}})),G.current.update({controlPosition:Z,boundaries:{minWidth:f,minHeight:d,maxWidth:h,maxHeight:g},keepAspectRatio:m,resizeDirection:x,onResizeStart:E,onResize:N,onResizeEnd:k,shouldResize:w}),()=>{G.current?.destroy()}},[Z,f,d,h,g,m,E,N,k,w]);const H=Z.split("-");return v.jsx("div",{className:Et(["react-flow__resize-control","nodrag",...H,n,r]),ref:B,style:{...a,scale:L,...u&&{[M?"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 D1=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},d)=>X.createElement("svg",{ref:d,...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(([h,g])=>X.createElement(h,g)),...Array.isArray(l)?l:[l]]));const ze=(e,t)=>{const n=X.forwardRef(({className:r,...a},l)=>X.createElement(A5,{ref:l,iconNode:t,className:ZS(`lucide-${E5(D1(e))}`,`lucide-${e}`,r),...a}));return n.displayName=D1(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"}]],rg=ze("anchor",M5);const R5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],j5=ze("arrow-left",R5);const z5=[["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"}]],O5=ze("bot",z5);const D5=[["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"}]],Nf=ze("chart-column",D5);const L5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],B5=ze("check",L5);const H5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],QS=ze("chevron-down",H5);const U5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],I5=ze("chevron-right",U5);const q5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$5=ze("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"}]],dm=ze("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"}]],Cf=ze("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=ze("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"}]],sg=ze("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"}]],hm=ze("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=ze("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=ze("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=ze("file-code",J5);const eR=[["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=ze("file-text",eR);const tR=[["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"}]],pm=ze("folder-open",tR);const nR=[["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"}]],iR=ze("globe",nR);const rR=[["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=ze("image",rR);const sR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],aR=ze("info",sR);const oR=[["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"}]],lR=ze("key",oR);const uR=[["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"}]],cR=ze("link-2",uR);const fR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],sf=ze("loader-circle",fR);const dR=[["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"}]],hR=ze("maximize-2",dR);const pR=[["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"}]],Tf=ze("message-square",pR);const mR=[["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"}]],gR=ze("minimize-2",mR);const yR=[["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=ze("play",yR);const xR=[["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"}]],bR=ze("refresh-cw",xR);const vR=[["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"}]],wR=ze("save",vR);const SR=[["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"}]],_R=ze("send",SR);const kR=[["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"}]],ER=ze("server",kR);const NR=[["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"}]],CR=ze("settings-2",NR);const TR=[["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=ze("settings",TR);const AR=[["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"}]],Cl=ze("sparkles",AR);const MR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ds=ze("terminal",MR);const RR=[["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"}]],Af=ze("trash-2",RR);const jR=[["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"}]],zR=ze("triangle-alert",jR);const OR=[["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"}]],DR=ze("upload",OR);const LR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ag=ze("x",LR);const BR=[["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"}]],Mf=ze("zap",BR),L1=e=>{let t;const n=new Set,r=(h,g)=>{const m=typeof h=="function"?h(t):h;if(!Object.is(m,t)){const x=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(b=>b(t,x))}},a=()=>t,f={setState:r,getState:a,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h))},d=t=e(r,a,f);return f},HR=(e=>e?L1(e):L1),UR=e=>e;function IR(e,t=UR){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 B1=e=>{const t=HR(e),n=r=>IR(t,r);return Object.assign(n,t),n},Rf=(e=>e?B1(e):B1);function qR(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var l;const u=d=>d===null?null:JSON.parse(d,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 mm=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return mm(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return mm(r)(n)}}}},$R=(e,t)=>(n,r,a)=>{let l={storage:qR(()=>localStorage),partialize:N=>N,version:0,merge:(N,k)=>({...k,...N}),...t},u=!1,f=0;const d=new Set,h=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,k)=>(x(N,k),m());const b=e((...N)=>(n(...N),m()),r,a);a.getInitialState=()=>b;let w;const E=()=>{var N,k;if(!g)return;const C=++f;u=!1,d.forEach(R=>{var B;return R((B=r())!=null?B:b)});const _=((k=l.onRehydrateStorage)==null?void 0:k.call(l,(N=r())!=null?N:b))||void 0;return mm(g.getItem.bind(g))(l.name).then(R=>{if(R)if(typeof R.version=="number"&&R.version!==l.version){if(l.migrate){const B=l.migrate(R.state,R.version);return B instanceof Promise?B.then(M=>[!0,M]):[!0,B]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,R.state];return[!1,void 0]}).then(R=>{var B;if(C!==f)return;const[M,L]=R;if(w=l.merge(L,(B=r())!=null?B:b),n(w,!0),M)return m()}).then(()=>{C===f&&(_?.(w,void 0),w=r(),u=!0,h.forEach(R=>R(w)))}).catch(R=>{C===f&&_?.(void 0,R)})};return a.persist={setOptions:N=>{l={...l,...N},N.storage&&(g=N.storage)},clearStorage:()=>{g?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>E(),hasHydrated:()=>u,onHydrate:N=>(d.add(N),()=>{d.delete(N)}),onFinishHydration:N=>(h.add(N),()=>{h.delete(N)})},l.skipHydration||E(),w||b},e_=$R,PR="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Sa=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=PR[n[e]&63];return t};const ci=Rf()(e_(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(h=>h.id)),a=["skill-","subagent-","command-","hook-"],l=h=>a.some(g=>h.startsWith(g)),u=n.nodes.filter(h=>l(h.id)?r.has(h.id):!0),f=new Set(u.map(h=>h.id)),d=t.filter(h=>!f.has(h.id));return{nodes:[...u,...d]}}),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})})),t_=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 n_=function(){const{crypto:e}=globalThis;if(e?.randomUUID)return n_=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 yl(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const gm=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 jf({message:r,cause:gm(n)});const l=n;return t===400?new r_(t,l,r,a):t===401?new s_(t,l,r,a):t===403?new a_(t,l,r,a):t===404?new o_(t,l,r,a):t===409?new l_(t,l,r,a):t===422?new u_(t,l,r,a):t===429?new c_(t,l,r,a):t>=500?new f_(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 jf extends Pt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}}class i_ extends jf{constructor({message:t}={}){super({message:t??"Request timed out."})}}class r_ extends Pt{}class s_ extends Pt{}class a_ extends Pt{}class o_ extends Pt{}class l_ extends Pt{}class u_ extends Pt{}class c_ extends Pt{}class f_ extends Pt{}const VR=/^[a-z][a-z0-9+.-]*:/i,FR=e=>VR.test(e);let ym=e=>(ym=Array.isArray,ym(e)),H1=ym;function xm(e){return typeof e!="object"?{}:e??{}}function YR(e){if(!e)return!0;for(const t in e)return!1;return!0}function XR(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const GR=(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},d_=e=>{try{return JSON.parse(e)}catch{return}},ZR=e=>new Promise(t=>setTimeout(t,e)),sa="0.71.2",QR=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function KR(){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 JR=()=>{const e=KR();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sa,"X-Stainless-OS":I1(Deno.build.os),"X-Stainless-Arch":U1(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":I1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":U1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const t=WR();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 WR(){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 U1=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",I1=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 q1;const ej=()=>q1??(q1=JR());function tj(){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 h_(...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 p_(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return h_({start(){},async pull(n){const{done:r,value:a}=await t.next();r?n.close():n.enqueue(a)},async cancel(){await t.return?.()}})}function og(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 nj(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 ij=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function rj(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 $1;function lg(e){let t;return($1??(t=new globalThis.TextEncoder,$1=t.encode.bind(t)))(e)}let P1;function V1(e){let t;return(P1??(t=new globalThis.TextDecoder,P1=t.decode.bind(t)))(e)}var bn,vn;class Tl{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"?lg(t):t;ge(this,bn,rj([ne(this,bn,"f"),n]));const r=[];let a;for(;(a=sj(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(V1(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=V1(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;Tl.NEWLINE_CHARS=new Set([`
17
+ `,"\r"]);Tl.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function sj(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 aj(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 af={off:0,error:200,warn:300,info:400,debug:500},F1=(e,t,n)=>{if(e){if(XR(af,e))return e;Xt(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(af))}`)}};function Jo(){}function dc(e,t,n){return!t||af[e]>af[n]?Jo:t[e].bind(t)}const oj={error:Jo,warn:Jo,info:Jo,debug:Jo};let Y1=new WeakMap;function Xt(e){const t=e.logger,n=e.logLevel??"off";if(!t)return oj;const r=Y1.get(t);if(r&&r[0]===n)return r[1];const a={error:dc("error",t,n),warn:dc("warn",t,n),info:dc("info",t,n),debug:dc("debug",t,n)};return Y1.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 d of lj(t,n)){if(d.event==="completion")try{yield JSON.parse(d.data)}catch(h){throw l.error("Could not parse message into JSON:",d.data),l.error("From chunk:",d.raw),h}if(d.event==="message_start"||d.event==="message_delta"||d.event==="message_stop"||d.event==="content_block_start"||d.event==="content_block_delta"||d.event==="content_block_stop")try{yield JSON.parse(d.data)}catch(h){throw l.error("Could not parse message into JSON:",d.data),l.error("From chunk:",d.raw),h}if(d.event!=="ping"&&d.event==="error")throw new Pt(void 0,d_(d.data)??d.data,void 0,t.headers)}f=!0}catch(d){if(yl(d))return;throw d}finally{f||n.abort()}}return new ai(u,n,r)}static fromReadableStream(t,n,r){let a=!1;async function*l(){const f=new Tl,d=og(t);for await(const h of d)for(const g of f.decode(h))yield g;for(const h of f.flush())yield h}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 d of l())f||d&&(yield JSON.parse(d));f=!0}catch(d){if(yl(d))return;throw d}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 h_({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=lg(JSON.stringify(a)+`
18
+ `);r.enqueue(u)}catch(a){r.error(a)}},async cancel(){await n.return?.()}})}}async function*lj(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 cj,r=new Tl,a=og(e.body);for await(const l of uj(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*uj(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"?lg(n):n;let a=new Uint8Array(t.length+r.length);a.set(t),a.set(r,t.length),t=a;let l;for(;(l=aj(t))!==-1;)yield t.slice(0,l),t=t.slice(l)}t.length>0&&(yield t)}class cj{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]=fj(t,":");return a.startsWith(" ")&&(a=a.substring(1)),n==="event"?this.event=a:n==="data"&&this.data.push(a),null}}function fj(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function m_(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 d=n.headers.get("content-type")?.split(";")[0]?.trim();if(d?.includes("application/json")||d?.endsWith("+json")){const m=await n.json();return g_(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 g_(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 zf extends Promise{constructor(t,n,r=m_){super(a=>{a(null)}),this.responsePromise=n,this.parseResponse=r,Wo.set(this,void 0),ge(this,Wo,t)}_thenUnwrap(t){return new zf(ne(this,Wo,"f"),this.responsePromise,async(n,r)=>g_(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 hc;class y_{constructor(t,n,r,a){hc.set(this,void 0),ge(this,hc,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,hc,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(hc=new WeakMap,Symbol.asyncIterator)](){for await(const t of this.iterPages())for(const n of t.getPaginatedItems())yield n}}class dj extends zf{constructor(t,n,r){super(t,n,async(a,l)=>new r(a,l.response,await m_(a,l),l.options))}async*[Symbol.asyncIterator](){const t=await this;for await(const n of t)yield n}}class Al extends y_{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:{...xm(this.options.query),before_id:n}}:null}const t=this.last_id;return t?{...this.options,query:{...xm(this.options.query),after_id:t}}:null}}class x_ extends y_{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:{...xm(this.options.query),page:t}}:null}}const b_=()=>{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 b_(),new File(e,t??"unknown_file",n)}function Ic(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 v_=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",ug=async(e,t)=>({...e,body:await pj(e.body,t)}),X1=new WeakMap;function hj(e){const t=typeof e=="function"?e:e.fetch,n=X1.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 X1.set(t,r),r}const pj=async(e,t)=>{if(!await hj(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])=>bm(n,r,a))),n},mj=e=>e instanceof Blob&&"name"in e,bm=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()],Ic(n),r))}else if(v_(n))e.append(t,da([await new Response(p_(n)).blob()],Ic(n)));else if(mj(n))e.append(t,da([n],Ic(n),{type:n.type}));else if(Array.isArray(n))await Promise.all(n.map(r=>bm(e,t+"[]",r)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,a])=>bm(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`)}},w_=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",gj=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&w_(e),yj=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function xj(e,t,n){if(b_(),e=await e,t||(t=Ic(e)),gj(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(yj(e)){const a=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),da(await vm(a),t,n)}const r=await vm(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 vm(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(w_(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(v_(e))for await(const n of e)t.push(...await vm(n));else{const n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${bj(e)}`)}return t}function bj(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}class Kn{constructor(t){this._client=t}}const S_=Symbol.for("brand.privateNullableHeaders");function*vj(e){if(!e)return;if(S_ 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():H1(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=H1(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 vj(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{[S_]:!0,values:t,nulls:n}};function __(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const G1=Object.freeze(Object.create(null)),wj=(e=__)=>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 b=r[x];let w=(a?encodeURIComponent:e)(""+b);return x!==r.length&&(b==null||typeof b=="object"&&b.toString===Object.getPrototypeOf(Object.getPrototypeOf(b.hasOwnProperty??G1)??G1)?.toString)&&(w=b+"",l.push({start:g.length+m.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(b).slice(8,-1)} is not a valid path parameter`})),g+m+(x===r.length?"":w)},""),f=u.split(/[?#]/,1)[0],d=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let h;for(;(h=d.exec(f))!==null;)l.push({start:h.index,length:h[0].length,error:`Value "${h[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,b)=>{const w=" ".repeat(b.start-g),E="^".repeat(b.length);return g=b.start+b.length,x+w+E},"");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=wj(__);class k_ extends Kn{list(t={},n){const{betas:r,...a}=t??{};return this._client.getAPIList("/v1/files",Al,{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",ug({body:a,...n,headers:Ve([{"anthropic-beta":[...r??[],"files-api-2025-04-14"].toString()},n?.headers])},this._client))}}let E_=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",Al,{query:a,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}};const N_={"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 Z1(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}:C_(e,t,n)}function C_(e,t,n){let r=null;const a=e.content.map(l=>{if(l.type==="text"){const u=Sj(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 Sj(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 _j=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="",d=!1;for(r=e[++t];r!=='"';){if(t===e.length){d=!0;break}if(r==="\\"){if(t++,t===e.length){d=!0;break}f+=r+e[t],r=e[++t]}else f+=r,r=e[++t]}r=e[++t],d||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},kj=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},Ej=e=>{let t="";return e.map(n=>{n.type==="string"?t+='"'+n.value+'"':t+=n.value}),t},T_=e=>JSON.parse(Ej(kj(aa(_j(e)))));var zn,_r,ta,Mo,pc,Ro,jo,mc,zo,Hi,Oo,gc,yc,Jr,xc,bc,Do,Sp,Q1,vc,_p,kp,Ep,K1;const J1="__json_buf";function W1(e){return e.type==="tool_use"||e.type==="server_tool_use"||e.type==="mcp_tool_use"}class of{constructor(t,n){zn.add(this),this.messages=[],this.receivedMessages=[],_r.set(this,void 0),ta.set(this,null),this.controller=new AbortController,Mo.set(this,void 0),pc.set(this,()=>{}),Ro.set(this,()=>{}),jo.set(this,void 0),mc.set(this,()=>{}),zo.set(this,()=>{}),Hi.set(this,{}),Oo.set(this,!1),gc.set(this,!1),yc.set(this,!1),Jr.set(this,!1),xc.set(this,void 0),bc.set(this,void 0),Do.set(this,void 0),vc.set(this,r=>{if(ge(this,gc,!0),yl(r)&&(r=new Gn),r instanceof Gn)return ge(this,yc,!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,pc,r,"f"),ge(this,Ro,a,"f")})),ge(this,jo,new Promise((r,a)=>{ge(this,mc,r,"f"),ge(this,zo,a,"f")})),ne(this,Mo,"f").catch(()=>{}),ne(this,jo,"f").catch(()=>{}),ge(this,ta,t),ge(this,Do,n?.logger??console)}get response(){return ne(this,xc,"f")}get request_id(){return ne(this,bc,"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 of(null);return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r,{logger:a}={}){const l=new of(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,vc,"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,zn,"m",_p).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 d of f)ne(this,zn,"m",kp).call(this,d);if(f.controller.signal?.aborted)throw new Gn;ne(this,zn,"m",Ep).call(this)}finally{a&&l&&a.removeEventListener("abort",l)}}_connected(t){this.ended||(ge(this,xc,t),ge(this,bc,t?.headers.get("request-id")),ne(this,pc,"f").call(this,t),this._emit("connect"))}get ended(){return ne(this,Oo,"f")}get errored(){return ne(this,gc,"f")}get aborted(){return ne(this,yc,"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,jo,"f")}get currentMessage(){return ne(this,_r,"f")}async finalMessage(){return await this.done(),ne(this,zn,"m",Sp).call(this)}async finalText(){return await this.done(),ne(this,zn,"m",Q1).call(this)}_emit(t,...n){if(ne(this,Oo,"f"))return;t==="end"&&(ge(this,Oo,!0),ne(this,mc,"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,Ro,"f").call(this,a),ne(this,zo,"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,Ro,"f").call(this,a),ne(this,zo,"f").call(this,a),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ne(this,zn,"m",Sp).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,zn,"m",_p).call(this),this._connected(null);const l=ai.fromReadableStream(t,this.controller);for await(const u of l)ne(this,zn,"m",kp).call(this,u);if(l.controller.signal?.aborted)throw new Gn;ne(this,zn,"m",Ep).call(this)}finally{r&&a&&r.removeEventListener("abort",a)}}[(_r=new WeakMap,ta=new WeakMap,Mo=new WeakMap,pc=new WeakMap,Ro=new WeakMap,jo=new WeakMap,mc=new WeakMap,zo=new WeakMap,Hi=new WeakMap,Oo=new WeakMap,gc=new WeakMap,yc=new WeakMap,Jr=new WeakMap,xc=new WeakMap,bc=new WeakMap,Do=new WeakMap,vc=new WeakMap,zn=new WeakSet,Sp=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},Q1=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(" ")},_p=function(){this.ended||ge(this,_r,void 0)},kp=function(n){if(this.ended)return;const r=ne(this,zn,"m",K1).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":{W1(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(Z1(r,ne(this,ta,"f"),{logger:ne(this,Do,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{ge(this,_r,r);break}}},Ep=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),Z1(n,ne(this,ta,"f"),{logger:ne(this,Do,"f")})},K1=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&&W1(a)){let l=a[J1]||"";l+=n.delta.partial_json;const u={...a};if(Object.defineProperty(u,J1,{value:l,enumerable:!1,writable:!0}),l)try{u.input=T_(l)}catch(f){const d=new Ae(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${f}. JSON: ${l}`);ne(this,vc,"f").call(this,d)}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 Nj=1e5,Cj=`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,ev,wm;function tv(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}class A_{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,tv())}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,ev=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 h=await ne(this,xn,"f");r=h.usage.input_tokens+(h.usage.cache_creation_input_tokens??0)+(h.usage.cache_read_input_tokens??0)+h.usage.output_tokens}catch{return!1}const a=n.contextTokenThreshold??Nj;if(r<a)return!1;const l=n.model??ne(this,Mt,"f").params.model,u=n.summaryPrompt??Cj,f=ne(this,Mt,"f").params.messages;if(f[f.length-1].role==="assistant"){const h=f[f.length-1];if(Array.isArray(h.content)){const g=h.content.filter(m=>m.type!=="tool_use");g.length===0?f.pop():h.content=g}}const d=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(d.content[0]?.type!=="text")throw new Ae("Expected text response for compaction");return ne(this,Mt,"f").params.messages=[{role:"user",content:d.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",ev).call(this)){if(!ne(this,Wr,"f")){const{role:d,content:h}=await ne(this,xn,"f");ne(this,Mt,"f").params.messages.push({role:d,content:h})}const f=await ne(this,Lo,"m",wm).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,tv()),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",wm).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)}}wm=async function(t){return ne(this,Ii,"f")!==void 0?ne(this,Ii,"f"):(ge(this,Ii,Tj(ne(this,Mt,"f").params,t)),ne(this,Ii,"f"))};async function Tj(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 Of{constructor(t,n){this.iterator=t,this.controller=n}async*decoder(){const t=new Tl;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 Of(og(t.body),n)}}let M_=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",Al,{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)=>Of.fromResponse(f.response,f.controller))}};const nv={"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 Df=class extends Kn{constructor(){super(...arguments),this.batches=new M_(this._client)}create(t,n){const{betas:r,...a}=t;a.model in nv&&console.warn(`The model '${a.model}' is deprecated and will reach end-of-life on ${nv[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=N_[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=>C_(r,t,{logger:this._client.logger??console}))}stream(t,n){return of.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 A_(this._client,t,n)}};Df.Batches=M_;Df.BetaToolRunner=A_;class R_ extends Kn{create(t,n={},r){const{betas:a,...l}=n??{};return this._client.post(Bt`/v1/skills/${t}/versions?beta=true`,ug({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`,x_,{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 cg extends Kn{constructor(){super(...arguments),this.versions=new R_(this._client)}create(t={},n){const{betas:r,...a}=t??{};return this._client.post("/v1/skills?beta=true",ug({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",x_,{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])})}}cg.Versions=R_;class Ea extends Kn{constructor(){super(...arguments),this.models=new E_(this._client),this.messages=new Df(this._client),this.files=new k_(this._client),this.skills=new cg(this._client)}}Ea.Models=E_;Ea.Messages=Df;Ea.Files=k_;Ea.Skills=cg;class j_ 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 On,Er,Uo,wc,Io,qo,Sc,$o,Ui,Po,_c,kc,es,Ec,Nc,Np,iv,Cp,Tp,Ap,Mp,rv;const sv="__json_buf";function av(e){return e.type==="tool_use"||e.type==="server_tool_use"}class lf{constructor(){On.add(this),this.messages=[],this.receivedMessages=[],Er.set(this,void 0),this.controller=new AbortController,Uo.set(this,void 0),wc.set(this,()=>{}),Io.set(this,()=>{}),qo.set(this,void 0),Sc.set(this,()=>{}),$o.set(this,()=>{}),Ui.set(this,{}),Po.set(this,!1),_c.set(this,!1),kc.set(this,!1),es.set(this,!1),Ec.set(this,void 0),Nc.set(this,void 0),Cp.set(this,t=>{if(ge(this,_c,!0),yl(t)&&(t=new Gn),t instanceof Gn)return ge(this,kc,!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,wc,t,"f"),ge(this,Io,n,"f")})),ge(this,qo,new Promise((t,n)=>{ge(this,Sc,t,"f"),ge(this,$o,n,"f")})),ne(this,Uo,"f").catch(()=>{}),ne(this,qo,"f").catch(()=>{})}get response(){return ne(this,Ec,"f")}get request_id(){return ne(this,Nc,"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 lf;return n._run(()=>n._fromReadableStream(t)),n}static createMessage(t,n,r){const a=new lf;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,Cp,"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,On,"m",Tp).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 d of f)ne(this,On,"m",Ap).call(this,d);if(f.controller.signal?.aborted)throw new Gn;ne(this,On,"m",Mp).call(this)}finally{a&&l&&a.removeEventListener("abort",l)}}_connected(t){this.ended||(ge(this,Ec,t),ge(this,Nc,t?.headers.get("request-id")),ne(this,wc,"f").call(this,t),this._emit("connect"))}get ended(){return ne(this,Po,"f")}get errored(){return ne(this,_c,"f")}get aborted(){return ne(this,kc,"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,On,"m",Np).call(this)}async finalText(){return await this.done(),ne(this,On,"m",iv).call(this)}_emit(t,...n){if(ne(this,Po,"f"))return;t==="end"&&(ge(this,Po,!0),ne(this,Sc,"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,On,"m",Np).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,On,"m",Tp).call(this),this._connected(null);const l=ai.fromReadableStream(t,this.controller);for await(const u of l)ne(this,On,"m",Ap).call(this,u);if(l.controller.signal?.aborted)throw new Gn;ne(this,On,"m",Mp).call(this)}finally{r&&a&&r.removeEventListener("abort",a)}}[(Er=new WeakMap,Uo=new WeakMap,wc=new WeakMap,Io=new WeakMap,qo=new WeakMap,Sc=new WeakMap,$o=new WeakMap,Ui=new WeakMap,Po=new WeakMap,_c=new WeakMap,kc=new WeakMap,es=new WeakMap,Ec=new WeakMap,Nc=new WeakMap,Cp=new WeakMap,On=new WeakSet,Np=function(){if(this.receivedMessages.length===0)throw new Ae("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},iv=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(" ")},Tp=function(){this.ended||ge(this,Er,void 0)},Ap=function(n){if(this.ended)return;const r=ne(this,On,"m",rv).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":{av(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}}},Mp=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},rv=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&&av(a)){let l=a[sv]||"";l+=n.delta.partial_json;const u={...a};Object.defineProperty(u,sv,{value:l,enumerable:!1,writable:!0}),l&&(u.input=T_(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 z_ 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",Al,{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)=>Of.fromResponse(l.response,l.controller))}}class fg extends Kn{constructor(){super(...arguments),this.batches=new z_(this._client)}create(t,n){t.model in ov&&console.warn(`The model '${t.model}' is deprecated and will reach end-of-life on ${ov[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=N_[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 lf.createMessage(this,t,n)}countTokens(t,n){return this._client.post("/v1/messages/count_tokens",{body:t,...n})}}const ov={"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"};fg.Batches=z_;class O_ 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",Al,{query:a,...n,headers:Ve([{...r?.toString()!=null?{"anthropic-beta":r?.toString()}:void 0},n?.headers])})}}var Aj={};const Cc=e=>{if(typeof globalThis.process<"u")return Aj?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()};var Sm,dg,qc,D_;const Mj="\\n\\nHuman:",Rj="\\n\\nAssistant:";class Nt{constructor({baseURL:t=Cc("ANTHROPIC_BASE_URL"),apiKey:n=Cc("ANTHROPIC_API_KEY")??null,authToken:r=Cc("ANTHROPIC_AUTH_TOKEN")??null,...a}={}){Sm.add(this),qc.set(this,void 0);const l={apiKey:n,authToken:r,...a,baseURL:t||"https://api.anthropic.com"};if(!l.dangerouslyAllowBrowser&&QR())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??dg.DEFAULT_TIMEOUT,this.logger=l.logger??console;const u="warn";this.logLevel=u,this.logLevel=F1(l.logLevel,"ClientOptions.logLevel",this)??F1(Cc("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??u,this.fetchOptions=l.fetchOptions,this.maxRetries=l.maxRetries??2,this.fetch=l.fetch??tj(),ge(this,qc,ij),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-${n_()}`}makeStatusError(t,n,r,a){return Pt.generate(t,n,r,a)}buildURL(t,n,r){const a=!ne(this,Sm,"m",D_).call(this)&&r||this.baseURL,l=FR(t)?new URL(t):new URL(a+(a.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),u=this.defaultQuery();return YR(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 zf(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:d}=await this.buildRequest(a,{retryCount:l-n});await this.prepareRequest(u,{url:f,options:a});const h="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),g=r===void 0?"":`, retryOf: ${r}`,m=Date.now();if(Xt(this).debug(`[${h}] 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,b=await this.fetchWithTimeout(f,u,d,x).catch(gm),w=Date.now();if(b instanceof globalThis.Error){const k=`retrying, ${n} attempts remaining`;if(a.signal?.aborted)throw new Gn;const C=yl(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(n)return Xt(this).info(`[${h}] connection ${C?"timed out":"failed"} - ${k}`),Xt(this).debug(`[${h}] connection ${C?"timed out":"failed"} (${k})`,is({retryOfRequestLogID:r,url:f,durationMs:w-m,message:b.message})),this.retryRequest(a,n,r??h);throw Xt(this).info(`[${h}] connection ${C?"timed out":"failed"} - error; no more retries left`),Xt(this).debug(`[${h}] connection ${C?"timed out":"failed"} (error; no more retries left)`,is({retryOfRequestLogID:r,url:f,durationMs:w-m,message:b.message})),C?new i_:new jf({cause:b})}const E=[...b.headers.entries()].filter(([k])=>k==="request-id").map(([k,C])=>", "+k+": "+JSON.stringify(C)).join(""),N=`[${h}${g}${E}] ${u.method} ${f} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${w-m}ms`;if(!b.ok){const k=await this.shouldRetry(b);if(n&&k){const L=`retrying, ${n} attempts remaining`;return await nj(b.body),Xt(this).info(`${N} - ${L}`),Xt(this).debug(`[${h}] response error (${L})`,is({retryOfRequestLogID:r,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),this.retryRequest(a,n,r??h,b.headers)}const C=k?"error; no more retries left":"error; not retryable";Xt(this).info(`${N} - ${C}`);const _=await b.text().catch(L=>gm(L).message),R=d_(_),B=R?void 0:_;throw Xt(this).debug(`[${h}] response error (${C})`,is({retryOfRequestLogID:r,url:b.url,status:b.status,headers:b.headers,message:B,durationMs:Date.now()-m})),this.makeStatusError(b.status,R,B,b.headers)}return Xt(this).info(N),Xt(this).debug(`[${h}] response start`,is({retryOfRequestLogID:r,url:b.url,status:b.status,headers:b.headers,durationMs:w-m})),{response:b,options:a,controller:x,requestLogID:h,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 dj(this,r,t)}async fetchWithTimeout(t,n,r,a){const{signal:l,method:u,...f}=n||{};l&&l.addEventListener("abort",()=>a.abort());const d=setTimeout(()=>a.abort(),r),h=globalThis.ReadableStream&&f.body instanceof globalThis.ReadableStream||typeof f.body=="object"&&f.body!==null&&Symbol.asyncIterator in f.body,g={signal:a.signal,...h?{duplex:"half"}:{},method:"GET",...f};u&&(g.method=u.toUpperCase());try{return await this.fetch.call(void 0,t,g)}finally{clearTimeout(d)}}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 d=parseFloat(u);Number.isNaN(d)||(l=d)}const f=a?.get("retry-after");if(f&&!l){const d=parseFloat(f);Number.isNaN(d)?l=Date.parse(f)-Date.now():l=d*1e3}if(!(l&&0<=l&&l<60*1e3)){const d=t.maxRetries??this.maxRetries;l=this.calculateDefaultRetryTimeoutMillis(n,d)}return await ZR(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,d=this.buildURL(l,u,f);"timeout"in r&&GR("timeout",r.timeout),r.timeout=r.timeout??this.timeout;const{bodyHeaders:h,body:g}=this.buildBody({options:r}),m=await this.buildHeaders({options:t,method:a,bodyHeaders:h,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:d,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))}:{},...ej(),...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:p_(t)}:ne(this,qc,"f").call(this,{body:t,headers:r})}}dg=Nt,qc=new WeakMap,Sm=new WeakSet,D_=function(){return this.baseURL!=="https://api.anthropic.com"};Nt.Anthropic=dg;Nt.HUMAN_PROMPT=Mj;Nt.AI_PROMPT=Rj;Nt.DEFAULT_TIMEOUT=6e5;Nt.AnthropicError=Ae;Nt.APIError=Pt;Nt.APIConnectionError=jf;Nt.APIConnectionTimeoutError=i_;Nt.APIUserAbortError=Gn;Nt.NotFoundError=o_;Nt.ConflictError=l_;Nt.RateLimitError=c_;Nt.BadRequestError=r_;Nt.AuthenticationError=s_;Nt.InternalServerError=f_;Nt.PermissionDeniedError=a_;Nt.UnprocessableEntityError=u_;Nt.toFile=xj;class Ml extends Nt{constructor(){super(...arguments),this.completions=new j_(this),this.messages=new fg(this),this.models=new O_(this),this.beta=new Ea(this)}}Ml.Completions=j_;Ml.Messages=fg;Ml.Models=O_;Ml.Beta=Ea;let Tc=null;function L_(){return Tc||(Tc=localStorage.getItem("claude_api_key"),Tc)}async function jj(e,t,n="sonnet"){const r=L_();if(!r)throw new Error("API key not set. Please configure your Claude API key.");const a=new Ml({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(d=>d.type==="text");if(!f||f.type!=="text")throw new Error("No text response from Claude");return f.text}function zj(){return!!L_()}function Oj(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,d)=>{f===0&&l.push(d)});const u=[];for(;l.length>0;){const f=l.shift(),d=n.get(f);d&&u.push(d),a.get(f)?.forEach(h=>{const g=(r.get(h)||0)-1;r.set(h,g),g===0&&l.push(h)})}return u}function Dj(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 Lj(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 Bj(e,t,n){const r=e.data;if(!zj())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 jj(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 Hj(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 Uj(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 Ij(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 qj(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 $j(e,t,n){const r={results:new Map,cancelled:!1},a=Oj(e,t);n.onLog("info",`Starting workflow execution with ${a.length} nodes`);for(const l of a){n.onNodeStart(l.id);try{const u=Dj(l.id,t,r.results);let f;switch(l.type){case"input":f=await Lj(l,n);break;case"subagent":f=await Bj(l,u,n);break;case"skill":f=await Hj(l,u,n);break;case"command":f=await Uj(l,u,n);break;case"hook":f=await Ij(l,u,n);break;case"output":f=await qj(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 Pj(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 B_(){const{nodes:e,edges:t,workflowName:n,updateNodeStatus:r}=ci(),{isRunning:a,startExecution:l,stopExecution:u,setCurrentNode:f,markNodeCompleted:d,markNodeFailed:h,setWorkflowResults:g,addLog:m,clearLogs:x}=ka(),[b,w]=X.useState(null),E=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 $j(e,t,{onNodeStart:_=>{r(_,"running",0),f(_)},onNodeProgress:(_,R)=>{r(_,"running",R)},onNodeComplete:(_,R)=>{r(_,"completed",100),d(_,R)},onNodeError:(_,R)=>{r(_,"error",0),h(_,R)},onLog:(_,R,B)=>{m(_,R,B)}}),k=[],C=[];for(const[_,R]of N){const B=e.find(L=>L.id===_),M=typeof R=="string"?R:JSON.stringify(R,null,2);if(k.push({nodeId:_,label:B?.data.label||_,success:!0,result:M}),B?.type==="output"){const L=`${B.data.label.replace(/\s+/g,"_")}.md`;C.push({name:L,content:M})}}if(g(k),u(),m("success","워크플로우 실행 완료!"),C.length>0){m("info",`${C.length}개 파일 저장 중...`);const _=await Pj(n,C);_.success&&_.outputDir?(w(_.outputDir),m("info",`파일 저장 완료: ${_.outputDir}`),C.forEach(R=>{m("info",` - ${R.name}`)})):m("error",`파일 저장 실패: ${_.error}`)}}catch(N){const k=N instanceof Error?N.message:"Unknown error";u(),m("error",`실행 오류: ${k}`)}},[e,t,n,m,x,l,u,r,f,d,h,g]);return{isRunning:a,execute:E,savedOutputDir:b}}function Vj(e,t,n,r="local"){const a=r==="global"?"~/.claude":".claude",l=Fj(t,a),u=Yj(t,a),f=Xj(e,t,n,a),d=Gj(t);return{skills:l,commands:f,agents:u,mcpSettings:d}}function Fj(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=Zj(a);return{name:l,path:u,content:f}})}function Yj(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=Qj(a);return{name:l,path:u,content:f}})}function Xj(e,t,n,r){if(t.length===0)return[];const a=Na(e),l=`${r}/commands/${a}.md`,u=Kj(e,t,n);return[{name:a,path:l,content:u}]}function Gj(e){return e.filter(n=>n.type==="hook").length===0,null}function Zj(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 Qj(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 Kj(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 d=Jj(t,n);let h=1;return d.forEach(g=>{if(g.type!=="input"){if(f.push(`${h}. **${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(""),h++}}),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 Jj(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,d)=>{f===0&&l.push(d)});const u=[];for(;l.length>0;){const f=l.shift(),d=n.get(f);d&&u.push(d),a.get(f)?.forEach(h=>{const g=(r.get(h)||0)-1;r.set(h,g),g===0&&l.push(h)})}return u}async function H_(){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 Wj(t)}catch(e){return console.error("Failed to load Claude config:",e),[]}}function Wj(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 U_(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=U_(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=U_(e))&&(r&&(r+=" "),r+=t);return r}const I_="http://localhost:3001/api";async function ez(e,t){const n=await fetch(`${I_}/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 tz(){const e=await fetch(`${I_}/project-path`);if(!e.ok)throw new Error("Failed to get project path");return(await e.json()).path}async function nz(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 iz({isOpen:e,onClose:t,config:n}){const[r,a]=X.useState("local"),[l,u]=X.useState(!0),[f,d]=X.useState(!0),[h,g]=X.useState(!0),[m,x]=X.useState(!0),[b,w]=X.useState(""),[E,N]=X.useState([]),[k,C]=X.useState(null),[_,R]=X.useState(!1),[B,M]=X.useState(null),[L,G]=X.useState(null);X.useEffect(()=>{e&&tz().then(w).catch(()=>w("."))},[e]),X.useEffect(()=>{if(!e)return;nz(n,{location:r,includeSkills:l,includeCommands:f,includeAgents:h,includeMcpSettings:m}).then(({files:te})=>{N(te),te.length>0&&!k&&C(te[0])})},[e,n,r,l,f,h,m]);const Z=async()=>{R(!0),G(null),M(null);const P={location:r,includeSkills:l,includeCommands:f,includeAgents:h,includeMcpSettings:m};try{const te=await ez(n,P);M(te),te.success&&setTimeout(()=>t(),2e3)}catch(te){G(te instanceof Error?te.message:"Failed to save")}finally{R(!1)}},H=P=>{switch(P){case"skill":return v.jsx(ml,{className:"w-4 h-4 text-node-skill"});case"agent":return v.jsx(O5,{className:"w-4 h-4 text-node-generate"});case"command":return v.jsx(ds,{className:"w-4 h-4 text-accent"});case"mcp":return v.jsx(WS,{className:"w-4 h-4 text-node-mcp"});default:return v.jsx(ml,{className:"w-4 h-4 text-gray-400"})}},$=n.skills.length>0||n.commands.length>0||n.agents.length>0||n.mcpSettings;return e?v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl shadow-2xl w-[900px] max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(hm,{className:"w-5 h-5 text-accent"}),v.jsx("h2",{className:"text-lg font-semibold text-white",children:"Export to Claude Code"})]}),v.jsx("button",{onClick:t,className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(ag,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"w-64 border-r border-border p-4 space-y-6 overflow-y-auto",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Save Location"}),v.jsxs("div",{className:"space-y-2",children:[v.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:[v.jsx(pm,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Local"}),v.jsx("div",{className:"text-xs text-gray-500",children:".claude/"})]})]}),v.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:[v.jsx(pm,{className:"w-4 h-4"}),v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:"Global"}),v.jsx("div",{className:"text-xs text-gray-500",children:"~/.claude/"})]})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Include Files"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.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"}),v.jsxs("span",{className:Gt("text-sm",n.skills.length===0?"text-gray-600":"text-gray-300"),children:["Skills (",n.skills.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:f,onChange:P=>d(P.target.checked),disabled:n.commands.length===0,className:"w-4 h-4 rounded border-border bg-surface text-accent focus:ring-accent"}),v.jsxs("span",{className:Gt("text-sm",n.commands.length===0?"text-gray-600":"text-gray-300"),children:["Commands (",n.commands.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.jsx("input",{type:"checkbox",checked:h,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"}),v.jsxs("span",{className:Gt("text-sm",n.agents.length===0?"text-gray-600":"text-gray-300"),children:["Agents (",n.agents.length,")"]})]}),v.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[v.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"}),v.jsx("span",{className:Gt("text-sm",n.mcpSettings?"text-gray-300":"text-gray-600"),children:"MCP Settings"})]})]})]}),v.jsxs("div",{className:"pt-4 border-t border-border",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Project Path"}),v.jsx("div",{className:"text-xs text-gray-400 font-mono truncate",title:b,children:b||"Loading..."})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border overflow-x-auto",children:[E.map((P,te)=>v.jsxs("button",{onClick:()=>C(P),className:Gt("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm whitespace-nowrap transition-colors",k===P?"bg-surface-hover text-white":"text-gray-400 hover:text-white hover:bg-surface-hover/50"),children:[H(P.type),v.jsx("span",{children:P.path.split("/").pop()})]},te)),E.length===0&&v.jsx("span",{className:"text-sm text-gray-500",children:"No files to export"})]}),v.jsx("div",{className:"flex-1 overflow-auto p-4",children:k?v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"text-xs text-gray-500 font-mono",children:k.path}),v.jsx("pre",{className:"text-sm text-gray-300 font-mono bg-canvas p-4 rounded-lg overflow-auto max-h-[400px]",children:k.content})]}):v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a file to preview"})})]})]}),v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[B&&B.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-completed text-sm",children:[v.jsx(B5,{className:"w-4 h-4"}),v.jsx("span",{children:"Saved successfully!"})]}),B&&!B.success&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(dm,{className:"w-4 h-4"}),v.jsx("span",{children:"Some files failed to save"})]}),L&&v.jsxs("div",{className:"flex items-center gap-2 text-status-error text-sm",children:[v.jsx(dm,{className:"w-4 h-4"}),v.jsx("span",{children:L})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"Cancel"}),v.jsxs("button",{onClick:Z,disabled:_||E.length===0||!$,className:Gt("flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors",_||E.length===0||!$?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-accent hover:bg-accent-hover text-white"),children:[v.jsx(hm,{className:"w-4 h-4"}),_?"Saving...":"Export"]})]})]})]})}):null}const hg=Rf()(e_(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 rz({isOpen:e,onClose:t}){const{apiMode:n,apiKey:r,proxyUrl:a,setApiMode:l,setApiKey:u,setProxyUrl:f}=hg(),[d,h]=X.useState(n),[g,m]=X.useState(r),[x,b]=X.useState(a),[w,E]=X.useState(!1);if(X.useEffect(()=>{e&&(h(n),m(r),b(a))},[e,n,r,a]),!e)return null;const N=async()=>{if(l(d),u(g),f(x),d==="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(k){console.error("Failed to save API key:",k)}t()};return v.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:v.jsxs("div",{className:"bg-surface border border-border rounded-xl w-full max-w-md mx-4 shadow-2xl",children:[v.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border",children:[v.jsx("h2",{className:"text-lg font-semibold text-white",children:"설정"}),v.jsx("button",{onClick:t,className:"p-1 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(ag,{className:"w-5 h-5 text-gray-400"})})]}),v.jsxs("div",{className:"p-6 space-y-6",children:[v.jsxs("div",{className:"space-y-3",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"API 모드"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("label",{className:`
102
+ flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
103
+ ${d==="proxy"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
104
+ `,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"proxy",checked:d==="proxy",onChange:()=>h("proxy"),className:"sr-only"}),v.jsx(ER,{className:`w-5 h-5 ${d==="proxy"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${d==="proxy"?"text-white":"text-gray-300"}`,children:"프록시 서버"}),v.jsx("div",{className:"text-sm text-gray-500",children:"프록시 서버의 API 키를 사용합니다"})]}),d==="proxy"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]}),v.jsxs("label",{className:`
105
+ flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors
106
+ ${d==="direct"?"border-accent bg-accent/10":"border-border hover:border-gray-600"}
107
+ `,children:[v.jsx("input",{type:"radio",name:"apiMode",value:"direct",checked:d==="direct",onChange:()=>h("direct"),className:"sr-only"}),v.jsx(lR,{className:`w-5 h-5 ${d==="direct"?"text-accent":"text-gray-400"}`}),v.jsxs("div",{className:"flex-1",children:[v.jsx("div",{className:`font-medium ${d==="direct"?"text-white":"text-gray-300"}`,children:"직접 입력"}),v.jsx("div",{className:"text-sm text-gray-500",children:"나만의 API 키를 사용합니다"})]}),d==="direct"&&v.jsx("div",{className:"w-2 h-2 bg-accent rounded-full"})]})]})]}),d==="proxy"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"프록시 서버 URL"}),v.jsx("input",{type:"text",value:x,onChange:k=>b(k.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"}),v.jsx("p",{className:"text-xs text-gray-500",children:"서버에서 API 키를 관리하는 프록시 서버 주소"})]}),d==="direct"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Anthropic API 키"}),v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:w?"text":"password",value:g,onChange:k=>m(k.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"}),v.jsx("button",{type:"button",onClick:()=>E(!w),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:w?v.jsx(Q5,{className:"w-4 h-4"}):v.jsx(KS,{className:"w-4 h-4"})})]}),v.jsx("p",{className:"text-xs text-gray-500",children:"API 키는 브라우저에 안전하게 저장됩니다"})]})]}),v.jsxs("div",{className:"flex justify-end gap-3 px-6 py-4 border-t border-border",children:[v.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-400 hover:text-white transition-colors",children:"취소"}),v.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 sz(){const{workflowName:e,setWorkflowName:t,isDraft:n,nodes:r,edges:a,clearWorkflow:l,mergeExistingConfig:u}=ci(),{isRunning:f,execute:d}=B_(),[h,g]=X.useState(!1),[m,x]=X.useState(!1),[b,w]=X.useState(null),[E,N]=X.useState(!1),k=X.useCallback(async()=>{N(!0);try{const M=await H_();M.length>0&&u(M)}catch(M){console.error("Failed to reload config:",M)}finally{N(!1)}},[u]),C=()=>{const M=Vj(e,r,a,"local");w(M),g(!0)},_=()=>{g(!1),w(null)},R=()=>{f||d()},B=()=>{r.length!==0&&window.confirm("모든 워크플로우를 삭제하시겠습니까?")&&l()};return v.jsxs("header",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(j5,{className:"w-5 h-5 text-gray-400"})}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"text",value:e,onChange:M=>t(M.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&&v.jsx("span",{className:"px-2 py-0.5 text-xs font-medium bg-yellow-500/20 text-yellow-400 rounded",children:"Draft"})]})]}),v.jsx("div",{className:"text-sm font-medium text-gray-400",children:"Visual Workflow Builder"}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm text-gray-500",children:"Saved"}),v.jsxs("button",{onClick:R,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:[v.jsx(gl,{className:"w-4 h-4"}),f?"Running...":"Run"]}),v.jsxs("button",{onClick:C,className:"flex items-center gap-2 px-3 py-2 bg-surface-hover hover:bg-border rounded-lg transition-colors",children:[v.jsx(hm,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Export"})]}),v.jsxs("button",{onClick:k,disabled:E,className:`
111
+ flex items-center gap-2 px-3 py-2 rounded-lg transition-colors
112
+ ${E?"bg-surface-hover cursor-not-allowed opacity-50":"bg-surface-hover hover:bg-blue-500/20 hover:text-blue-400"}
113
+ `,title:".claude/ 폴더에서 다시 로드",children:[v.jsx(bR,{className:`w-4 h-4 text-gray-400 ${E?"animate-spin":""}`}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Reload"})]}),v.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:[v.jsx(Af,{className:"w-4 h-4 text-gray-400"}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Clear"})]}),v.jsx("button",{className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",children:v.jsx(wR,{className:"w-5 h-5 text-gray-400"})}),v.jsx("button",{onClick:()=>x(!0),className:"p-2 hover:bg-surface-hover rounded-lg transition-colors",title:"설정",children:v.jsx(WS,{className:"w-5 h-5 text-gray-400"})})]}),b&&v.jsx(iz,{isOpen:h,onClose:_,config:b}),v.jsx(rz,{isOpen:m,onClose:()=>x(!1)})]})}function Lf(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 q_(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:Lf(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 $_(e){if(e.type==="input"||e.type==="output")return!0;try{const t=await fetch("/api/sync/node",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({node:Lf(e)})});return t.ok?!0:(console.error("Failed to delete node:",await t.text()),!1)}catch(t){return console.error("Failed to delete node:",t),!1}}async function lv(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(Lf)})});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 az(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(Lf)})});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 oz=[{type:"input",label:"User Input",icon:v.jsx(Tf,{className:"w-4 h-4"}),color:"text-yellow-400",hoverColor:"hover:bg-yellow-500/10"},{type:"subagent",label:"Sub Agent",icon:v.jsx(Cl,{className:"w-4 h-4"}),color:"text-purple-400",hoverColor:"hover:bg-purple-500/10"},{type:"skill",label:"Skill",icon:v.jsx(Mf,{className:"w-4 h-4"}),color:"text-cyan-400",hoverColor:"hover:bg-cyan-500/10"},{type:"command",label:"Command",icon:v.jsx(ds,{className:"w-4 h-4"}),color:"text-orange-400",hoverColor:"hover:bg-orange-500/10"},{type:"hook",label:"Hook",icon:v.jsx(rg,{className:"w-4 h-4"}),color:"text-pink-400",hoverColor:"hover:bg-pink-500/10"},{type:"output",label:"Output",icon:v.jsx(Nf,{className:"w-4 h-4"}),color:"text-emerald-400",hoverColor:"hover:bg-emerald-500/10"}];function lz(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 uz(){const e=ci(n=>n.addNode),t=n=>{const r=lz(n);e(r),q_(r).catch(a=>{console.error("Failed to sync node to filesystem:",a)})};return v.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-canvas border-b border-border",children:oz.map(n=>v.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:[v.jsx("span",{className:n.color,children:n.icon}),v.jsx("span",{className:"text-sm font-medium text-gray-300",children:n.label})]},n.type))})}function cz({status:e}){switch(e){case"running":return v.jsx(sf,{className:"w-4 h-4 animate-spin text-blue-400"});case"completed":return v.jsx(Y5,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(dm,{className:"w-4 h-4 text-red-400"});default:return v.jsx(gl,{className:"w-4 h-4"})}}function fz({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 v.jsxs("div",{className:Gt("workflow-node",t&&"ring-2 ring-accent ring-offset-2 ring-offset-canvas",f()),children:[v.jsxs("div",{className:Gt("node-header flex items-center justify-between",a),children:[v.jsxs("div",{className:"flex items-center gap-2",children:[r,v.jsx("span",{className:"font-semibold text-sm text-white",children:e.label})]}),v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(cz,{status:e.status})})]}),v.jsxs("div",{className:"node-content",children:[e.description&&v.jsx("p",{className:"text-sm text-gray-400 mb-3",children:e.description}),n,e.usedInputs&&e.usedInputs.length>0&&v.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700/50",children:[v.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Used in this step"}),v.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.usedInputs.map(d=>v.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:[v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),d]},d))})]})]}),u&&v.jsx(wa,{type:"target",position:be.Left}),l&&v.jsx(wa,{type:"source",position:be.Right})]})}const Ca=X.memo(fz);function dz({data:e,selected:t}){return v.jsx(Ca,{data:e,selected:t,headerIcon:v.jsx(Tf,{className:"w-4 h-4 text-amber-100"}),headerColor:"bg-gradient-to-br from-amber-500 to-orange-600",showTargetHandle:!1,showSourceHandle:!0,children:v.jsxs("div",{className:"text-gray-300",children:[e.inputType==="text"&&v.jsx("div",{className:"text-sm text-gray-400",children:e.value||e.placeholder||"Enter your input..."}),e.inputType==="file"&&v.jsx("div",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),e.inputType==="select"&&e.options&&v.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=>v.jsx("option",{value:n,children:n},n))})]})})}const hz=X.memo(dz);function pz({data:e,selected:t}){return v.jsx(Ca,{data:e,selected:t,headerIcon:v.jsx(Cl,{className:"w-4 h-4 text-violet-100"}),headerColor:"bg-gradient-to-br from-violet-500 to-purple-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.tools&&e.tools.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.tools.slice(0,3).map(n=>v.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&&v.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&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Model: ",e.model]})]})})}const mz=X.memo(pz);function gz({data:e,selected:t}){return v.jsx(Ca,{data:e,selected:t,headerIcon:v.jsx(Mf,{className:"w-4 h-4 text-cyan-100"}),headerColor:"bg-gradient-to-br from-cyan-500 to-cyan-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.skillType==="official"&&e.skillId&&v.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&&v.jsxs("div",{className:"text-xs text-gray-500",children:["Category: ",e.skillCategory]})]})})}const yz=X.memo(gz);function xz({data:e,selected:t}){return v.jsx(Ca,{data:e,selected:t,headerIcon:v.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:v.jsxs("div",{className:"space-y-2",children:[e.commandName&&v.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&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.commandPath})]})})}const bz=X.memo(xz);function vz({data:e,selected:t}){return v.jsx(Ca,{data:e,selected:t,headerIcon:v.jsx(rg,{className:"w-4 h-4 text-pink-100"}),headerColor:"bg-gradient-to-br from-pink-500 to-rose-700",showTargetHandle:!0,showSourceHandle:!0,children:v.jsxs("div",{className:"space-y-2",children:[e.hookEvent&&v.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&&v.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.hookMatcher})]})})}const wz=X.memo(vz);function Sz(e){switch(e){case"markdown":case"document":return v.jsx(ml,{className:"w-4 h-4 text-emerald-100"});case"image":return v.jsx(JS,{className:"w-4 h-4 text-emerald-100"});case"webpage":return v.jsx(iR,{className:"w-4 h-4 text-emerald-100"});case"link":return v.jsx(cR,{className:"w-4 h-4 text-emerald-100"});default:return v.jsx(Nf,{className:"w-4 h-4 text-emerald-100"})}}function _z({data:e,selected:t}){return v.jsx(Ca,{data:e,selected:t,headerIcon:Sz(e.outputType),headerColor:"bg-gradient-to-br from-emerald-500 to-green-700",showTargetHandle:!0,showSourceHandle:!1,children:v.jsxs("div",{className:"space-y-2",children:[e.layoutType&&v.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&&v.jsxs("div",{className:"text-xs text-gray-400 truncate max-w-[200px]",children:[e.result.substring(0,50),"..."]})]})})}const kz=X.memo(_z),Bf=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 uv(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 Ez={input:hz,subagent:mz,skill:yz,command:bz,hook:wz,output:kz};function Nz(){const{nodes:e,edges:t,setNodes:n,setEdges:r,addEdge:a,setSelectedNode:l}=ci(),u=Bf(N=>N.openStepPanel),[f,d]=X.useState(!1),h=X.useRef([]);X.useEffect(()=>{const N=C=>{C.key==="Shift"&&d(!0)},k=C=>{C.key==="Shift"&&(d(!1),h.current=[])};return window.addEventListener("keydown",N),window.addEventListener("keyup",k),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",k)}},[]);const g=X.useCallback(({nodes:N})=>{if(!f){h.current=[];return}const k=N.map(C=>C.id);if(k.length===2){const[C,_]=k;if(!t.some(B=>B.source===C&&B.target===_||B.source===_&&B.target===C)){const B=e.find(L=>L.id===C),M=e.find(L=>L.id===_);if(B&&M){let L=C,G=_;(B.position?.x??0)>(M.position?.x??0)&&(L=_,G=C);const Z={source:L,target:G,sourceHandle:null,targetHandle:null};if(uv(Z,e)){const H={id:`e-${L}-${G}`,source:L,target:G,animated:!0};r(am({...Z,animated:!0},t)),a(H),lv(H,e).catch($=>{console.error("Failed to sync edge to filesystem:",$)})}}}}h.current=k},[f,e,t,r,a]),m=X.useCallback(N=>{for(const k of N)if(k.type==="remove"){const C=e.find(_=>_.id===k.id);C&&$_(C).catch(_=>{console.error("Failed to delete node from filesystem:",_)})}n(bS(N,e))},[e,n]),x=X.useCallback(N=>{for(const k of N)if(k.type==="remove"){const C=t.find(_=>_.id===k.id);C&&az(C,e).catch(_=>{console.error("Failed to remove edge from filesystem:",_)})}r(vS(N,t))},[t,e,r]),b=X.useCallback(N=>{if(!uv(N,e))return;const k={id:`e-${N.source}-${N.target}`,source:N.source,target:N.target,animated:!0};r(am({...N,animated:!0},t)),a(k),lv(k,e).catch(C=>{console.error("Failed to sync edge to filesystem:",C)})},[e,t,r,a]),w=X.useCallback((N,k)=>{l(k.id),u()},[l,u]),E=X.useCallback(()=>{l(null)},[l]);return v.jsxs(Q3,{nodes:e,edges:t,onNodesChange:m,onEdgesChange:x,onConnect:b,onSelectionChange:g,onNodeClick:w,onPaneClick:E,nodeTypes:Ez,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:[v.jsx(t5,{variant:$i.Dots,gap:20,size:1,color:"#333333"}),v.jsx(l5,{}),v.jsx(w5,{nodeColor:N=>{switch(N.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)"})]})}function Cz(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Az=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Mz={};function cv(e,t){return(Mz.jsx?Az:Tz).test(e)}const Rz=/[ \t\n\f\r]/g;function jz(e){return typeof e=="object"?e.type==="text"?fv(e.value):!1:fv(e)}function fv(e){return e.replace(Rz,"")===""}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 P_(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 _m(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 zz=0;const je=hs(),_t=hs(),km=hs(),de=hs(),at=hs(),ha=hs(),wn=hs();function hs(){return 2**++zz}const Em=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:_t,commaOrSpaceSeparated:wn,commaSeparated:ha,number:de,overloadedBoolean:km,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),Rp=Object.keys(Em);class pg extends ln{constructor(t,n,r,a){let l=-1;if(super(t,n),dv(this,"space",a),typeof r=="number")for(;++l<Rp.length;){const u=Rp[l];dv(this,Rp[l],(r&Em[u])===Em[u])}}}pg.prototype.defined=!0;function dv(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 pg(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[_m(r)]=r,n[_m(l.attribute)]=r}return new Rl(t,n,e.space)}const V_=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 F_(e,t){return t in e?e[t]:t}function Y_(e,t){return F_(e,t.toLowerCase())}const Oz=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:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:at,autoFocus:je,autoPlay:je,blocking:at,capture:null,charSet:null,checked:je,cite:null,className:at,cols:de,colSpan:null,content:null,contentEditable:_t,controls:je,controlsList:at,coords:de|ha,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:km,draggable:_t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:at,height:de,hidden:km,high:de,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:at,itemRef:at,itemScope:je,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:de,pattern:null,ping:at,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:at,required:je,reversed:je,rows:de,rowSpan:de,sandbox:at,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,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:je,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:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:je,noHref:je,noShade:je,noWrap:je,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:je,disableRemotePlayback:je,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Y_}),Dz=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:je,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:F_}),X_=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()}}),G_=Ta({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Y_}),Z_=Ta({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Lz={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"},Bz=/[A-Z]/g,hv=/-[a-z]/g,Hz=/^data[-\w.:]+$/i;function Uz(e,t){const n=_m(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"&&Hz.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(hv,qz);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!hv.test(l)){let u=l.replace(Bz,Iz);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=pg}return new a(r,t)}function Iz(e){return"-"+e.toLowerCase()}function qz(e){return e.charAt(1).toUpperCase()}const $z=P_([V_,Oz,X_,G_,Z_],"html"),mg=P_([V_,Dz,X_,G_,Z_],"svg");function Pz(e){return e.join(" ").trim()}var ia={},jp,pv;function Vz(){if(pv)return jp;pv=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
123
+ `,h="/",g="*",m="",x="comment",b="declaration";function w(N,k){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];k=k||{};var C=1,_=1;function R(D){var U=D.match(t);U&&(C+=U.length);var z=D.lastIndexOf(d);_=~z?D.length-z:_+D.length}function B(){var D={line:C,column:_};return function(U){return U.position=new M(D),Z(),U}}function M(D){this.start=D,this.end={line:C,column:_},this.source=k.source}M.prototype.content=N;function L(D){var U=new Error(k.source+":"+C+":"+_+": "+D);if(U.reason=D,U.filename=k.source,U.line=C,U.column=_,U.source=N,!k.silent)throw U}function G(D){var U=D.exec(N);if(U){var z=U[0];return R(z),N=N.slice(z.length),U}}function Z(){G(n)}function H(D){var U;for(D=D||[];U=$();)U!==!1&&D.push(U);return D}function $(){var D=B();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var U=2;m!=N.charAt(U)&&(g!=N.charAt(U)||h!=N.charAt(U+1));)++U;if(U+=2,m===N.charAt(U-1))return L("End of comment missing");var z=N.slice(2,U-2);return _+=2,R(z),N=N.slice(U),_+=2,D({type:x,comment:z})}}function P(){var D=B(),U=G(r);if(U){if($(),!G(a))return L("property missing ':'");var z=G(l),I=D({type:b,property:E(U[0].replace(e,m)),value:z?E(z[0].replace(e,m)):m});return G(u),I}}function te(){var D=[];H(D);for(var U;U=P();)U!==!1&&(D.push(U),H(D));return D}return Z(),te()}function E(N){return N?N.replace(f,m):m}return jp=w,jp}var mv;function Fz(){if(mv)return ia;mv=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(Vz());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(d=>{if(d.type!=="declaration")return;const{property:h,value:g}=d;f?a(h,g,d):g&&(l=l||{},l[h]=g)}),l}return ia}var Vo={},gv;function Yz(){if(gv)return Vo;gv=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(h){return!h||n.test(h)||e.test(h)},u=function(h,g){return g.toUpperCase()},f=function(h,g){return"".concat(g,"-")},d=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,f):h=h.replace(r,f),h.replace(t,u))};return Vo.camelCase=d,Vo}var Fo,yv;function Xz(){if(yv)return Fo;yv=1;var e=Fo&&Fo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(Fz()),n=Yz();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(f,d){f&&d&&(u[(0,n.camelCase)(f,l)]=d)}),u}return r.default=r,Fo=r,Fo}var Gz=Xz();const Zz=hf(Gz),Q_=K_("end"),gg=K_("start");function K_(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 Qz(e){const t=gg(e),n=Q_(e);if(t&&n)return{start:t,end:n}}function il(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xv(e.position):"start"in e||"end"in e?xv(e):"line"in e||"column"in e?Nm(e):""}function Nm(e){return bv(e&&e.line)+":"+bv(e&&e.column)}function xv(e){return Nm(e&&e.start)+"-"+Nm(e&&e.end)}function bv(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 d=r.indexOf(":");d===-1?l.ruleId=r:(l.source=r.slice(0,d),l.ruleId=r.slice(d+1))}if(!l.place&&l.ancestors&&l.ancestors){const d=l.ancestors[l.ancestors.length-1];d&&(l.place=d.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 yg={}.hasOwnProperty,Kz=new Map,Jz=/[A-Z]/g,Wz=new Set(["table","tbody","thead","tfoot","tr"]),eO=new Set(["td","th"]),J_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tO(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=uO(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=lO(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"?mg:$z,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=W_(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function W_(e,t,n){if(t.type==="element")return nO(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return iO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sO(e,t,n);if(t.type==="mdxjsEsm")return rO(e,t);if(t.type==="root")return aO(e,t,n);if(t.type==="text")return oO(e,t)}function nO(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=mg,e.schema=a),e.ancestors.push(t);const l=t2(e,t.tagName,!1),u=cO(e,t);let f=bg(e,t);return Wz.has(t.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!jz(d):!0})),e2(e,u,l,t),xg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function iO(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)}xl(e,t.position)}function rO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xl(e,t.position)}function sO(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=mg,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:t2(e,t.name,!0),u=fO(e,t),f=bg(e,t);return e2(e,u,l,t),xg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function aO(e,t,n){const r={};return xg(r,bg(e,t)),e.create(t,e.Fragment,r,n)}function oO(e,t){return t.value}function e2(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lO(e,t,n){return r;function r(a,l,u,f){const h=Array.isArray(u.children)?n:t;return f?h(l,u,f):h(l,u)}}function uO(e,t){return n;function n(r,a,l,u){const f=Array.isArray(l.children),d=gg(r);return t(a,l,u,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function cO(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&yg.call(t.properties,a)){const l=dO(e,a,t.properties[a]);if(l){const[u,f]=l;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&eO.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 fO(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 xl(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 xl(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function bg(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:Kz;for(;++r<t.children.length;){const l=t.children[r];let u;if(e.passKeys){const d=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(d){const h=a.get(d)||0;u=d+"-"+h,a.set(d,h+1)}}const f=W_(e,l,u);f!==void 0&&n.push(f)}return n}function dO(e,t,n){const r=Uz(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Cz(n):Pz(n)),r.property==="style"){let a=typeof n=="object"?n:hO(e,String(n));return e.stylePropertyNameCase==="css"&&(a=pO(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Lz[r.property]||r.property:r.attribute,n]}}function hO(e,t){try{return Zz(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=J_+"#cannot-parse-style-attribute",a}}function t2(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=cv(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=cv(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return yg.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);xl(e)}function xl(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=J_+"#cannot-handle-mdx-estrees-without-createevaluater",n}function pO(e){const t={};let n;for(n in e)yg.call(e,n)&&(t[mO(n)]=e[n]);return t}function mO(e){let t=e.replace(Jz,gO);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function gO(e){return"-"+e.toLowerCase()}const zp={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"]},yO={};function vg(e,t){const n=yO,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return n2(e,r,a)}function n2(e,t,n){if(xO(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 vv(e.children,t,n)}return Array.isArray(e)?vv(e,t,n):""}function vv(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=n2(e[a],t,n);return r.join("")}function xO(e){return!!(e&&typeof e=="object")}const wv=document.createElement("i");function wg(e){const t="&"+e+";";wv.innerHTML=t;const n=wv.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 Dn(e,t){return e.length>0?(_n(e,e.length,0,t),e):t}const Sv={}.hasOwnProperty;function i2(e){const t={};let n=-1;for(;++n<e.length;)bO(t,e[n]);return t}function bO(e,t){let n;for(n in t){const a=(Sv.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let u;if(l)for(u in l){Sv.call(a,u)||(a[u]=[]);const f=l[u];vO(a[u],Array.isArray(f)?f:f?[f]:[])}}}function vO(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 r2(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]/),wO=Mr(/[#-'*+\--9=?A-Z^-~]/);function uf(e){return e!==null&&(e<32||e===127)}const Cm=Mr(/\d/),SO=Mr(/[\dA-Fa-f]/),_O=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 Hf=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(d){return He(d)?(e.enter(n),f(d)):t(d)}function f(d){return He(d)&&l++<a?(e.consume(d),f):(e.exit(n),t(d))}}const kO={tokenize:EO};function EO(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 d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,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 NO={tokenize:CO},_v={tokenize:TO};function CO(e){const t=this,n=[];let r=0,a,l,u;return f;function f(_){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,d,h)(_)}return h(_)}function d(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const R=t.events.length;let B=R,M;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){M=t.events[B][1].end;break}k(r);let L=R;for(;L<t.events.length;)t.events[L][1].end={...M},L++;return _n(t.events,B+1,0,t.events.slice(R)),t.events.length=L,h(_)}return f(_)}function h(_){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(_v,g,m)(_)}function g(_){return a&&C(),k(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(_v,b,w)(_)}function b(_){return r++,n.push([t.currentConstruct,t.containerState]),x(_)}function w(_){if(_===null){a&&C(),k(0),e.consume(_);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:l}),E(_)}function E(_){if(_===null){N(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return Se(_)?(e.consume(_),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(_),E)}function N(_,R){const B=t.sliceStream(_);if(R&&B.push(null),_.previous=l,l&&(l.next=_),l=_,a.defineSkip(_.start),a.write(B),t.parser.lazy[_.start.line]){let M=a.events.length;for(;M--;)if(a.events[M][1].start.offset<u&&(!a.events[M][1].end||a.events[M][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(k(r),M=L;M<t.events.length;)t.events[M][1].end={...H},M++;_n(t.events,G+1,0,t.events.slice(L)),t.events.length=M}}function k(_){let R=n.length;for(;R-- >_;){const B=n[R];t.containerState=B[1],B[0].exit.call(t,e)}n.length=_}function C(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function TO(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(Hf(e))return 2}function Uf(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 Tm={name:"attention",resolveAll:AO,tokenize:MO};function AO(e,t){let n=-1,r,a,l,u,f,d,h,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;d=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};kv(m,-d),kv(x,d),u={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},l={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[r][1].end={...u.start},e[n][1].start={...f.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Dn(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Dn(h,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),h=Dn(h,Uf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Dn(h,[["exit",l,t],["enter",f,t],["exit",f,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Dn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,_n(e,r-1,n-r+3,h),n=r+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function MO(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=_a(r);let l;return u;function u(d){return l=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===l)return e.consume(d),f;const h=e.exit("attentionSequence"),g=_a(d),m=!g||g===2&&a||n.includes(d),x=!a||a===2&&g||n.includes(r);return h._open=!!(l===42?m:m&&(a||!x)),h._close=!!(l===42?x:x&&(g||!m)),t(d)}}function kv(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const RO={name:"autolink",tokenize:jO};function jO(e,t,n){let r=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Zt(b)?(e.consume(b),u):b===64?n(b):h(b)}function u(b){return b===43||b===45||b===46||$t(b)?(r=1,f(b)):h(b)}function f(b){return b===58?(e.consume(b),r=0,d):(b===43||b===45||b===46||$t(b))&&r++<32?(e.consume(b),f):(r=0,h(b))}function d(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||uf(b)?n(b):(e.consume(b),d)}function h(b){return b===64?(e.consume(b),g):wO(b)?(e.consume(b),h):n(b)}function g(b){return $t(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),r=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||$t(b))&&r++<63){const w=b===45?x:m;return e.consume(b),w}return n(b)}}const jl={partial:!0,tokenize:zO};function zO(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 s2={continuation:{tokenize:DO},exit:LO,name:"blockQuote",tokenize:OO};function OO(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 DO(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(s2,t,n)(u)}}function LO(e){e.exit("blockQuote")}const a2={name:"characterEscape",tokenize:BO};function BO(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 _O(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const o2={name:"characterReference",tokenize:HO};function HO(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"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,u=$t,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,u=SO,g):(e.enter("characterReferenceValue"),l=7,u=Cm,g(m))}function g(m){if(m===59&&a){const x=e.exit("characterReferenceValue");return u===$t&&!wg(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 Ev={partial:!0,tokenize:IO},Nv={concrete:!0,name:"codeFenced",tokenize:UO};function UO(e,t,n){const r=this,a={partial:!0,tokenize:B};let l=0,u=0,f;return d;function d(M){return h(M)}function h(M){const L=r.events[r.events.length-1];return l=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===f?(u++,e.consume(M),g):u<3?n(M):(e.exit("codeFencedFenceSequence"),He(M)?Fe(e,m,"whitespace")(M):m(M))}function m(M){return M===null||Se(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(Ev,E,R)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(M))}function x(M){return M===null||Se(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(M)):He(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Fe(e,b,"whitespace")(M)):M===96&&M===f?n(M):(e.consume(M),x)}function b(M){return M===null||Se(M)?m(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===null||Se(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(M)):M===96&&M===f?n(M):(e.consume(M),w)}function E(M){return e.attempt(a,R,N)(M)}function N(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return l>0&&He(M)?Fe(e,C,"linePrefix",l+1)(M):C(M)}function C(M){return M===null||Se(M)?e.check(Ev,E,R)(M):(e.enter("codeFlowValue"),_(M))}function _(M){return M===null||Se(M)?(e.exit("codeFlowValue"),C(M)):(e.consume(M),_)}function R(M){return e.exit("codeFenced"),t(M)}function B(M,L,G){let Z=0;return H;function H(U){return M.enter("lineEnding"),M.consume(U),M.exit("lineEnding"),$}function $(U){return M.enter("codeFencedFence"),He(U)?Fe(M,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):P(U)}function P(U){return U===f?(M.enter("codeFencedFenceSequence"),te(U)):G(U)}function te(U){return U===f?(Z++,M.consume(U),te):Z>=u?(M.exit("codeFencedFenceSequence"),He(U)?Fe(M,D,"whitespace")(U):D(U)):G(U)}function D(U){return U===null||Se(U)?(M.exit("codeFencedFence"),L(U)):G(U)}}}function IO(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:$O},qO={partial:!0,tokenize:PO};function $O(e,t,n){const r=this;return a;function a(h){return e.enter("codeIndented"),Fe(e,l,"linePrefix",5)(h)}function l(h){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?d(h):Se(h)?e.attempt(qO,u,d)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Se(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function d(h){return e.exit("codeIndented"),t(h)}}function PO(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 VO={name:"codeText",previous:YO,resolve:FO,tokenize:XO};function FO(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 YO(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function XO(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"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(l=e.enter("codeTextSequence"),a=0,g(m)):Se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Se(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),a++,g):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(l.type="codeTextData",h(m))}}class GO{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 l2(e){const t={};let n=-1,r,a,l,u,f,d,h;const g=new GO(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"&&(d=r[1]._tokenizer.events,l=0,l<d.length&&d[l][1].type==="lineEndingBlank"&&(l+=2),l<d.length&&d[l][1].type==="content"))for(;++l<d.length&&d[l][1].type!=="content";)d[l][1].type==="chunkText"&&(d[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ZO(g,n)),n=t[n],h=!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)),!h}function ZO(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,d=[],h={};let g,m,x=-1,b=n,w=0,E=0;const N=[E];for(;b;){for(;e.get(++a)[1]!==b;);l.push(a),b._tokenizer||(g=r.sliceStream(b),b.next||g.push(null),m&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=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&&(E=x+1,N.push(E),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),x=N.length;x--;){const k=f.slice(N[x],N[x+1]),C=l.pop();d.push([C,C+k.length-1]),e.splice(C,2,k)}for(d.reverse(),x=-1;++x<d.length;)h[w+d[x][0]]=w+d[x][1],w+=d[x][1]-d[x][0]-1;return h}const QO={resolve:JO,tokenize:WO},KO={partial:!0,tokenize:eD};function JO(e){return l2(e),e}function WO(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(KO,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 eD(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 u2(e,t,n,r,a,l,u,f,d){const h=d||Number.POSITIVE_INFINITY;let g=0;return m;function m(k){return k===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(k),e.exit(l),x):k===null||k===32||k===41||uf(k)?n(k):(e.enter(r),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),E(k))}function x(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(f),x(k)):k===null||k===60||Se(k)?n(k):(e.consume(k),k===92?w:b)}function w(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function E(k){return!g&&(k===null||k===41||st(k))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(r),t(k)):g<h&&k===40?(e.consume(k),g++,E):k===41?(e.consume(k),g--,E):k===null||k===32||k===40||uf(k)?n(k):(e.consume(k),k===92?N:E)}function N(k){return k===40||k===41||k===92?(e.consume(k),E):E(k)}}function c2(e,t,n,r,a,l){const u=this;let f=0,d;return h;function h(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),e.enter(l),g}function g(b){return f>999||b===null||b===91||b===93&&!d||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(b):b===93?(e.exit(l),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):Se(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Se(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),d||(d=!He(b)),b===92?x:m)}function x(b){return b===91||b===92||b===93?(e.consume(b),f++,m):m(b)}}function f2(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,d):n(x)}function d(x){return x===u?(e.enter(a),e.consume(x),e.exit(a),e.exit(r),t):(e.enter(l),h(x))}function h(x){return x===u?(e.exit(l),d(u)):x===null?n(x):Se(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Fe(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===u||x===null||Se(x)?(e.exit("chunkString"),h(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 tD={name:"definition",tokenize:iD},nD={partial:!0,tokenize:rD};function iD(e,t,n){const r=this;let a;return l;function l(b){return e.enter("definition"),u(b)}function u(b){return c2.call(r,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return a=Zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),d):n(b)}function d(b){return st(b)?rl(e,h)(b):h(b)}function h(b){return u2(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(nD,m,m)(b)}function m(b){return He(b)?Fe(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Se(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function rD(e,t,n){return r;function r(f){return st(f)?rl(e,a)(f):n(f)}function a(f){return f2(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 sD={name:"hardBreakEscape",tokenize:aD};function aD(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 oD={name:"headingAtx",resolve:lD,tokenize:uD};function lD(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 uD(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"),d(g)):g===null||Se(g)?(e.exit("atxHeading"),t(g)):He(g)?Fe(e,f,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function d(g){return g===35?(e.consume(g),d):(e.exit("atxHeadingSequence"),f(g))}function h(g){return g===null||g===35||st(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),h)}}const cD=["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"],Cv=["pre","script","style","textarea"],fD={concrete:!0,name:"htmlFlow",resolveTo:pD,tokenize:mD},dD={partial:!0,tokenize:yD},hD={partial:!0,tokenize:gD};function pD(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 mD(e,t,n){const r=this;let a,l,u,f,d;return h;function h(A){return g(A)}function g(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),x):A===47?(e.consume(A),l=!0,E):A===63?(e.consume(A),a=3,r.interrupt?t:j):Zt(A)?(e.consume(A),u=String.fromCharCode(A),N):n(A)}function x(A){return A===45?(e.consume(A),a=2,b):A===91?(e.consume(A),a=5,f=0,w):Zt(A)?(e.consume(A),a=4,r.interrupt?t:j):n(A)}function b(A){return A===45?(e.consume(A),r.interrupt?t:j):n(A)}function w(A){const ie="CDATA[";return A===ie.charCodeAt(f++)?(e.consume(A),f===ie.length?r.interrupt?t:P:w):n(A)}function E(A){return Zt(A)?(e.consume(A),u=String.fromCharCode(A),N):n(A)}function N(A){if(A===null||A===47||A===62||st(A)){const ie=A===47,ce=u.toLowerCase();return!ie&&!l&&Cv.includes(ce)?(a=1,r.interrupt?t(A):P(A)):cD.includes(u.toLowerCase())?(a=6,ie?(e.consume(A),k):r.interrupt?t(A):P(A)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):l?C(A):_(A))}return A===45||$t(A)?(e.consume(A),u+=String.fromCharCode(A),N):n(A)}function k(A){return A===62?(e.consume(A),r.interrupt?t:P):n(A)}function C(A){return He(A)?(e.consume(A),C):H(A)}function _(A){return A===47?(e.consume(A),H):A===58||A===95||Zt(A)?(e.consume(A),R):He(A)?(e.consume(A),_):H(A)}function R(A){return A===45||A===46||A===58||A===95||$t(A)?(e.consume(A),R):B(A)}function B(A){return A===61?(e.consume(A),M):He(A)?(e.consume(A),B):_(A)}function M(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),d=A,L):He(A)?(e.consume(A),M):G(A)}function L(A){return A===d?(e.consume(A),d=null,Z):A===null||Se(A)?n(A):(e.consume(A),L)}function G(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||st(A)?B(A):(e.consume(A),G)}function Z(A){return A===47||A===62||He(A)?_(A):n(A)}function H(A){return A===62?(e.consume(A),$):n(A)}function $(A){return A===null||Se(A)?P(A):He(A)?(e.consume(A),$):n(A)}function P(A){return A===45&&a===2?(e.consume(A),z):A===60&&a===1?(e.consume(A),I):A===62&&a===4?(e.consume(A),O):A===63&&a===3?(e.consume(A),j):A===93&&a===5?(e.consume(A),K):Se(A)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(dD,V,te)(A)):A===null||Se(A)?(e.exit("htmlFlowData"),te(A)):(e.consume(A),P)}function te(A){return e.check(hD,D,V)(A)}function D(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),U}function U(A){return A===null||Se(A)?te(A):(e.enter("htmlFlowData"),P(A))}function z(A){return A===45?(e.consume(A),j):P(A)}function I(A){return A===47?(e.consume(A),u="",F):P(A)}function F(A){if(A===62){const ie=u.toLowerCase();return Cv.includes(ie)?(e.consume(A),O):P(A)}return Zt(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),F):P(A)}function K(A){return A===93?(e.consume(A),j):P(A)}function j(A){return A===62?(e.consume(A),O):A===45&&a===2?(e.consume(A),j):P(A)}function O(A){return A===null||Se(A)?(e.exit("htmlFlowData"),V(A)):(e.consume(A),O)}function V(A){return e.exit("htmlFlow"),t(A)}}function gD(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 yD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(jl,t,n)}}const xD={name:"htmlText",tokenize:bD};function bD(e,t,n){const r=this;let a,l,u;return f;function f(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),d}function d(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),B):j===63?(e.consume(j),_):Zt(j)?(e.consume(j),G):n(j)}function h(j){return j===45?(e.consume(j),g):j===91?(e.consume(j),l=0,w):Zt(j)?(e.consume(j),C):n(j)}function g(j){return j===45?(e.consume(j),b):n(j)}function m(j){return j===null?n(j):j===45?(e.consume(j),x):Se(j)?(u=m,I(j)):(e.consume(j),m)}function x(j){return j===45?(e.consume(j),b):m(j)}function b(j){return j===62?z(j):j===45?x(j):m(j)}function w(j){const O="CDATA[";return j===O.charCodeAt(l++)?(e.consume(j),l===O.length?E:w):n(j)}function E(j){return j===null?n(j):j===93?(e.consume(j),N):Se(j)?(u=E,I(j)):(e.consume(j),E)}function N(j){return j===93?(e.consume(j),k):E(j)}function k(j){return j===62?z(j):j===93?(e.consume(j),k):E(j)}function C(j){return j===null||j===62?z(j):Se(j)?(u=C,I(j)):(e.consume(j),C)}function _(j){return j===null?n(j):j===63?(e.consume(j),R):Se(j)?(u=_,I(j)):(e.consume(j),_)}function R(j){return j===62?z(j):_(j)}function B(j){return Zt(j)?(e.consume(j),M):n(j)}function M(j){return j===45||$t(j)?(e.consume(j),M):L(j)}function L(j){return Se(j)?(u=L,I(j)):He(j)?(e.consume(j),L):z(j)}function G(j){return j===45||$t(j)?(e.consume(j),G):j===47||j===62||st(j)?Z(j):n(j)}function Z(j){return j===47?(e.consume(j),z):j===58||j===95||Zt(j)?(e.consume(j),H):Se(j)?(u=Z,I(j)):He(j)?(e.consume(j),Z):z(j)}function H(j){return j===45||j===46||j===58||j===95||$t(j)?(e.consume(j),H):$(j)}function $(j){return j===61?(e.consume(j),P):Se(j)?(u=$,I(j)):He(j)?(e.consume(j),$):Z(j)}function P(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),a=j,te):Se(j)?(u=P,I(j)):He(j)?(e.consume(j),P):(e.consume(j),D)}function te(j){return j===a?(e.consume(j),a=void 0,U):j===null?n(j):Se(j)?(u=te,I(j)):(e.consume(j),te)}function D(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||st(j)?Z(j):(e.consume(j),D)}function U(j){return j===47||j===62||st(j)?Z(j):n(j)}function z(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function I(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),F}function F(j){return He(j)?Fe(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):K(j)}function K(j){return e.enter("htmlTextData"),u(j)}}const Sg={name:"labelEnd",resolveAll:_D,resolveTo:kD,tokenize:ED},vD={tokenize:ND},wD={tokenize:CD},SD={tokenize:TD};function _D(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 kD(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 d={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={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",d,t],["enter",h,t]],f=Dn(f,e.slice(l+1,l+r+3)),f=Dn(f,[["enter",g,t]]),f=Dn(f,Uf(t.parser.constructs.insideSpan.null,e.slice(l+r+4,u-3),t)),f=Dn(f,[["exit",g,t],e[u-2],e[u-1],["exit",h,t]]),f=Dn(f,e.slice(u+1)),f=Dn(f,[["exit",d,t]]),_n(e,l,e.length,f),e}function ED(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"),d):n(x)}function d(x){return x===40?e.attempt(vD,g,u?g:m)(x):x===91?e.attempt(wD,g,u?h:m)(x):u?g(x):m(x)}function h(x){return e.attempt(SD,g,m)(x)}function g(x){return t(x)}function m(x){return l._balanced=!0,n(x)}}function ND(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):u2(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function u(m){return st(m)?rl(e,d)(m):g(m)}function f(m){return n(m)}function d(m){return m===34||m===39||m===40?f2(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(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 CD(e,t,n){const r=this;return a;function a(f){return c2.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 TD(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 AD={name:"labelStartImage",resolveAll:Sg.resolveAll,tokenize:MD};function MD(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 RD={name:"labelStartLink",resolveAll:Sg.resolveAll,tokenize:jD};function jD(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 Dp={name:"lineEnding",tokenize:zD};function zD(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Fe(e,t,"linePrefix")}}const $c={name:"thematicBreak",tokenize:OD};function OD(e,t,n){let r=0,a;return l;function l(h){return e.enter("thematicBreak"),u(h)}function u(h){return a=h,f(h)}function f(h){return h===a?(e.enter("thematicBreakSequence"),d(h)):r>=3&&(h===null||Se(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===a?(e.consume(h),r++,d):(e.exit("thematicBreakSequence"),He(h)?Fe(e,f,"whitespace")(h):f(h))}}const an={continuation:{tokenize:HD},exit:ID,name:"list",tokenize:BD},DD={partial:!0,tokenize:qD},LD={partial:!0,tokenize:UD};function BD(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(b){const w=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Cm(b)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check($c,n,h)(b):h(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(b)}return n(b)}function d(b){return Cm(b)&&++u<10?(e.consume(b),d):(!r.interrupt||u<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(jl,r.interrupt?n:g,e.attempt(DD,x,m))}function g(b){return r.containerState.initialBlankLine=!0,l++,x(b)}function m(b){return He(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):n(b)}function x(b){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function HD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(jl,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(LD,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 UD(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 ID(e){e.exit(this.containerState.type)}function qD(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 Tv={name:"setextUnderline",resolveTo:$D,tokenize:PD};function $D(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 PD(e,t,n){const r=this;let a;return l;function l(h){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=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===a?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),He(h)?Fe(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Se(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const VD={tokenize:FD};function FD(e){const t=this,n=e.attempt(jl,r,e.attempt(this.parser.constructs.flowInitial,a,Fe(e,e.attempt(this.parser.constructs.flow,a,e.attempt(QO,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 YD={resolveAll:h2()},XD=d2("string"),GD=d2("text");function d2(e){return{resolveAll:h2(e==="text"?ZD: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 h(g)?l(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),d}function d(g){return h(g)?(n.exit("data"),l(g)):(n.consume(g),d)}function h(g){if(g===null)return!0;const m=a[g];let x=-1;if(m)for(;++x<m.length;){const b=m[x];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function h2(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 ZD(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,d;for(;l--;){const h=a[l];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)d=!0,f++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||d||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={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const QD={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:s2},KD={91:tD},JD={[-2]:Op,[-1]:Op,32:Op},WD={35:oD,42:$c,45:[Tv,$c],60:fD,61:Tv,95:$c,96:Nv,126:Nv},e6={38:o2,92:a2},t6={[-5]:Dp,[-4]:Dp,[-3]:Dp,33:AD,38:o2,42:Tm,60:[RO,xD],91:RD,92:[sD,a2],93:Sg,95:Tm,96:VO},n6={null:[Tm,YD]},i6={null:[42,95]},r6={null:[]},s6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:i6,contentInitial:KD,disable:r6,document:QD,flow:WD,flowInitial:JD,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 d={attempt:L(B),check:L(M),consume:C,enter:_,exit:R,interrupt:L(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:m};let g=t.tokenize.call(h,d);return t.resolveAll&&l.push(t),h;function m($){return u=Dn(u,$),N(),u[u.length-1]!==null?[]:(G(t,0),h.events=Uf(l,h.events,h),h.events)}function x($,P){return l6(b($),P)}function b($){return o6(u,$)}function w(){const{_bufferIndex:$,_index:P,line:te,column:D,offset:U}=r;return{_bufferIndex:$,_index:P,line:te,column:D,offset:U}}function E($){a[$.line]=$.column,H()}function N(){let $;for(;r._index<u.length;){const P=u[r._index];if(typeof P=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<P.length;)k(P.charCodeAt(r._bufferIndex));else k(P)}}function k($){g=g($)}function C($){Se($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,H()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=$}function _($,P){const te=P||{};return te.type=$,te.start=w(),h.events.push(["enter",te,h]),f.push(te),te}function R($){const P=f.pop();return P.end=w(),h.events.push(["exit",P,h]),P}function B($,P){G($,P.from)}function M($,P){P.restore()}function L($,P){return te;function te(D,U,z){let I,F,K,j;return Array.isArray(D)?V(D):"tokenize"in D?V([D]):O(D);function O(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?z:A(fe[F])}function A(fe){return he;function he(ue){return j=Z(),K=fe,fe.partial||(h.currentConstruct=fe),fe.name&&h.parser.constructs.disable.null.includes(fe.name)?ce():fe.tokenize.call(P?Object.assign(Object.create(h),P):h,d,ie,ce)(ue)}}function ie(fe){return $(K,j),U}function ce(fe){return j.restore(),++F<I.length?A(I[F]):z}}}function G($,P){$.resolveAll&&!l.includes($)&&l.push($),$.resolve&&_n(h.events,P,h.events.length-P,$.resolve(h.events.slice(P),h)),$.resolveTo&&(h.events=$.resolveTo(h.events,h))}function Z(){const $=w(),P=h.previous,te=h.currentConstruct,D=h.events.length,U=Array.from(f);return{from:D,restore:z};function z(){r=$,h.previous=P,h.currentConstruct=te,h.events.length=D,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:i2([s6,...(e||{}).extensions||[]]),content:a(kO),defined:[],document:a(NO),flow:a(VD),lazy:{},string:a(XD),text:a(GD)};return r;function a(l){return u;function u(f){return a6(r,l,f)}}}function c6(e){for(;!l2(e););return e}const Av=/[\0\t\n\r]/g;function f6(){let e=1,t="",n=!0,r;return a;function a(l,u,f){const d=[];let h,g,m,x,b;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(Av.lastIndex=m,h=Av.exec(l),x=h&&h.index!==void 0?h.index:l.length,b=l.charCodeAt(x),!h){t=l.slice(m);break}if(b===10&&m===x&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<x&&(d.push(l.slice(m,x)),e+=x-m),b){case 0:{d.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,d.push(-2);e++<g;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=x+1}return f&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}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 r2(n.slice(l?2:1),l?16:10)}return wg(n)||e}const p2={}.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(De),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:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Qe),strong:l(mi),thematicBreak:l(Yi)},exit:{atxHeading:d(),atxHeadingSequence:B,autolink:d(),autolinkEmail:me,autolinkProtocol:ue,blockQuote:d(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:fe,characterReference:he,codeFenced:d(N),codeFencedFence:E,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:H,codeIndented:d(k),codeText:d(U),codeTextData:H,data:H,definition:d(),definitionDestinationString:R,definitionLabelString:C,definitionTitleString:_,emphasis:d(),hardBreakEscape:d(P),hardBreakTrailing:d(P),htmlFlow:d(te),htmlFlowData:H,htmlText:d(D),htmlTextData:H,image:d(I),label:K,labelText:F,lineEnding:$,link:d(z),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ie,resourceDestinationString:j,resourceTitleString:O,resource:V,setextHeading:d(G),setextHeadingLineSequence:L,setextHeadingText:M,strong:d(),thematicBreak:d()}};m2(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:h,buffer:u,resume:g,data:n},Oe=[];let Pe=-1;for(;++Pe<se.length;)if(se[Pe][1].type==="listOrdered"||se[Pe][1].type==="listUnordered")if(se[Pe][0]==="enter")Oe.push(Pe);else{const Ft=Oe.pop();Pe=a(se,Ft,Pe)}for(Pe=-1;++Pe<se.length;){const Ft=t[se[Pe][0]];p2.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]||Mv).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 Oe=pe-1,Pe=-1,Ft=!1,Hn,jt,mt,Ut;for(;++Oe<=_e;){const Je=se[Oe];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=Oe),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=Oe;for(jt=void 0;Jn--;){const cn=se[Jn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;jt&&(se[jt][1].type="lineEndingBlank",Ft=!0),cn[1].type="lineEnding",jt=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&&(!jt||mt<jt)&&(Hn._spread=!0),Hn.end=Object.assign({},jt?se[jt][1].start:Je[1].end),se.splice(jt||Oe,0,["exit",Hn,Je[2]]),Oe++,_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(Oe,0,["enter",Jn,Je[2]]),Oe++,_e++,mt=void 0,Ut=!0}}}return se[pe][1]._spread=Ft,_e}function l(se,pe){return _e;function _e(Oe){f.call(this,se(Oe),Oe),pe&&pe.call(this,Oe)}}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 d(se){return pe;function pe(_e){se&&se.call(this,_e),h.call(this,_e)}}function h(se,pe){const _e=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==se.type&&(pe?pe.call(this,se,Oe[0]):(Oe[1]||Mv).call(this,se,Oe[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 vg(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 b(){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 E(){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 k(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.value=se.replace(/(\r?\n|\r)$/g,"")}function C(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 R(){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 M(){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 Oe=_e[_e.length-1];(!Oe||Oe.type!=="text")&&(Oe=Ct(),Oe.position={start:Nr(se.start),end:void 0},_e.push(Oe)),this.stack.push(Oe)}function H(se){const pe=this.stack.pop();pe.value+=this.sliceSerialize(se),pe.position.end=Nr(se.end)}function $(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 D(){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 z(){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 Oe=se.children;_e.children=Oe}else _e.alt=pe}function j(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.url=se}function O(){const se=this.resume(),pe=this.stack[this.stack.length-1];pe.title=se}function V(){this.data.inReference=void 0}function A(){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 Oe;_e?(Oe=r2(pe,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=wg(pe);const Pe=this.stack[this.stack.length-1];Pe.value+=Oe}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 De(){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 m2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?m2(e,r):y6(e,r)}}function y6(e,t){let n;for(n in t)if(p2.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 Mv(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 d={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,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}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 g2(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 g2(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 g2(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 R6(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 j6(e,t,n){const r=e.all(t),a=n?z6(n):y2(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 d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
129
+ `});const h={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,h),e.applyData(t,h)}function z6(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=y2(n[r])}return t}function y2(e){const t=e.spread;return t??e.children.length>1}function O6(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 D6(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=gg(t.children[1]),d=Q_(t.children[t.children.length-1]);f&&d&&(u.position={start:f,end:d}),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 d=-1;const h=[];for(;++d<f;){const m=t.children[d],x={},b=u?u[d]:void 0;b&&(x.align=b);let w={type:"element",tagName:l,properties:x,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),h.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!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 Rv=9,jv=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(zv(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(zv(t.slice(a),a>0,!1)),l.join("")}function zv(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===Rv||l===jv;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===Rv||l===jv;)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:R6,listItem:j6,list:O6,paragraph:D6,root:L6,strong:B6,table:H6,tableCell:I6,tableRow:U6,text:$6,thematicBreak:P6,toml:Ac,yaml:Ac,definition:Ac,footnoteDefinition:Ac};function Ac(){}const x2=-1,If=0,sl=1,cf=2,_g=3,kg=4,Eg=5,Ng=6,b2=7,v2=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 If:case x2:return n(u,a);case sl:{const f=n([],a);for(const d of u)f.push(r(d));return f}case cf:{const f=n({},a);for(const[d,h]of u)f[r(d)]=r(h);return f}case _g:return n(new Date(u),a);case kg:{const{source:f,flags:d}=u;return n(new RegExp(f,d),a)}case Eg:{const f=n(new Map,a);for(const[d,h]of u)f.set(r(d),r(h));return f}case Ng:{const f=n(new Set,a);for(const d of u)f.add(r(d));return f}case b2:{const{name:f,message:d}=u;return n(new Ov[f](d),a)}case v2: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},Dv=e=>F6(new Map,e)(0),ra="",{toString:Y6}={},{keys:X6}=Object,Xo=e=>{const t=typeof e;if(t!=="object"||!e)return[If,t];const n=Y6.call(e).slice(8,-1);switch(n){case"Array":return[sl,ra];case"Object":return[cf,ra];case"Date":return[_g,ra];case"RegExp":return[kg,ra];case"Map":return[Eg,ra];case"Set":return[Ng,ra];case"DataView":return[sl,n]}return n.includes("Array")?[sl,n]:n.includes("Error")?[b2,n]:[cf,n]},Mc=([e,t])=>e===If&&(t==="function"||t==="symbol"),G6=(e,t,n,r)=>{const a=(u,f)=>{const d=r.push(u)-1;return n.set(f,d),d},l=u=>{if(n.has(u))return n.get(u);let[f,d]=Xo(u);switch(f){case If:{let g=u;switch(d){case"bigint":f=v2,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);g=null;break;case"undefined":return a([x2],u)}return a([f,g],u)}case sl:{if(d){let x=u;return d==="DataView"?x=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(u)),a([d,[...x]],u)}const g=[],m=a([f,g],u);for(const x of u)g.push(l(x));return m}case cf:{if(d)switch(d){case"BigInt":return a([d,u.toString()],u);case"Boolean":case"Number":case"String":return a([d,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||!Mc(Xo(u[x])))&&g.push([l(x),l(u[x])]);return m}case _g:return a([f,u.toISOString()],u);case kg:{const{source:g,flags:m}=u;return a([f,{source:g,flags:m}],u)}case Eg:{const g=[],m=a([f,g],u);for(const[x,b]of u)(e||!(Mc(Xo(x))||Mc(Xo(b))))&&g.push([l(x),l(b)]);return m}case Ng:{const g=[],m=a([f,g],u);for(const x of u)(e||!Mc(Xo(x)))&&g.push(l(x));return m}}const{message:h}=u;return a([f,{name:d,message:h}],u)};return l},Lv=(e,{json:t,lossy:n}={})=>{const r=[];return G6(!(t||n),!!t,new Map,r)(e),r},ff=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dv(Lv(e,t)):structuredClone(e):(e,t)=>Dv(Lv(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 d=-1;for(;++d<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[d]);if(!h)continue;const g=e.all(h),m=String(h.identifier).toUpperCase(),x=Aa(m.toLowerCase());let b=0;const w=[],E=e.footnoteCounts.get(m);for(;E!==void 0&&++b<=E;){w.length>0&&w.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,b);typeof C=="string"&&(C={type:"text",value:C}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const C=N.children[N.children.length-1];C&&C.type==="text"?C.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...w)}else g.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,k),f.push(k)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ff(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 qf=(function(e){if(e==null)return tL;if(typeof e=="function")return $f(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]=qf(e[n]);return $f(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 $f(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 $f(t);function t(n){return n&&n.type===e}}function $f(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 w2=[],iL=!0,Am=!1,rL="skip";function S2(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const l=qf(a),u=r?-1:1;f(e,void 0,[])();function f(d,h,g){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=w2,w,E,N;if((!t||l(d,h,g[g.length-1]||void 0))&&(b=sL(n(d,g)),b[0]===Am))return b;if("children"in d&&d.children){const k=d;if(k.children&&b[0]!==rL)for(E=(r?k.children.length:-1)+u,N=g.concat(k);E>-1&&E<k.children.length;){const C=k.children[E];if(w=f(C,E,N)(),w[0]===Am)return w;E=typeof w[1]=="number"?w[1]:E+u}}return b}}}function sL(e){return Array.isArray(e)?e:typeof e=="number"?[iL,e]:e==null?w2:[e]}function Cg(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),S2(e,l,f,a);function f(d,h){const g=h[h.length-1],m=g?g.children.indexOf(d):void 0;return u(d,m,g)}}const Mm={}.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:h,applyData:uL,definitionById:r,footnoteById:a,footnoteCounts:l,footnoteOrder:[],handlers:u,one:d,options:n,patch:lL,wrap:fL};return Cg(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 d(g,m){const x=g.type,b=f.handlers[x];if(Mm.call(f.handlers,x)&&b)return b(f,g,m);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in g){const{children:E,...N}=g,k=ff(N);return k.children=f.all(g),k}return ff(g)}return(f.options.unknownHandler||cL)(f,g,m)}function h(g){const m=[];if("children"in g){const x=g.children;let b=-1;for(;++b<x.length;){const w=f.one(x[b],g);if(w){if(b&&x[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Bv(w.value)),!Array.isArray(w)&&w.type==="element")){const E=w.children[0];E&&E.type==="text"&&(E.value=Bv(E.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function lL(e,t){e.position&&(t.position=Qz(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,ff(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&&!(Mm.call(n,"hProperties")||Mm.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 Bv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Hv(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=Hv(n,{file:r,...t});await e.run(a,r)}:function(n,r){return Hv(n,{file:r,...e||t})}}function Uv(e){if(e)throw e}var Lp,Iv;function hL(){if(Iv)return Lp;Iv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},u=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},f=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(r)return r(h,g).value}else return;return h[g]};return Lp=function d(){var h,g,m,x,b,w,E=arguments[0],N=1,k=arguments.length,C=!1;for(typeof E=="boolean"&&(C=E,E=arguments[1]||{},N=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});N<k;++N)if(h=arguments[N],h!=null)for(g in h)m=f(E,g),x=f(h,g),E!==x&&(C&&x&&(l(x)||(b=a(x)))?(b?(b=!1,w=m&&a(m)?m:[]):w=m&&l(m)?m:{},u(E,{name:g,newValue:d(C,w,x)})):typeof x<"u"&&u(E,{name:g,newValue:x}));return E},Lp}var pL=hL();const Bp=hf(pL);function Rm(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(d,...h){const g=e[++l];let m=-1;if(d){u(d);return}for(;++m<a.length;)(h[m]===null||h[m]===void 0)&&(h[m]=a[m]);a=h,g?gL(g,f)(...h):u(null,...h)}}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 d;f&&u.push(a);try{d=e.apply(this,u)}catch(h){const g=h;if(f&&n)throw g;return a(g)}f||(d&&d.then&&typeof d.then=="function"?d.then(l,a):d instanceof Error?a(d):l(d))}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');zl(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(zl(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){zl(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;)zl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":wL(n)}function wL(e){zl(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,d;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(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),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 zl(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 jm(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(!jm(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 Hp=["history","path","basename","stem","extname","dirname"];class _2{constructor(t){let n;t?jm(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<Hp.length;){const l=Hp[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)Hp.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?ri.basename(this.path):void 0}set basename(t){Ip(t,"basename"),Up(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){qv(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(Up(t,"extname"),qv(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){jm(t)&&(t=EL(t)),Ip(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){Ip(t,"stem"),Up(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 Up(e,t){if(e&&e.includes(ri.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ri.sep+"`")}function Ip(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qv(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 Tg 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 Tg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Bp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Pp("data",this.frozen),this.namespace[t]=n,this):AL.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Pp("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 qp("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),qp("process",this.parser||this.Parser),$p("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(l,u){const f=Rc(t),d=r.parse(f);r.run(d,f,function(g,m,x){if(g||!m||!x)return h(g);const b=m,w=r.stringify(b,x);jL(w)?x.value=w:x.result=w,h(g,x)});function h(g,m){g||!m?u(g):l?l(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),qp("processSync",this.parser||this.Parser),$p("processSync",this.compiler||this.Compiler),this.process(t,a),Pv("processSync","process",n),r;function a(l,u){n=!0,Uv(l),r=u}}run(t,n,r){$v(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 d=Rc(n);a.run(t,d,h);function h(g,m,x){const b=m||t;g?f(g):u?u(b):r(void 0,b,x)}}}runSync(t,n){let r=!1,a;return this.run(t,n,l),Pv("runSync","run",r),a;function l(u,f){Uv(u),a=f,r=!0}}stringify(t,n){this.freeze();const r=Rc(n),a=this.compiler||this.Compiler;return $p("stringify",a),$v(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Pp("use",this.frozen),t!=null)if(typeof t=="function")d(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(h){if(typeof h=="function")d(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;d(g,m)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(a.settings=Bp(!0,a.settings,h.settings))}function f(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];l(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function d(h,g){let m=-1,x=-1;for(;++m<r.length;)if(r[m][0]===h){x=m;break}if(x===-1)r.push([h,...g]);else if(g.length>0){let[b,...w]=g;const E=r[x][1];Rm(E)&&Rm(b)&&(b=Bp(!0,E,b)),r[x]=[h,b,...w]}}}}const ML=new Tg().freeze();function qp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $p(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Pp(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 $v(e){if(!Rm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Pv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rc(e){return RL(e)?e:new _2(e)}function RL(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function jL(e){return typeof e=="string"||zL(e)}function zL(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vv=[],Fv={allowDangerousHtml:!0},DL=/^(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 Yv(e){const t=BL(e),n=HL(e);return UL(t.runSync(t.parse(n),n),e)}function BL(e){const t=e.rehypePlugins||Vv,n=e.remarkPlugins||Vv,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Fv}:Fv;return ML().use(x6).use(n).use(dL,r).use(t)}function HL(e){const t=e.children||"",n=new _2;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,d=t.urlTransform||IL;for(const g of LL)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+OL+g.id,void 0);return Cg(e,h),tO(e,{Fragment:v.Fragment,components:a,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function h(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 b;for(b in zp)if(Object.hasOwn(zp,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],E=zp[b];(E===null||E.includes(g.tagName))&&(g.properties[b]=d(String(w||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(g,m,x)),b&&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||DL.test(e.slice(0,t))?e:""}function Xv(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=qf((n||{}).ignore||[]),l=PL(t);let u=-1;for(;++u<l.length;)S2(e,"text",f);function f(h,g){let m=-1,x;for(;++m<g.length;){const b=g[m],w=x?x.children:void 0;if(a(b,w?w.indexOf(b):void 0,x))return;x=b}if(x)return d(h,g)}function d(h,g){const m=g[g.length-1],x=l[u][0],b=l[u][1];let w=0;const N=m.children.indexOf(h);let k=!1,C=[];x.lastIndex=0;let _=x.exec(h.value);for(;_;){const R=_.index,B={index:_.index,input:_.input,stack:[...g,h]};let M=b(..._,B);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?x.lastIndex=R+1:(w!==R&&C.push({type:"text",value:h.value.slice(w,R)}),Array.isArray(M)?C.push(...M):M&&C.push(M),w=R+_[0].length,k=!0),!x.global)break;_=x.exec(h.value)}return k?(w<h.value.length&&C.push({type:"text",value:h.value.slice(w)}),m.children.splice(N,1,...C)):C=[h],N+C.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 Vp="phrasing",Fp=["autolink","link","image","label"];function YL(){return{transforms:[WL],enter:{literalAutolink:GL,literalAutolinkEmail:Yp,literalAutolinkHttp:Yp,literalAutolinkWww:Yp},exit:{literalAutolink:JL,literalAutolinkEmail:KL,literalAutolinkHttp:ZL,literalAutolinkWww:QL}}}function XL(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Vp,notInConstruct:Fp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Vp,notInConstruct:Fp},{character:":",before:"[ps]",after:"\\/",inConstruct:Vp,notInConstruct:Fp}]}}function GL(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yp(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(!k2(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!k2(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=Xv(e,"(");let l=Xv(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 k2(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||fs(n)||Hf(n))&&(!t||n!==47)}E2.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 E2(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:E2},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const f=l.createTracker(u);let d=f.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return d+=f.move(l.safe(l.associationId(r),{before:d,after:"]"})),g(),d+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),d+=f.move((t?`
136
+ `:" ")+l.indentLines(l.containerFlow(r,f.current()),t?N2:mB))),h(),d}}function mB(e,t,n){return t===0?e:N2(e,t,n)}function N2(e,t,n){return(n?"":" ")+e}const gB=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];C2.peek=wB;function yB(){return{canContainEols:["delete"],enter:{strikethrough:bB},exit:{strikethrough:vB}}}function xB(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gB}],handlers:{delete:C2}}}function bB(e){this.enter({type:"delete",children:[]},e)}function vB(e){this.exit(e)}function C2(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=[],d=[];let h=0,g=-1;for(;++g<e.length;){const E=[],N=[];let k=-1;for(e[g].length>h&&(h=e[g].length);++k<e[g].length;){const C=kB(e[g][k]);if(n.alignDelimiters!==!1){const _=a(C);N[k]=_,(d[k]===void 0||_>d[k])&&(d[k]=_)}E.push(C)}u[g]=E,f[g]=N}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)l[m]=Gv(r[m]);else{const E=Gv(r);for(;++m<h;)l[m]=E}m=-1;const x=[],b=[];for(;++m<h;){const E=l[m];let N="",k="";E===99?(N=":",k=":"):E===108?N=":":E===114&&(k=":");let C=n.alignDelimiters===!1?1:Math.max(1,d[m]-N.length-k.length);const _=N+"-".repeat(C)+k;n.alignDelimiters!==!1&&(C=N.length+C+k.length,C>d[m]&&(d[m]=C),b[m]=C),x[m]=_}u.splice(1,0,x),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const E=u[g],N=f[g];m=-1;const k=[];for(;++m<h;){const C=E[m]||"";let _="",R="";if(n.alignDelimiters!==!1){const B=d[m]-(N[m]||0),M=l[m];M===114?_=" ".repeat(B):M===99?B%2?(_=" ".repeat(B/2+.5),R=" ".repeat(B/2-.5)):(_=" ".repeat(B/2),R=_):R=" ".repeat(B)}n.delimiterStart!==!1&&!m&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||m)&&k.push(" "),n.alignDelimiters!==!1&&k.push(_),k.push(C),n.alignDelimiters!==!1&&k.push(R),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&k.push("|")}w.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
137
+ `)}function kB(e){return e==null?"":String(e)}function Gv(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 Zv(e,t.inConstruct,!0)&&!Zv(e,t.notInConstruct,!1)}function Zv(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 Qv(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 RB(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,jB);return m(),x}const f=n.createTracker(r),d=a.repeat(Math.max(TB(l,a)+1,3)),h=n.enter("codeFenced");let g=f.move(d);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(d),h(),g}function jB(e,t,n){return(n?"":" ")+e}function Ag(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 zB(e,t,n,r){const a=Ag(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const d=n.createTracker(r);let h=d.move("[");return h+=d.move(n.safe(n.associationId(e),{before:h,after:"]",...d.current()})),h+=d.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(f=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":`
143
+ `,...d.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=d.move(" "+a),h+=d.move(n.safe(e.title,{before:h,after:a,...d.current()})),h+=d.move(a),f()),u(),h}function OB(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 bl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(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}}T2.peek=DB;function T2(e,t,n,r){const a=OB(n),l=n.enter("emphasis"),u=n.createTracker(r),f=u.move(a);let d=u.move(n.containerPhrasing(e,{after:a,before:f,...u.current()}));const h=d.charCodeAt(0),g=df(r.before.charCodeAt(r.before.length-1),h,a);g.inside&&(d=bl(h)+d.slice(1));const m=d.charCodeAt(d.length-1),x=df(r.after.charCodeAt(0),m,a);x.inside&&(d=d.slice(0,-1)+bl(m));const b=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+d+b}function DB(e,t,n){return n.options.emphasis||"*"}function LB(e,t){let n=!1;return Cg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Am}),!!((!e.depth||e.depth<3)&&vg(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"),d=n.enter("phrasing");l.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
148
+ `,...l.current()});return/^[\t ]/.test(h)&&(h=bl(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),d(),f(),h}A2.peek=HB;function A2(e){return e.value||""}function HB(){return"<"}M2.peek=UB;function M2(e,t,n,r){const a=Ag(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const d=n.createTracker(r);let h=d.move("![");return h+=d.move(n.safe(e.alt,{before:h,after:"]",...d.current()})),h+=d.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(n.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(f=n.enter("destinationRaw"),h+=d.move(n.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=d.move(" "+a),h+=d.move(n.safe(e.title,{before:h,after:a,...d.current()})),h+=d.move(a),f()),h+=d.move(")"),u(),h}function UB(){return"!"}R2.peek=IB;function R2(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");const h=n.safe(e.alt,{before:d,after:"]",...f.current()});d+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...f.current()});return u(),n.stack=g,l(),a==="full"||!h||h!==m?d+=f.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function IB(){return"!"}j2.peek=qB;function j2(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 d;if(u.atBreak)for(;d=f.exec(r);){let h=d.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(d.index+1)}}return a+r+a}function qB(){return"`"}function z2(e,t){const n=vg(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))}O2.peek=$B;function O2(e,t,n,r){const a=Ag(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let f,d;if(z2(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"),d=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(d=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),d(),e.title&&(d=n.enter(`title${l}`),h+=u.move(" "+a),h+=u.move(n.safe(e.title,{before:h,after:a,...u.current()})),h+=u.move(a),d()),h+=u.move(")"),f(),h}function $B(e,t,n){return z2(e,n)?"<":"["}D2.peek=PB;function D2(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");const h=n.containerPhrasing(e,{before:d,after:"]",...f.current()});d+=f.move(h+"]["),u();const g=n.stack;n.stack=[],u=n.enter("reference");const m=n.safe(n.associationId(e),{before:d,after:"]",...f.current()});return u(),n.stack=g,l(),a==="full"||!h||h!==m?d+=f.move(m+"]"):a==="shortcut"?d=d.slice(0,-1):d+=f.move("]"),d}function PB(){return"["}function Mg(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=Mg(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 L2(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):Mg(n);const f=e.ordered?u==="."?")":".":VB(n);let d=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&&(d=!0),L2(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"){d=!0;break}}}}d&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=l,a(),h}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||Mg(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 d=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),g);return d(),h;function g(m,x,b){return x?(b?"":" ".repeat(u))+m:(b?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=qf(["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}B2.peek=WB;function B2(e,t,n,r){const a=JB(n),l=n.enter("strong"),u=n.createTracker(r),f=u.move(a+a);let d=u.move(n.containerPhrasing(e,{after:a,before:f,...u.current()}));const h=d.charCodeAt(0),g=df(r.before.charCodeAt(r.before.length-1),h,a);g.inside&&(d=bl(h)+d.slice(1));const m=d.charCodeAt(d.length-1),x=df(r.after.charCodeAt(0),m,a);x.inside&&(d=d.slice(0,-1)+bl(m));const b=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},f+d+b}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=(L2(n)+(n.options.ruleSpaces?" ":"")).repeat(t8(n));return n.options.ruleSpaces?r.slice(0,-1):r}const H2={blockquote:EB,break:Qv,code:RB,definition:zB,emphasis:T2,hardBreak:Qv,heading:BB,html:A2,image:M2,imageReference:R2,inlineCode:j2,link:O2,linkReference:D2,list:YB,listItem:GB,paragraph:ZB,root:KB,strong:B2,text:e8,thematicBreak:n8};function i8(){return{enter:{table:r8,tableData:Kv,tableHeader:Kv,tableRow:a8},exit:{codeText:o8,table:s8,tableData:Xp,tableHeader:Xp,tableRow:Xp}}}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 Xp(e){this.exit(e)}function Kv(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:d,tableRow:f}};function u(b,w,E,N){return h(g(b,E,N),b.align)}function f(b,w,E,N){const k=m(b,E,N),C=h([k]);return C.slice(0,C.indexOf(`
150
+ `))}function d(b,w,E,N){const k=E.enter("tableCell"),C=E.enter("phrasing"),_=E.containerPhrasing(b,{...N,before:l,after:l});return C(),k(),_}function h(b,w){return _B(b,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function g(b,w,E){const N=b.children;let k=-1;const C=[],_=w.enter("table");for(;++k<N.length;)C[k]=m(N[k],w,E);return _(),C}function m(b,w,E){const N=b.children;let k=-1;const C=[],_=w.enter("tableRow");for(;++k<N.length;)C[k]=d(N[k],b,w,E);return _(),C}function x(b,w,E){let N=H2.inlineCode(b,w,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function c8(){return{exit:{taskListCheckValueChecked:Jv,taskListCheckValueUnchecked:Jv,paragraph:d8}}}function f8(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:h8}}}function Jv(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 d=H2.listItem(e,t,n,{...r,...f.current()});return l&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),d;function h(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},U2={tokenize:_8,partial:!0},I2={tokenize:k8,partial:!0},q2={tokenize:E8,partial:!0},y8={tokenize:N8,partial:!0},$2={name:"wwwAutolink",tokenize:v8,previous:V2},P2={name:"protocolAutolink",tokenize:w8,previous:F2},Fi={name:"emailAutolink",tokenize:b8,previous:Y2},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,P2];hi[104]=[Fi,P2];hi[87]=[Fi,$2];hi[119]=[Fi,$2];function b8(e,t,n){const r=this;let a,l;return u;function u(m){return!zm(m)||!Y2.call(r,r.previous)||Rg(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(m))}function f(m){return zm(m)?(e.consume(m),f):m===64?(e.consume(m),d):n(m)}function d(m){return m===46?e.check(y8,g,h)(m):m===45||m===95||$t(m)?(l=!0,e.consume(m),d):g(m)}function h(m){return e.consume(m),a=!0,d}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||!V2.call(r,r.previous)||Rg(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(g8,e.attempt(U2,e.attempt(I2,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)&&F2.call(r,r.previous)&&!Rg(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),d}return n(m)}function d(m){return m===47?(e.consume(m),l?h:(l=!0,d)):n(m)}function h(m){return m===null||uf(m)||st(m)||fs(m)||Hf(m)?n(m):e.attempt(U2,e.attempt(I2,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(h){return h===46||h===95?e.check(q2,d,f)(h):h===null||st(h)||fs(h)||h!==45&&Hf(h)?d(h):(l=!0,e.consume(h),u)}function f(h){return h===95?r=!0:(a=r,r=void 0),e.consume(h),u}function d(h){return a||r||!l?n(h):t(h)}}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(q2,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 V2(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||st(e)}function F2(e){return!Zt(e)}function Y2(e){return!(e===47||zm(e))}function zm(e){return e===43||e===45||e===46||e===95||$t(e)}function Rg(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:D8,partial:!0};function T8(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:j8,continuation:{tokenize:z8},exit:O8}},text:{91:{name:"gfmFootnoteCall",tokenize:R8},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 d=r.events[a][1];if(d.type==="labelImage"){u=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return f;function f(d){if(!u||!u._balanced)return n(d);const h=Zn(r.sliceSerialize({start:u.end,end:r.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}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 R8(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"),d}function d(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(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:h}function g(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function j8(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,f;return d;function d(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(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 E=e.exit("gfmFootnoteDefinitionLabelString");return l=Zn(r.sliceSerialize(E)),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,b,"gfmFootnoteDefinitionWhitespace")):n(w)}function b(w){return t(w)}}function z8(e,t,n){return e.check(jl,t,e.attempt(C8,t,n))}function O8(e){e.exit("gfmFootnoteDefinition")}function D8(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 d=-1;for(;++d<u.length;)if(u[d][0]==="enter"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._close){let h=d;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[d][1].end.offset-u[d][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[d][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[d][1].end)},m={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[d][1].start)},x=[["enter",g,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",m,f]],b=f.parser.constructs.insideSpan.null;b&&_n(x,x.length,0,Uf(b,u.slice(h+1,d),f)),_n(x,x.length,0,[["exit",m,f],["enter",u[d][1],f],["exit",u[d][1],f],["exit",g,f]]),_n(u,h-1,d-h+3,x),d=h+x.length-2;break}}for(d=-1;++d<u.length;)u[d][1].type==="strikethroughSequenceTemporary"&&(u[d][1].type="data");return u}function l(u,f,d){const h=this.previous,g=this.events;let m=0;return x;function x(w){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const E=_a(h);if(w===126)return m>1?d(w):(u.consume(w),m++,b);if(m<2&&!n)return d(w);const N=u.exit("strikethroughSequenceTemporary"),k=_a(w);return N._open=!k||k===2&&!!E,N._close=!E||E===2&&!!k,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 $=r.events.length-1;for(;$>-1;){const D=r.events[$][1].type;if(D==="lineEnding"||D==="linePrefix")$--;else break}const P=$>-1?r.events[$][1].type:null,te=P==="tableHead"||P==="tableRow"?M:d;return te===M&&r.parser.lazy[r.now().line]?n(H):te(H)}function d(H){return e.enter("tableHead"),e.enter("tableRow"),h(H)}function h(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"),b):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 b(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"),E):B(H)}function E(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"),k):H===45?(l+=1,k(H)):H===null||Se(H)?R(H):B(H)}function k(H){return H===45?(e.enter("tableDelimiterFiller"),C(H)):B(H)}function C(H){return H===45?(e.consume(H),C):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,R,"whitespace")(H):R(H)}function R(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 M(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,d=0,h,g,m;const x=new B8;for(;++n<e.length;){const b=e[n],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,d!==0&&(Wv(x,t,d,h,g),g=void 0,d=0),h={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",h,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=jc(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=jc(x,t,l,a,void 0,m)),l=u,u=[l[1],n,0,0])):w.type==="tableHead"?(f=!0,d=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(d=n,l[1]!==0?(u[0]=u[1],m=jc(x,t,l,a,n,m)):u[1]!==0&&(m=jc(x,t,u,a,n,m)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=n)}for(d!==0&&Wv(x,t,d,h,g),x.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=U8(t.events,n))}return e}function jc(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 d=oa(t.events,n[1]);if(l={type:u,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=oa(t.events,n[2]),g=oa(t.events,n[3]),m={type:f,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const x=t.events[n[2]],b=t.events[n[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,E=n[3]-n[2]-1;e.add(w,E,[])}}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 Wv(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(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),l)}function l(d){return st(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),u):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),u):n(d)}function u(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(d)}function f(d){return Se(d)?t(d):He(d)?e.check({tokenize:Y8},t,n)(d):n(d)}}function Y8(e,t,n){return Fe(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function X8(e){return i2([x8(),T8(),L8(e),I8(),V8()])}const G8={};function ew(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(t_),{execute:d,savedOutputDir:h}=B_(),[g,m]=X.useState("");X.useEffect(()=>{if(f?.type==="input"){const C=f.data;m(C.value||"")}},[l,f]);const x=a.filter(C=>C.type==="output"),b=x.length>0?t.get(x[0].id):null,w=f?.type==="input",E=w?f.data:null,N=C=>{m(C),l&&u(l,{value:C})},k=()=>{d()};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(KS,{className:"w-5 h-5 text-gray-400"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Preview"})]}),e&&v.jsx("span",{className:"text-sm text-blue-400 animate-pulse",children:"Running..."})]}),e&&v.jsx("div",{className:"p-4 border-b border-border",children:v.jsx("div",{className:"space-y-3",children:a.map(C=>v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:`w-2 h-2 rounded-full ${C.data.status==="completed"?"bg-green-500":C.data.status==="running"?"bg-blue-500 animate-pulse":C.data.status==="error"?"bg-red-500":"bg-gray-500"}`}),v.jsx("span",{className:"text-sm text-gray-300",children:C.data.label}),C.data.status==="running"&&C.data.progress!==void 0&&v.jsxs("span",{className:"text-xs text-gray-500",children:[C.data.progress,"%"]})]},C.id))})}),v.jsxs("div",{className:"p-4 border-b border-border",children:[v.jsxs("button",{onClick:k,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:[v.jsx(gl,{className:"w-4 h-4"}),e?"Running...":"Run Workflow"]}),a.length===0&&v.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:"노드를 추가해주세요"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[w&&E&&v.jsxs("div",{className:"space-y-4 mb-4 p-4 bg-surface rounded-lg border border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Tf,{className:"w-5 h-5 text-amber-500"}),v.jsx("h4",{className:"text-md font-medium text-white",children:E.label})]}),E.inputType==="text"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Enter your input"}),v.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:E.placeholder||"Type your message here...",value:g||E.value||"",onChange:C=>N(C.target.value)})]}),E.inputType==="file"&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Upload a file"}),v.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:[v.jsx(DR,{className:"w-8 h-8 text-gray-500 mb-2"}),v.jsx("p",{className:"text-sm text-gray-400",children:"Drop files here or click to upload"}),E.fileTypes&&v.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Supported: ",E.fileTypes.join(", ")]})]})]}),E.inputType==="select"&&E.options&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"text-sm text-gray-400",children:E.description||"Select an option"}),v.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||E.value||"",onChange:C=>N(C.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),E.options.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),h&&v.jsxs("div",{className:"mb-4 p-4 bg-green-900/20 border border-green-700 rounded-lg",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[v.jsx(pm,{className:"w-5 h-5 text-green-400"}),v.jsx("h4",{className:"text-sm font-medium text-green-300",children:"파일 저장 완료"})]}),v.jsx("p",{className:"text-xs text-gray-400 break-all",children:h})]}),n.length>0?v.jsx("div",{className:"space-y-4",children:n.map(C=>v.jsxs("div",{className:`p-4 rounded-lg border ${C.success?"bg-surface border-border":"bg-red-900/20 border-red-700"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[C.success?v.jsx(Cf,{className:"w-5 h-5 text-green-500"}):v.jsx(sg,{className:"w-5 h-5 text-red-500"}),v.jsx("h5",{className:"text-sm font-medium text-white",children:C.label})]}),C.error&&v.jsx("p",{className:"text-sm text-red-400 mb-3",children:C.error}),C.files&&C.files.length>0&&v.jsxs("div",{className:"space-y-2 mb-3",children:[v.jsx("p",{className:"text-xs text-gray-400",children:"생성된 파일:"}),C.files.map((_,R)=>v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded",children:[_.type==="image"?v.jsx(JS,{className:"w-4 h-4 text-purple-400"}):v.jsx(ml,{className:"w-4 h-4 text-blue-400"}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("p",{className:"text-sm text-white truncate",children:_.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:_.path})]})]},R))]}),C.result&&v.jsxs("details",{className:"group",open:!0,children:[v.jsx("summary",{className:"text-xs text-gray-400 cursor-pointer hover:text-gray-300",children:"결과 보기"}),v.jsx("div",{className:"mt-2 p-2 bg-black/30 rounded max-h-64 overflow-y-auto",children:v.jsx("div",{className:"markdown-content text-sm",children:v.jsx(Yv,{remarkPlugins:[ew],children:C.result.length>2e3?C.result.substring(0,2e3)+"...":C.result})})})]})]},C.nodeId))}):b?v.jsx("div",{className:"markdown-content",children:v.jsx(Yv,{remarkPlugins:[ew],children:typeof b=="string"?b:JSON.stringify(b,null,2)})}):r.length>0?v.jsxs("div",{className:"space-y-2",children:[v.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"실행 로그"}),r.slice(-20).map(C=>v.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[v.jsx("span",{className:"text-gray-500 shrink-0",children:new Date(C.timestamp).toLocaleTimeString("ko-KR")}),v.jsx("span",{className:C.level==="error"?"text-red-400":C.level==="warning"?"text-yellow-400":C.level==="success"?"text-green-400":"text-gray-300",children:C.message})]},C.id))]}):v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500",children:[v.jsx(ml,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-sm",children:"Run the workflow to see results"}),v.jsx("p",{className:"text-xs mt-2",children:"노드를 연결하고 Run Workflow 버튼을 클릭하세요"})]})]})]})}function X2({level:e}){switch(e){case"success":return v.jsx(Cf,{className:"w-4 h-4 text-green-400"});case"error":return v.jsx(sg,{className:"w-4 h-4 text-red-400"});case"warning":return v.jsx(zR,{className:"w-4 h-4 text-yellow-400"});default:return v.jsx(aR,{className:"w-4 h-4 text-blue-400"})}}function G2(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,d]=X.useState(250),h=X.useRef(null);X.useEffect(()=>{h.current&&!l&&h.current.scrollIntoView({behavior:"smooth"})},[n,l]);const g=m=>{m.preventDefault();const x=m.clientY,b=f,w=N=>{const k=x-N.clientY,C=Math.min(Math.max(b+k,100),500);d(C)},E=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",E)};return e?v.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&&v.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 cursor-ns-resize hover:bg-amber-500 transition-colors",onMouseDown:g}),v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#252525] border-b border-gray-700",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ds,{className:"w-4 h-4 text-amber-500"}),v.jsx("span",{className:"text-sm font-medium text-white",children:"Console"}),a&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",n.length," logs)"]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:r,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Clear logs",children:v.jsx(Af,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>u(!l),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:l?"Expand":"Minimize",children:l?v.jsx($5,{className:"w-4 h-4 text-gray-400"}):v.jsx(QS,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:()=>d(f===250?400:250),className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Toggle size",children:f>250?v.jsx(gR,{className:"w-4 h-4 text-gray-400"}):v.jsx(hR,{className:"w-4 h-4 text-gray-400"})}),v.jsx("button",{onClick:t,className:"p-1.5 hover:bg-gray-700 rounded transition-colors",title:"Close",children:v.jsx(ag,{className:"w-4 h-4 text-gray-400"})})]})]}),!l&&v.jsx("div",{className:"overflow-y-auto font-mono text-sm p-3",style:{height:f-44},children:n.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[n.map(m=>v.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:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",G2(m.timestamp),"]"]}),v.jsx(X2,{level:m.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.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&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",m.nodeId.slice(0,8),"]"]}),m.details&&v.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)),v.jsx("div",{ref:h})]})})]}):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]),v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ds,{className:"w-5 h-5 text-amber-500"}),v.jsx("h3",{className:"text-lg font-semibold text-white",children:"Console"}),n&&v.jsxs("span",{className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-blue-500/20 text-blue-400 rounded",children:[v.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full animate-pulse"}),"Running"]}),v.jsxs("span",{className:"text-xs text-gray-500",children:["(",e.length," logs)"]})]}),v.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:v.jsx(Af,{className:"w-4 h-4"})})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4 font-mono text-sm",children:e.length===0?v.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:v.jsx("p",{children:"No logs yet. Run the workflow to see output."})}):v.jsxs("div",{className:"space-y-1",children:[e.map(a=>v.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:[v.jsxs("span",{className:"text-gray-600 shrink-0 text-xs",children:["[",G2(a.timestamp),"]"]}),v.jsx(X2,{level:a.level}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.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&&v.jsxs("span",{className:"ml-2 text-purple-400 text-xs",children:["[",a.nodeId.slice(0,8),"]"]}),a.details&&v.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)),v.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 v.jsx(Tf,{className:"w-5 h-5 text-yellow-400"});case"subagent":return v.jsx(Cl,{className:"w-5 h-5 text-purple-400"});case"skill":return v.jsx(Mf,{className:"w-5 h-5 text-cyan-400"});case"command":return v.jsx(ds,{className:"w-5 h-5 text-orange-400"});case"hook":return v.jsx(rg,{className:"w-5 h-5 text-pink-400"});case"output":return v.jsx(Nf,{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}=ci(),r=X.useRef(null),a=X.useCallback(d=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{q_(d).catch(h=>{console.error("Failed to sync node to filesystem:",h)})},500)},[]);if(X.useEffect(()=>(e&&e.type!=="input"&&e.type!=="output"&&a(e),()=>{r.current&&clearTimeout(r.current)}),[e,a]),!e)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 p-8",children:[v.jsx(CR,{className:"w-12 h-12 mb-4 opacity-50"}),v.jsx("p",{className:"text-center",children:"Select a node to configure its settings"})]});const l=()=>{$_(e).catch(d=>{console.error("Failed to delete node from filesystem:",d)}),n(e.id)},u=d=>{t(e.id,{label:d})},f=d=>{t(e.id,{description:d})};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border bg-surface-hover/50",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-lg bg-surface",children:t9(e.type)}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-base font-semibold text-white",children:e.data.label}),v.jsx("p",{className:"text-xs text-gray-500",children:n9(e.type)})]})]}),v.jsx("button",{onClick:l,className:"p-2 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",title:"Delete node",children:v.jsx(Af,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-5",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Name"}),v.jsx("input",{type:"text",value:e.data.label,onChange:d=>u(d.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"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:e.type==="subagent"?"Prompt":"Description"}),v.jsx("textarea",{value:e.data.description||"",onChange:d=>f(d.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"&&v.jsx(r9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="subagent"&&v.jsx(s9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="skill"&&v.jsx(a9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="command"&&v.jsx(o9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="hook"&&v.jsx(l9,{data:e.data,onUpdate:d=>t(e.id,d)}),e.type==="output"&&v.jsx(u9,{onUpdate:d=>t(e.id,d)})]})]})}function r9({data:e,onUpdate:t}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Input Type"}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:["text","file","select"].map(n=>v.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))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Default Value"}),v.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 v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Model"}),v.jsx("div",{className:"space-y-2",children:e9.map(n=>v.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:[v.jsx(Cl,{className:"w-5 h-5 text-purple-400"}),v.jsxs("div",{className:"text-left",children:[v.jsx("div",{className:"font-medium text-white",children:n.name}),v.jsx("div",{className:"text-xs text-gray-500",children:n.description})]})]},n.id))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Allowed Tools"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:J8.map(n=>v.jsxs("label",{className:"flex items-center gap-2 p-2 bg-surface-hover rounded-lg cursor-pointer hover:bg-border transition-colors",children:[v.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"}),v.jsx("span",{className:"text-sm text-gray-300",children:n})]},n))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"System Prompt"}),v.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),[d,h]=X.useState(""),[g,m]=X.useState(!1),[x,b]=X.useState(null);X.useEffect(()=>{e.skillType==="generated"&&e.skillPath&&(l(!0),fetch(`/api/skill/files?path=${encodeURIComponent(e.skillPath)}`).then(E=>E.json()).then(E=>{r(E.files||[]),E.files?.length>0&&f(E.files[0].name)}).catch(E=>{console.error("Failed to load skill files:",E)}).finally(()=>l(!1)))},[e.skillPath,e.skillType]);const w=async()=>{if(e.skillPath){m(!0),b(null);try{const E=d.trim()?d.trim().split(/\s+/):[],k=await(await fetch("/api/skill/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillPath:e.skillPath,args:E})})).json();b(k)}catch(E){b({success:!1,error:E instanceof Error?E.message:"Unknown error"})}finally{m(!1)}}};return e.skillType==="generated"&&e.skillPath?v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Path"}),v.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})]}),v.jsxs("div",{children:[v.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[v.jsx(W5,{className:"w-4 h-4 inline mr-1"}),"Files Preview"]}),a?v.jsxs("div",{className:"flex items-center justify-center py-8 text-gray-500",children:[v.jsx(sf,{className:"w-5 h-5 animate-spin mr-2"}),"파일 로딩 중..."]}):n.length===0?v.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"파일을 찾을 수 없습니다"}):v.jsx("div",{className:"space-y-2",children:n.map(E=>v.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[v.jsxs("button",{onClick:()=>f(u===E.name?null:E.name),className:"w-full flex items-center justify-between px-3 py-2 bg-surface-hover hover:bg-border transition-colors",children:[v.jsx("span",{className:"text-sm text-white font-medium",children:E.name}),u===E.name?v.jsx(QS,{className:"w-4 h-4 text-gray-400"}):v.jsx(I5,{className:"w-4 h-4 text-gray-400"})]}),u===E.name&&v.jsx("pre",{className:"p-3 bg-[#0d1117] text-xs text-gray-300 overflow-x-auto max-h-64 overflow-y-auto font-mono",children:E.content})]},E.name))})]}),v.jsxs("div",{children:[v.jsxs("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:[v.jsx(gl,{className:"w-4 h-4 inline mr-1"}),"Test Skill"]}),v.jsxs("div",{className:"space-y-3",children:[v.jsx("div",{children:v.jsx("input",{type:"text",value:d,onChange:E=>h(E.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"})}),v.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?v.jsxs(v.Fragment,{children:[v.jsx(sf,{className:"w-4 h-4 animate-spin"}),"실행 중..."]}):v.jsxs(v.Fragment,{children:[v.jsx(gl,{className:"w-4 h-4"}),"테스트 실행"]})}),x&&v.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:[v.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[x.success?v.jsx(Cf,{className:"w-4 h-4 text-green-400"}):v.jsx(sg,{className:"w-4 h-4 text-red-400"}),v.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&&v.jsxs("div",{className:"mb-2",children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Output:"}),v.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&&v.jsxs("div",{children:[v.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Error:"}),v.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&&v.jsx("div",{className:"text-sm text-red-400",children:x.error})]})]})]})]}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Skill Type"}),v.jsx("div",{className:"grid grid-cols-2 gap-2 mb-4",children:["official","custom"].map(E=>v.jsx("button",{onClick:()=>t({skillType:E}),className:`px-3 py-2 text-sm rounded-lg border transition-colors ${e.skillType===E?"bg-accent/20 border-accent text-white":"bg-surface border-border text-gray-400 hover:border-gray-500"}`,children:E.charAt(0).toUpperCase()+E.slice(1)},E))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Select Skill"}),v.jsx("div",{className:"space-y-2",children:W8.map(E=>v.jsxs("button",{onClick:()=>t({skillId:E.id,description:E.description}),className:`w-full flex items-center gap-3 p-3 rounded-lg border transition-colors text-left ${e.skillId===E.id?"bg-accent/20 border-accent":"bg-surface border-border hover:border-gray-500"}`,children:[v.jsx(Mf,{className:"w-5 h-5 text-cyan-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:E.name}),v.jsx("div",{className:"text-xs text-gray-500",children:E.description})]})]},E.id))})]})]})}function o9({data:e,onUpdate:t}){return v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Name"}),v.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"}),v.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Slash command to execute (without /)"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Command Path (optional)"}),v.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 v.jsxs(v.Fragment,{children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Event"}),v.jsx("div",{className:"grid grid-cols-2 gap-2",children:n.map(r=>v.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))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Tool Matcher (optional)"}),v.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"}),v.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Filter by tool name pattern"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-medium text-gray-500 uppercase tracking-wide mb-2",children:"Hook Command"}),v.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"}),v.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 v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Output Format"}),v.jsx("div",{className:"space-y-2",children:t.map(n=>v.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:[v.jsx(Nf,{className:"w-5 h-5 text-emerald-400"}),v.jsxs("div",{children:[v.jsx("div",{className:"font-medium text-white",children:n.name}),v.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}=Bf(),n=ci(t_);return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-1 p-2 border-b border-border",children:c9.map(r=>v.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))}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e==="preview"&&v.jsx(Z8,{}),e==="console"&&v.jsx(K8,{}),e==="step"&&v.jsx(i9,{node:n}),e==="theme"&&v.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}=hg.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 d=`서버 오류 (${t.status})`;try{d=(await t.json()).message||d}catch{}throw new Error(d)}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 E=u.get(w.target)||[];E.push(w.source),u.set(w.target,E);const N=f.get(w.source)||[];N.push(w.target),f.set(w.source,N)});const d=e.filter(w=>(u.get(w.id)||[]).length===0),h=new Map,g=[];for(d.forEach(w=>{h.set(w.id,0),g.push({id:w.id,depth:0})}),d.length===0&&e.length>0&&(h.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 k=h.get(N),C=w.depth+1;(k===void 0||C>k)&&(h.set(N,C),g.push({id:N,depth:C}))})}const m=new Map;h.forEach((w,E)=>{const N=m.get(w)||[];N.push(E),m.set(w,N)});const x=Math.max(...Array.from(h.values()),0),b=new Map;for(let w=0;w<=x;w++){const E=m.get(w)||[],k=(E.length-1)*r,C=l+(300-k)/2;E.forEach((_,R)=>{b.set(_,{x:a+w*n,y:C+R*r})})}return e.map(w=>{const E=b.get(w.id)||w.position;return{...w,position:E}})}function p9(e){const t=[],n=new Map,r={x:0,y:0};e.nodes.forEach((u,f)=>{const d=Sa();n.set(f,d);const h={label:u.label,description:u.description,status:"idle",usedInputs:[]};switch(u.type){case"input":t.push({id:d,type:"input",position:{...r},data:{...h,inputType:u.config.inputType||"text",placeholder:u.config.placeholder||u.description}});break;case"subagent":t.push({id:d,type:"subagent",position:{...r},data:{...h,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:d,type:"skill",position:{...r},data:{...h,skillType:u.config.skillType||"official",skillId:u.config.skillId,skillContent:u.config.skillContent}});break;case"command":t.push({id:d,type:"command",position:{...r},data:{...h,commandName:u.config.commandName||u.label,commandPath:u.config.commandPath}});break;case"hook":t.push({id:d,type:"hook",position:{...r},data:{...h,hookEvent:u.config.hookEvent||"PreToolUse",hookMatcher:u.config.hookMatcher,hookCommand:u.config.hookCommand}});break;case"output":t.push({id:d,type:"output",position:{...r},data:{...h,outputType:u.config.outputType||"auto"}});break}}),e.edges.forEach(u=>{const f=n.get(u.to),d=n.get(u.from);if(f&&d){const h=t.find(g=>g.id===f);h&&h.data.usedInputs&&h.data.usedInputs.push(d)}});const a=e.edges.map(u=>{const f=n.get(u.from),d=n.get(u.to);return!f||!d?null:{id:`e-${f}-${d}`,source:f,target:d,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 Pc=Object.create(null);Object.keys(fi).forEach(e=>{Pc[fi[e]]=e});const Om={type:"error",data:"parser error"},Z2=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Q2=typeof ArrayBuffer=="function",K2=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,jg=({type:e,data:t},n,r)=>Z2&&t instanceof Blob?n?r(t):tw(t,r):Q2&&(t instanceof ArrayBuffer||K2(t))?n?r(t):tw(new Blob([t]),r):r(fi[e]+(t||"")),tw=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function nw(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Gp;function g9(e,t){if(Z2&&e.data instanceof Blob)return e.data.arrayBuffer().then(nw).then(t);if(Q2&&(e.data instanceof ArrayBuffer||K2(e.data)))return t(nw(e.data));jg(e,!1,n=>{Gp||(Gp=new TextEncoder),t(Gp.encode(n))})}const iw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",el=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<iw.length;e++)el[iw.charCodeAt(e)]=e;const y9=e=>{let t=e.length*.75,n=e.length,r,a=0,l,u,f,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const h=new ArrayBuffer(t),g=new Uint8Array(h);for(r=0;r<n;r+=4)l=el[e.charCodeAt(r)],u=el[e.charCodeAt(r+1)],f=el[e.charCodeAt(r+2)],d=el[e.charCodeAt(r+3)],g[a++]=l<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|d&63;return h},x9=typeof ArrayBuffer=="function",zg=(e,t)=>{if(typeof e!="string")return{type:"message",data:J2(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:b9(e.substring(1),t)}:Pc[n]?e.length>1?{type:Pc[n],data:e.substring(1)}:{type:Pc[n]}:Om},b9=(e,t)=>{if(x9){const n=y9(e);return J2(n,t)}else return{base64:!0,data:e}},J2=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,W2="",v9=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((l,u)=>{jg(l,!1,f=>{r[u]=f,++a===n&&t(r.join(W2))})})},w9=(e,t)=>{const n=e.split(W2),r=[];for(let a=0;a<n.length;a++){const l=zg(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 Zp;function zc(e){return e.reduce((t,n)=>t+n.length,0)}function Oc(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){Zp||(Zp=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(zc(n)<1)break;const d=Oc(n,1);l=(d[0]&128)===128,a=d[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(zc(n)<2)break;const d=Oc(n,2);a=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),r=3}else if(r===2){if(zc(n)<8)break;const d=Oc(n,8),h=new DataView(d.buffer,d.byteOffset,d.length),g=h.getUint32(0);if(g>Math.pow(2,21)-1){f.enqueue(Om);break}a=g*Math.pow(2,32)+h.getUint32(4),r=3}else{if(zc(n)<a)break;const d=Oc(n,a);f.enqueue(zg(l?d:Zp.decode(d),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 Pf=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 Vf(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 R9(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function j9(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 z9 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,Vf(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 z9(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=zg(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=R9(t);return n.length?"?"+n:""}}class O9 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 D9=ik;function L9(){}class B9 extends O9{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,Vf(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",rw);else if(typeof addEventListener=="function"){const e="onpagehide"in Ln?"pagehide":"unload";addEventListener(e,rw,!1)}}function rw(){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||D9))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;jg(r,this.supportsBinary,l=>{try{this.doWrite(r,l)}catch{}a&&Pf(()=>{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 Qp=Ln.WebSocket||Ln.MozWebSocket;class q9 extends I9{createSocket(t,n,r){return sk?new Qp(t,n,r):n?new Qp(t,n):new Qp(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:d})=>{f||(this.onPacket(d),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&&Pf(()=>{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 Dm(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 Lm=typeof addEventListener=="function"&&typeof removeEventListener=="function",Vc=[];Lm&&addEventListener("offline",()=>{Vc.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=Dm(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=Dm(n.host).host);Vf(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=j9(this.opts.query)),Lm&&(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"})},Vc.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,Pf(()=>{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(),Lm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Vc.indexOf(this._offlineEventListener);r!==-1&&Vc.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 d(){u("socket closed")}function h(m){n&&m.name!==n.name&&l()}const g=()=>{n.removeListener("open",a),n.removeListener("error",u),n.removeListener("close",f),this.off("close",d),this.off("upgrading",h)};n.once("open",a),n.once("error",u),n.once("close",f),this.once("close",d),this.once("upgrading",h),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=Dm(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 Dg(e){return K9&&(e instanceof ArrayBuffer||J9(e))||W9&&e instanceof Blob||eH&&e instanceof File}function Fc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Fc(e[n]))return!0;return!1}if(Dg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Fc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Fc(e[n]))return!0;return!1}function tH(e){const t=[],n=e.data,r=e;return r.data=Bm(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Bm(e,t){if(!e)return e;if(Dg(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]=Bm(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]=Bm(e[r],t));return n}return e}function nH(e,t){return e.data=Hm(e.data,t),delete e.attachments,e}function Hm(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]=Hm(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Hm(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)&&Fc(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 Lg 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(Dg(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(Lg.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 sw(n);case $e.DISCONNECT:return n===void 0;case $e.CONNECT_ERROR:return typeof n=="string"||sw(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 sw(e){return Object.prototype.toString.call(e)==="[object Object]"}const aH=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Lg,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,d=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!f||(d?(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 Um 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,Vf(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,d=this.setTimeoutFn(()=>{a(),l(new Error("timeout")),n.close()},f);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}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){Pf(()=>{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 Yc(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 d;return f?d=new Um(r,t):(Go[a]||(Go[a]=new Um(r,t)),d=Go[a]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Yc,{Manager:Um,Socket:ok,io:Yc,connect:Yc});const aw=window.location.origin;class lH{socket;constructor(){this.socket=Yc(aw,{autoConnect:!0,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3}),this.socket.on("connect",()=>{console.log("[Socket] Connected to server:",aw)}),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),[d,h]=X.useState("workflow"),{loadWorkflow:g,addNode:m,setSelectedNode:x,nodes:b}=ci(),{openConsolePanel:w,openStepPanel:E}=Bf(),{addLog:N,clearLogs:k}=ka(),{apiMode:C,apiKey:_,proxyUrl:R}=hg(),B=X.useCallback(H=>{console.log("[PromptBar] Skill progress:",H.step,H.message);const $=H.step==="error"?"error":H.step==="completed"?"success":"info";N($,H.message,void 0,H.detail)},[N]),M=X.useCallback(H=>{r(!1),f(`스킬 "${H.skill.skillName}"이 ${H.savedPath}에 저장되었습니다!`),t(""),setTimeout(()=>f(null),5e3);const $=Sa(),P=b.length,te={id:$,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($),E()},[b,m,x,E]),L=X.useCallback(H=>{r(!1),l(H.error)},[]);X.useEffect(()=>(Cr.on("skill:progress",B),Cr.on("skill:completed",M),Cr.on("skill:error",L),()=>{Cr.off("skill:progress",B),Cr.off("skill:completed",M),Cr.off("skill:error",L)}),[B,M,L]);const G=async()=>{if(!e.trim()||n)return;r(!0),l(null),f(null);const H=m9(e);h(H?"skill":"workflow");try{if(H)k(),w(),Cr.isConnected()||N("warning","⚠️ 서버 연결 대기 중...",void 0,"잠시 후 자동으로 연결됩니다"),Cr.generateSkill({prompt:e,apiMode:C,apiKey:C==="direct"?_:void 0,proxyUrl:C==="proxy"?R:void 0});else{const{workflow:$,workflowName:P}=await d9(e);g({nodes:$.nodes,edges:$.edges,name:P}),t(""),r(!1)}}catch($){console.error("Generation failed:",$);const P=$ instanceof Error?$.message:"생성에 실패했습니다.";l(P),r(!1)}},Z=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),G())};return v.jsxs("div",{className:"bg-surface border border-border rounded-2xl px-5 py-3 shadow-2xl flex items-center gap-3",children:[v.jsx(Cl,{className:"w-5 h-5 text-accent flex-shrink-0"}),v.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}),v.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?v.jsx(sf,{className:"w-5 h-5 animate-spin"}):v.jsx(_R,{className:"w-5 h-5"})}),v.jsx("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-xs whitespace-nowrap",children:a?v.jsx("span",{className:"text-red-400",children:a}):u?v.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[v.jsx(Cf,{className:"w-3 h-3"}),u]}):n?v.jsxs("span",{className:"text-accent",children:["AI가 ",d==="skill"?"스킬":"워크플로우","을 생성하고 있습니다..."]}):v.jsx("span",{className:"text-gray-600",children:'"스킬 만들어줘" 또는 워크플로우 설명을 입력하세요'})})]})}function cH(){const{isCollapsed:e,width:t}=Bf(),{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,H_().then(d=>{d.length>0&&(console.log(`Loaded ${d.length} nodes from .claude/`),a(d))}).catch(d=>{console.error("Failed to load initial config:",d)}))},[a]),X.useEffect(()=>{n&&u(!0)},[n]),v.jsx(FS,{children:v.jsxs("div",{className:"flex flex-col h-screen bg-canvas",children:[v.jsx(sz,{}),v.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[v.jsxs("div",{className:"flex-1 flex flex-col",children:[v.jsx(uz,{}),v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(Nz,{}),v.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 w-full max-w-2xl px-4",children:v.jsx(uH,{})})]})]}),!e&&v.jsx("div",{className:"border-l border-border bg-surface",style:{width:`${t}px`},children:v.jsx(f9,{})})]}),v.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:[v.jsx(ds,{className:"w-4 h-4"}),v.jsx("span",{className:"text-sm font-medium",children:"Console"}),r.length>0&&!l&&v.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-amber-500 text-white rounded-full",children:r.length}),n&&v.jsx("span",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"})]}),v.jsx(Q8,{isOpen:l,onClose:()=>u(!1)})]})})}wN.createRoot(document.getElementById("root")).render(v.jsx(X.StrictMode,{children:v.jsx(cH,{})}));