@sequenza/workbench 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,70 +0,0 @@
1
- (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const u of s)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function i(s){const u={};return s.integrity&&(u.integrity=s.integrity),s.referrerPolicy&&(u.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?u.credentials="include":s.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(s){if(s.ep)return;s.ep=!0;const u=i(s);fetch(s.href,u)}})();function pv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Md={exports:{}},La={};var _y;function L2(){if(_y)return La;_y=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,s,u){var f=null;if(u!==void 0&&(f=""+u),s.key!==void 0&&(f=""+s.key),"key"in s){u={};for(var h in s)h!=="key"&&(u[h]=s[h])}else u=s;return s=u.ref,{$$typeof:t,type:a,key:f,ref:s!==void 0?s:null,props:u}}return La.Fragment=r,La.jsx=i,La.jsxs=i,La}var wy;function j2(){return wy||(wy=1,Md.exports=L2()),Md.exports}var T=j2(),Dd={exports:{}},_e={};var Ty;function F2(){if(Ty)return _e;Ty=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,N={};function w(M,F,J){this.props=M,this.context=F,this.refs=N,this.updater=J||E}w.prototype.isReactComponent={},w.prototype.setState=function(M,F){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,F,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function O(){}O.prototype=w.prototype;function _(M,F,J){this.props=M,this.context=F,this.refs=N,this.updater=J||E}var C=_.prototype=new O;C.constructor=_,S(C,w.prototype),C.isPureReactComponent=!0;var D=Array.isArray;function z(){}var U={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function Y(M,F,J){var te=J.ref;return{$$typeof:t,type:M,key:F,ref:te!==void 0?te:null,props:J}}function ae(M,F){return Y(M.type,F,M.props)}function X(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function P(M){var F={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(J){return F[J]})}var re=/\/+/g;function B(M,F){return typeof M=="object"&&M!==null&&M.key!=null?P(""+M.key):F.toString(36)}function q(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(z,z):(M.status="pending",M.then(function(F){M.status==="pending"&&(M.status="fulfilled",M.value=F)},function(F){M.status==="pending"&&(M.status="rejected",M.reason=F)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function R(M,F,J,te,se){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var fe=!1;if(M===null)fe=!0;else switch(he){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(M.$$typeof){case t:case r:fe=!0;break;case y:return fe=M._init,R(fe(M._payload),F,J,te,se)}}if(fe)return se=se(M),fe=te===""?"."+B(M,0):te,D(se)?(J="",fe!=null&&(J=fe.replace(re,"$&/")+"/"),R(se,F,J,"",function(ne){return ne})):se!=null&&(X(se)&&(se=ae(se,J+(se.key==null||M&&M.key===se.key?"":(""+se.key).replace(re,"$&/")+"/")+fe)),F.push(se)),1;fe=0;var ue=te===""?".":te+":";if(D(M))for(var me=0;me<M.length;me++)te=M[me],he=ue+B(te,me),fe+=R(te,F,J,he,se);else if(me=b(M),typeof me=="function")for(M=me.call(M),me=0;!(te=M.next()).done;)te=te.value,he=ue+B(te,me++),fe+=R(te,F,J,he,se);else if(he==="object"){if(typeof M.then=="function")return R(q(M),F,J,te,se);throw F=String(M),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return fe}function L(M,F,J){if(M==null)return M;var te=[],se=0;return R(M,te,"","",function(he){return F.call(J,he,se++)}),te}function k(M){if(M._status===-1){var F=M._result;F=F(),F.then(function(J){(M._status===0||M._status===-1)&&(M._status=1,M._result=J)},function(J){(M._status===0||M._status===-1)&&(M._status=2,M._result=J)}),M._status===-1&&(M._status=0,M._result=F)}if(M._status===1)return M._result.default;throw M._result}var $=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ee={map:L,forEach:function(M,F,J){L(M,function(){F.apply(this,arguments)},J)},count:function(M){var F=0;return L(M,function(){F++}),F},toArray:function(M){return L(M,function(F){return F})||[]},only:function(M){if(!X(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return _e.Activity=g,_e.Children=ee,_e.Component=w,_e.Fragment=i,_e.Profiler=s,_e.PureComponent=_,_e.StrictMode=a,_e.Suspense=p,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,_e.__COMPILER_RUNTIME={__proto__:null,c:function(M){return U.H.useMemoCache(M)}},_e.cache=function(M){return function(){return M.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(M,F,J){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var te=S({},M.props),se=M.key;if(F!=null)for(he in F.key!==void 0&&(se=""+F.key),F)!V.call(F,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&F.ref===void 0||(te[he]=F[he]);var he=arguments.length-2;if(he===1)te.children=J;else if(1<he){for(var fe=Array(he),ue=0;ue<he;ue++)fe[ue]=arguments[ue+2];te.children=fe}return Y(M.type,se,te)},_e.createContext=function(M){return M={$$typeof:f,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:u,_context:M},M},_e.createElement=function(M,F,J){var te,se={},he=null;if(F!=null)for(te in F.key!==void 0&&(he=""+F.key),F)V.call(F,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(se[te]=F[te]);var fe=arguments.length-2;if(fe===1)se.children=J;else if(1<fe){for(var ue=Array(fe),me=0;me<fe;me++)ue[me]=arguments[me+2];se.children=ue}if(M&&M.defaultProps)for(te in fe=M.defaultProps,fe)se[te]===void 0&&(se[te]=fe[te]);return Y(M,he,se)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(M){return{$$typeof:h,render:M}},_e.isValidElement=X,_e.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:k}},_e.memo=function(M,F){return{$$typeof:m,type:M,compare:F===void 0?null:F}},_e.startTransition=function(M){var F=U.T,J={};U.T=J;try{var te=M(),se=U.S;se!==null&&se(J,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(z,$)}catch(he){$(he)}finally{F!==null&&J.types!==null&&(F.types=J.types),U.T=F}},_e.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},_e.use=function(M){return U.H.use(M)},_e.useActionState=function(M,F,J){return U.H.useActionState(M,F,J)},_e.useCallback=function(M,F){return U.H.useCallback(M,F)},_e.useContext=function(M){return U.H.useContext(M)},_e.useDebugValue=function(){},_e.useDeferredValue=function(M,F){return U.H.useDeferredValue(M,F)},_e.useEffect=function(M,F){return U.H.useEffect(M,F)},_e.useEffectEvent=function(M){return U.H.useEffectEvent(M)},_e.useId=function(){return U.H.useId()},_e.useImperativeHandle=function(M,F,J){return U.H.useImperativeHandle(M,F,J)},_e.useInsertionEffect=function(M,F){return U.H.useInsertionEffect(M,F)},_e.useLayoutEffect=function(M,F){return U.H.useLayoutEffect(M,F)},_e.useMemo=function(M,F){return U.H.useMemo(M,F)},_e.useOptimistic=function(M,F){return U.H.useOptimistic(M,F)},_e.useReducer=function(M,F,J){return U.H.useReducer(M,F,J)},_e.useRef=function(M){return U.H.useRef(M)},_e.useState=function(M){return U.H.useState(M)},_e.useSyncExternalStore=function(M,F,J){return U.H.useSyncExternalStore(M,F,J)},_e.useTransition=function(){return U.H.useTransition()},_e.version="19.2.4",_e}var Ay;function cl(){return Ay||(Ay=1,Dd.exports=F2()),Dd.exports}var j=cl();const V2=pv(j);var Od={exports:{}},ja={},zd={exports:{}},Bd={};var Ny;function k2(){return Ny||(Ny=1,(function(t){function r(R,L){var k=R.length;R.push(L);e:for(;0<k;){var $=k-1>>>1,ee=R[$];if(0<s(ee,L))R[$]=L,R[k]=ee,k=$;else break e}}function i(R){return R.length===0?null:R[0]}function a(R){if(R.length===0)return null;var L=R[0],k=R.pop();if(k!==L){R[0]=k;e:for(var $=0,ee=R.length,M=ee>>>1;$<M;){var F=2*($+1)-1,J=R[F],te=F+1,se=R[te];if(0>s(J,k))te<ee&&0>s(se,J)?(R[$]=se,R[te]=k,$=te):(R[$]=J,R[F]=k,$=F);else if(te<ee&&0>s(se,k))R[$]=se,R[te]=k,$=te;else break e}}return L}function s(R,L){var k=R.sortIndex-L.sortIndex;return k!==0?k:R.id-L.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var p=[],m=[],y=1,g=null,x=3,b=!1,E=!1,S=!1,N=!1,w=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function C(R){for(var L=i(m);L!==null;){if(L.callback===null)a(m);else if(L.startTime<=R)a(m),L.sortIndex=L.expirationTime,r(p,L);else break;L=i(m)}}function D(R){if(S=!1,C(R),!E)if(i(p)!==null)E=!0,z||(z=!0,P());else{var L=i(m);L!==null&&q(D,L.startTime-R)}}var z=!1,U=-1,V=5,Y=-1;function ae(){return N?!0:!(t.unstable_now()-Y<V)}function X(){if(N=!1,z){var R=t.unstable_now();Y=R;var L=!0;try{e:{E=!1,S&&(S=!1,O(U),U=-1),b=!0;var k=x;try{t:{for(C(R),g=i(p);g!==null&&!(g.expirationTime>R&&ae());){var $=g.callback;if(typeof $=="function"){g.callback=null,x=g.priorityLevel;var ee=$(g.expirationTime<=R);if(R=t.unstable_now(),typeof ee=="function"){g.callback=ee,C(R),L=!0;break t}g===i(p)&&a(p),C(R)}else a(p);g=i(p)}if(g!==null)L=!0;else{var M=i(m);M!==null&&q(D,M.startTime-R),L=!1}}break e}finally{g=null,x=k,b=!1}L=void 0}}finally{L?P():z=!1}}}var P;if(typeof _=="function")P=function(){_(X)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,B=re.port2;re.port1.onmessage=X,P=function(){B.postMessage(null)}}else P=function(){w(X,0)};function q(R,L){U=w(function(){R(t.unstable_now())},L)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(R){switch(x){case 1:case 2:case 3:var L=3;break;default:L=x}var k=x;x=L;try{return R()}finally{x=k}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var k=x;x=R;try{return L()}finally{x=k}},t.unstable_scheduleCallback=function(R,L,k){var $=t.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?$+k:$):k=$,R){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=k+ee,R={id:y++,callback:L,priorityLevel:R,startTime:k,expirationTime:ee,sortIndex:-1},k>$?(R.sortIndex=k,r(m,R),i(p)===null&&R===i(m)&&(S?(O(U),U=-1):S=!0,q(D,k-$))):(R.sortIndex=ee,r(p,R),E||b||(E=!0,z||(z=!0,P()))),R},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(R){var L=x;return function(){var k=x;x=L;try{return R.apply(this,arguments)}finally{x=k}}}})(Bd)),Bd}var Cy;function G2(){return Cy||(Cy=1,zd.exports=k2()),zd.exports}var Ud={exports:{}},St={};var Ry;function q2(){if(Ry)return St;Ry=1;var t=cl();function r(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function u(p,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:p,containerInfo:m,implementation:y}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return St.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,St.createPortal=function(p,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(r(299));return u(p,m,null,y)},St.flushSync=function(p){var m=f.T,y=a.p;try{if(f.T=null,a.p=2,p)return p()}finally{f.T=m,a.p=y,a.d.f()}},St.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(p,m))},St.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},St.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var y=m.as,g=h(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?a.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):y==="script"&&a.d.X(p,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},St.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=h(m.as,m.crossOrigin);a.d.M(p,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(p)},St.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=h(y,m.crossOrigin);a.d.L(p,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},St.preloadModule=function(p,m){if(typeof p=="string")if(m){var y=h(m.as,m.crossOrigin);a.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(p)},St.requestFormReset=function(p){a.d.r(p)},St.unstable_batchedUpdates=function(p,m){return p(m)},St.useFormState=function(p,m,y){return f.H.useFormState(p,m,y)},St.useFormStatus=function(){return f.H.useHostTransitionStatus()},St.version="19.2.4",St}var My;function gv(){if(My)return Ud.exports;My=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Ud.exports=q2(),Ud.exports}var Dy;function Y2(){if(Dy)return ja;Dy=1;var t=G2(),r=cl(),i=gv();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(u(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(a(188));return n!==e?null:e}for(var o=e,l=n;;){var c=o.return;if(c===null)break;var d=c.alternate;if(d===null){if(l=c.return,l!==null){o=l;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===o)return p(c),e;if(d===l)return p(c),n;d=d.sibling}throw Error(a(188))}if(o.return!==l.return)o=c,l=d;else{for(var v=!1,A=c.child;A;){if(A===o){v=!0,o=c,l=d;break}if(A===l){v=!0,l=c,o=d;break}A=A.sibling}if(!v){for(A=d.child;A;){if(A===o){v=!0,o=d,l=c;break}if(A===l){v=!0,l=d,o=c;break}A=A.sibling}if(!v)throw Error(a(189))}}if(o.alternate!==l)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:n}function y(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=y(e),n!==null)return n;e=e.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function B(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case w:return"Profiler";case N:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case _:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case C:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return n=e.displayName||null,n!==null?n:B(e.type)||"Memo";case V:n=e._payload,e=e._init;try{return B(e(n))}catch{}}return null}var q=Array.isArray,R=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k={pending:!1,data:null,method:null,action:null},$=[],ee=-1;function M(e){return{current:e}}function F(e){0>ee||(e.current=$[ee],$[ee]=null,ee--)}function J(e,n){ee++,$[ee]=e.current,e.current=n}var te=M(null),se=M(null),he=M(null),fe=M(null);function ue(e,n){switch(J(he,n),J(se,e),J(te,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Ig(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Ig(n),e=$g(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(te),J(te,e)}function me(){F(te),F(se),F(he)}function ne(e){e.memoizedState!==null&&J(fe,e);var n=te.current,o=$g(n,e.type);n!==o&&(J(se,e),J(te,o))}function ce(e){se.current===e&&(F(te),F(se)),fe.current===e&&(F(fe),za._currentValue=k)}var de,ge;function xe(e){if(de===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);de=n&&n[1]||"",ge=-1<o.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+de+e+ge}var Se=!1;function Ae(e,n){if(!e||Se)return"";Se=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){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(W){var K=W}Reflect.construct(e,[],le)}else{try{le.call()}catch(W){K=W}e.call(le.prototype)}}else{try{throw Error()}catch(W){K=W}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(W){if(W&&K&&typeof W.stack=="string")return[W.stack,K.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),v=d[0],A=d[1];if(v&&A){var H=v.split(`
4
- `),Q=A.split(`
5
- `);for(c=l=0;l<H.length&&!H[l].includes("DetermineComponentFrameRoot");)l++;for(;c<Q.length&&!Q[c].includes("DetermineComponentFrameRoot");)c++;if(l===H.length||c===Q.length)for(l=H.length-1,c=Q.length-1;1<=l&&0<=c&&H[l]!==Q[c];)c--;for(;1<=l&&0<=c;l--,c--)if(H[l]!==Q[c]){if(l!==1||c!==1)do if(l--,c--,0>c||H[l]!==Q[c]){var ie=`
6
- `+H[l].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),ie}while(1<=l&&0<=c);break}}}finally{Se=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?xe(o):""}function je(e,n){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe("Lazy");case 13:return e.child!==n&&n!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return xe("Activity");default:return""}}function Ie(e){try{var n="",o=null;do n+=je(e,o),o=e,e=e.return;while(e);return n}catch(l){return`
7
- Error generating stack: `+l.message+`
8
- `+l.stack}}var wt=Object.prototype.hasOwnProperty,Tt=t.unstable_scheduleCallback,vn=t.unstable_cancelCallback,jn=t.unstable_shouldYield,Fn=t.unstable_requestPaint,$e=t.unstable_now,bn=t.unstable_getCurrentPriorityLevel,an=t.unstable_ImmediatePriority,En=t.unstable_UserBlockingPriority,Vn=t.unstable_NormalPriority,dc=t.unstable_LowPriority,Hi=t.unstable_IdlePriority,hc=t.log,mc=t.unstable_setDisableYieldValue,Wr=null,At=null;function Sn(e){if(typeof hc=="function"&&mc(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Wr,e)}catch{}}var Nt=Math.clz32?Math.clz32:yc,pc=Math.log,gc=Math.LN2;function yc(e){return e>>>=0,e===0?32:31-(pc(e)/gc|0)|0}var Li=256,ji=262144,Fi=4194304;function kn(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vi(e,n,o){var l=e.pendingLanes;if(l===0)return 0;var c=0,d=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var A=l&134217727;return A!==0?(l=A&~d,l!==0?c=kn(l):(v&=A,v!==0?c=kn(v):o||(o=A&~e,o!==0&&(c=kn(o))))):(A=l&~d,A!==0?c=kn(A):v!==0?c=kn(v):o||(o=l&~e,o!==0&&(c=kn(o)))),c===0?0:n!==0&&n!==c&&(n&d)===0&&(d=c&-c,o=n&-n,d>=o||d===32&&(o&4194048)!==0)?n:c}function ei(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function xc(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Sl(){var e=Fi;return Fi<<=1,(Fi&62914560)===0&&(Fi=4194304),e}function Yo(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ti(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vc(e,n,o,l,c,d){var v=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var A=e.entanglements,H=e.expirationTimes,Q=e.hiddenUpdates;for(o=v&~o;0<o;){var ie=31-Nt(o),le=1<<ie;A[ie]=0,H[ie]=-1;var K=Q[ie];if(K!==null)for(Q[ie]=null,ie=0;ie<K.length;ie++){var W=K[ie];W!==null&&(W.lane&=-536870913)}o&=~le}l!==0&&_l(e,l,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(v&~n))}function _l(e,n,o){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Nt(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|o&261930}function wl(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-Nt(o),c=1<<l;c&n|e[l]&n&&(e[l]|=n),o&=~c}}function Tl(e,n){var o=n&-n;return o=(o&42)!==0?1:Xo(o),(o&(e.suspendedLanes|n))!==0?0:o}function Xo(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Io(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Al(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:gy(e.type))}function Nl(e,n){var o=L.p;try{return L.p=e,n()}finally{L.p=o}}var _n=Math.random().toString(36).slice(2),ht="__reactFiber$"+_n,Et="__reactProps$"+_n,Gn="__reactContainer$"+_n,ki="__reactEvents$"+_n,Cl="__reactListeners$"+_n,bc="__reactHandles$"+_n,Rl="__reactResources$"+_n,ni="__reactMarker$"+_n;function $o(e){delete e[ht],delete e[Et],delete e[ki],delete e[Cl],delete e[bc]}function mr(e){var n=e[ht];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Gn]||o[ht]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=ey(e);e!==null;){if(o=e[ht])return o;e=ey(e)}return n}e=o,o=e.parentNode}return null}function pr(e){if(e=e[ht]||e[Gn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function gr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function yr(e){var n=e[Rl];return n||(n=e[Rl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ot(e){e[ni]=!0}var Ml=new Set,Dl={};function qn(e,n){xr(e,n),xr(e+"Capture",n)}function xr(e,n){for(Dl[e]=n,e=0;e<n.length;e++)Ml.add(n[e])}var Ec=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]*$"),Po={},Ol={};function Sc(e){return wt.call(Ol,e)?!0:wt.call(Po,e)?!1:Ec.test(e)?Ol[e]=!0:(Po[e]=!0,!1)}function Gi(e,n,o){if(Sc(n))if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+o)}}function qi(e,n,o){if(o===null)e.removeAttribute(n);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+o)}}function ln(e,n,o,l){if(l===null)e.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(n,o,""+l)}}function Dt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zl(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _c(e,n,o){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var c=l.get,d=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(v){o=""+v,d.call(this,v)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(v){o=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Yi(e){if(!e._valueTracker){var n=zl(e)?"checked":"value";e._valueTracker=_c(e,n,""+e[n])}}function Bl(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=zl(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function ri(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var wc=/[\n"\\]/g;function Ot(e){return e.replace(wc,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function ii(e,n,o,l,c,d,v,A){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),n!=null?v==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Dt(n)):e.value!==""+Dt(n)&&(e.value=""+Dt(n)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),n!=null?Zo(e,v,Dt(n)):o!=null?Zo(e,v,Dt(o)):l!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+Dt(A):e.removeAttribute("name")}function Ul(e,n,o,l,c,d,v,A){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||o!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Yi(e);return}o=o!=null?""+Dt(o):"",n=n!=null?""+Dt(n):o,A||n===e.value||(e.value=n),e.defaultValue=n}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=A?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),Yi(e)}function Zo(e,n,o){n==="number"&&ri(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Yn(e,n,o,l){if(e=e.options,n){n={};for(var c=0;c<o.length;c++)n["$"+o[c]]=!0;for(o=0;o<e.length;o++)c=n.hasOwnProperty("$"+e[o].value),e[o].selected!==c&&(e[o].selected=c),c&&l&&(e[o].defaultSelected=!0)}else{for(o=""+Dt(o),n=null,c=0;c<e.length;c++){if(e[c].value===o){e[c].selected=!0,l&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function k0(e,n,o){if(n!=null&&(n=""+Dt(n),n!==e.value&&(e.value=n),o==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=o!=null?""+Dt(o):""}function G0(e,n,o,l){if(n==null){if(l!=null){if(o!=null)throw Error(a(92));if(q(l)){if(1<l.length)throw Error(a(93));l=l[0]}o=l}o==null&&(o=""),n=o}o=Dt(n),e.defaultValue=o,l=e.textContent,l===o&&l!==""&&l!==null&&(e.value=l),Yi(e)}function Xi(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var OS=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 q0(e,n,o){var l=n.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,o):typeof o!="number"||o===0||OS.has(n)?n==="float"?e.cssFloat=o:e[n]=(""+o).trim():e[n]=o+"px"}function Y0(e,n,o){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var c in n)l=n[c],n.hasOwnProperty(c)&&o[c]!==l&&q0(e,c,l)}else for(var d in n)n.hasOwnProperty(d)&&q0(e,d,n[d])}function Tc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zS=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"]]),BS=/^[\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 Hl(e){return BS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Ac=null;function Nc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ii=null,$i=null;function X0(e){var n=pr(e);if(n&&(e=n.stateNode)){var o=e[Et]||null;e:switch(e=n.stateNode,n.type){case"input":if(ii(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Ot(""+n)+'"][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var c=l[Et]||null;if(!c)throw Error(a(90));ii(l,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(n=0;n<o.length;n++)l=o[n],l.form===e.form&&Bl(l)}break e;case"textarea":k0(e,o.value,o.defaultValue);break e;case"select":n=o.value,n!=null&&Yn(e,!!o.multiple,n,!1)}}}var Cc=!1;function I0(e,n,o){if(Cc)return e(n,o);Cc=!0;try{var l=e(n);return l}finally{if(Cc=!1,(Ii!==null||$i!==null)&&(_s(),Ii&&(n=Ii,e=$i,$i=Ii=null,X0(n),e)))for(n=0;n<e.length;n++)X0(e[n])}}function Qo(e,n){var o=e.stateNode;if(o===null)return null;var l=o[Et]||null;if(l===null)return null;o=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,n,typeof o));return o}var In=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=!1;if(In)try{var Ko={};Object.defineProperty(Ko,"passive",{get:function(){Rc=!0}}),window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Rc=!1}var vr=null,Mc=null,Ll=null;function $0(){if(Ll)return Ll;var e,n=Mc,o=n.length,l,c="value"in vr?vr.value:vr.textContent,d=c.length;for(e=0;e<o&&n[e]===c[e];e++);var v=o-e;for(l=1;l<=v&&n[o-l]===c[d-l];l++);return Ll=c.slice(e,1<l?1-l:void 0)}function jl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Fl(){return!0}function P0(){return!1}function zt(e){function n(o,l,c,d,v){this._reactName=o,this._targetInst=c,this.type=l,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var A in e)e.hasOwnProperty(A)&&(o=e[A],this[A]=o?o(d):d[A]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Fl:P0,this.isPropagationStopped=P0,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Fl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),n}var oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vl=zt(oi),Jo=g({},oi,{view:0,detail:0}),US=zt(Jo),Dc,Oc,Wo,kl=g({},Jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wo&&(Wo&&e.type==="mousemove"?(Dc=e.screenX-Wo.screenX,Oc=e.screenY-Wo.screenY):Oc=Dc=0,Wo=e),Dc)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),Z0=zt(kl),HS=g({},kl,{dataTransfer:0}),LS=zt(HS),jS=g({},Jo,{relatedTarget:0}),zc=zt(jS),FS=g({},oi,{animationName:0,elapsedTime:0,pseudoElement:0}),VS=zt(FS),kS=g({},oi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),GS=zt(kS),qS=g({},oi,{data:0}),Q0=zt(qS),YS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XS={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"},IS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $S(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=IS[e])?!!n[e]:!1}function Bc(){return $S}var PS=g({},Jo,{key:function(e){if(e.key){var n=YS[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=jl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?XS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bc,charCode:function(e){return e.type==="keypress"?jl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ZS=zt(PS),QS=g({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),K0=zt(QS),KS=g({},Jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bc}),JS=zt(KS),WS=g({},oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),e_=zt(WS),t_=g({},kl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),n_=zt(t_),r_=g({},oi,{newState:0,oldState:0}),i_=zt(r_),o_=[9,13,27,32],Uc=In&&"CompositionEvent"in window,ea=null;In&&"documentMode"in document&&(ea=document.documentMode);var a_=In&&"TextEvent"in window&&!ea,J0=In&&(!Uc||ea&&8<ea&&11>=ea),W0=" ",em=!1;function tm(e,n){switch(e){case"keyup":return o_.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pi=!1;function l_(e,n){switch(e){case"compositionend":return nm(n);case"keypress":return n.which!==32?null:(em=!0,W0);case"textInput":return e=n.data,e===W0&&em?null:e;default:return null}}function s_(e,n){if(Pi)return e==="compositionend"||!Uc&&tm(e,n)?(e=$0(),Ll=Mc=vr=null,Pi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return J0&&n.locale!=="ko"?null:n.data;default:return null}}var u_={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 rm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!u_[e.type]:n==="textarea"}function im(e,n,o,l){Ii?$i?$i.push(l):$i=[l]:Ii=l,n=Ms(n,"onChange"),0<n.length&&(o=new Vl("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var ta=null,na=null;function c_(e){Vg(e,0)}function Gl(e){var n=gr(e);if(Bl(n))return e}function om(e,n){if(e==="change")return n}var am=!1;if(In){var Hc;if(In){var Lc="oninput"in document;if(!Lc){var lm=document.createElement("div");lm.setAttribute("oninput","return;"),Lc=typeof lm.oninput=="function"}Hc=Lc}else Hc=!1;am=Hc&&(!document.documentMode||9<document.documentMode)}function sm(){ta&&(ta.detachEvent("onpropertychange",um),na=ta=null)}function um(e){if(e.propertyName==="value"&&Gl(na)){var n=[];im(n,na,e,Nc(e)),I0(c_,n)}}function f_(e,n,o){e==="focusin"?(sm(),ta=n,na=o,ta.attachEvent("onpropertychange",um)):e==="focusout"&&sm()}function d_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gl(na)}function h_(e,n){if(e==="click")return Gl(n)}function m_(e,n){if(e==="input"||e==="change")return Gl(n)}function p_(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Vt=typeof Object.is=="function"?Object.is:p_;function ra(e,n){if(Vt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var c=o[l];if(!wt.call(n,c)||!Vt(e[c],n[c]))return!1}return!0}function cm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fm(e,n){var o=cm(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=cm(o)}}function dm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?dm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function hm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ri(e.document);n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=ri(e.document)}return n}function jc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var g_=In&&"documentMode"in document&&11>=document.documentMode,Zi=null,Fc=null,ia=null,Vc=!1;function mm(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Vc||Zi==null||Zi!==ri(l)||(l=Zi,"selectionStart"in l&&jc(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ia&&ra(ia,l)||(ia=l,l=Ms(Fc,"onSelect"),0<l.length&&(n=new Vl("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=Zi)))}function ai(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Qi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},kc={},pm={};In&&(pm=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function li(e){if(kc[e])return kc[e];if(!Qi[e])return e;var n=Qi[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in pm)return kc[e]=n[o];return e}var gm=li("animationend"),ym=li("animationiteration"),xm=li("animationstart"),y_=li("transitionrun"),x_=li("transitionstart"),v_=li("transitioncancel"),vm=li("transitionend"),bm=new Map,Gc="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(" ");Gc.push("scrollEnd");function sn(e,n){bm.set(e,n),qn(n,[e])}var ql=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Qt=[],Ki=0,qc=0;function Yl(){for(var e=Ki,n=qc=Ki=0;n<e;){var o=Qt[n];Qt[n++]=null;var l=Qt[n];Qt[n++]=null;var c=Qt[n];Qt[n++]=null;var d=Qt[n];if(Qt[n++]=null,l!==null&&c!==null){var v=l.pending;v===null?c.next=c:(c.next=v.next,v.next=c),l.pending=c}d!==0&&Em(o,c,d)}}function Xl(e,n,o,l){Qt[Ki++]=e,Qt[Ki++]=n,Qt[Ki++]=o,Qt[Ki++]=l,qc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Yc(e,n,o,l){return Xl(e,n,o,l),Il(e)}function si(e,n){return Xl(e,null,null,n),Il(e)}function Em(e,n,o){e.lanes|=o;var l=e.alternate;l!==null&&(l.lanes|=o);for(var c=!1,d=e.return;d!==null;)d.childLanes|=o,l=d.alternate,l!==null&&(l.childLanes|=o),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&n!==null&&(c=31-Nt(o),e=d.hiddenUpdates,l=e[c],l===null?e[c]=[n]:l.push(n),n.lane=o|536870912),d):null}function Il(e){if(50<Aa)throw Aa=0,ed=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ji={};function b_(e,n,o,l){this.tag=e,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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,n,o,l){return new b_(e,n,o,l)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $n(e,n){var o=e.alternate;return o===null?(o=kt(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&65011712,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function Sm(e,n){e.flags&=65011714;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,n=o.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function $l(e,n,o,l,c,d){var v=0;if(l=e,typeof e=="function")Xc(e)&&(v=1);else if(typeof e=="string")v=T2(e,o,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=kt(31,o,n,c),e.elementType=Y,e.lanes=d,e;case S:return ui(o.children,c,d,n);case N:v=8,c|=24;break;case w:return e=kt(12,o,n,c|2),e.elementType=w,e.lanes=d,e;case D:return e=kt(13,o,n,c),e.elementType=D,e.lanes=d,e;case z:return e=kt(19,o,n,c),e.elementType=z,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:v=10;break e;case O:v=9;break e;case C:v=11;break e;case U:v=14;break e;case V:v=16,l=null;break e}v=29,o=Error(a(130,e===null?"null":typeof e,"")),l=null}return n=kt(v,o,n,c),n.elementType=e,n.type=l,n.lanes=d,n}function ui(e,n,o,l){return e=kt(7,e,l,n),e.lanes=o,e}function Ic(e,n,o){return e=kt(6,e,null,n),e.lanes=o,e}function _m(e){var n=kt(18,null,null,0);return n.stateNode=e,n}function $c(e,n,o){return n=kt(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var wm=new WeakMap;function Kt(e,n){if(typeof e=="object"&&e!==null){var o=wm.get(e);return o!==void 0?o:(n={value:e,source:n,stack:Ie(n)},wm.set(e,n),n)}return{value:e,source:n,stack:Ie(n)}}var Wi=[],eo=0,Pl=null,oa=0,Jt=[],Wt=0,br=null,wn=1,Tn="";function Pn(e,n){Wi[eo++]=oa,Wi[eo++]=Pl,Pl=e,oa=n}function Tm(e,n,o){Jt[Wt++]=wn,Jt[Wt++]=Tn,Jt[Wt++]=br,br=e;var l=wn;e=Tn;var c=32-Nt(l)-1;l&=~(1<<c),o+=1;var d=32-Nt(n)+c;if(30<d){var v=c-c%5;d=(l&(1<<v)-1).toString(32),l>>=v,c-=v,wn=1<<32-Nt(n)+c|o<<c|l,Tn=d+e}else wn=1<<d|o<<c|l,Tn=e}function Pc(e){e.return!==null&&(Pn(e,1),Tm(e,1,0))}function Zc(e){for(;e===Pl;)Pl=Wi[--eo],Wi[eo]=null,oa=Wi[--eo],Wi[eo]=null;for(;e===br;)br=Jt[--Wt],Jt[Wt]=null,Tn=Jt[--Wt],Jt[Wt]=null,wn=Jt[--Wt],Jt[Wt]=null}function Am(e,n){Jt[Wt++]=wn,Jt[Wt++]=Tn,Jt[Wt++]=br,wn=n.id,Tn=n.overflow,br=e}var yt=null,Pe=null,ze=!1,Er=null,en=!1,Qc=Error(a(519));function Sr(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw aa(Kt(n,e)),Qc}function Nm(e){var n=e.stateNode,o=e.type,l=e.memoizedProps;switch(n[ht]=e,n[Et]=l,o){case"dialog":Re("cancel",n),Re("close",n);break;case"iframe":case"object":case"embed":Re("load",n);break;case"video":case"audio":for(o=0;o<Ca.length;o++)Re(Ca[o],n);break;case"source":Re("error",n);break;case"img":case"image":case"link":Re("error",n),Re("load",n);break;case"details":Re("toggle",n);break;case"input":Re("invalid",n),Ul(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Re("invalid",n);break;case"textarea":Re("invalid",n),G0(n,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||n.textContent===""+o||l.suppressHydrationWarning===!0||Yg(n.textContent,o)?(l.popover!=null&&(Re("beforetoggle",n),Re("toggle",n)),l.onScroll!=null&&Re("scroll",n),l.onScrollEnd!=null&&Re("scrollend",n),l.onClick!=null&&(n.onclick=Xn),n=!0):n=!1,n||Sr(e,!0)}function Cm(e){for(yt=e.return;yt;)switch(yt.tag){case 5:case 31:case 13:en=!1;return;case 27:case 3:en=!0;return;default:yt=yt.return}}function to(e){if(e!==yt)return!1;if(!ze)return Cm(e),ze=!0,!1;var n=e.tag,o;if((o=n!==3&&n!==27)&&((o=n===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||pd(e.type,e.memoizedProps)),o=!o),o&&Pe&&Sr(e),Cm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Pe=Wg(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Pe=Wg(e)}else n===27?(n=Pe,Hr(e.type)?(e=bd,bd=null,Pe=e):Pe=n):Pe=yt?nn(e.stateNode.nextSibling):null;return!0}function ci(){Pe=yt=null,ze=!1}function Kc(){var e=Er;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),Er=null),e}function aa(e){Er===null?Er=[e]:Er.push(e)}var Jc=M(null),fi=null,Zn=null;function _r(e,n,o){J(Jc,n._currentValue),n._currentValue=o}function Qn(e){e._currentValue=Jc.current,F(Jc)}function Wc(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function ef(e,n,o,l){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var v=c.child;d=d.firstContext;e:for(;d!==null;){var A=d;d=c;for(var H=0;H<n.length;H++)if(A.context===n[H]){d.lanes|=o,A=d.alternate,A!==null&&(A.lanes|=o),Wc(d.return,o,e),l||(v=null);break e}d=A.next}}else if(c.tag===18){if(v=c.return,v===null)throw Error(a(341));v.lanes|=o,d=v.alternate,d!==null&&(d.lanes|=o),Wc(v,o,e),v=null}else v=c.child;if(v!==null)v.return=c;else for(v=c;v!==null;){if(v===e){v=null;break}if(c=v.sibling,c!==null){c.return=v.return,v=c;break}v=v.return}c=v}}function no(e,n,o,l){e=null;for(var c=n,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var v=c.alternate;if(v===null)throw Error(a(387));if(v=v.memoizedProps,v!==null){var A=c.type;Vt(c.pendingProps.value,v.value)||(e!==null?e.push(A):e=[A])}}else if(c===fe.current){if(v=c.alternate,v===null)throw Error(a(387));v.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(za):e=[za])}c=c.return}e!==null&&ef(n,e,o,l),n.flags|=262144}function Zl(e){for(e=e.firstContext;e!==null;){if(!Vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function di(e){fi=e,Zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xt(e){return Rm(fi,e)}function Ql(e,n){return fi===null&&di(e),Rm(e,n)}function Rm(e,n){var o=n._currentValue;if(n={context:n,memoizedValue:o,next:null},Zn===null){if(e===null)throw Error(a(308));Zn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Zn=Zn.next=n;return o}var E_=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(o,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(o){return o()})}},S_=t.unstable_scheduleCallback,__=t.unstable_NormalPriority,at={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new E_,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&S_(__,function(){e.controller.abort()})}var sa=null,nf=0,ro=0,io=null;function w_(e,n){if(sa===null){var o=sa=[];nf=0,ro=ad(),io={status:"pending",value:void 0,then:function(l){o.push(l)}}}return nf++,n.then(Mm,Mm),n}function Mm(){if(--nf===0&&sa!==null){io!==null&&(io.status="fulfilled");var e=sa;sa=null,ro=0,io=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function T_(e,n){var o=[],l={status:"pending",value:null,reason:null,then:function(c){o.push(c)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var c=0;c<o.length;c++)(0,o[c])(n)},function(c){for(l.status="rejected",l.reason=c,c=0;c<o.length;c++)(0,o[c])(void 0)}),l}var Dm=R.S;R.S=function(e,n){mg=$e(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&w_(e,n),Dm!==null&&Dm(e,n)};var hi=M(null);function rf(){var e=hi.current;return e!==null?e:Xe.pooledCache}function Kl(e,n){n===null?J(hi,hi.current):J(hi,n.pool)}function Om(){var e=rf();return e===null?null:{parent:at._currentValue,pool:e}}var oo=Error(a(460)),of=Error(a(474)),Jl=Error(a(542)),Wl={then:function(){}};function zm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bm(e,n,o){switch(o=e[o],o===void 0?e.push(n):o!==n&&(n.then(Xn,Xn),n=o),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Hm(e),e;default:if(typeof n.status=="string")n.then(Xn,Xn);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(l){if(n.status==="pending"){var c=n;c.status="fulfilled",c.value=l}},function(l){if(n.status==="pending"){var c=n;c.status="rejected",c.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Hm(e),e}throw pi=n,oo}}function mi(e){try{var n=e._init;return n(e._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(pi=o,oo):o}}var pi=null;function Um(){if(pi===null)throw Error(a(459));var e=pi;return pi=null,e}function Hm(e){if(e===oo||e===Jl)throw Error(a(483))}var ao=null,ua=0;function es(e){var n=ua;return ua+=1,ao===null&&(ao=[]),Bm(ao,e,n)}function ca(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ts(e,n){throw n.$$typeof===x?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Lm(e){function n(I,G){if(e){var Z=I.deletions;Z===null?(I.deletions=[G],I.flags|=16):Z.push(G)}}function o(I,G){if(!e)return null;for(;G!==null;)n(I,G),G=G.sibling;return null}function l(I){for(var G=new Map;I!==null;)I.key!==null?G.set(I.key,I):G.set(I.index,I),I=I.sibling;return G}function c(I,G){return I=$n(I,G),I.index=0,I.sibling=null,I}function d(I,G,Z){return I.index=Z,e?(Z=I.alternate,Z!==null?(Z=Z.index,Z<G?(I.flags|=67108866,G):Z):(I.flags|=67108866,G)):(I.flags|=1048576,G)}function v(I){return e&&I.alternate===null&&(I.flags|=67108866),I}function A(I,G,Z,oe){return G===null||G.tag!==6?(G=Ic(Z,I.mode,oe),G.return=I,G):(G=c(G,Z),G.return=I,G)}function H(I,G,Z,oe){var be=Z.type;return be===S?ie(I,G,Z.props.children,oe,Z.key):G!==null&&(G.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===V&&mi(be)===G.type)?(G=c(G,Z.props),ca(G,Z),G.return=I,G):(G=$l(Z.type,Z.key,Z.props,null,I.mode,oe),ca(G,Z),G.return=I,G)}function Q(I,G,Z,oe){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=$c(Z,I.mode,oe),G.return=I,G):(G=c(G,Z.children||[]),G.return=I,G)}function ie(I,G,Z,oe,be){return G===null||G.tag!==7?(G=ui(Z,I.mode,oe,be),G.return=I,G):(G=c(G,Z),G.return=I,G)}function le(I,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Ic(""+G,I.mode,Z),G.return=I,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return Z=$l(G.type,G.key,G.props,null,I.mode,Z),ca(Z,G),Z.return=I,Z;case E:return G=$c(G,I.mode,Z),G.return=I,G;case V:return G=mi(G),le(I,G,Z)}if(q(G)||P(G))return G=ui(G,I.mode,Z,null),G.return=I,G;if(typeof G.then=="function")return le(I,es(G),Z);if(G.$$typeof===_)return le(I,Ql(I,G),Z);ts(I,G)}return null}function K(I,G,Z,oe){var be=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return be!==null?null:A(I,G,""+Z,oe);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===be?H(I,G,Z,oe):null;case E:return Z.key===be?Q(I,G,Z,oe):null;case V:return Z=mi(Z),K(I,G,Z,oe)}if(q(Z)||P(Z))return be!==null?null:ie(I,G,Z,oe,null);if(typeof Z.then=="function")return K(I,G,es(Z),oe);if(Z.$$typeof===_)return K(I,G,Ql(I,Z),oe);ts(I,Z)}return null}function W(I,G,Z,oe,be){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return I=I.get(Z)||null,A(G,I,""+oe,be);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return I=I.get(oe.key===null?Z:oe.key)||null,H(G,I,oe,be);case E:return I=I.get(oe.key===null?Z:oe.key)||null,Q(G,I,oe,be);case V:return oe=mi(oe),W(I,G,Z,oe,be)}if(q(oe)||P(oe))return I=I.get(Z)||null,ie(G,I,oe,be,null);if(typeof oe.then=="function")return W(I,G,Z,es(oe),be);if(oe.$$typeof===_)return W(I,G,Z,Ql(G,oe),be);ts(G,oe)}return null}function pe(I,G,Z,oe){for(var be=null,He=null,ye=G,Ne=G=0,De=null;ye!==null&&Ne<Z.length;Ne++){ye.index>Ne?(De=ye,ye=null):De=ye.sibling;var Le=K(I,ye,Z[Ne],oe);if(Le===null){ye===null&&(ye=De);break}e&&ye&&Le.alternate===null&&n(I,ye),G=d(Le,G,Ne),He===null?be=Le:He.sibling=Le,He=Le,ye=De}if(Ne===Z.length)return o(I,ye),ze&&Pn(I,Ne),be;if(ye===null){for(;Ne<Z.length;Ne++)ye=le(I,Z[Ne],oe),ye!==null&&(G=d(ye,G,Ne),He===null?be=ye:He.sibling=ye,He=ye);return ze&&Pn(I,Ne),be}for(ye=l(ye);Ne<Z.length;Ne++)De=W(ye,I,Ne,Z[Ne],oe),De!==null&&(e&&De.alternate!==null&&ye.delete(De.key===null?Ne:De.key),G=d(De,G,Ne),He===null?be=De:He.sibling=De,He=De);return e&&ye.forEach(function(kr){return n(I,kr)}),ze&&Pn(I,Ne),be}function Ee(I,G,Z,oe){if(Z==null)throw Error(a(151));for(var be=null,He=null,ye=G,Ne=G=0,De=null,Le=Z.next();ye!==null&&!Le.done;Ne++,Le=Z.next()){ye.index>Ne?(De=ye,ye=null):De=ye.sibling;var kr=K(I,ye,Le.value,oe);if(kr===null){ye===null&&(ye=De);break}e&&ye&&kr.alternate===null&&n(I,ye),G=d(kr,G,Ne),He===null?be=kr:He.sibling=kr,He=kr,ye=De}if(Le.done)return o(I,ye),ze&&Pn(I,Ne),be;if(ye===null){for(;!Le.done;Ne++,Le=Z.next())Le=le(I,Le.value,oe),Le!==null&&(G=d(Le,G,Ne),He===null?be=Le:He.sibling=Le,He=Le);return ze&&Pn(I,Ne),be}for(ye=l(ye);!Le.done;Ne++,Le=Z.next())Le=W(ye,I,Ne,Le.value,oe),Le!==null&&(e&&Le.alternate!==null&&ye.delete(Le.key===null?Ne:Le.key),G=d(Le,G,Ne),He===null?be=Le:He.sibling=Le,He=Le);return e&&ye.forEach(function(H2){return n(I,H2)}),ze&&Pn(I,Ne),be}function Ye(I,G,Z,oe){if(typeof Z=="object"&&Z!==null&&Z.type===S&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var be=Z.key;G!==null;){if(G.key===be){if(be=Z.type,be===S){if(G.tag===7){o(I,G.sibling),oe=c(G,Z.props.children),oe.return=I,I=oe;break e}}else if(G.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===V&&mi(be)===G.type){o(I,G.sibling),oe=c(G,Z.props),ca(oe,Z),oe.return=I,I=oe;break e}o(I,G);break}else n(I,G);G=G.sibling}Z.type===S?(oe=ui(Z.props.children,I.mode,oe,Z.key),oe.return=I,I=oe):(oe=$l(Z.type,Z.key,Z.props,null,I.mode,oe),ca(oe,Z),oe.return=I,I=oe)}return v(I);case E:e:{for(be=Z.key;G!==null;){if(G.key===be)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){o(I,G.sibling),oe=c(G,Z.children||[]),oe.return=I,I=oe;break e}else{o(I,G);break}else n(I,G);G=G.sibling}oe=$c(Z,I.mode,oe),oe.return=I,I=oe}return v(I);case V:return Z=mi(Z),Ye(I,G,Z,oe)}if(q(Z))return pe(I,G,Z,oe);if(P(Z)){if(be=P(Z),typeof be!="function")throw Error(a(150));return Z=be.call(Z),Ee(I,G,Z,oe)}if(typeof Z.then=="function")return Ye(I,G,es(Z),oe);if(Z.$$typeof===_)return Ye(I,G,Ql(I,Z),oe);ts(I,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(o(I,G.sibling),oe=c(G,Z),oe.return=I,I=oe):(o(I,G),oe=Ic(Z,I.mode,oe),oe.return=I,I=oe),v(I)):o(I,G)}return function(I,G,Z,oe){try{ua=0;var be=Ye(I,G,Z,oe);return ao=null,be}catch(ye){if(ye===oo||ye===Jl)throw ye;var He=kt(29,ye,null,I.mode);return He.lanes=oe,He.return=I,He}}}var gi=Lm(!0),jm=Lm(!1),wr=!1;function af(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Tr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ar(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Fe&2)!==0){var c=l.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),l.pending=n,n=Il(e),Em(e,null,o),n}return Xl(e,l,n,o),Il(e)}function fa(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,wl(e,o)}}function sf(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var c=null,d=null;if(o=o.firstBaseUpdate,o!==null){do{var v={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};d===null?c=d=v:d=d.next=v,o=o.next}while(o!==null);d===null?c=d=n:d=d.next=n}else c=d=n;o={baseState:l.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}var uf=!1;function da(){if(uf){var e=io;if(e!==null)throw e}}function ha(e,n,o,l){uf=!1;var c=e.updateQueue;wr=!1;var d=c.firstBaseUpdate,v=c.lastBaseUpdate,A=c.shared.pending;if(A!==null){c.shared.pending=null;var H=A,Q=H.next;H.next=null,v===null?d=Q:v.next=Q,v=H;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,A=ie.lastBaseUpdate,A!==v&&(A===null?ie.firstBaseUpdate=Q:A.next=Q,ie.lastBaseUpdate=H))}if(d!==null){var le=c.baseState;v=0,ie=Q=H=null,A=d;do{var K=A.lane&-536870913,W=K!==A.lane;if(W?(Me&K)===K:(l&K)===K){K!==0&&K===ro&&(uf=!0),ie!==null&&(ie=ie.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var pe=e,Ee=A;K=n;var Ye=o;switch(Ee.tag){case 1:if(pe=Ee.payload,typeof pe=="function"){le=pe.call(Ye,le,K);break e}le=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ee.payload,K=typeof pe=="function"?pe.call(Ye,le,K):pe,K==null)break e;le=g({},le,K);break e;case 2:wr=!0}}K=A.callback,K!==null&&(e.flags|=64,W&&(e.flags|=8192),W=c.callbacks,W===null?c.callbacks=[K]:W.push(K))}else W={lane:K,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ie===null?(Q=ie=W,H=le):ie=ie.next=W,v|=K;if(A=A.next,A===null){if(A=c.shared.pending,A===null)break;W=A,A=W.next,W.next=null,c.lastBaseUpdate=W,c.shared.pending=null}}while(!0);ie===null&&(H=le),c.baseState=H,c.firstBaseUpdate=Q,c.lastBaseUpdate=ie,d===null&&(c.shared.lanes=0),Dr|=v,e.lanes=v,e.memoizedState=le}}function Fm(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function Vm(e,n){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)Fm(o[e],n)}var lo=M(null),ns=M(0);function km(e,n){e=or,J(ns,e),J(lo,n),or=e|n.baseLanes}function cf(){J(ns,or),J(lo,lo.current)}function ff(){or=ns.current,F(lo),F(ns)}var Gt=M(null),tn=null;function Nr(e){var n=e.alternate;J(rt,rt.current&1),J(Gt,e),tn===null&&(n===null||lo.current!==null||n.memoizedState!==null)&&(tn=e)}function df(e){J(rt,rt.current),J(Gt,e),tn===null&&(tn=e)}function Gm(e){e.tag===22?(J(rt,rt.current),J(Gt,e),tn===null&&(tn=e)):Cr()}function Cr(){J(rt,rt.current),J(Gt,Gt.current)}function qt(e){F(Gt),tn===e&&(tn=null),F(rt)}var rt=M(0);function rs(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||xd(o)||vd(o)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Kn=0,Te=null,Ge=null,lt=null,is=!1,so=!1,yi=!1,os=0,ma=0,uo=null,A_=0;function tt(){throw Error(a(321))}function hf(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!Vt(e[o],n[o]))return!1;return!0}function mf(e,n,o,l,c,d){return Kn=d,Te=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,R.H=e===null||e.memoizedState===null?Tp:Rf,yi=!1,d=o(l,c),yi=!1,so&&(d=Ym(n,o,l,c)),qm(e),d}function qm(e){R.H=ya;var n=Ge!==null&&Ge.next!==null;if(Kn=0,lt=Ge=Te=null,is=!1,ma=0,uo=null,n)throw Error(a(300));e===null||st||(e=e.dependencies,e!==null&&Zl(e)&&(st=!0))}function Ym(e,n,o,l){Te=e;var c=0;do{if(so&&(uo=null),ma=0,so=!1,25<=c)throw Error(a(301));if(c+=1,lt=Ge=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}R.H=Ap,d=n(o,l)}while(so);return d}function N_(){var e=R.H,n=e.useState()[0];return n=typeof n.then=="function"?pa(n):n,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Te.flags|=1024),n}function pf(){var e=os!==0;return os=0,e}function gf(e,n,o){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~o}function yf(e){if(is){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}is=!1}Kn=0,lt=Ge=Te=null,so=!1,ma=os=0,uo=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Te.memoizedState=lt=e:lt=lt.next=e,lt}function it(){if(Ge===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var n=lt===null?Te.memoizedState:lt.next;if(n!==null)lt=n,Ge=e;else{if(e===null)throw Te.alternate===null?Error(a(467)):Error(a(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},lt===null?Te.memoizedState=lt=e:lt=lt.next=e}return lt}function as(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pa(e){var n=ma;return ma+=1,uo===null&&(uo=[]),e=Bm(uo,e,n),n=Te,(lt===null?n.memoizedState:lt.next)===null&&(n=n.alternate,R.H=n===null||n.memoizedState===null?Tp:Rf),e}function ls(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pa(e);if(e.$$typeof===_)return xt(e)}throw Error(a(438,String(e)))}function xf(e){var n=null,o=Te.updateQueue;if(o!==null&&(n=o.memoCache),n==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(c){return c.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),o===null&&(o=as(),Te.updateQueue=o),o.memoCache=n,o=n.data[n.index],o===void 0)for(o=n.data[n.index]=Array(e),l=0;l<e;l++)o[l]=ae;return n.index++,o}function Jn(e,n){return typeof n=="function"?n(e):n}function ss(e){var n=it();return vf(n,Ge,e)}function vf(e,n,o){var l=e.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=o;var c=e.baseQueue,d=l.pending;if(d!==null){if(c!==null){var v=c.next;c.next=d.next,d.next=v}n.baseQueue=c=d,l.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{n=c.next;var A=v=null,H=null,Q=n,ie=!1;do{var le=Q.lane&-536870913;if(le!==Q.lane?(Me&le)===le:(Kn&le)===le){var K=Q.revertLane;if(K===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),le===ro&&(ie=!0);else if((Kn&K)===K){Q=Q.next,K===ro&&(ie=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},H===null?(A=H=le,v=d):H=H.next=le,Te.lanes|=K,Dr|=K;le=Q.action,yi&&o(d,le),d=Q.hasEagerState?Q.eagerState:o(d,le)}else K={lane:le,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},H===null?(A=H=K,v=d):H=H.next=K,Te.lanes|=le,Dr|=le;Q=Q.next}while(Q!==null&&Q!==n);if(H===null?v=d:H.next=A,!Vt(d,e.memoizedState)&&(st=!0,ie&&(o=io,o!==null)))throw o;e.memoizedState=d,e.baseState=v,e.baseQueue=H,l.lastRenderedState=d}return c===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function bf(e){var n=it(),o=n.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var l=o.dispatch,c=o.pending,d=n.memoizedState;if(c!==null){o.pending=null;var v=c=c.next;do d=e(d,v.action),v=v.next;while(v!==c);Vt(d,n.memoizedState)||(st=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),o.lastRenderedState=d}return[d,l]}function Xm(e,n,o){var l=Te,c=it(),d=ze;if(d){if(o===void 0)throw Error(a(407));o=o()}else o=n();var v=!Vt((Ge||c).memoizedState,o);if(v&&(c.memoizedState=o,st=!0),c=c.queue,_f(Pm.bind(null,l,c,e),[e]),c.getSnapshot!==n||v||lt!==null&&lt.memoizedState.tag&1){if(l.flags|=2048,co(9,{destroy:void 0},$m.bind(null,l,c,o,n),null),Xe===null)throw Error(a(349));d||(Kn&127)!==0||Im(l,n,o)}return o}function Im(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=Te.updateQueue,n===null?(n=as(),Te.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function $m(e,n,o,l){n.value=o,n.getSnapshot=l,Zm(n)&&Qm(e)}function Pm(e,n,o){return o(function(){Zm(n)&&Qm(e)})}function Zm(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!Vt(e,o)}catch{return!0}}function Qm(e){var n=si(e,2);n!==null&&jt(n,e,2)}function Ef(e){var n=Ct();if(typeof e=="function"){var o=e;if(e=o(),yi){Sn(!0);try{o()}finally{Sn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jn,lastRenderedState:e},n}function Km(e,n,o,l){return e.baseState=o,vf(e,Ge,typeof l=="function"?l:Jn)}function C_(e,n,o,l,c){if(fs(e))throw Error(a(485));if(e=n.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};R.T!==null?o(!0):d.isTransition=!1,l(d),o=n.pending,o===null?(d.next=n.pending=d,Jm(n,d)):(d.next=o.next,n.pending=o.next=d)}}function Jm(e,n){var o=n.action,l=n.payload,c=e.state;if(n.isTransition){var d=R.T,v={};R.T=v;try{var A=o(c,l),H=R.S;H!==null&&H(v,A),Wm(e,n,A)}catch(Q){Sf(e,n,Q)}finally{d!==null&&v.types!==null&&(d.types=v.types),R.T=d}}else try{d=o(c,l),Wm(e,n,d)}catch(Q){Sf(e,n,Q)}}function Wm(e,n,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){ep(e,n,l)},function(l){return Sf(e,n,l)}):ep(e,n,o)}function ep(e,n,o){n.status="fulfilled",n.value=o,tp(n),e.state=o,n=e.pending,n!==null&&(o=n.next,o===n?e.pending=null:(o=o.next,n.next=o,Jm(e,o)))}function Sf(e,n,o){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=o,tp(n),n=n.next;while(n!==l)}e.action=null}function tp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function np(e,n){return n}function rp(e,n){if(ze){var o=Xe.formState;if(o!==null){e:{var l=Te;if(ze){if(Pe){t:{for(var c=Pe,d=en;c.nodeType!==8;){if(!d){c=null;break t}if(c=nn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){Pe=nn(c.nextSibling),l=c.data==="F!";break e}}Sr(l)}l=!1}l&&(n=o[0])}}return o=Ct(),o.memoizedState=o.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:np,lastRenderedState:n},o.queue=l,o=Sp.bind(null,Te,l),l.dispatch=o,l=Ef(!1),d=Cf.bind(null,Te,!1,l.queue),l=Ct(),c={state:n,dispatch:null,action:e,pending:null},l.queue=c,o=C_.bind(null,Te,c,d,o),c.dispatch=o,l.memoizedState=e,[n,o,!1]}function ip(e){var n=it();return op(n,Ge,e)}function op(e,n,o){if(n=vf(e,n,np)[0],e=ss(Jn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=pa(n)}catch(v){throw v===oo?Jl:v}else l=n;n=it();var c=n.queue,d=c.dispatch;return o!==n.memoizedState&&(Te.flags|=2048,co(9,{destroy:void 0},R_.bind(null,c,o),null)),[l,d,e]}function R_(e,n){e.action=n}function ap(e){var n=it(),o=Ge;if(o!==null)return op(n,o,e);it(),n=n.memoizedState,o=it();var l=o.queue.dispatch;return o.memoizedState=e,[n,l,!1]}function co(e,n,o,l){return e={tag:e,create:o,deps:l,inst:n,next:null},n=Te.updateQueue,n===null&&(n=as(),Te.updateQueue=n),o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e),e}function lp(){return it().memoizedState}function us(e,n,o,l){var c=Ct();Te.flags|=e,c.memoizedState=co(1|n,{destroy:void 0},o,l===void 0?null:l)}function cs(e,n,o,l){var c=it();l=l===void 0?null:l;var d=c.memoizedState.inst;Ge!==null&&l!==null&&hf(l,Ge.memoizedState.deps)?c.memoizedState=co(n,d,o,l):(Te.flags|=e,c.memoizedState=co(1|n,d,o,l))}function sp(e,n){us(8390656,8,e,n)}function _f(e,n){cs(2048,8,e,n)}function M_(e){Te.flags|=4;var n=Te.updateQueue;if(n===null)n=as(),Te.updateQueue=n,n.events=[e];else{var o=n.events;o===null?n.events=[e]:o.push(e)}}function up(e){var n=it().memoizedState;return M_({ref:n,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function cp(e,n){return cs(4,2,e,n)}function fp(e,n){return cs(4,4,e,n)}function dp(e,n){if(typeof n=="function"){e=e();var o=n(e);return function(){typeof o=="function"?o():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function hp(e,n,o){o=o!=null?o.concat([e]):null,cs(4,4,dp.bind(null,n,e),o)}function wf(){}function mp(e,n){var o=it();n=n===void 0?null:n;var l=o.memoizedState;return n!==null&&hf(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function pp(e,n){var o=it();n=n===void 0?null:n;var l=o.memoizedState;if(n!==null&&hf(n,l[1]))return l[0];if(l=e(),yi){Sn(!0);try{e()}finally{Sn(!1)}}return o.memoizedState=[l,n],l}function Tf(e,n,o){return o===void 0||(Kn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=n:(e.memoizedState=o,e=gg(),Te.lanes|=e,Dr|=e,o)}function gp(e,n,o,l){return Vt(o,n)?o:lo.current!==null?(e=Tf(e,o,l),Vt(e,n)||(st=!0),e):(Kn&42)===0||(Kn&1073741824)!==0&&(Me&261930)===0?(st=!0,e.memoizedState=o):(e=gg(),Te.lanes|=e,Dr|=e,n)}function yp(e,n,o,l,c){var d=L.p;L.p=d!==0&&8>d?d:8;var v=R.T,A={};R.T=A,Cf(e,!1,n,o);try{var H=c(),Q=R.S;if(Q!==null&&Q(A,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=T_(H,l);ga(e,n,ie,It(e))}else ga(e,n,l,It(e))}catch(le){ga(e,n,{then:function(){},status:"rejected",reason:le},It())}finally{L.p=d,v!==null&&A.types!==null&&(v.types=A.types),R.T=v}}function D_(){}function Af(e,n,o,l){if(e.tag!==5)throw Error(a(476));var c=xp(e).queue;yp(e,c,n,k,o===null?D_:function(){return vp(e),o(l)})}function xp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:k,baseState:k,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jn,lastRenderedState:k},next:null};var o={};return n.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jn,lastRenderedState:o},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function vp(e){var n=xp(e);n.next===null&&(n=e.alternate.memoizedState),ga(e,n.next.queue,{},It())}function Nf(){return xt(za)}function bp(){return it().memoizedState}function Ep(){return it().memoizedState}function O_(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var o=It();e=Tr(o);var l=Ar(n,e,o);l!==null&&(jt(l,n,o),fa(l,n,o)),n={cache:tf()},e.payload=n;return}n=n.return}}function z_(e,n,o){var l=It();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},fs(e)?_p(n,o):(o=Yc(e,n,o,l),o!==null&&(jt(o,e,l),wp(o,n,l)))}function Sp(e,n,o){var l=It();ga(e,n,o,l)}function ga(e,n,o,l){var c={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(fs(e))_p(n,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var v=n.lastRenderedState,A=d(v,o);if(c.hasEagerState=!0,c.eagerState=A,Vt(A,v))return Xl(e,n,c,0),Xe===null&&Yl(),!1}catch{}if(o=Yc(e,n,c,l),o!==null)return jt(o,e,l),wp(o,n,l),!0}return!1}function Cf(e,n,o,l){if(l={lane:2,revertLane:ad(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},fs(e)){if(n)throw Error(a(479))}else n=Yc(e,o,l,2),n!==null&&jt(n,e,2)}function fs(e){var n=e.alternate;return e===Te||n!==null&&n===Te}function _p(e,n){so=is=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function wp(e,n,o){if((o&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,wl(e,o)}}var ya={readContext:xt,use:ls,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ya.useEffectEvent=tt;var Tp={readContext:xt,use:ls,useCallback:function(e,n){return Ct().memoizedState=[e,n===void 0?null:n],e},useContext:xt,useEffect:sp,useImperativeHandle:function(e,n,o){o=o!=null?o.concat([e]):null,us(4194308,4,dp.bind(null,n,e),o)},useLayoutEffect:function(e,n){return us(4194308,4,e,n)},useInsertionEffect:function(e,n){us(4,2,e,n)},useMemo:function(e,n){var o=Ct();n=n===void 0?null:n;var l=e();if(yi){Sn(!0);try{e()}finally{Sn(!1)}}return o.memoizedState=[l,n],l},useReducer:function(e,n,o){var l=Ct();if(o!==void 0){var c=o(n);if(yi){Sn(!0);try{o(n)}finally{Sn(!1)}}}else c=n;return l.memoizedState=l.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},l.queue=e,e=e.dispatch=z_.bind(null,Te,e),[l.memoizedState,e]},useRef:function(e){var n=Ct();return e={current:e},n.memoizedState=e},useState:function(e){e=Ef(e);var n=e.queue,o=Sp.bind(null,Te,n);return n.dispatch=o,[e.memoizedState,o]},useDebugValue:wf,useDeferredValue:function(e,n){var o=Ct();return Tf(o,e,n)},useTransition:function(){var e=Ef(!1);return e=yp.bind(null,Te,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,o){var l=Te,c=Ct();if(ze){if(o===void 0)throw Error(a(407));o=o()}else{if(o=n(),Xe===null)throw Error(a(349));(Me&127)!==0||Im(l,n,o)}c.memoizedState=o;var d={value:o,getSnapshot:n};return c.queue=d,sp(Pm.bind(null,l,d,e),[e]),l.flags|=2048,co(9,{destroy:void 0},$m.bind(null,l,d,o,n),null),o},useId:function(){var e=Ct(),n=Xe.identifierPrefix;if(ze){var o=Tn,l=wn;o=(l&~(1<<32-Nt(l)-1)).toString(32)+o,n="_"+n+"R_"+o,o=os++,0<o&&(n+="H"+o.toString(32)),n+="_"}else o=A_++,n="_"+n+"r_"+o.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Nf,useFormState:rp,useActionState:rp,useOptimistic:function(e){var n=Ct();n.memoizedState=n.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=o,n=Cf.bind(null,Te,!0,o),o.dispatch=n,[e,n]},useMemoCache:xf,useCacheRefresh:function(){return Ct().memoizedState=O_.bind(null,Te)},useEffectEvent:function(e){var n=Ct(),o={impl:e};return n.memoizedState=o,function(){if((Fe&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},Rf={readContext:xt,use:ls,useCallback:mp,useContext:xt,useEffect:_f,useImperativeHandle:hp,useInsertionEffect:cp,useLayoutEffect:fp,useMemo:pp,useReducer:ss,useRef:lp,useState:function(){return ss(Jn)},useDebugValue:wf,useDeferredValue:function(e,n){var o=it();return gp(o,Ge.memoizedState,e,n)},useTransition:function(){var e=ss(Jn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:pa(e),n]},useSyncExternalStore:Xm,useId:bp,useHostTransitionStatus:Nf,useFormState:ip,useActionState:ip,useOptimistic:function(e,n){var o=it();return Km(o,Ge,e,n)},useMemoCache:xf,useCacheRefresh:Ep};Rf.useEffectEvent=up;var Ap={readContext:xt,use:ls,useCallback:mp,useContext:xt,useEffect:_f,useImperativeHandle:hp,useInsertionEffect:cp,useLayoutEffect:fp,useMemo:pp,useReducer:bf,useRef:lp,useState:function(){return bf(Jn)},useDebugValue:wf,useDeferredValue:function(e,n){var o=it();return Ge===null?Tf(o,e,n):gp(o,Ge.memoizedState,e,n)},useTransition:function(){var e=bf(Jn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:pa(e),n]},useSyncExternalStore:Xm,useId:bp,useHostTransitionStatus:Nf,useFormState:ap,useActionState:ap,useOptimistic:function(e,n){var o=it();return Ge!==null?Km(o,Ge,e,n):(o.baseState=e,[e,o.queue.dispatch])},useMemoCache:xf,useCacheRefresh:Ep};Ap.useEffectEvent=up;function Mf(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:g({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Df={enqueueSetState:function(e,n,o){e=e._reactInternals;var l=It(),c=Tr(l);c.payload=n,o!=null&&(c.callback=o),n=Ar(e,c,l),n!==null&&(jt(n,e,l),fa(n,e,l))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=It(),c=Tr(l);c.tag=1,c.payload=n,o!=null&&(c.callback=o),n=Ar(e,c,l),n!==null&&(jt(n,e,l),fa(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=It(),l=Tr(o);l.tag=2,n!=null&&(l.callback=n),n=Ar(e,l,o),n!==null&&(jt(n,e,o),fa(n,e,o))}};function Np(e,n,o,l,c,d,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,v):n.prototype&&n.prototype.isPureReactComponent?!ra(o,l)||!ra(c,d):!0}function Cp(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&Df.enqueueReplaceState(n,n.state,null)}function xi(e,n){var o=n;if("ref"in n){o={};for(var l in n)l!=="ref"&&(o[l]=n[l])}if(e=e.defaultProps){o===n&&(o=g({},o));for(var c in e)o[c]===void 0&&(o[c]=e[c])}return o}function Rp(e){ql(e)}function Mp(e){console.error(e)}function Dp(e){ql(e)}function ds(e,n){try{var o=e.onUncaughtError;o(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function Op(e,n,o){try{var l=e.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Of(e,n,o){return o=Tr(o),o.tag=3,o.payload={element:null},o.callback=function(){ds(e,n)},o}function zp(e){return e=Tr(e),e.tag=3,e}function Bp(e,n,o,l){var c=o.type.getDerivedStateFromError;if(typeof c=="function"){var d=l.value;e.payload=function(){return c(d)},e.callback=function(){Op(n,o,l)}}var v=o.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){Op(n,o,l),typeof c!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var A=l.stack;this.componentDidCatch(l.value,{componentStack:A!==null?A:""})})}function B_(e,n,o,l,c){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=o.alternate,n!==null&&no(n,o,c,!0),o=Gt.current,o!==null){switch(o.tag){case 31:case 13:return tn===null?ws():o.alternate===null&&nt===0&&(nt=3),o.flags&=-257,o.flags|=65536,o.lanes=c,l===Wl?o.flags|=16384:(n=o.updateQueue,n===null?o.updateQueue=new Set([l]):n.add(l),rd(e,l,c)),!1;case 22:return o.flags|=65536,l===Wl?o.flags|=16384:(n=o.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=n):(o=n.retryQueue,o===null?n.retryQueue=new Set([l]):o.add(l)),rd(e,l,c)),!1}throw Error(a(435,o.tag))}return rd(e,l,c),ws(),!1}if(ze)return n=Gt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=c,l!==Qc&&(e=Error(a(422),{cause:l}),aa(Kt(e,o)))):(l!==Qc&&(n=Error(a(423),{cause:l}),aa(Kt(n,o))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,l=Kt(l,o),c=Of(e.stateNode,l,c),sf(e,c),nt!==4&&(nt=2)),!1;var d=Error(a(520),{cause:l});if(d=Kt(d,o),Ta===null?Ta=[d]:Ta.push(d),nt!==4&&(nt=2),n===null)return!0;l=Kt(l,o),o=n;do{switch(o.tag){case 3:return o.flags|=65536,e=c&-c,o.lanes|=e,e=Of(o.stateNode,l,e),sf(o,e),!1;case 1:if(n=o.type,d=o.stateNode,(o.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Or===null||!Or.has(d))))return o.flags|=65536,c&=-c,o.lanes|=c,c=zp(c),Bp(c,e,o,l),sf(o,c),!1}o=o.return}while(o!==null);return!1}var zf=Error(a(461)),st=!1;function vt(e,n,o,l){n.child=e===null?jm(n,null,o,l):gi(n,e.child,o,l)}function Up(e,n,o,l,c){o=o.render;var d=n.ref;if("ref"in l){var v={};for(var A in l)A!=="ref"&&(v[A]=l[A])}else v=l;return di(n),l=mf(e,n,o,v,d,c),A=pf(),e!==null&&!st?(gf(e,n,c),Wn(e,n,c)):(ze&&A&&Pc(n),n.flags|=1,vt(e,n,l,c),n.child)}function Hp(e,n,o,l,c){if(e===null){var d=o.type;return typeof d=="function"&&!Xc(d)&&d.defaultProps===void 0&&o.compare===null?(n.tag=15,n.type=d,Lp(e,n,d,l,c)):(e=$l(o.type,null,l,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!kf(e,c)){var v=d.memoizedProps;if(o=o.compare,o=o!==null?o:ra,o(v,l)&&e.ref===n.ref)return Wn(e,n,c)}return n.flags|=1,e=$n(d,l),e.ref=n.ref,e.return=n,n.child=e}function Lp(e,n,o,l,c){if(e!==null){var d=e.memoizedProps;if(ra(d,l)&&e.ref===n.ref)if(st=!1,n.pendingProps=l=d,kf(e,c))(e.flags&131072)!==0&&(st=!0);else return n.lanes=e.lanes,Wn(e,n,c)}return Bf(e,n,o,l,c)}function jp(e,n,o,l){var c=l.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|o:o,e!==null){for(l=n.child=e.child,c=0;l!==null;)c=c|l.lanes|l.childLanes,l=l.sibling;l=c&~d}else l=0,n.child=null;return Fp(e,n,d,o,l)}if((o&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Kl(n,d!==null?d.cachePool:null),d!==null?km(n,d):cf(),Gm(n);else return l=n.lanes=536870912,Fp(e,n,d!==null?d.baseLanes|o:o,o,l)}else d!==null?(Kl(n,d.cachePool),km(n,d),Cr(),n.memoizedState=null):(e!==null&&Kl(n,null),cf(),Cr());return vt(e,n,c,o),n.child}function xa(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Fp(e,n,o,l,c){var d=rf();return d=d===null?null:{parent:at._currentValue,pool:d},n.memoizedState={baseLanes:o,cachePool:d},e!==null&&Kl(n,null),cf(),Gm(n),e!==null&&no(e,n,l,!0),n.childLanes=c,null}function hs(e,n){return n=ps({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Vp(e,n,o){return gi(n,e.child,null,o),e=hs(n,n.pendingProps),e.flags|=2,qt(n),n.memoizedState=null,e}function U_(e,n,o){var l=n.pendingProps,c=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(ze){if(l.mode==="hidden")return e=hs(n,l),n.lanes=536870912,xa(null,e);if(df(n),(e=Pe)?(e=Jg(e,en),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:br!==null?{id:wn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},o=_m(e),o.return=n,n.child=o,yt=n,Pe=null)):e=null,e===null)throw Sr(n);return n.lanes=536870912,null}return hs(n,l)}var d=e.memoizedState;if(d!==null){var v=d.dehydrated;if(df(n),c)if(n.flags&256)n.flags&=-257,n=Vp(e,n,o);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(st||no(e,n,o,!1),c=(o&e.childLanes)!==0,st||c){if(l=Xe,l!==null&&(v=Tl(l,o),v!==0&&v!==d.retryLane))throw d.retryLane=v,si(e,v),jt(l,e,v),zf;ws(),n=Vp(e,n,o)}else e=d.treeContext,Pe=nn(v.nextSibling),yt=n,ze=!0,Er=null,en=!1,e!==null&&Am(n,e),n=hs(n,l),n.flags|=4096;return n}return e=$n(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ms(e,n){var o=n.ref;if(o===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(n.flags|=4194816)}}function Bf(e,n,o,l,c){return di(n),o=mf(e,n,o,l,void 0,c),l=pf(),e!==null&&!st?(gf(e,n,c),Wn(e,n,c)):(ze&&l&&Pc(n),n.flags|=1,vt(e,n,o,c),n.child)}function kp(e,n,o,l,c,d){return di(n),n.updateQueue=null,o=Ym(n,l,o,c),qm(e),l=pf(),e!==null&&!st?(gf(e,n,d),Wn(e,n,d)):(ze&&l&&Pc(n),n.flags|=1,vt(e,n,o,d),n.child)}function Gp(e,n,o,l,c){if(di(n),n.stateNode===null){var d=Ji,v=o.contextType;typeof v=="object"&&v!==null&&(d=xt(v)),d=new o(l,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Df,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=l,d.state=n.memoizedState,d.refs={},af(n),v=o.contextType,d.context=typeof v=="object"&&v!==null?xt(v):Ji,d.state=n.memoizedState,v=o.getDerivedStateFromProps,typeof v=="function"&&(Mf(n,o,v,l),d.state=n.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&Df.enqueueReplaceState(d,d.state,null),ha(n,l,d,c),da(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){d=n.stateNode;var A=n.memoizedProps,H=xi(o,A);d.props=H;var Q=d.context,ie=o.contextType;v=Ji,typeof ie=="object"&&ie!==null&&(v=xt(ie));var le=o.getDerivedStateFromProps;ie=typeof le=="function"||typeof d.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,ie||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(A||Q!==v)&&Cp(n,d,l,v),wr=!1;var K=n.memoizedState;d.state=K,ha(n,l,d,c),da(),Q=n.memoizedState,A||K!==Q||wr?(typeof le=="function"&&(Mf(n,o,le,l),Q=n.memoizedState),(H=wr||Np(n,o,H,l,K,Q,v))?(ie||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=Q),d.props=l,d.state=Q,d.context=v,l=H):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{d=n.stateNode,lf(e,n),v=n.memoizedProps,ie=xi(o,v),d.props=ie,le=n.pendingProps,K=d.context,Q=o.contextType,H=Ji,typeof Q=="object"&&Q!==null&&(H=xt(Q)),A=o.getDerivedStateFromProps,(Q=typeof A=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==le||K!==H)&&Cp(n,d,l,H),wr=!1,K=n.memoizedState,d.state=K,ha(n,l,d,c),da();var W=n.memoizedState;v!==le||K!==W||wr||e!==null&&e.dependencies!==null&&Zl(e.dependencies)?(typeof A=="function"&&(Mf(n,o,A,l),W=n.memoizedState),(ie=wr||Np(n,o,ie,l,K,W,H)||e!==null&&e.dependencies!==null&&Zl(e.dependencies))?(Q||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,W,H),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,W,H)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=W),d.props=l,d.state=W,d.context=H,l=ie):(typeof d.componentDidUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&K===e.memoizedState||(n.flags|=1024),l=!1)}return d=l,ms(e,n),l=(n.flags&128)!==0,d||l?(d=n.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&l?(n.child=gi(n,e.child,null,c),n.child=gi(n,null,o,c)):vt(e,n,o,c),n.memoizedState=d.state,e=n.child):e=Wn(e,n,c),e}function qp(e,n,o,l){return ci(),n.flags|=256,vt(e,n,o,l),n.child}var Uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hf(e){return{baseLanes:e,cachePool:Om()}}function Lf(e,n,o){return e=e!==null?e.childLanes&~o:0,n&&(e|=Xt),e}function Yp(e,n,o){var l=n.pendingProps,c=!1,d=(n.flags&128)!==0,v;if((v=d)||(v=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),v&&(c=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,e===null){if(ze){if(c?Nr(n):Cr(),(e=Pe)?(e=Jg(e,en),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:br!==null?{id:wn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},o=_m(e),o.return=n,n.child=o,yt=n,Pe=null)):e=null,e===null)throw Sr(n);return vd(e)?n.lanes=32:n.lanes=536870912,null}var A=l.children;return l=l.fallback,c?(Cr(),c=n.mode,A=ps({mode:"hidden",children:A},c),l=ui(l,c,o,null),A.return=n,l.return=n,A.sibling=l,n.child=A,l=n.child,l.memoizedState=Hf(o),l.childLanes=Lf(e,v,o),n.memoizedState=Uf,xa(null,l)):(Nr(n),jf(n,A))}var H=e.memoizedState;if(H!==null&&(A=H.dehydrated,A!==null)){if(d)n.flags&256?(Nr(n),n.flags&=-257,n=Ff(e,n,o)):n.memoizedState!==null?(Cr(),n.child=e.child,n.flags|=128,n=null):(Cr(),A=l.fallback,c=n.mode,l=ps({mode:"visible",children:l.children},c),A=ui(A,c,o,null),A.flags|=2,l.return=n,A.return=n,l.sibling=A,n.child=l,gi(n,e.child,null,o),l=n.child,l.memoizedState=Hf(o),l.childLanes=Lf(e,v,o),n.memoizedState=Uf,n=xa(null,l));else if(Nr(n),vd(A)){if(v=A.nextSibling&&A.nextSibling.dataset,v)var Q=v.dgst;v=Q,l=Error(a(419)),l.stack="",l.digest=v,aa({value:l,source:null,stack:null}),n=Ff(e,n,o)}else if(st||no(e,n,o,!1),v=(o&e.childLanes)!==0,st||v){if(v=Xe,v!==null&&(l=Tl(v,o),l!==0&&l!==H.retryLane))throw H.retryLane=l,si(e,l),jt(v,e,l),zf;xd(A)||ws(),n=Ff(e,n,o)}else xd(A)?(n.flags|=192,n.child=e.child,n=null):(e=H.treeContext,Pe=nn(A.nextSibling),yt=n,ze=!0,Er=null,en=!1,e!==null&&Am(n,e),n=jf(n,l.children),n.flags|=4096);return n}return c?(Cr(),A=l.fallback,c=n.mode,H=e.child,Q=H.sibling,l=$n(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,Q!==null?A=$n(Q,A):(A=ui(A,c,o,null),A.flags|=2),A.return=n,l.return=n,l.sibling=A,n.child=l,xa(null,l),l=n.child,A=e.child.memoizedState,A===null?A=Hf(o):(c=A.cachePool,c!==null?(H=at._currentValue,c=c.parent!==H?{parent:H,pool:H}:c):c=Om(),A={baseLanes:A.baseLanes|o,cachePool:c}),l.memoizedState=A,l.childLanes=Lf(e,v,o),n.memoizedState=Uf,xa(e.child,l)):(Nr(n),o=e.child,e=o.sibling,o=$n(o,{mode:"visible",children:l.children}),o.return=n,o.sibling=null,e!==null&&(v=n.deletions,v===null?(n.deletions=[e],n.flags|=16):v.push(e)),n.child=o,n.memoizedState=null,o)}function jf(e,n){return n=ps({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ps(e,n){return e=kt(22,e,null,n),e.lanes=0,e}function Ff(e,n,o){return gi(n,e.child,null,o),e=jf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Xp(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Wc(e.return,n,o)}function Vf(e,n,o,l,c,d){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:c,treeForkCount:d}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=o,v.tailMode=c,v.treeForkCount=d)}function Ip(e,n,o){var l=n.pendingProps,c=l.revealOrder,d=l.tail;l=l.children;var v=rt.current,A=(v&2)!==0;if(A?(v=v&1|2,n.flags|=128):v&=1,J(rt,v),vt(e,n,l,o),l=ze?oa:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xp(e,o,n);else if(e.tag===19)Xp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(o=n.child,c=null;o!==null;)e=o.alternate,e!==null&&rs(e)===null&&(c=o),o=o.sibling;o=c,o===null?(c=n.child,n.child=null):(c=o.sibling,o.sibling=null),Vf(n,!1,c,o,d,l);break;case"backwards":case"unstable_legacy-backwards":for(o=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&rs(e)===null){n.child=c;break}e=c.sibling,c.sibling=o,o=c,c=e}Vf(n,!0,o,null,d,l);break;case"together":Vf(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function Wn(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),Dr|=n.lanes,(o&n.childLanes)===0)if(e!==null){if(no(e,n,o,!1),(o&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,o=$n(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=$n(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function kf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Zl(e)))}function H_(e,n,o){switch(n.tag){case 3:ue(n,n.stateNode.containerInfo),_r(n,at,e.memoizedState.cache),ci();break;case 27:case 5:ne(n);break;case 4:ue(n,n.stateNode.containerInfo);break;case 10:_r(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,df(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(Nr(n),n.flags|=128,null):(o&n.child.childLanes)!==0?Yp(e,n,o):(Nr(n),e=Wn(e,n,o),e!==null?e.sibling:null);Nr(n);break;case 19:var c=(e.flags&128)!==0;if(l=(o&n.childLanes)!==0,l||(no(e,n,o,!1),l=(o&n.childLanes)!==0),c){if(l)return Ip(e,n,o);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),J(rt,rt.current),l)break;return null;case 22:return n.lanes=0,jp(e,n,o,n.pendingProps);case 24:_r(n,at,e.memoizedState.cache)}return Wn(e,n,o)}function $p(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps)st=!0;else{if(!kf(e,o)&&(n.flags&128)===0)return st=!1,H_(e,n,o);st=(e.flags&131072)!==0}else st=!1,ze&&(n.flags&1048576)!==0&&Tm(n,oa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=mi(n.elementType),n.type=e,typeof e=="function")Xc(e)?(l=xi(e,l),n.tag=1,n=Gp(null,n,e,l,o)):(n.tag=0,n=Bf(null,n,e,l,o));else{if(e!=null){var c=e.$$typeof;if(c===C){n.tag=11,n=Up(null,n,e,l,o);break e}else if(c===U){n.tag=14,n=Hp(null,n,e,l,o);break e}}throw n=B(e)||e,Error(a(306,n,""))}}return n;case 0:return Bf(e,n,n.type,n.pendingProps,o);case 1:return l=n.type,c=xi(l,n.pendingProps),Gp(e,n,l,c,o);case 3:e:{if(ue(n,n.stateNode.containerInfo),e===null)throw Error(a(387));l=n.pendingProps;var d=n.memoizedState;c=d.element,lf(e,n),ha(n,l,null,o);var v=n.memoizedState;if(l=v.cache,_r(n,at,l),l!==d.cache&&ef(n,[at],o,!0),da(),l=v.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=qp(e,n,l,o);break e}else if(l!==c){c=Kt(Error(a(424)),n),aa(c),n=qp(e,n,l,o);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Pe=nn(e.firstChild),yt=n,ze=!0,Er=null,en=!0,o=jm(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ci(),l===c){n=Wn(e,n,o);break e}vt(e,n,l,o)}n=n.child}return n;case 26:return ms(e,n),e===null?(o=iy(n.type,null,n.pendingProps,null))?n.memoizedState=o:ze||(o=n.type,e=n.pendingProps,l=Ds(he.current).createElement(o),l[ht]=n,l[Et]=e,bt(l,o,e),ot(l),n.stateNode=l):n.memoizedState=iy(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ne(n),e===null&&ze&&(l=n.stateNode=ty(n.type,n.pendingProps,he.current),yt=n,en=!0,c=Pe,Hr(n.type)?(bd=c,Pe=nn(l.firstChild)):Pe=c),vt(e,n,n.pendingProps.children,o),ms(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&ze&&((c=l=Pe)&&(l=d2(l,n.type,n.pendingProps,en),l!==null?(n.stateNode=l,yt=n,Pe=nn(l.firstChild),en=!1,c=!0):c=!1),c||Sr(n)),ne(n),c=n.type,d=n.pendingProps,v=e!==null?e.memoizedProps:null,l=d.children,pd(c,d)?l=null:v!==null&&pd(c,v)&&(n.flags|=32),n.memoizedState!==null&&(c=mf(e,n,N_,null,null,o),za._currentValue=c),ms(e,n),vt(e,n,l,o),n.child;case 6:return e===null&&ze&&((e=o=Pe)&&(o=h2(o,n.pendingProps,en),o!==null?(n.stateNode=o,yt=n,Pe=null,e=!0):e=!1),e||Sr(n)),null;case 13:return Yp(e,n,o);case 4:return ue(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=gi(n,null,l,o):vt(e,n,l,o),n.child;case 11:return Up(e,n,n.type,n.pendingProps,o);case 7:return vt(e,n,n.pendingProps,o),n.child;case 8:return vt(e,n,n.pendingProps.children,o),n.child;case 12:return vt(e,n,n.pendingProps.children,o),n.child;case 10:return l=n.pendingProps,_r(n,n.type,l.value),vt(e,n,l.children,o),n.child;case 9:return c=n.type._context,l=n.pendingProps.children,di(n),c=xt(c),l=l(c),n.flags|=1,vt(e,n,l,o),n.child;case 14:return Hp(e,n,n.type,n.pendingProps,o);case 15:return Lp(e,n,n.type,n.pendingProps,o);case 19:return Ip(e,n,o);case 31:return U_(e,n,o);case 22:return jp(e,n,o,n.pendingProps);case 24:return di(n),l=xt(at),e===null?(c=rf(),c===null&&(c=Xe,d=tf(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=o),c=d),n.memoizedState={parent:l,cache:c},af(n),_r(n,at,c)):((e.lanes&o)!==0&&(lf(e,n),ha(n,null,null,o),da()),c=e.memoizedState,d=n.memoizedState,c.parent!==l?(c={parent:l,cache:l},n.memoizedState=c,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=c),_r(n,at,l)):(l=d.cache,_r(n,at,l),l!==c.cache&&ef(n,[at],o,!0))),vt(e,n,n.pendingProps.children,o),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function er(e){e.flags|=4}function Gf(e,n,o,l,c){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(bg())e.flags|=8192;else throw pi=Wl,of}else e.flags&=-16777217}function Pp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!uy(n))if(bg())e.flags|=8192;else throw pi=Wl,of}function gs(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Sl():536870912,e.lanes|=n,po|=n)}function va(e,n){if(!ze)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Ze(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var c=e.child;c!==null;)o|=c.lanes|c.childLanes,l|=c.subtreeFlags&65011712,l|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)o|=c.lanes|c.childLanes,l|=c.subtreeFlags,l|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function L_(e,n,o){var l=n.pendingProps;switch(Zc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(n),null;case 1:return Ze(n),null;case 3:return o=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Qn(at),me(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(to(n)?er(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kc())),Ze(n),null;case 26:var c=n.type,d=n.memoizedState;return e===null?(er(n),d!==null?(Ze(n),Pp(n,d)):(Ze(n),Gf(n,c,null,l,o))):d?d!==e.memoizedState?(er(n),Ze(n),Pp(n,d)):(Ze(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&er(n),Ze(n),Gf(n,c,e,l,o)),null;case 27:if(ce(n),o=he.current,c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&er(n);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Ze(n),null}e=te.current,to(n)?Nm(n):(e=ty(c,l,o),n.stateNode=e,er(n))}return Ze(n),null;case 5:if(ce(n),c=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==l&&er(n);else{if(!l){if(n.stateNode===null)throw Error(a(166));return Ze(n),null}if(d=te.current,to(n))Nm(n);else{var v=Ds(he.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=v.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?d.multiple=!0:l.size&&(d.size=l.size);break;default:d=typeof l.is=="string"?v.createElement(c,{is:l.is}):v.createElement(c)}}d[ht]=n,d[Et]=l;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)d.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=d;e:switch(bt(d,c,l),c){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&er(n)}}return Ze(n),Gf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,o),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==l&&er(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(a(166));if(e=he.current,to(n)){if(e=n.stateNode,o=n.memoizedProps,l=null,c=yt,c!==null)switch(c.tag){case 27:case 5:l=c.memoizedProps}e[ht]=n,e=!!(e.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||Yg(e.nodeValue,o)),e||Sr(n,!0)}else e=Ds(e).createTextNode(l),e[ht]=n,n.stateNode=e}return Ze(n),null;case 31:if(o=n.memoizedState,e===null||e.memoizedState!==null){if(l=to(n),o!==null){if(e===null){if(!l)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[ht]=n}else ci(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ze(n),e=!1}else o=Kc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),e=!0;if(!e)return n.flags&256?(qt(n),n):(qt(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Ze(n),null;case 13:if(l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=to(n),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=n.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[ht]=n}else ci(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ze(n),c=!1}else c=Kc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return n.flags&256?(qt(n),n):(qt(n),null)}return qt(n),(n.flags&128)!==0?(n.lanes=o,n):(o=l!==null,e=e!==null&&e.memoizedState!==null,o&&(l=n.child,c=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(c=l.alternate.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==c&&(l.flags|=2048)),o!==e&&o&&(n.child.flags|=8192),gs(n,n.updateQueue),Ze(n),null);case 4:return me(),e===null&&cd(n.stateNode.containerInfo),Ze(n),null;case 10:return Qn(n.type),Ze(n),null;case 19:if(F(rt),l=n.memoizedState,l===null)return Ze(n),null;if(c=(n.flags&128)!==0,d=l.rendering,d===null)if(c)va(l,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=rs(e),d!==null){for(n.flags|=128,va(l,!1),e=d.updateQueue,n.updateQueue=e,gs(n,e),n.subtreeFlags=0,e=o,o=n.child;o!==null;)Sm(o,e),o=o.sibling;return J(rt,rt.current&1|2),ze&&Pn(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&$e()>Es&&(n.flags|=128,c=!0,va(l,!1),n.lanes=4194304)}else{if(!c)if(e=rs(d),e!==null){if(n.flags|=128,c=!0,e=e.updateQueue,n.updateQueue=e,gs(n,e),va(l,!0),l.tail===null&&l.tailMode==="hidden"&&!d.alternate&&!ze)return Ze(n),null}else 2*$e()-l.renderingStartTime>Es&&o!==536870912&&(n.flags|=128,c=!0,va(l,!1),n.lanes=4194304);l.isBackwards?(d.sibling=n.child,n.child=d):(e=l.last,e!==null?e.sibling=d:n.child=d,l.last=d)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=$e(),e.sibling=null,o=rt.current,J(rt,c?o&1|2:o&1),ze&&Pn(n,l.treeForkCount),e):(Ze(n),null);case 22:case 23:return qt(n),ff(),l=n.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(o&536870912)!==0&&(n.flags&128)===0&&(Ze(n),n.subtreeFlags&6&&(n.flags|=8192)):Ze(n),o=n.updateQueue,o!==null&&gs(n,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==o&&(n.flags|=2048),e!==null&&F(hi),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Qn(at),Ze(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function j_(e,n){switch(Zc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Qn(at),me(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return ce(n),null;case 31:if(n.memoizedState!==null){if(qt(n),n.alternate===null)throw Error(a(340));ci()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(qt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));ci()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return F(rt),null;case 4:return me(),null;case 10:return Qn(n.type),null;case 22:case 23:return qt(n),ff(),e!==null&&F(hi),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Qn(at),null;case 25:return null;default:return null}}function Zp(e,n){switch(Zc(n),n.tag){case 3:Qn(at),me();break;case 26:case 27:case 5:ce(n);break;case 4:me();break;case 31:n.memoizedState!==null&&qt(n);break;case 13:qt(n);break;case 19:F(rt);break;case 10:Qn(n.type);break;case 22:case 23:qt(n),ff(),e!==null&&F(hi);break;case 24:Qn(at)}}function ba(e,n){try{var o=n.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var c=l.next;o=c;do{if((o.tag&e)===e){l=void 0;var d=o.create,v=o.inst;l=d(),v.destroy=l}o=o.next}while(o!==c)}}catch(A){ke(n,n.return,A)}}function Rr(e,n,o){try{var l=n.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var d=c.next;l=d;do{if((l.tag&e)===e){var v=l.inst,A=v.destroy;if(A!==void 0){v.destroy=void 0,c=n;var H=o,Q=A;try{Q()}catch(ie){ke(c,H,ie)}}}l=l.next}while(l!==d)}}catch(ie){ke(n,n.return,ie)}}function Qp(e){var n=e.updateQueue;if(n!==null){var o=e.stateNode;try{Vm(n,o)}catch(l){ke(e,e.return,l)}}}function Kp(e,n,o){o.props=xi(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(l){ke(e,n,l)}}function Ea(e,n){try{var o=e.ref;if(o!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof o=="function"?e.refCleanup=o(l):o.current=l}}catch(c){ke(e,n,c)}}function An(e,n){var o=e.ref,l=e.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(c){ke(e,n,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(c){ke(e,n,c)}else o.current=null}function Jp(e){var n=e.type,o=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(c){ke(e,e.return,c)}}function qf(e,n,o){try{var l=e.stateNode;a2(l,e.type,o,n),l[Et]=n}catch(c){ke(e,e.return,c)}}function Wp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hr(e.type)||e.tag===4}function Yf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Hr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xf(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(e,n):(n=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,n.appendChild(e),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=Xn));else if(l!==4&&(l===27&&Hr(e.type)&&(o=e.stateNode,n=null),e=e.child,e!==null))for(Xf(e,n,o),e=e.sibling;e!==null;)Xf(e,n,o),e=e.sibling}function ys(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(l===27&&Hr(e.type)&&(o=e.stateNode),e=e.child,e!==null))for(ys(e,n,o),e=e.sibling;e!==null;)ys(e,n,o),e=e.sibling}function eg(e){var n=e.stateNode,o=e.memoizedProps;try{for(var l=e.type,c=n.attributes;c.length;)n.removeAttributeNode(c[0]);bt(n,l,o),n[ht]=e,n[Et]=o}catch(d){ke(e,e.return,d)}}var tr=!1,ut=!1,If=!1,tg=typeof WeakSet=="function"?WeakSet:Set,gt=null;function F_(e,n){if(e=e.containerInfo,hd=js,e=hm(e),jc(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var c=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{o.nodeType,d.nodeType}catch{o=null;break e}var v=0,A=-1,H=-1,Q=0,ie=0,le=e,K=null;t:for(;;){for(var W;le!==o||c!==0&&le.nodeType!==3||(A=v+c),le!==d||l!==0&&le.nodeType!==3||(H=v+l),le.nodeType===3&&(v+=le.nodeValue.length),(W=le.firstChild)!==null;)K=le,le=W;for(;;){if(le===e)break t;if(K===o&&++Q===c&&(A=v),K===d&&++ie===l&&(H=v),(W=le.nextSibling)!==null)break;le=K,K=le.parentNode}le=W}o=A===-1||H===-1?null:{start:A,end:H}}else o=null}o=o||{start:0,end:0}}else o=null;for(md={focusedElem:e,selectionRange:o},js=!1,gt=n;gt!==null;)if(n=gt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,gt=e;else for(;gt!==null;){switch(n=gt,d=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(o=0;o<e.length;o++)c=e[o],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,o=n,c=d.memoizedProps,d=d.memoizedState,l=o.stateNode;try{var pe=xi(o.type,c);e=l.getSnapshotBeforeUpdate(pe,d),l.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){ke(o,o.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,o=e.nodeType,o===9)yd(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,gt=e;break}gt=n.return}}function ng(e,n,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:rr(e,o),l&4&&ba(5,o);break;case 1:if(rr(e,o),l&4)if(e=o.stateNode,n===null)try{e.componentDidMount()}catch(v){ke(o,o.return,v)}else{var c=xi(o.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(c,n,e.__reactInternalSnapshotBeforeUpdate)}catch(v){ke(o,o.return,v)}}l&64&&Qp(o),l&512&&Ea(o,o.return);break;case 3:if(rr(e,o),l&64&&(e=o.updateQueue,e!==null)){if(n=null,o.child!==null)switch(o.child.tag){case 27:case 5:n=o.child.stateNode;break;case 1:n=o.child.stateNode}try{Vm(e,n)}catch(v){ke(o,o.return,v)}}break;case 27:n===null&&l&4&&eg(o);case 26:case 5:rr(e,o),n===null&&l&4&&Jp(o),l&512&&Ea(o,o.return);break;case 12:rr(e,o);break;case 31:rr(e,o),l&4&&og(e,o);break;case 13:rr(e,o),l&4&&ag(e,o),l&64&&(e=o.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(o=P_.bind(null,o),m2(e,o))));break;case 22:if(l=o.memoizedState!==null||tr,!l){n=n!==null&&n.memoizedState!==null||ut,c=tr;var d=ut;tr=l,(ut=n)&&!d?ir(e,o,(o.subtreeFlags&8772)!==0):rr(e,o),tr=c,ut=d}break;case 30:break;default:rr(e,o)}}function rg(e){var n=e.alternate;n!==null&&(e.alternate=null,rg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&$o(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ke=null,Bt=!1;function nr(e,n,o){for(o=o.child;o!==null;)ig(e,n,o),o=o.sibling}function ig(e,n,o){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Wr,o)}catch{}switch(o.tag){case 26:ut||An(o,n),nr(e,n,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ut||An(o,n);var l=Ke,c=Bt;Hr(o.type)&&(Ke=o.stateNode,Bt=!1),nr(e,n,o),Ma(o.stateNode),Ke=l,Bt=c;break;case 5:ut||An(o,n);case 6:if(l=Ke,c=Bt,Ke=null,nr(e,n,o),Ke=l,Bt=c,Ke!==null)if(Bt)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(o.stateNode)}catch(d){ke(o,n,d)}else try{Ke.removeChild(o.stateNode)}catch(d){ke(o,n,d)}break;case 18:Ke!==null&&(Bt?(e=Ke,Qg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,o.stateNode),_o(e)):Qg(Ke,o.stateNode));break;case 4:l=Ke,c=Bt,Ke=o.stateNode.containerInfo,Bt=!0,nr(e,n,o),Ke=l,Bt=c;break;case 0:case 11:case 14:case 15:Rr(2,o,n),ut||Rr(4,o,n),nr(e,n,o);break;case 1:ut||(An(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"&&Kp(o,n,l)),nr(e,n,o);break;case 21:nr(e,n,o);break;case 22:ut=(l=ut)||o.memoizedState!==null,nr(e,n,o),ut=l;break;default:nr(e,n,o)}}function og(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{_o(e)}catch(o){ke(n,n.return,o)}}}function ag(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_o(e)}catch(o){ke(n,n.return,o)}}function V_(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new tg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new tg),n;default:throw Error(a(435,e.tag))}}function xs(e,n){var o=V_(e);n.forEach(function(l){if(!o.has(l)){o.add(l);var c=Z_.bind(null,e,l);l.then(c,c)}})}function Ut(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var c=o[l],d=e,v=n,A=v;e:for(;A!==null;){switch(A.tag){case 27:if(Hr(A.type)){Ke=A.stateNode,Bt=!1;break e}break;case 5:Ke=A.stateNode,Bt=!1;break e;case 3:case 4:Ke=A.stateNode.containerInfo,Bt=!0;break e}A=A.return}if(Ke===null)throw Error(a(160));ig(d,v,c),Ke=null,Bt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)lg(n,e),n=n.sibling}var un=null;function lg(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ut(n,e),Ht(e),l&4&&(Rr(3,e,e.return),ba(3,e),Rr(5,e,e.return));break;case 1:Ut(n,e),Ht(e),l&512&&(ut||o===null||An(o,o.return)),l&64&&tr&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var c=un;if(Ut(n,e),Ht(e),l&512&&(ut||o===null||An(o,o.return)),l&4){var d=o!==null?o.memoizedState:null;if(l=e.memoizedState,o===null)if(l===null)if(e.stateNode===null){e:{l=e.type,o=e.memoizedProps,c=c.ownerDocument||c;t:switch(l){case"title":d=c.getElementsByTagName("title")[0],(!d||d[ni]||d[ht]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(l),c.head.insertBefore(d,c.querySelector("head > title"))),bt(d,l,o),d[ht]=e,ot(d),l=d;break e;case"link":var v=ly("link","href",c).get(l+(o.href||""));if(v){for(var A=0;A<v.length;A++)if(d=v[A],d.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&d.getAttribute("rel")===(o.rel==null?null:o.rel)&&d.getAttribute("title")===(o.title==null?null:o.title)&&d.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){v.splice(A,1);break t}}d=c.createElement(l),bt(d,l,o),c.head.appendChild(d);break;case"meta":if(v=ly("meta","content",c).get(l+(o.content||""))){for(A=0;A<v.length;A++)if(d=v[A],d.getAttribute("content")===(o.content==null?null:""+o.content)&&d.getAttribute("name")===(o.name==null?null:o.name)&&d.getAttribute("property")===(o.property==null?null:o.property)&&d.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&d.getAttribute("charset")===(o.charSet==null?null:o.charSet)){v.splice(A,1);break t}}d=c.createElement(l),bt(d,l,o),c.head.appendChild(d);break;default:throw Error(a(468,l))}d[ht]=e,ot(d),l=d}e.stateNode=l}else sy(c,e.type,e.stateNode);else e.stateNode=ay(c,l,e.memoizedProps);else d!==l?(d===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):d.count--,l===null?sy(c,e.type,e.stateNode):ay(c,l,e.memoizedProps)):l===null&&e.stateNode!==null&&qf(e,e.memoizedProps,o.memoizedProps)}break;case 27:Ut(n,e),Ht(e),l&512&&(ut||o===null||An(o,o.return)),o!==null&&l&4&&qf(e,e.memoizedProps,o.memoizedProps);break;case 5:if(Ut(n,e),Ht(e),l&512&&(ut||o===null||An(o,o.return)),e.flags&32){c=e.stateNode;try{Xi(c,"")}catch(pe){ke(e,e.return,pe)}}l&4&&e.stateNode!=null&&(c=e.memoizedProps,qf(e,c,o!==null?o.memoizedProps:c)),l&1024&&(If=!0);break;case 6:if(Ut(n,e),Ht(e),l&4){if(e.stateNode===null)throw Error(a(162));l=e.memoizedProps,o=e.stateNode;try{o.nodeValue=l}catch(pe){ke(e,e.return,pe)}}break;case 3:if(Bs=null,c=un,un=Os(n.containerInfo),Ut(n,e),un=c,Ht(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{_o(n.containerInfo)}catch(pe){ke(e,e.return,pe)}If&&(If=!1,sg(e));break;case 4:l=un,un=Os(e.stateNode.containerInfo),Ut(n,e),Ht(e),un=l;break;case 12:Ut(n,e),Ht(e);break;case 31:Ut(n,e),Ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xs(e,l)));break;case 13:Ut(n,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(bs=$e()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xs(e,l)));break;case 22:c=e.memoizedState!==null;var H=o!==null&&o.memoizedState!==null,Q=tr,ie=ut;if(tr=Q||c,ut=ie||H,Ut(n,e),ut=ie,tr=Q,Ht(e),l&8192)e:for(n=e.stateNode,n._visibility=c?n._visibility&-2:n._visibility|1,c&&(o===null||H||tr||ut||vi(e)),o=null,n=e;;){if(n.tag===5||n.tag===26){if(o===null){H=o=n;try{if(d=H.stateNode,c)v=d.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{A=H.stateNode;var le=H.memoizedProps.style,K=le!=null&&le.hasOwnProperty("display")?le.display:null;A.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(pe){ke(H,H.return,pe)}}}else if(n.tag===6){if(o===null){H=n;try{H.stateNode.nodeValue=c?"":H.memoizedProps}catch(pe){ke(H,H.return,pe)}}}else if(n.tag===18){if(o===null){H=n;try{var W=H.stateNode;c?Kg(W,!0):Kg(H.stateNode,!1)}catch(pe){ke(H,H.return,pe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;o===n&&(o=null),n=n.return}o===n&&(o=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,xs(e,o))));break;case 19:Ut(n,e),Ht(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xs(e,l)));break;case 30:break;case 21:break;default:Ut(n,e),Ht(e)}}function Ht(e){var n=e.flags;if(n&2){try{for(var o,l=e.return;l!==null;){if(Wp(l)){o=l;break}l=l.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var c=o.stateNode,d=Yf(e);ys(e,d,c);break;case 5:var v=o.stateNode;o.flags&32&&(Xi(v,""),o.flags&=-33);var A=Yf(e);ys(e,A,v);break;case 3:case 4:var H=o.stateNode.containerInfo,Q=Yf(e);Xf(e,Q,H);break;default:throw Error(a(161))}}catch(ie){ke(e,e.return,ie)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function sg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;sg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function rr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)ng(e,n.alternate,n),n=n.sibling}function vi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Rr(4,n,n.return),vi(n);break;case 1:An(n,n.return);var o=n.stateNode;typeof o.componentWillUnmount=="function"&&Kp(n,n.return,o),vi(n);break;case 27:Ma(n.stateNode);case 26:case 5:An(n,n.return),vi(n);break;case 22:n.memoizedState===null&&vi(n);break;case 30:vi(n);break;default:vi(n)}e=e.sibling}}function ir(e,n,o){for(o=o&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,c=e,d=n,v=d.flags;switch(d.tag){case 0:case 11:case 15:ir(c,d,o),ba(4,d);break;case 1:if(ir(c,d,o),l=d,c=l.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(Q){ke(l,l.return,Q)}if(l=d,c=l.updateQueue,c!==null){var A=l.stateNode;try{var H=c.shared.hiddenCallbacks;if(H!==null)for(c.shared.hiddenCallbacks=null,c=0;c<H.length;c++)Fm(H[c],A)}catch(Q){ke(l,l.return,Q)}}o&&v&64&&Qp(d),Ea(d,d.return);break;case 27:eg(d);case 26:case 5:ir(c,d,o),o&&l===null&&v&4&&Jp(d),Ea(d,d.return);break;case 12:ir(c,d,o);break;case 31:ir(c,d,o),o&&v&4&&og(c,d);break;case 13:ir(c,d,o),o&&v&4&&ag(c,d);break;case 22:d.memoizedState===null&&ir(c,d,o),Ea(d,d.return);break;case 30:break;default:ir(c,d,o)}n=n.sibling}}function $f(e,n){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&la(o))}function Pf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&la(e))}function cn(e,n,o,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)ug(e,n,o,l),n=n.sibling}function ug(e,n,o,l){var c=n.flags;switch(n.tag){case 0:case 11:case 15:cn(e,n,o,l),c&2048&&ba(9,n);break;case 1:cn(e,n,o,l);break;case 3:cn(e,n,o,l),c&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&la(e)));break;case 12:if(c&2048){cn(e,n,o,l),e=n.stateNode;try{var d=n.memoizedProps,v=d.id,A=d.onPostCommit;typeof A=="function"&&A(v,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(H){ke(n,n.return,H)}}else cn(e,n,o,l);break;case 31:cn(e,n,o,l);break;case 13:cn(e,n,o,l);break;case 23:break;case 22:d=n.stateNode,v=n.alternate,n.memoizedState!==null?d._visibility&2?cn(e,n,o,l):Sa(e,n):d._visibility&2?cn(e,n,o,l):(d._visibility|=2,fo(e,n,o,l,(n.subtreeFlags&10256)!==0||!1)),c&2048&&$f(v,n);break;case 24:cn(e,n,o,l),c&2048&&Pf(n.alternate,n);break;default:cn(e,n,o,l)}}function fo(e,n,o,l,c){for(c=c&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,v=n,A=o,H=l,Q=v.flags;switch(v.tag){case 0:case 11:case 15:fo(d,v,A,H,c),ba(8,v);break;case 23:break;case 22:var ie=v.stateNode;v.memoizedState!==null?ie._visibility&2?fo(d,v,A,H,c):Sa(d,v):(ie._visibility|=2,fo(d,v,A,H,c)),c&&Q&2048&&$f(v.alternate,v);break;case 24:fo(d,v,A,H,c),c&&Q&2048&&Pf(v.alternate,v);break;default:fo(d,v,A,H,c)}n=n.sibling}}function Sa(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var o=e,l=n,c=l.flags;switch(l.tag){case 22:Sa(o,l),c&2048&&$f(l.alternate,l);break;case 24:Sa(o,l),c&2048&&Pf(l.alternate,l);break;default:Sa(o,l)}n=n.sibling}}var _a=8192;function ho(e,n,o){if(e.subtreeFlags&_a)for(e=e.child;e!==null;)cg(e,n,o),e=e.sibling}function cg(e,n,o){switch(e.tag){case 26:ho(e,n,o),e.flags&_a&&e.memoizedState!==null&&A2(o,un,e.memoizedState,e.memoizedProps);break;case 5:ho(e,n,o);break;case 3:case 4:var l=un;un=Os(e.stateNode.containerInfo),ho(e,n,o),un=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=_a,_a=16777216,ho(e,n,o),_a=l):ho(e,n,o));break;default:ho(e,n,o)}}function fg(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function wa(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var l=n[o];gt=l,hg(l,e)}fg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dg(e),e=e.sibling}function dg(e){switch(e.tag){case 0:case 11:case 15:wa(e),e.flags&2048&&Rr(9,e,e.return);break;case 3:wa(e);break;case 12:wa(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,vs(e)):wa(e);break;default:wa(e)}}function vs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var o=0;o<n.length;o++){var l=n[o];gt=l,hg(l,e)}fg(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Rr(8,n,n.return),vs(n);break;case 22:o=n.stateNode,o._visibility&2&&(o._visibility&=-3,vs(n));break;default:vs(n)}e=e.sibling}}function hg(e,n){for(;gt!==null;){var o=gt;switch(o.tag){case 0:case 11:case 15:Rr(8,o,n);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:la(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,gt=l;else e:for(o=e;gt!==null;){l=gt;var c=l.sibling,d=l.return;if(rg(l),l===o){gt=null;break e}if(c!==null){c.return=d,gt=c;break e}gt=d}}}var k_={getCacheForType:function(e){var n=xt(at),o=n.data.get(e);return o===void 0&&(o=e(),n.data.set(e,o)),o},cacheSignal:function(){return xt(at).controller.signal}},G_=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Xe=null,Ce=null,Me=0,Ve=0,Yt=null,Mr=!1,mo=!1,Zf=!1,or=0,nt=0,Dr=0,bi=0,Qf=0,Xt=0,po=0,Ta=null,Lt=null,Kf=!1,bs=0,mg=0,Es=1/0,Ss=null,Or=null,mt=0,zr=null,go=null,ar=0,Jf=0,Wf=null,pg=null,Aa=0,ed=null;function It(){return(Fe&2)!==0&&Me!==0?Me&-Me:R.T!==null?ad():Al()}function gg(){if(Xt===0)if((Me&536870912)===0||ze){var e=ji;ji<<=1,(ji&3932160)===0&&(ji=262144),Xt=e}else Xt=536870912;return e=Gt.current,e!==null&&(e.flags|=32),Xt}function jt(e,n,o){(e===Xe&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(yo(e,0),Br(e,Me,Xt,!1)),ti(e,o),((Fe&2)===0||e!==Xe)&&(e===Xe&&((Fe&2)===0&&(bi|=o),nt===4&&Br(e,Me,Xt,!1)),Nn(e))}function yg(e,n,o){if((Fe&6)!==0)throw Error(a(327));var l=!o&&(n&127)===0&&(n&e.expiredLanes)===0||ei(e,n),c=l?X_(e,n):nd(e,n,!0),d=l;do{if(c===0){mo&&!l&&Br(e,n,0,!1);break}else{if(o=e.current.alternate,d&&!q_(o)){c=nd(e,n,!1),d=!1;continue}if(c===2){if(d=n,e.errorRecoveryDisabledLanes&d)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var A=e;c=Ta;var H=A.current.memoizedState.isDehydrated;if(H&&(yo(A,v).flags|=256),v=nd(A,v,!1),v!==2){if(Zf&&!H){A.errorRecoveryDisabledLanes|=d,bi|=d,c=4;break e}d=Lt,Lt=c,d!==null&&(Lt===null?Lt=d:Lt.push.apply(Lt,d))}c=v}if(d=!1,c!==2)continue}}if(c===1){yo(e,0),Br(e,n,0,!0);break}e:{switch(l=e,d=c,d){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:Br(l,n,Xt,!Mr);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(c=bs+300-$e(),10<c)){if(Br(l,n,Xt,!Mr),Vi(l,0,!0)!==0)break e;ar=n,l.timeoutHandle=Pg(xg.bind(null,l,o,Lt,Ss,Kf,n,Xt,bi,po,Mr,d,"Throttled",-0,0),c);break e}xg(l,o,Lt,Ss,Kf,n,Xt,bi,po,Mr,d,null,-0,0)}}break}while(!0);Nn(e)}function xg(e,n,o,l,c,d,v,A,H,Q,ie,le,K,W){if(e.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},cg(n,d,le);var pe=(d&62914560)===d?bs-$e():(d&4194048)===d?mg-$e():0;if(pe=N2(le,pe),pe!==null){ar=d,e.cancelPendingCommit=pe(Ag.bind(null,e,n,d,o,l,c,v,A,H,ie,le,null,K,W)),Br(e,d,v,!Q);return}}Ag(e,n,d,o,l,c,v,A,H)}function q_(e){for(var n=e;;){var o=n.tag;if((o===0||o===11||o===15)&&n.flags&16384&&(o=n.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var c=o[l],d=c.getSnapshot;c=c.value;try{if(!Vt(d(),c))return!1}catch{return!1}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Br(e,n,o,l){n&=~Qf,n&=~bi,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var c=n;0<c;){var d=31-Nt(c),v=1<<d;l[d]=-1,c&=~v}o!==0&&_l(e,o,n)}function _s(){return(Fe&6)===0?(Na(0),!1):!0}function td(){if(Ce!==null){if(Ve===0)var e=Ce.return;else e=Ce,Zn=fi=null,yf(e),ao=null,ua=0,e=Ce;for(;e!==null;)Zp(e.alternate,e),e=e.return;Ce=null}}function yo(e,n){var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,u2(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),ar=0,td(),Xe=e,Ce=o=$n(e.current,null),Me=n,Ve=0,Yt=null,Mr=!1,mo=ei(e,n),Zf=!1,po=Xt=Qf=bi=Dr=nt=0,Lt=Ta=null,Kf=!1,(n&8)!==0&&(n|=n&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=n;0<l;){var c=31-Nt(l),d=1<<c;n|=e[c],l&=~d}return or=n,Yl(),o}function vg(e,n){Te=null,R.H=ya,n===oo||n===Jl?(n=Um(),Ve=3):n===of?(n=Um(),Ve=4):Ve=n===zf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Ce===null&&(nt=1,ds(e,Kt(n,e.current)))}function bg(){var e=Gt.current;return e===null?!0:(Me&4194048)===Me?tn===null:(Me&62914560)===Me||(Me&536870912)!==0?e===tn:!1}function Eg(){var e=R.H;return R.H=ya,e===null?ya:e}function Sg(){var e=R.A;return R.A=k_,e}function ws(){nt=4,Mr||(Me&4194048)!==Me&&Gt.current!==null||(mo=!0),(Dr&134217727)===0&&(bi&134217727)===0||Xe===null||Br(Xe,Me,Xt,!1)}function nd(e,n,o){var l=Fe;Fe|=2;var c=Eg(),d=Sg();(Xe!==e||Me!==n)&&(Ss=null,yo(e,n)),n=!1;var v=nt;e:do try{if(Ve!==0&&Ce!==null){var A=Ce,H=Yt;switch(Ve){case 8:td(),v=6;break e;case 3:case 2:case 9:case 6:Gt.current===null&&(n=!0);var Q=Ve;if(Ve=0,Yt=null,xo(e,A,H,Q),o&&mo){v=0;break e}break;default:Q=Ve,Ve=0,Yt=null,xo(e,A,H,Q)}}Y_(),v=nt;break}catch(ie){vg(e,ie)}while(!0);return n&&e.shellSuspendCounter++,Zn=fi=null,Fe=l,R.H=c,R.A=d,Ce===null&&(Xe=null,Me=0,Yl()),v}function Y_(){for(;Ce!==null;)_g(Ce)}function X_(e,n){var o=Fe;Fe|=2;var l=Eg(),c=Sg();Xe!==e||Me!==n?(Ss=null,Es=$e()+500,yo(e,n)):mo=ei(e,n);e:do try{if(Ve!==0&&Ce!==null){n=Ce;var d=Yt;t:switch(Ve){case 1:Ve=0,Yt=null,xo(e,n,d,1);break;case 2:case 9:if(zm(d)){Ve=0,Yt=null,wg(n);break}n=function(){Ve!==2&&Ve!==9||Xe!==e||(Ve=7),Nn(e)},d.then(n,n);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:zm(d)?(Ve=0,Yt=null,wg(n)):(Ve=0,Yt=null,xo(e,n,d,7));break;case 5:var v=null;switch(Ce.tag){case 26:v=Ce.memoizedState;case 5:case 27:var A=Ce;if(v?uy(v):A.stateNode.complete){Ve=0,Yt=null;var H=A.sibling;if(H!==null)Ce=H;else{var Q=A.return;Q!==null?(Ce=Q,Ts(Q)):Ce=null}break t}}Ve=0,Yt=null,xo(e,n,d,5);break;case 6:Ve=0,Yt=null,xo(e,n,d,6);break;case 8:td(),nt=6;break e;default:throw Error(a(462))}}I_();break}catch(ie){vg(e,ie)}while(!0);return Zn=fi=null,R.H=l,R.A=c,Fe=o,Ce!==null?0:(Xe=null,Me=0,Yl(),nt)}function I_(){for(;Ce!==null&&!jn();)_g(Ce)}function _g(e){var n=$p(e.alternate,e,or);e.memoizedProps=e.pendingProps,n===null?Ts(e):Ce=n}function wg(e){var n=e,o=n.alternate;switch(n.tag){case 15:case 0:n=kp(o,n,n.pendingProps,n.type,void 0,Me);break;case 11:n=kp(o,n,n.pendingProps,n.type.render,n.ref,Me);break;case 5:yf(n);default:Zp(o,n),n=Ce=Sm(n,or),n=$p(o,n,or)}e.memoizedProps=e.pendingProps,n===null?Ts(e):Ce=n}function xo(e,n,o,l){Zn=fi=null,yf(n),ao=null,ua=0;var c=n.return;try{if(B_(e,c,n,o,Me)){nt=1,ds(e,Kt(o,e.current)),Ce=null;return}}catch(d){if(c!==null)throw Ce=c,d;nt=1,ds(e,Kt(o,e.current)),Ce=null;return}n.flags&32768?(ze||l===1?e=!0:mo||(Me&536870912)!==0?e=!1:(Mr=e=!0,(l===2||l===9||l===3||l===6)&&(l=Gt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Tg(n,e)):Ts(n)}function Ts(e){var n=e;do{if((n.flags&32768)!==0){Tg(n,Mr);return}e=n.return;var o=L_(n.alternate,n,or);if(o!==null){Ce=o;return}if(n=n.sibling,n!==null){Ce=n;return}Ce=n=e}while(n!==null);nt===0&&(nt=5)}function Tg(e,n){do{var o=j_(e.alternate,e);if(o!==null){o.flags&=32767,Ce=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!n&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=o}while(e!==null);nt=6,Ce=null}function Ag(e,n,o,l,c,d,v,A,H){e.cancelPendingCommit=null;do As();while(mt!==0);if((Fe&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(d=n.lanes|n.childLanes,d|=qc,vc(e,o,d,v,A,H),e===Xe&&(Ce=Xe=null,Me=0),go=n,zr=e,ar=o,Jf=d,Wf=c,pg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Q_(Vn,function(){return Dg(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=R.T,R.T=null,c=L.p,L.p=2,v=Fe,Fe|=4;try{F_(e,n,o)}finally{Fe=v,L.p=c,R.T=l}}mt=1,Ng(),Cg(),Rg()}}function Ng(){if(mt===1){mt=0;var e=zr,n=go,o=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||o){o=R.T,R.T=null;var l=L.p;L.p=2;var c=Fe;Fe|=4;try{lg(n,e);var d=md,v=hm(e.containerInfo),A=d.focusedElem,H=d.selectionRange;if(v!==A&&A&&A.ownerDocument&&dm(A.ownerDocument.documentElement,A)){if(H!==null&&jc(A)){var Q=H.start,ie=H.end;if(ie===void 0&&(ie=Q),"selectionStart"in A)A.selectionStart=Q,A.selectionEnd=Math.min(ie,A.value.length);else{var le=A.ownerDocument||document,K=le&&le.defaultView||window;if(K.getSelection){var W=K.getSelection(),pe=A.textContent.length,Ee=Math.min(H.start,pe),Ye=H.end===void 0?Ee:Math.min(H.end,pe);!W.extend&&Ee>Ye&&(v=Ye,Ye=Ee,Ee=v);var I=fm(A,Ee),G=fm(A,Ye);if(I&&G&&(W.rangeCount!==1||W.anchorNode!==I.node||W.anchorOffset!==I.offset||W.focusNode!==G.node||W.focusOffset!==G.offset)){var Z=le.createRange();Z.setStart(I.node,I.offset),W.removeAllRanges(),Ee>Ye?(W.addRange(Z),W.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),W.addRange(Z))}}}}for(le=[],W=A;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<le.length;A++){var oe=le[A];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}js=!!hd,md=hd=null}finally{Fe=c,L.p=l,R.T=o}}e.current=n,mt=2}}function Cg(){if(mt===2){mt=0;var e=zr,n=go,o=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||o){o=R.T,R.T=null;var l=L.p;L.p=2;var c=Fe;Fe|=4;try{ng(e,n.alternate,n)}finally{Fe=c,L.p=l,R.T=o}}mt=3}}function Rg(){if(mt===4||mt===3){mt=0,Fn();var e=zr,n=go,o=ar,l=pg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?mt=5:(mt=0,go=zr=null,Mg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Or=null),Io(o),n=n.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Wr,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=R.T,c=L.p,L.p=2,R.T=null;try{for(var d=e.onRecoverableError,v=0;v<l.length;v++){var A=l[v];d(A.value,{componentStack:A.stack})}}finally{R.T=n,L.p=c}}(ar&3)!==0&&As(),Nn(e),c=e.pendingLanes,(o&261930)!==0&&(c&42)!==0?e===ed?Aa++:(Aa=0,ed=e):Aa=0,Na(0)}}function Mg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,la(n)))}function As(){return Ng(),Cg(),Rg(),Dg()}function Dg(){if(mt!==5)return!1;var e=zr,n=Jf;Jf=0;var o=Io(ar),l=R.T,c=L.p;try{L.p=32>o?32:o,R.T=null,o=Wf,Wf=null;var d=zr,v=ar;if(mt=0,go=zr=null,ar=0,(Fe&6)!==0)throw Error(a(331));var A=Fe;if(Fe|=4,dg(d.current),ug(d,d.current,v,o),Fe=A,Na(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Wr,d)}catch{}return!0}finally{L.p=c,R.T=l,Mg(e,n)}}function Og(e,n,o){n=Kt(o,n),n=Of(e.stateNode,n,2),e=Ar(e,n,2),e!==null&&(ti(e,2),Nn(e))}function ke(e,n,o){if(e.tag===3)Og(e,e,o);else for(;n!==null;){if(n.tag===3){Og(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Or===null||!Or.has(l))){e=Kt(o,e),o=zp(2),l=Ar(n,o,2),l!==null&&(Bp(o,l,n,e),ti(l,2),Nn(l));break}}n=n.return}}function rd(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new G_;var c=new Set;l.set(n,c)}else c=l.get(n),c===void 0&&(c=new Set,l.set(n,c));c.has(o)||(Zf=!0,c.add(o),e=$_.bind(null,e,n,o),n.then(e,e))}function $_(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,Xe===e&&(Me&o)===o&&(nt===4||nt===3&&(Me&62914560)===Me&&300>$e()-bs?(Fe&2)===0&&yo(e,0):Qf|=o,po===Me&&(po=0)),Nn(e)}function zg(e,n){n===0&&(n=Sl()),e=si(e,n),e!==null&&(ti(e,n),Nn(e))}function P_(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),zg(e,o)}function Z_(e,n){var o=0;switch(e.tag){case 31:case 13:var l=e.stateNode,c=e.memoizedState;c!==null&&(o=c.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(n),zg(e,o)}function Q_(e,n){return Tt(e,n)}var Ns=null,vo=null,id=!1,Cs=!1,od=!1,Ur=0;function Nn(e){e!==vo&&e.next===null&&(vo===null?Ns=vo=e:vo=vo.next=e),Cs=!0,id||(id=!0,J_())}function Na(e,n){if(!od&&Cs){od=!0;do for(var o=!1,l=Ns;l!==null;){if(e!==0){var c=l.pendingLanes;if(c===0)var d=0;else{var v=l.suspendedLanes,A=l.pingedLanes;d=(1<<31-Nt(42|e)+1)-1,d&=c&~(v&~A),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(o=!0,Lg(l,d))}else d=Me,d=Vi(l,l===Xe?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||ei(l,d)||(o=!0,Lg(l,d));l=l.next}while(o);od=!1}}function K_(){Bg()}function Bg(){Cs=id=!1;var e=0;Ur!==0&&s2()&&(e=Ur);for(var n=$e(),o=null,l=Ns;l!==null;){var c=l.next,d=Ug(l,n);d===0?(l.next=null,o===null?Ns=c:o.next=c,c===null&&(vo=o)):(o=l,(e!==0||(d&3)!==0)&&(Cs=!0)),l=c}mt!==0&&mt!==5||Na(e),Ur!==0&&(Ur=0)}function Ug(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var v=31-Nt(d),A=1<<v,H=c[v];H===-1?((A&o)===0||(A&l)!==0)&&(c[v]=xc(A,n)):H<=n&&(e.expiredLanes|=A),d&=~A}if(n=Xe,o=Me,o=Vi(e,e===n?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,o===0||e===n&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&vn(l),e.callbackNode=null,e.callbackPriority=0;if((o&3)===0||ei(e,o)){if(n=o&-o,n===e.callbackPriority)return n;switch(l!==null&&vn(l),Io(o)){case 2:case 8:o=En;break;case 32:o=Vn;break;case 268435456:o=Hi;break;default:o=Vn}return l=Hg.bind(null,e),o=Tt(o,l),e.callbackPriority=n,e.callbackNode=o,n}return l!==null&&l!==null&&vn(l),e.callbackPriority=2,e.callbackNode=null,2}function Hg(e,n){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var o=e.callbackNode;if(As()&&e.callbackNode!==o)return null;var l=Me;return l=Vi(e,e===Xe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(yg(e,l,n),Ug(e,$e()),e.callbackNode!=null&&e.callbackNode===o?Hg.bind(null,e):null)}function Lg(e,n){if(As())return null;yg(e,n,!0)}function J_(){c2(function(){(Fe&6)!==0?Tt(an,K_):Bg()})}function ad(){if(Ur===0){var e=ro;e===0&&(e=Li,Li<<=1,(Li&261888)===0&&(Li=256)),Ur=e}return Ur}function jg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hl(""+e)}function Fg(e,n){var o=n.ownerDocument.createElement("input");return o.name=n.name,o.value=n.value,e.id&&o.setAttribute("form",e.id),n.parentNode.insertBefore(o,n),e=new FormData(e),o.parentNode.removeChild(o),e}function W_(e,n,o,l,c){if(n==="submit"&&o&&o.stateNode===c){var d=jg((c[Et]||null).action),v=l.submitter;v&&(n=(n=v[Et]||null)?jg(n.formAction):v.getAttribute("formAction"),n!==null&&(d=n,v=null));var A=new Vl("action","action",null,l,c);e.push({event:A,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ur!==0){var H=v?Fg(c,v):new FormData(c);Af(o,{pending:!0,data:H,method:c.method,action:d},null,H)}}else typeof d=="function"&&(A.preventDefault(),H=v?Fg(c,v):new FormData(c),Af(o,{pending:!0,data:H,method:c.method,action:d},d,H))},currentTarget:c}]})}}for(var ld=0;ld<Gc.length;ld++){var sd=Gc[ld],e2=sd.toLowerCase(),t2=sd[0].toUpperCase()+sd.slice(1);sn(e2,"on"+t2)}sn(gm,"onAnimationEnd"),sn(ym,"onAnimationIteration"),sn(xm,"onAnimationStart"),sn("dblclick","onDoubleClick"),sn("focusin","onFocus"),sn("focusout","onBlur"),sn(y_,"onTransitionRun"),sn(x_,"onTransitionStart"),sn(v_,"onTransitionCancel"),sn(vm,"onTransitionEnd"),xr("onMouseEnter",["mouseout","mouseover"]),xr("onMouseLeave",["mouseout","mouseover"]),xr("onPointerEnter",["pointerout","pointerover"]),xr("onPointerLeave",["pointerout","pointerover"]),qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ca="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(" "),n2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ca));function Vg(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],c=l.event;l=l.listeners;e:{var d=void 0;if(n)for(var v=l.length-1;0<=v;v--){var A=l[v],H=A.instance,Q=A.currentTarget;if(A=A.listener,H!==d&&c.isPropagationStopped())break e;d=A,c.currentTarget=Q;try{d(c)}catch(ie){ql(ie)}c.currentTarget=null,d=H}else for(v=0;v<l.length;v++){if(A=l[v],H=A.instance,Q=A.currentTarget,A=A.listener,H!==d&&c.isPropagationStopped())break e;d=A,c.currentTarget=Q;try{d(c)}catch(ie){ql(ie)}c.currentTarget=null,d=H}}}}function Re(e,n){var o=n[ki];o===void 0&&(o=n[ki]=new Set);var l=e+"__bubble";o.has(l)||(kg(n,e,2,!1),o.add(l))}function ud(e,n,o){var l=0;n&&(l|=4),kg(o,e,l,n)}var Rs="_reactListening"+Math.random().toString(36).slice(2);function cd(e){if(!e[Rs]){e[Rs]=!0,Ml.forEach(function(o){o!=="selectionchange"&&(n2.has(o)||ud(o,!1,e),ud(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Rs]||(n[Rs]=!0,ud("selectionchange",!1,n))}}function kg(e,n,o,l){switch(gy(n)){case 2:var c=M2;break;case 8:c=D2;break;default:c=Td}o=c.bind(null,n,o,e),c=void 0,!Rc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),l?c!==void 0?e.addEventListener(n,o,{capture:!0,passive:c}):e.addEventListener(n,o,!0):c!==void 0?e.addEventListener(n,o,{passive:c}):e.addEventListener(n,o,!1)}function fd(e,n,o,l,c){var d=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var A=l.stateNode.containerInfo;if(A===c)break;if(v===4)for(v=l.return;v!==null;){var H=v.tag;if((H===3||H===4)&&v.stateNode.containerInfo===c)return;v=v.return}for(;A!==null;){if(v=mr(A),v===null)return;if(H=v.tag,H===5||H===6||H===26||H===27){l=d=v;continue e}A=A.parentNode}}l=l.return}I0(function(){var Q=d,ie=Nc(o),le=[];e:{var K=bm.get(e);if(K!==void 0){var W=Vl,pe=e;switch(e){case"keypress":if(jl(o)===0)break e;case"keydown":case"keyup":W=ZS;break;case"focusin":pe="focus",W=zc;break;case"focusout":pe="blur",W=zc;break;case"beforeblur":case"afterblur":W=zc;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":W=Z0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=LS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=JS;break;case gm:case ym:case xm:W=VS;break;case vm:W=e_;break;case"scroll":case"scrollend":W=US;break;case"wheel":W=n_;break;case"copy":case"cut":case"paste":W=GS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=K0;break;case"toggle":case"beforetoggle":W=i_}var Ee=(n&4)!==0,Ye=!Ee&&(e==="scroll"||e==="scrollend"),I=Ee?K!==null?K+"Capture":null:K;Ee=[];for(var G=Q,Z;G!==null;){var oe=G;if(Z=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||Z===null||I===null||(oe=Qo(G,I),oe!=null&&Ee.push(Ra(G,oe,Z))),Ye)break;G=G.return}0<Ee.length&&(K=new W(K,pe,null,o,ie),le.push({event:K,listeners:Ee}))}}if((n&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",K&&o!==Ac&&(pe=o.relatedTarget||o.fromElement)&&(mr(pe)||pe[Gn]))break e;if((W||K)&&(K=ie.window===ie?ie:(K=ie.ownerDocument)?K.defaultView||K.parentWindow:window,W?(pe=o.relatedTarget||o.toElement,W=Q,pe=pe?mr(pe):null,pe!==null&&(Ye=u(pe),Ee=pe.tag,pe!==Ye||Ee!==5&&Ee!==27&&Ee!==6)&&(pe=null)):(W=null,pe=Q),W!==pe)){if(Ee=Z0,oe="onMouseLeave",I="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=K0,oe="onPointerLeave",I="onPointerEnter",G="pointer"),Ye=W==null?K:gr(W),Z=pe==null?K:gr(pe),K=new Ee(oe,G+"leave",W,o,ie),K.target=Ye,K.relatedTarget=Z,oe=null,mr(ie)===Q&&(Ee=new Ee(I,G+"enter",pe,o,ie),Ee.target=Z,Ee.relatedTarget=Ye,oe=Ee),Ye=oe,W&&pe)t:{for(Ee=r2,I=W,G=pe,Z=0,oe=I;oe;oe=Ee(oe))Z++;oe=0;for(var be=G;be;be=Ee(be))oe++;for(;0<Z-oe;)I=Ee(I),Z--;for(;0<oe-Z;)G=Ee(G),oe--;for(;Z--;){if(I===G||G!==null&&I===G.alternate){Ee=I;break t}I=Ee(I),G=Ee(G)}Ee=null}else Ee=null;W!==null&&Gg(le,K,W,Ee,!1),pe!==null&&Ye!==null&&Gg(le,Ye,pe,Ee,!0)}}e:{if(K=Q?gr(Q):window,W=K.nodeName&&K.nodeName.toLowerCase(),W==="select"||W==="input"&&K.type==="file")var He=om;else if(rm(K))if(am)He=m_;else{He=d_;var ye=f_}else W=K.nodeName,!W||W.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Q&&Tc(Q.elementType)&&(He=om):He=h_;if(He&&(He=He(e,Q))){im(le,He,o,ie);break e}ye&&ye(e,K,Q),e==="focusout"&&Q&&K.type==="number"&&Q.memoizedProps.value!=null&&Zo(K,"number",K.value)}switch(ye=Q?gr(Q):window,e){case"focusin":(rm(ye)||ye.contentEditable==="true")&&(Zi=ye,Fc=Q,ia=null);break;case"focusout":ia=Fc=Zi=null;break;case"mousedown":Vc=!0;break;case"contextmenu":case"mouseup":case"dragend":Vc=!1,mm(le,o,ie);break;case"selectionchange":if(g_)break;case"keydown":case"keyup":mm(le,o,ie)}var Ne;if(Uc)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else Pi?tm(e,o)&&(De="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(De="onCompositionStart");De&&(J0&&o.locale!=="ko"&&(Pi||De!=="onCompositionStart"?De==="onCompositionEnd"&&Pi&&(Ne=$0()):(vr=ie,Mc="value"in vr?vr.value:vr.textContent,Pi=!0)),ye=Ms(Q,De),0<ye.length&&(De=new Q0(De,e,null,o,ie),le.push({event:De,listeners:ye}),Ne?De.data=Ne:(Ne=nm(o),Ne!==null&&(De.data=Ne)))),(Ne=a_?l_(e,o):s_(e,o))&&(De=Ms(Q,"onBeforeInput"),0<De.length&&(ye=new Q0("onBeforeInput","beforeinput",null,o,ie),le.push({event:ye,listeners:De}),ye.data=Ne)),W_(le,e,Q,o,ie)}Vg(le,n)})}function Ra(e,n,o){return{instance:e,listener:n,currentTarget:o}}function Ms(e,n){for(var o=n+"Capture",l=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Qo(e,o),c!=null&&l.unshift(Ra(e,c,d)),c=Qo(e,n),c!=null&&l.push(Ra(e,c,d))),e.tag===3)return l;e=e.return}return[]}function r2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gg(e,n,o,l,c){for(var d=n._reactName,v=[];o!==null&&o!==l;){var A=o,H=A.alternate,Q=A.stateNode;if(A=A.tag,H!==null&&H===l)break;A!==5&&A!==26&&A!==27||Q===null||(H=Q,c?(Q=Qo(o,d),Q!=null&&v.unshift(Ra(o,Q,H))):c||(Q=Qo(o,d),Q!=null&&v.push(Ra(o,Q,H)))),o=o.return}v.length!==0&&e.push({event:n,listeners:v})}var i2=/\r\n?/g,o2=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(i2,`
9
- `).replace(o2,"")}function Yg(e,n){return n=qg(n),qg(e)===n}function qe(e,n,o,l,c,d){switch(o){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Xi(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Xi(e,""+l);break;case"className":qi(e,"class",l);break;case"tabIndex":qi(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":qi(e,o,l);break;case"style":Y0(e,l,d);break;case"data":if(n!=="object"){qi(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||o!=="href")){e.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(o);break}l=Hl(""+l),e.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){e.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 d=="function"&&(o==="formAction"?(n!=="input"&&qe(e,n,"name",c.name,c,null),qe(e,n,"formEncType",c.formEncType,c,null),qe(e,n,"formMethod",c.formMethod,c,null),qe(e,n,"formTarget",c.formTarget,c,null)):(qe(e,n,"encType",c.encType,c,null),qe(e,n,"method",c.method,c,null),qe(e,n,"target",c.target,c,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(o);break}l=Hl(""+l),e.setAttribute(o,l);break;case"onClick":l!=null&&(e.onclick=Xn);break;case"onScroll":l!=null&&Re("scroll",e);break;case"onScrollEnd":l!=null&&Re("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(o=l.__html,o!=null){if(c.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}o=Hl(""+l),e.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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(o,""+l):e.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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":l===!0?e.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(o,l):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(o,l):e.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(o):e.setAttribute(o,l);break;case"popover":Re("beforetoggle",e),Re("toggle",e),Gi(e,"popover",l);break;case"xlinkActuate":ln(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ln(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ln(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ln(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ln(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ln(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ln(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ln(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ln(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Gi(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=zS.get(o)||o,Gi(e,o,l))}}function dd(e,n,o,l,c,d){switch(o){case"style":Y0(e,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(o=l.__html,o!=null){if(c.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof l=="string"?Xi(e,l):(typeof l=="number"||typeof l=="bigint")&&Xi(e,""+l);break;case"onScroll":l!=null&&Re("scroll",e);break;case"onScrollEnd":l!=null&&Re("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dl.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(c=o.endsWith("Capture"),n=o.slice(2,c?o.length-7:void 0),d=e[Et]||null,d=d!=null?d[o]:null,typeof d=="function"&&e.removeEventListener(n,d,c),typeof l=="function")){typeof d!="function"&&d!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(n,l,c);break e}o in e?e[o]=l:l===!0?e.setAttribute(o,""):Gi(e,o,l)}}}function bt(e,n,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var l=!1,c=!1,d;for(d in o)if(o.hasOwnProperty(d)){var v=o[d];if(v!=null)switch(d){case"src":l=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:qe(e,n,d,v,o,null)}}c&&qe(e,n,"srcSet",o.srcSet,o,null),l&&qe(e,n,"src",o.src,o,null);return;case"input":Re("invalid",e);var A=d=v=c=null,H=null,Q=null;for(l in o)if(o.hasOwnProperty(l)){var ie=o[l];if(ie!=null)switch(l){case"name":c=ie;break;case"type":v=ie;break;case"checked":H=ie;break;case"defaultChecked":Q=ie;break;case"value":d=ie;break;case"defaultValue":A=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,n));break;default:qe(e,n,l,ie,o,null)}}Ul(e,d,A,H,Q,v,c,!1);return;case"select":Re("invalid",e),l=v=d=null;for(c in o)if(o.hasOwnProperty(c)&&(A=o[c],A!=null))switch(c){case"value":d=A;break;case"defaultValue":v=A;break;case"multiple":l=A;default:qe(e,n,c,A,o,null)}n=d,o=v,e.multiple=!!l,n!=null?Yn(e,!!l,n,!1):o!=null&&Yn(e,!!l,o,!0);return;case"textarea":Re("invalid",e),d=c=l=null;for(v in o)if(o.hasOwnProperty(v)&&(A=o[v],A!=null))switch(v){case"value":l=A;break;case"defaultValue":c=A;break;case"children":d=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(a(91));break;default:qe(e,n,v,A,o,null)}G0(e,l,c,d);return;case"option":for(H in o)o.hasOwnProperty(H)&&(l=o[H],l!=null)&&(H==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":qe(e,n,H,l,o,null));return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(l=0;l<Ca.length;l++)Re(Ca[l],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in o)if(o.hasOwnProperty(Q)&&(l=o[Q],l!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:qe(e,n,Q,l,o,null)}return;default:if(Tc(n)){for(ie in o)o.hasOwnProperty(ie)&&(l=o[ie],l!==void 0&&dd(e,n,ie,l,o,void 0));return}}for(A in o)o.hasOwnProperty(A)&&(l=o[A],l!=null&&qe(e,n,A,l,o,null))}function a2(e,n,o,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,v=null,A=null,H=null,Q=null,ie=null;for(W in o){var le=o[W];if(o.hasOwnProperty(W)&&le!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":H=le;default:l.hasOwnProperty(W)||qe(e,n,W,null,l,le)}}for(var K in l){var W=l[K];if(le=o[K],l.hasOwnProperty(K)&&(W!=null||le!=null))switch(K){case"type":d=W;break;case"name":c=W;break;case"checked":Q=W;break;case"defaultChecked":ie=W;break;case"value":v=W;break;case"defaultValue":A=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,n));break;default:W!==le&&qe(e,n,K,W,l,le)}}ii(e,v,A,H,Q,ie,d,c);return;case"select":W=v=A=K=null;for(d in o)if(H=o[d],o.hasOwnProperty(d)&&H!=null)switch(d){case"value":break;case"multiple":W=H;default:l.hasOwnProperty(d)||qe(e,n,d,null,l,H)}for(c in l)if(d=l[c],H=o[c],l.hasOwnProperty(c)&&(d!=null||H!=null))switch(c){case"value":K=d;break;case"defaultValue":A=d;break;case"multiple":v=d;default:d!==H&&qe(e,n,c,d,l,H)}n=A,o=v,l=W,K!=null?Yn(e,!!o,K,!1):!!l!=!!o&&(n!=null?Yn(e,!!o,n,!0):Yn(e,!!o,o?[]:"",!1));return;case"textarea":W=K=null;for(A in o)if(c=o[A],o.hasOwnProperty(A)&&c!=null&&!l.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:qe(e,n,A,null,l,c)}for(v in l)if(c=l[v],d=o[v],l.hasOwnProperty(v)&&(c!=null||d!=null))switch(v){case"value":K=c;break;case"defaultValue":W=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(a(91));break;default:c!==d&&qe(e,n,v,c,l,d)}k0(e,K,W);return;case"option":for(var pe in o)K=o[pe],o.hasOwnProperty(pe)&&K!=null&&!l.hasOwnProperty(pe)&&(pe==="selected"?e.selected=!1:qe(e,n,pe,null,l,K));for(H in l)K=l[H],W=o[H],l.hasOwnProperty(H)&&K!==W&&(K!=null||W!=null)&&(H==="selected"?e.selected=K&&typeof K!="function"&&typeof K!="symbol":qe(e,n,H,K,l,W));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 Ee in o)K=o[Ee],o.hasOwnProperty(Ee)&&K!=null&&!l.hasOwnProperty(Ee)&&qe(e,n,Ee,null,l,K);for(Q in l)if(K=l[Q],W=o[Q],l.hasOwnProperty(Q)&&K!==W&&(K!=null||W!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,n));break;default:qe(e,n,Q,K,l,W)}return;default:if(Tc(n)){for(var Ye in o)K=o[Ye],o.hasOwnProperty(Ye)&&K!==void 0&&!l.hasOwnProperty(Ye)&&dd(e,n,Ye,void 0,l,K);for(ie in l)K=l[ie],W=o[ie],!l.hasOwnProperty(ie)||K===W||K===void 0&&W===void 0||dd(e,n,ie,K,l,W);return}}for(var I in o)K=o[I],o.hasOwnProperty(I)&&K!=null&&!l.hasOwnProperty(I)&&qe(e,n,I,null,l,K);for(le in l)K=l[le],W=o[le],!l.hasOwnProperty(le)||K===W||K==null&&W==null||qe(e,n,le,K,l,W)}function Xg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var c=o[l],d=c.transferSize,v=c.initiatorType,A=c.duration;if(d&&A&&Xg(v)){for(v=0,A=c.responseEnd,l+=1;l<o.length;l++){var H=o[l],Q=H.startTime;if(Q>A)break;var ie=H.transferSize,le=H.initiatorType;ie&&Xg(le)&&(H=H.responseEnd,v+=ie*(H<A?1:(A-Q)/(H-Q)))}if(--l,n+=8*(d+v)/(c.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hd=null,md=null;function Ds(e){return e.nodeType===9?e:e.ownerDocument}function Ig(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $g(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function pd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var gd=null;function s2(){var e=window.event;return e&&e.type==="popstate"?e===gd?!1:(gd=e,!0):(gd=null,!1)}var Pg=typeof setTimeout=="function"?setTimeout:void 0,u2=typeof clearTimeout=="function"?clearTimeout:void 0,Zg=typeof Promise=="function"?Promise:void 0,c2=typeof queueMicrotask=="function"?queueMicrotask:typeof Zg<"u"?function(e){return Zg.resolve(null).then(e).catch(f2)}:Pg;function f2(e){setTimeout(function(){throw e})}function Hr(e){return e==="head"}function Qg(e,n){var o=n,l=0;do{var c=o.nextSibling;if(e.removeChild(o),c&&c.nodeType===8)if(o=c.data,o==="/$"||o==="/&"){if(l===0){e.removeChild(c),_o(n);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")Ma(e.ownerDocument.documentElement);else if(o==="head"){o=e.ownerDocument.head,Ma(o);for(var d=o.firstChild;d;){var v=d.nextSibling,A=d.nodeName;d[ni]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&d.rel.toLowerCase()==="stylesheet"||o.removeChild(d),d=v}}else o==="body"&&Ma(e.ownerDocument.body);o=c}while(o);_o(n)}function Kg(e,n){var o=e;e=0;do{var l=o.nextSibling;if(o.nodeType===1?n?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(n?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(e===0)break;e--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||e++;o=l}while(o)}function yd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var o=n;switch(n=n.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":yd(o),$o(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function d2(e,n,o,l){for(;e.nodeType===1;){var c=o;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ni])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=nn(e.nextSibling),e===null)break}return null}function h2(e,n,o){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=nn(e.nextSibling),e===null))return null;return e}function Jg(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=nn(e.nextSibling),e===null))return null;return e}function xd(e){return e.data==="$?"||e.data==="$~"}function vd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m2(e,n){var o=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||o.readyState!=="loading")n();else{var l=function(){n(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function nn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var bd=null;function Wg(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"||o==="/&"){if(n===0)return nn(e.nextSibling);n--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||n++}e=e.nextSibling}return null}function ey(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(n===0)return e;n--}else o!=="/$"&&o!=="/&"||n++}e=e.previousSibling}return null}function ty(e,n,o){switch(n=Ds(o),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ma(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);$o(e)}var rn=new Map,ny=new Set;function Os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var lr=L.d;L.d={f:p2,r:g2,D:y2,C:x2,L:v2,m:b2,X:S2,S:E2,M:_2};function p2(){var e=lr.f(),n=_s();return e||n}function g2(e){var n=pr(e);n!==null&&n.tag===5&&n.type==="form"?vp(n):lr.r(e)}var bo=typeof document>"u"?null:document;function ry(e,n,o){var l=bo;if(l&&typeof n=="string"&&n){var c=Ot(n);c='link[rel="'+e+'"][href="'+c+'"]',typeof o=="string"&&(c+='[crossorigin="'+o+'"]'),ny.has(c)||(ny.add(c),e={rel:e,crossOrigin:o,href:n},l.querySelector(c)===null&&(n=l.createElement("link"),bt(n,"link",e),ot(n),l.head.appendChild(n)))}}function y2(e){lr.D(e),ry("dns-prefetch",e,null)}function x2(e,n){lr.C(e,n),ry("preconnect",e,n)}function v2(e,n,o){lr.L(e,n,o);var l=bo;if(l&&e&&n){var c='link[rel="preload"][as="'+Ot(n)+'"]';n==="image"&&o&&o.imageSrcSet?(c+='[imagesrcset="'+Ot(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(c+='[imagesizes="'+Ot(o.imageSizes)+'"]')):c+='[href="'+Ot(e)+'"]';var d=c;switch(n){case"style":d=Eo(e);break;case"script":d=So(e)}rn.has(d)||(e=g({rel:"preload",href:n==="image"&&o&&o.imageSrcSet?void 0:e,as:n},o),rn.set(d,e),l.querySelector(c)!==null||n==="style"&&l.querySelector(Da(d))||n==="script"&&l.querySelector(Oa(d))||(n=l.createElement("link"),bt(n,"link",e),ot(n),l.head.appendChild(n)))}}function b2(e,n){lr.m(e,n);var o=bo;if(o&&e){var l=n&&typeof n.as=="string"?n.as:"script",c='link[rel="modulepreload"][as="'+Ot(l)+'"][href="'+Ot(e)+'"]',d=c;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=So(e)}if(!rn.has(d)&&(e=g({rel:"modulepreload",href:e},n),rn.set(d,e),o.querySelector(c)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Oa(d)))return}l=o.createElement("link"),bt(l,"link",e),ot(l),o.head.appendChild(l)}}}function E2(e,n,o){lr.S(e,n,o);var l=bo;if(l&&e){var c=yr(l).hoistableStyles,d=Eo(e);n=n||"default";var v=c.get(d);if(!v){var A={loading:0,preload:null};if(v=l.querySelector(Da(d)))A.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},o),(o=rn.get(d))&&Ed(e,o);var H=v=l.createElement("link");ot(H),bt(H,"link",e),H._p=new Promise(function(Q,ie){H.onload=Q,H.onerror=ie}),H.addEventListener("load",function(){A.loading|=1}),H.addEventListener("error",function(){A.loading|=2}),A.loading|=4,zs(v,n,l)}v={type:"stylesheet",instance:v,count:1,state:A},c.set(d,v)}}}function S2(e,n){lr.X(e,n);var o=bo;if(o&&e){var l=yr(o).hoistableScripts,c=So(e),d=l.get(c);d||(d=o.querySelector(Oa(c)),d||(e=g({src:e,async:!0},n),(n=rn.get(c))&&Sd(e,n),d=o.createElement("script"),ot(d),bt(d,"link",e),o.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function _2(e,n){lr.M(e,n);var o=bo;if(o&&e){var l=yr(o).hoistableScripts,c=So(e),d=l.get(c);d||(d=o.querySelector(Oa(c)),d||(e=g({src:e,async:!0,type:"module"},n),(n=rn.get(c))&&Sd(e,n),d=o.createElement("script"),ot(d),bt(d,"link",e),o.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(c,d))}}function iy(e,n,o,l){var c=(c=he.current)?Os(c):null;if(!c)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(n=Eo(o.href),o=yr(c).hoistableStyles,l=o.get(n),l||(l={type:"style",instance:null,count:0,state:null},o.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=Eo(o.href);var d=yr(c).hoistableStyles,v=d.get(e);if(v||(c=c.ownerDocument||c,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,v),(d=c.querySelector(Da(e)))&&!d._p&&(v.instance=d,v.state.loading=5),rn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},rn.set(e,o),d||w2(c,e,o,v.state))),n&&l===null)throw Error(a(528,""));return v}if(n&&l!==null)throw Error(a(529,""));return null;case"script":return n=o.async,o=o.src,typeof o=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=So(o),o=yr(c).hoistableScripts,l=o.get(n),l||(l={type:"script",instance:null,count:0,state:null},o.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Eo(e){return'href="'+Ot(e)+'"'}function Da(e){return'link[rel="stylesheet"]['+e+"]"}function oy(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function w2(e,n,o,l){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=e.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),bt(n,"link",o),ot(n),e.head.appendChild(n))}function So(e){return'[src="'+Ot(e)+'"]'}function Oa(e){return"script[async]"+e}function ay(e,n,o){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+Ot(o.href)+'"]');if(l)return n.instance=l,ot(l),l;var c=g({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),ot(l),bt(l,"style",c),zs(l,o.precedence,e),n.instance=l;case"stylesheet":c=Eo(o.href);var d=e.querySelector(Da(c));if(d)return n.state.loading|=4,n.instance=d,ot(d),d;l=oy(o),(c=rn.get(c))&&Ed(l,c),d=(e.ownerDocument||e).createElement("link"),ot(d);var v=d;return v._p=new Promise(function(A,H){v.onload=A,v.onerror=H}),bt(d,"link",l),n.state.loading|=4,zs(d,o.precedence,e),n.instance=d;case"script":return d=So(o.src),(c=e.querySelector(Oa(d)))?(n.instance=c,ot(c),c):(l=o,(c=rn.get(d))&&(l=g({},o),Sd(l,c)),e=e.ownerDocument||e,c=e.createElement("script"),ot(c),bt(c,"link",l),e.head.appendChild(c),n.instance=c);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,zs(l,o.precedence,e));return n.instance}function zs(e,n,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=l.length?l[l.length-1]:null,d=c,v=0;v<l.length;v++){var A=l[v];if(A.dataset.precedence===n)d=A;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=o.nodeType===9?o.head:o,n.insertBefore(e,n.firstChild))}function Ed(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Sd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Bs=null;function ly(e,n,o){if(Bs===null){var l=new Map,c=Bs=new Map;c.set(o,l)}else c=Bs,l=c.get(o),l||(l=new Map,c.set(o,l));if(l.has(e))return l;for(l.set(e,null),o=o.getElementsByTagName(e),c=0;c<o.length;c++){var d=o[c];if(!(d[ni]||d[ht]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(n)||"";v=e+v;var A=l.get(v);A?A.push(d):l.set(v,[d])}}return l}function sy(e,n,o){e=e.ownerDocument||e,e.head.insertBefore(o,n==="title"?e.querySelector("head > title"):null)}function T2(e,n,o){if(o===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function uy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A2(e,n,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var c=Eo(l.href),d=n.querySelector(Da(c));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Us.bind(e),n.then(e,e)),o.state.loading|=4,o.instance=d,ot(d);return}d=n.ownerDocument||n,l=oy(l),(c=rn.get(c))&&Ed(l,c),d=d.createElement("link"),ot(d);var v=d;v._p=new Promise(function(A,H){v.onload=A,v.onerror=H}),bt(d,"link",l),o.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(o,n),(n=o.state.preload)&&(o.state.loading&3)===0&&(e.count++,o=Us.bind(e),n.addEventListener("load",o),n.addEventListener("error",o))}}var _d=0;function N2(e,n){return e.stylesheets&&e.count===0&&Ls(e,e.stylesheets),0<e.count||0<e.imgCount?function(o){var l=setTimeout(function(){if(e.stylesheets&&Ls(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&_d===0&&(_d=62500*l2());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ls(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>_d?50:800)+n);return e.unsuspend=o,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(c)}}:null}function Us(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ls(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Hs=null;function Ls(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Hs=new Map,n.forEach(C2,e),Hs=null,Us.call(e))}function C2(e,n){if(!(n.state.loading&4)){var o=Hs.get(e);if(o)var l=o.get(null);else{o=new Map,Hs.set(e,o);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var v=c[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(o.set(v.dataset.precedence,v),l=v)}l&&o.set(null,l)}c=n.instance,v=c.getAttribute("data-precedence"),d=o.get(v)||l,d===l&&o.set(null,c),o.set(v,c),this.count++,l=Us.bind(this),c.addEventListener("load",l),c.addEventListener("error",l),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),n.state.loading|=4}}var za={$$typeof:_,Provider:null,Consumer:null,_currentValue:k,_currentValue2:k,_threadCount:0};function R2(e,n,o,l,c,d,v,A,H){this.tag=1,this.containerInfo=e,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=Yo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.hiddenUpdates=Yo(null),this.identifierPrefix=l,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function cy(e,n,o,l,c,d,v,A,H,Q,ie,le){return e=new R2(e,n,o,v,H,Q,ie,le,A),n=1,d===!0&&(n|=24),d=kt(3,null,null,n),e.current=d,d.stateNode=e,n=tf(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:l,isDehydrated:o,cache:n},af(d),e}function fy(e){return e?(e=Ji,e):Ji}function dy(e,n,o,l,c,d){c=fy(c),l.context===null?l.context=c:l.pendingContext=c,l=Tr(n),l.payload={element:o},d=d===void 0?null:d,d!==null&&(l.callback=d),o=Ar(e,l,n),o!==null&&(jt(o,e,n),fa(o,e,n))}function hy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function wd(e,n){hy(e,n),(e=e.alternate)&&hy(e,n)}function my(e){if(e.tag===13||e.tag===31){var n=si(e,67108864);n!==null&&jt(n,e,67108864),wd(e,67108864)}}function py(e){if(e.tag===13||e.tag===31){var n=It();n=Xo(n);var o=si(e,n);o!==null&&jt(o,e,n),wd(e,n)}}var js=!0;function M2(e,n,o,l){var c=R.T;R.T=null;var d=L.p;try{L.p=2,Td(e,n,o,l)}finally{L.p=d,R.T=c}}function D2(e,n,o,l){var c=R.T;R.T=null;var d=L.p;try{L.p=8,Td(e,n,o,l)}finally{L.p=d,R.T=c}}function Td(e,n,o,l){if(js){var c=Ad(l);if(c===null)fd(e,n,l,Fs,o),yy(e,l);else if(z2(c,e,n,o,l))l.stopPropagation();else if(yy(e,l),n&4&&-1<O2.indexOf(e)){for(;c!==null;){var d=pr(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=kn(d.pendingLanes);if(v!==0){var A=d;for(A.pendingLanes|=2,A.entangledLanes|=2;v;){var H=1<<31-Nt(v);A.entanglements[1]|=H,v&=~H}Nn(d),(Fe&6)===0&&(Es=$e()+500,Na(0))}}break;case 31:case 13:A=si(d,2),A!==null&&jt(A,d,2),_s(),wd(d,2)}if(d=Ad(l),d===null&&fd(e,n,l,Fs,o),d===c)break;c=d}c!==null&&l.stopPropagation()}else fd(e,n,l,null,o)}}function Ad(e){return e=Nc(e),Nd(e)}var Fs=null;function Nd(e){if(Fs=null,e=mr(e),e!==null){var n=u(e);if(n===null)e=null;else{var o=n.tag;if(o===13){if(e=f(n),e!==null)return e;e=null}else if(o===31){if(e=h(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Fs=e,null}function gy(e){switch(e){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(bn()){case an:return 2;case En:return 8;case Vn:case dc:return 32;case Hi:return 268435456;default:return 32}default:return 32}}var Cd=!1,Lr=null,jr=null,Fr=null,Ba=new Map,Ua=new Map,Vr=[],O2="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 yy(e,n){switch(e){case"focusin":case"focusout":Lr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Fr=null;break;case"pointerover":case"pointerout":Ba.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ua.delete(n.pointerId)}}function Ha(e,n,o,l,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:d,targetContainers:[c]},n!==null&&(n=pr(n),n!==null&&my(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function z2(e,n,o,l,c){switch(n){case"focusin":return Lr=Ha(Lr,e,n,o,l,c),!0;case"dragenter":return jr=Ha(jr,e,n,o,l,c),!0;case"mouseover":return Fr=Ha(Fr,e,n,o,l,c),!0;case"pointerover":var d=c.pointerId;return Ba.set(d,Ha(Ba.get(d)||null,e,n,o,l,c)),!0;case"gotpointercapture":return d=c.pointerId,Ua.set(d,Ha(Ua.get(d)||null,e,n,o,l,c)),!0}return!1}function xy(e){var n=mr(e.target);if(n!==null){var o=u(n);if(o!==null){if(n=o.tag,n===13){if(n=f(o),n!==null){e.blockedOn=n,Nl(e.priority,function(){py(o)});return}}else if(n===31){if(n=h(o),n!==null){e.blockedOn=n,Nl(e.priority,function(){py(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vs(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=Ad(e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);Ac=l,o.target.dispatchEvent(l),Ac=null}else return n=pr(o),n!==null&&my(n),e.blockedOn=o,!1;n.shift()}return!0}function vy(e,n,o){Vs(e)&&o.delete(n)}function B2(){Cd=!1,Lr!==null&&Vs(Lr)&&(Lr=null),jr!==null&&Vs(jr)&&(jr=null),Fr!==null&&Vs(Fr)&&(Fr=null),Ba.forEach(vy),Ua.forEach(vy)}function ks(e,n){e.blockedOn===n&&(e.blockedOn=null,Cd||(Cd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,B2)))}var Gs=null;function by(e){Gs!==e&&(Gs=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gs===e&&(Gs=null);for(var n=0;n<e.length;n+=3){var o=e[n],l=e[n+1],c=e[n+2];if(typeof l!="function"){if(Nd(l||o)===null)continue;break}var d=pr(o);d!==null&&(e.splice(n,3),n-=3,Af(d,{pending:!0,data:c,method:o.method,action:l},l,c))}}))}function _o(e){function n(H){return ks(H,e)}Lr!==null&&ks(Lr,e),jr!==null&&ks(jr,e),Fr!==null&&ks(Fr,e),Ba.forEach(n),Ua.forEach(n);for(var o=0;o<Vr.length;o++){var l=Vr[o];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Vr.length&&(o=Vr[0],o.blockedOn===null);)xy(o),o.blockedOn===null&&Vr.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var c=o[l],d=o[l+1],v=c[Et]||null;if(typeof d=="function")v||by(o);else if(v){var A=null;if(d&&d.hasAttribute("formAction")){if(c=d,v=d[Et]||null)A=v.formAction;else if(Nd(c)!==null)continue}else A=v.action;typeof A=="function"?o[l+1]=A:(o.splice(l,3),l-=3),by(o)}}}function Ey(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return c=v})},focusReset:"manual",scroll:"manual"})}function n(){c!==null&&(c(),c=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),c!==null&&(c(),c=null)}}}function Rd(e){this._internalRoot=e}qs.prototype.render=Rd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var o=n.current,l=It();dy(o,l,e,n,null,null)},qs.prototype.unmount=Rd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;dy(e.current,2,null,e,null,null),_s(),n[Gn]=null}};function qs(e){this._internalRoot=e}qs.prototype.unstable_scheduleHydration=function(e){if(e){var n=Al();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Vr.length&&n!==0&&n<Vr[o].priority;o++);Vr.splice(o,0,e),o===0&&xy(e)}};var Sy=r.version;if(Sy!=="19.2.4")throw Error(a(527,Sy,"19.2.4"));L.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var U2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ys=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ys.isDisabled&&Ys.supportsFiber)try{Wr=Ys.inject(U2),At=Ys}catch{}}return ja.createRoot=function(e,n){if(!s(e))throw Error(a(299));var o=!1,l="",c=Rp,d=Mp,v=Dp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=cy(e,1,!1,null,null,o,l,null,c,d,v,Ey),e[Gn]=n.current,cd(e),new Rd(n)},ja.hydrateRoot=function(e,n,o){if(!s(e))throw Error(a(299));var l=!1,c="",d=Rp,v=Mp,A=Dp,H=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(c=o.identifierPrefix),o.onUncaughtError!==void 0&&(d=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(A=o.onRecoverableError),o.formState!==void 0&&(H=o.formState)),n=cy(e,1,!0,n,o??null,l,c,H,d,v,A,Ey),n.context=fy(null),o=n.current,l=It(),l=Xo(l),c=Tr(l),c.callback=null,Ar(o,c,l),o=l,n.current.lanes=o,ti(n,o),Nn(n),e[Gn]=n.current,cd(e),new qs(n)},ja.version="19.2.4",ja}var Oy;function X2(){if(Oy)return Od.exports;Oy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Od.exports=Y2(),Od.exports}var I2=X2();const On=Object.create(null);On.open="0";On.close="1";On.ping="2";On.pong="3";On.message="4";On.upgrade="5";On.noop="6";const su=Object.create(null);Object.keys(On).forEach(t=>{su[On[t]]=t});const lh={type:"error",data:"parser error"},yv=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",xv=typeof ArrayBuffer=="function",vv=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Hh=({type:t,data:r},i,a)=>yv&&r instanceof Blob?i?a(r):zy(r,a):xv&&(r instanceof ArrayBuffer||vv(r))?i?a(r):zy(new Blob([r]),a):a(On[t]+(r||"")),zy=(t,r)=>{const i=new FileReader;return i.onload=function(){const a=i.result.split(",")[1];r("b"+(a||""))},i.readAsDataURL(t)};function By(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Hd;function $2(t,r){if(yv&&t.data instanceof Blob)return t.data.arrayBuffer().then(By).then(r);if(xv&&(t.data instanceof ArrayBuffer||vv(t.data)))return r(By(t.data));Hh(t,!1,i=>{Hd||(Hd=new TextEncoder),r(Hd.encode(i))})}const Uy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Uy.length;t++)Xa[Uy.charCodeAt(t)]=t;const P2=t=>{let r=t.length*.75,i=t.length,a,s=0,u,f,h,p;t[t.length-1]==="="&&(r--,t[t.length-2]==="="&&r--);const m=new ArrayBuffer(r),y=new Uint8Array(m);for(a=0;a<i;a+=4)u=Xa[t.charCodeAt(a)],f=Xa[t.charCodeAt(a+1)],h=Xa[t.charCodeAt(a+2)],p=Xa[t.charCodeAt(a+3)],y[s++]=u<<2|f>>4,y[s++]=(f&15)<<4|h>>2,y[s++]=(h&3)<<6|p&63;return m},Z2=typeof ArrayBuffer=="function",Lh=(t,r)=>{if(typeof t!="string")return{type:"message",data:bv(t,r)};const i=t.charAt(0);return i==="b"?{type:"message",data:Q2(t.substring(1),r)}:su[i]?t.length>1?{type:su[i],data:t.substring(1)}:{type:su[i]}:lh},Q2=(t,r)=>{if(Z2){const i=P2(t);return bv(i,r)}else return{base64:!0,data:t}},bv=(t,r)=>r==="blob"?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,Ev="",K2=(t,r)=>{const i=t.length,a=new Array(i);let s=0;t.forEach((u,f)=>{Hh(u,!1,h=>{a[f]=h,++s===i&&r(a.join(Ev))})})},J2=(t,r)=>{const i=t.split(Ev),a=[];for(let s=0;s<i.length;s++){const u=Lh(i[s],r);if(a.push(u),u.type==="error")break}return a};function W2(){return new TransformStream({transform(t,r){$2(t,i=>{const a=i.length;let s;if(a<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,a);else if(a<65536){s=new Uint8Array(3);const u=new DataView(s.buffer);u.setUint8(0,126),u.setUint16(1,a)}else{s=new Uint8Array(9);const u=new DataView(s.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(a))}t.data&&typeof t.data!="string"&&(s[0]|=128),r.enqueue(s),r.enqueue(i)})}})}let Ld;function Xs(t){return t.reduce((r,i)=>r+i.length,0)}function Is(t,r){if(t[0].length===r)return t.shift();const i=new Uint8Array(r);let a=0;for(let s=0;s<r;s++)i[s]=t[0][a++],a===t[0].length&&(t.shift(),a=0);return t.length&&a<t[0].length&&(t[0]=t[0].slice(a)),i}function ew(t,r){Ld||(Ld=new TextDecoder);const i=[];let a=0,s=-1,u=!1;return new TransformStream({transform(f,h){for(i.push(f);;){if(a===0){if(Xs(i)<1)break;const p=Is(i,1);u=(p[0]&128)===128,s=p[0]&127,s<126?a=3:s===126?a=1:a=2}else if(a===1){if(Xs(i)<2)break;const p=Is(i,2);s=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),a=3}else if(a===2){if(Xs(i)<8)break;const p=Is(i,8),m=new DataView(p.buffer,p.byteOffset,p.length),y=m.getUint32(0);if(y>Math.pow(2,21)-1){h.enqueue(lh);break}s=y*Math.pow(2,32)+m.getUint32(4),a=3}else{if(Xs(i)<s)break;const p=Is(i,s);h.enqueue(Lh(u?p:Ld.decode(p),r)),a=0}if(s===0||s>t){h.enqueue(lh);break}}}})}const Sv=4;function ct(t){if(t)return tw(t)}function tw(t){for(var r in ct.prototype)t[r]=ct.prototype[r];return t}ct.prototype.on=ct.prototype.addEventListener=function(t,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(r),this};ct.prototype.once=function(t,r){function i(){this.off(t,i),r.apply(this,arguments)}return i.fn=r,this.on(t,i),this};ct.prototype.off=ct.prototype.removeListener=ct.prototype.removeAllListeners=ct.prototype.removeEventListener=function(t,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+t];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var a,s=0;s<i.length;s++)if(a=i[s],a===r||a.fn===r){i.splice(s,1);break}return i.length===0&&delete this._callbacks["$"+t],this};ct.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+t],a=1;a<arguments.length;a++)r[a-1]=arguments[a];if(i){i=i.slice(0);for(var a=0,s=i.length;a<s;++a)i[a].apply(this,r)}return this};ct.prototype.emitReserved=ct.prototype.emit;ct.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ct.prototype.hasListeners=function(t){return!!this.listeners(t).length};const ju=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),on=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nw="arraybuffer";function _v(t,...r){return r.reduce((i,a)=>(t.hasOwnProperty(a)&&(i[a]=t[a]),i),{})}const rw=on.setTimeout,iw=on.clearTimeout;function Fu(t,r){r.useNativeTimers?(t.setTimeoutFn=rw.bind(on),t.clearTimeoutFn=iw.bind(on)):(t.setTimeoutFn=on.setTimeout.bind(on),t.clearTimeoutFn=on.clearTimeout.bind(on))}const ow=1.33;function aw(t){return typeof t=="string"?lw(t):Math.ceil((t.byteLength||t.size)*ow)}function lw(t){let r=0,i=0;for(let a=0,s=t.length;a<s;a++)r=t.charCodeAt(a),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(a++,i+=4);return i}function wv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function sw(t){let r="";for(let i in t)t.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return r}function uw(t){let r={},i=t.split("&");for(let a=0,s=i.length;a<s;a++){let u=i[a].split("=");r[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return r}class cw extends Error{constructor(r,i,a){super(r),this.description=i,this.context=a,this.type="TransportError"}}class jh extends ct{constructor(r){super(),this.writable=!1,Fu(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,a){return super.emitReserved("error",new cw(r,i,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=Lh(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_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(r){const i=sw(r);return i.length?"?"+i:""}}class fw extends jh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||i()})),this.writable||(a++,this.once("drain",function(){--a||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};J2(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,K2(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=wv()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let Tv=!1;try{Tv=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const dw=Tv;function hw(){}class mw extends fw{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let a=location.port;a||(a=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||a!==r.port}}doWrite(r,i){const a=this.request({method:"POST",data:r});a.on("success",i),a.on("error",(s,u)=>{this.onError("xhr post error",s,u)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,a)=>{this.onError("xhr poll error",i,a)}),this.pollXhr=r}}class Mn extends ct{constructor(r,i,a){super(),this.createRequest=r,Fu(this,a),this._opts=a,this._method=a.method||"GET",this._uri=i,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var r;const i=_v(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(i);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&a.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var s;a.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Mn.requestsCount++,Mn.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=hw,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Mn.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Mn.requestsCount=0;Mn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Hy);else if(typeof addEventListener=="function"){const t="onpagehide"in on?"pagehide":"unload";addEventListener(t,Hy,!1)}}function Hy(){for(let t in Mn.requests)Mn.requests.hasOwnProperty(t)&&Mn.requests[t].abort()}const pw=(function(){const t=Av({xdomain:!1});return t&&t.responseType!==null})();class gw extends mw{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=pw&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Mn(Av,this.uri(),r)}}function Av(t){const r=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||dw))return new XMLHttpRequest}catch{}if(!r)try{return new on[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Nv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yw extends jh{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,a=Nv?{}:_v(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,a)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const a=r[i],s=i===r.length-1;Hh(a,this.supportsBinary,u=>{try{this.doWrite(a,u)}catch{}s&&ju(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=wv()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const jd=on.WebSocket||on.MozWebSocket;class xw extends yw{createSocket(r,i,a){return Nv?new jd(r,i,a):i?new jd(r,i):new jd(r)}doWrite(r,i){this.ws.send(i)}}class vw extends jh{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=ew(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=r.readable.pipeThrough(i).getReader(),s=W2();s.readable.pipeTo(r.writable),this._writer=s.writable.getWriter();const u=()=>{a.read().then(({done:h,value:p})=>{h||(this.onPacket(p),u())}).catch(h=>{})};u();const f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const a=r[i],s=i===r.length-1;this._writer.write(a).then(()=>{s&&ju(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const bw={websocket:xw,webtransport:vw,polling:gw},Ew=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Sw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function sh(t){if(t.length>8e3)throw"URI too long";const r=t,i=t.indexOf("["),a=t.indexOf("]");i!=-1&&a!=-1&&(t=t.substring(0,i)+t.substring(i,a).replace(/:/g,";")+t.substring(a,t.length));let s=Ew.exec(t||""),u={},f=14;for(;f--;)u[Sw[f]]=s[f]||"";return i!=-1&&a!=-1&&(u.source=r,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=_w(u,u.path),u.queryKey=ww(u,u.query),u}function _w(t,r){const i=/\/{2,9}/g,a=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&a.splice(0,1),r.slice(-1)=="/"&&a.splice(a.length-1,1),a}function ww(t,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,u){s&&(i[s]=u)}),i}const uh=typeof addEventListener=="function"&&typeof removeEventListener=="function",uu=[];uh&&addEventListener("offline",()=>{uu.forEach(t=>t())},!1);class $r extends ct{constructor(r,i){if(super(),this.binaryType=nw,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const a=sh(r);i.hostname=a.host,i.secure=a.protocol==="https"||a.protocol==="wss",i.port=a.port,a.query&&(i.query=a.query)}else i.host&&(i.hostname=sh(i.host).host);Fu(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(a=>{const s=a.prototype.name;this.transports.push(s),this._transportsByName[s]=a}),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},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=uw(this.opts.query)),uh&&(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"})},uu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=Sv,i.transport=r,this.id&&(i.sid=this.id);const a=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&$r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",$r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),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 r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(i+=aw(s)),a>0&&i>this._maxPayload)return this.writeBuffer.slice(0,a);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,ju(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,a){return this._sendPacket("message",r,i,a),this}send(r,i,a){return this._sendPacket("message",r,i,a),this}_sendPacket(r,i,a,s){if(typeof i=="function"&&(s=i,i=void 0),typeof a=="function"&&(s=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const u={type:r,data:i,options:a};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),s&&this.once("flush",s),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},a=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():r()}):this.upgrading?a():r()),this}_onError(r){if($r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){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(),uh&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=uu.indexOf(this._offlineEventListener);a!==-1&&uu.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}$r.protocol=Sv;class Tw extends $r{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),a=!1;$r.priorWebsocketSuccess=!1;const s=()=>{a||(i.send([{type:"ping",data:"probe"}]),i.once("packet",g=>{if(!a)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;$r.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(y(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=i.name,this.emitReserved("upgradeError",x)}}))};function u(){a||(a=!0,y(),i.close(),i=null)}const f=g=>{const x=new Error("probe error: "+g);x.transport=i.name,u(),this.emitReserved("upgradeError",x)};function h(){f("transport closed")}function p(){f("socket closed")}function m(g){i&&g.name!==i.name&&u()}const y=()=>{i.removeListener("open",s),i.removeListener("error",f),i.removeListener("close",h),this.off("close",p),this.off("upgrading",m)};i.once("open",s),i.once("error",f),i.once("close",h),this.once("close",p),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{a||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let a=0;a<r.length;a++)~this.transports.indexOf(r[a])&&i.push(r[a]);return i}}let Aw=class extends Tw{constructor(r,i={}){const a=typeof r=="object"?r:i;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(s=>bw[s]).filter(s=>!!s)),super(r,a)}};function Nw(t,r="",i){let a=t;i=i||typeof location<"u"&&location,t==null&&(t=i.protocol+"//"+i.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=i.protocol+t:t=i.host+t),/^(https?|wss?):\/\//.test(t)||(typeof i<"u"?t=i.protocol+"//"+t:t="https://"+t),a=sh(t)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const u=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+u+":"+a.port+r,a.href=a.protocol+"://"+u+(i&&i.port===a.port?"":":"+a.port),a}const Cw=typeof ArrayBuffer=="function",Rw=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Cv=Object.prototype.toString,Mw=typeof Blob=="function"||typeof Blob<"u"&&Cv.call(Blob)==="[object BlobConstructor]",Dw=typeof File=="function"||typeof File<"u"&&Cv.call(File)==="[object FileConstructor]";function Fh(t){return Cw&&(t instanceof ArrayBuffer||Rw(t))||Mw&&t instanceof Blob||Dw&&t instanceof File}function cu(t,r){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let i=0,a=t.length;i<a;i++)if(cu(t[i]))return!0;return!1}if(Fh(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return cu(t.toJSON(),!0);for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&cu(t[i]))return!0;return!1}function Ow(t){const r=[],i=t.data,a=t;return a.data=ch(i,r),a.attachments=r.length,{packet:a,buffers:r}}function ch(t,r){if(!t)return t;if(Fh(t)){const i={_placeholder:!0,num:r.length};return r.push(t),i}else if(Array.isArray(t)){const i=new Array(t.length);for(let a=0;a<t.length;a++)i[a]=ch(t[a],r);return i}else if(typeof t=="object"&&!(t instanceof Date)){const i={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=ch(t[a],r));return i}return t}function zw(t,r){return t.data=fh(t.data,r),delete t.attachments,t}function fh(t,r){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<r.length)return r[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i]=fh(t[i],r);else if(typeof t=="object")for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(t[i]=fh(t[i],r));return t}const Bw=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Be;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Be||(Be={}));class Uw{constructor(r){this.replacer=r}encode(r){return(r.type===Be.EVENT||r.type===Be.ACK)&&cu(r)?this.encodeAsBinary({type:r.type===Be.EVENT?Be.BINARY_EVENT:Be.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Be.BINARY_EVENT||r.type===Be.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=Ow(r),a=this.encodeAsString(i.packet),s=i.buffers;return s.unshift(a),s}}class Vh extends ct{constructor(r){super(),this.reviver=r}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const a=i.type===Be.BINARY_EVENT;a||i.type===Be.BINARY_ACK?(i.type=a?Be.EVENT:Be.ACK,this.reconstructor=new Hw(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Fh(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const a={type:Number(r.charAt(0))};if(Be[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===Be.BINARY_EVENT||a.type===Be.BINARY_ACK){const u=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const f=r.substring(u,i);if(f!=Number(f)||r.charAt(i)!=="-")throw new Error("Illegal attachments");a.attachments=Number(f)}if(r.charAt(i+1)==="/"){const u=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););a.nsp=r.substring(u,i)}else a.nsp="/";const s=r.charAt(i+1);if(s!==""&&Number(s)==s){const u=i+1;for(;++i;){const f=r.charAt(i);if(f==null||Number(f)!=f){--i;break}if(i===r.length)break}a.id=Number(r.substring(u,i+1))}if(r.charAt(++i)){const u=this.tryParse(r.substr(i));if(Vh.isPayloadValid(a.type,u))a.data=u;else throw new Error("invalid payload")}return a}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Be.CONNECT:return Ly(i);case Be.DISCONNECT:return i===void 0;case Be.CONNECT_ERROR:return typeof i=="string"||Ly(i);case Be.EVENT:case Be.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&Bw.indexOf(i[0])===-1);case Be.ACK:case Be.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Hw{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=zw(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Ly(t){return Object.prototype.toString.call(t)==="[object Object]"}const Lw=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Vh,Encoder:Uw,get PacketType(){return Be}},Symbol.toStringTag,{value:"Module"}));function dn(t,r,i){return t.on(r,i),function(){t.off(r,i)}}const jw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Rv extends ct{constructor(r,i,a){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=r,this.nsp=i,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[dn(r,"open",this.onopen.bind(this)),dn(r,"packet",this.onpacket.bind(this)),dn(r,"error",this.onerror.bind(this)),dn(r,"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(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var a,s,u;if(jw.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const f={type:Be.EVENT,data:i};if(f.options={},f.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const y=this.ids++,g=i.pop();this._registerAckCallback(y,g),f.id=y}const h=(s=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||s===void 0?void 0:s.writable,p=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!h||(p?(this.notifyOutgoingListeners(f),this.packet(f)):this.sendBuffer.push(f)),this.flags={},this}_registerAckCallback(r,i){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[r]=i;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===r&&this.sendBuffer.splice(h,1);i.call(this,new Error("operation has timed out"))},s),f=(...h)=>{this.io.clearTimeoutFn(u),i.apply(this,h)};f.withError=!0,this.acks[r]=f}emitWithAck(r,...i){return new Promise((a,s)=>{const u=(f,h)=>f?s(f):a(h);u.withError=!0,i.push(u),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((s,...u)=>(this._queue[0],s!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(s)):(this._queue.shift(),i&&i(null,...u)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Be.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(a=>String(a.id)===r)){const a=this.acks[r];delete this.acks[r],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Be.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.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 Be.EVENT:case Be.BINARY_EVENT:this.onevent(r);break;case Be.ACK:case Be.BINARY_ACK:this.onack(r);break;case Be.DISCONNECT:this.ondisconnect();break;case Be.CONNECT_ERROR:this.destroy();const a=new Error(r.data.message);a.data=r.data.data,this.emitReserved("connect_error",a);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const a of i)a.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let a=!1;return function(...s){a||(a=!0,i.packet({type:Be.ACK,id:r,data:s}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Be.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let a=0;a<i.length;a++)if(r===i[a])return i.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let a=0;a<i.length;a++)if(r===i[a])return i.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const a of i)a.apply(this,r.data)}}}function Go(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Go.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*t);t=(Math.floor(r*10)&1)==0?t-i:t+i}return Math.min(t,this.max)|0};Go.prototype.reset=function(){this.attempts=0};Go.prototype.setMin=function(t){this.ms=t};Go.prototype.setMax=function(t){this.max=t};Go.prototype.setJitter=function(t){this.jitter=t};class dh extends ct{constructor(r,i){var a;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Fu(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((a=i.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new Go({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const s=i.parser||Lw;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Aw(this.uri,this.opts);const i=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=dn(i,"open",function(){a.onopen(),r&&r()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},f=dn(i,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{s(),u(new Error("timeout")),i.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(s),this.subs.push(f),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(dn(r,"ping",this.onping.bind(this)),dn(r,"data",this.ondata.bind(this)),dn(r,"error",this.onerror.bind(this)),dn(r,"close",this.onclose.bind(this)),dn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){ju(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let a=this.nsps[r];return a?this._autoConnect&&!a.active&&a.connect():(a=new Rv(this,r,i),this.nsps[r]=a),a}_destroy(r){const i=Object.keys(this.nsps);for(const a of i)if(this.nsps[a].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let a=0;a<i.length;a++)this.engine.write(i[a],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(s=>{s?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",s)):r.onreconnect()}))},i);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Fa={};function fu(t,r){typeof t=="object"&&(r=t,t=void 0),r=r||{};const i=Nw(t,r.path||"/socket.io"),a=i.source,s=i.id,u=i.path,f=Fa[s]&&u in Fa[s].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||f;let p;return h?p=new dh(a,r):(Fa[s]||(Fa[s]=new dh(a,r)),p=Fa[s]),i.query&&!r.query&&(r.query=i.queryKey),p.socket(i.path,r)}Object.assign(fu,{Manager:dh,Socket:Rv,io:fu,connect:fu});let kh=Float32Array;function Gh(t,r,i){const a=new kh(3);return t&&(a[0]=t),r&&(a[1]=r),i&&(a[2]=i),a}function Fw(t,r,i){return i=i||new kh(3),i[0]=t[0]+r[0],i[1]=t[1]+r[1],i[2]=t[2]+r[2],i}function Vw(t,r,i){return i=i||new kh(3),i[0]=t[0]*r[0],i[1]=t[1]*r[1],i[2]=t[2]*r[2],i}let Mv=Float32Array;function kw(t){return t=t||new Mv(16),t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Gw(t,r){r=r||new Mv(16);const i=t[0],a=t[1],s=t[2],u=t[3],f=t[4],h=t[5],p=t[6],m=t[7],y=t[8],g=t[9],x=t[10],b=t[11],E=t[12],S=t[13],N=t[14],w=t[15],O=x*w,_=N*b,C=p*w,D=N*m,z=p*b,U=x*m,V=s*w,Y=N*u,ae=s*b,X=x*u,P=s*m,re=p*u,B=y*S,q=E*g,R=f*S,L=E*h,k=f*g,$=y*h,ee=i*S,M=E*a,F=i*g,J=y*a,te=i*h,se=f*a,he=O*h+D*g+z*S-(_*h+C*g+U*S),fe=_*a+V*g+X*S-(O*a+Y*g+ae*S),ue=C*a+Y*h+P*S-(D*a+V*h+re*S),me=U*a+ae*h+re*g-(z*a+X*h+P*g),ne=1/(i*he+f*fe+y*ue+E*me);return r[0]=ne*he,r[1]=ne*fe,r[2]=ne*ue,r[3]=ne*me,r[4]=ne*(_*f+C*y+U*E-(O*f+D*y+z*E)),r[5]=ne*(O*i+Y*y+ae*E-(_*i+V*y+X*E)),r[6]=ne*(D*i+V*f+re*E-(C*i+Y*f+P*E)),r[7]=ne*(z*i+X*f+P*y-(U*i+ae*f+re*y)),r[8]=ne*(B*m+L*b+k*w-(q*m+R*b+$*w)),r[9]=ne*(q*u+ee*b+J*w-(B*u+M*b+F*w)),r[10]=ne*(R*u+M*m+te*w-(L*u+ee*m+se*w)),r[11]=ne*($*u+F*m+se*b-(k*u+J*m+te*b)),r[12]=ne*(R*x+$*N+q*p-(k*N+B*p+L*x)),r[13]=ne*(F*N+B*s+M*x-(ee*x+J*N+q*s)),r[14]=ne*(ee*p+se*N+L*s-(te*N+R*s+M*p)),r[15]=ne*(te*x+k*s+J*p-(F*p+se*x+$*s)),r}function qw(t,r,i){i=i||Gh();const a=r[0],s=r[1],u=r[2],f=a*t[3]+s*t[7]+u*t[11]+t[15];return i[0]=(a*t[0]+s*t[4]+u*t[8]+t[12])/f,i[1]=(a*t[1]+s*t[5]+u*t[9]+t[13])/f,i[2]=(a*t[2]+s*t[6]+u*t[10]+t[14])/f,i}function Yw(t,r,i){i=i||Gh();const a=r[0],s=r[1],u=r[2];return i[0]=a*t[0]+s*t[4]+u*t[8],i[1]=a*t[1]+s*t[5]+u*t[9],i[2]=a*t[2]+s*t[6]+u*t[10],i}const qh=5120,Qa=5121,Yh=5122,Xh=5123,Ih=5124,$h=5125,Ph=5126,Xw=32819,Iw=32820,$w=33635,Pw=5131,Zw=33640,Qw=35899,Kw=35902,Jw=36269,Ww=34042,Dv={};{const t=Dv;t[qh]=Int8Array,t[Qa]=Uint8Array,t[Yh]=Int16Array,t[Xh]=Uint16Array,t[Ih]=Int32Array,t[$h]=Uint32Array,t[Ph]=Float32Array,t[Xw]=Uint16Array,t[Iw]=Uint16Array,t[$w]=Uint16Array,t[Pw]=Uint16Array,t[Zw]=Uint32Array,t[Qw]=Uint32Array,t[Kw]=Uint32Array,t[Jw]=Uint32Array,t[Ww]=Uint32Array}function Vu(t){if(t instanceof Int8Array)return qh;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return Qa;if(t instanceof Int16Array)return Yh;if(t instanceof Uint16Array)return Xh;if(t instanceof Int32Array)return Ih;if(t instanceof Uint32Array)return $h;if(t instanceof Float32Array)return Ph;throw new Error("unsupported typed array type")}function Ov(t){if(t===Int8Array)return qh;if(t===Uint8Array||t===Uint8ClampedArray)return Qa;if(t===Int16Array)return Yh;if(t===Uint16Array)return Xh;if(t===Int32Array)return Ih;if(t===Uint32Array)return $h;if(t===Float32Array)return Ph;throw new Error("unsupported typed array type")}function zv(t){const r=Dv[t];if(!r)throw new Error("unknown gl type");return r}const Ka=typeof SharedArrayBuffer<"u"?function(r){return r&&r.buffer&&(r.buffer instanceof ArrayBuffer||r.buffer instanceof SharedArrayBuffer)}:function(r){return r&&r.buffer&&r.buffer instanceof ArrayBuffer};function eT(t,r,i){t.forEach(function(a){const s=r[a];s!==void 0&&(i[a]=s)})}function Bv(...t){console.error(...t)}const jy=new Map;function ku(t,r){if(!t||typeof t!="object")return!1;let i=jy.get(r);i||(i=new WeakMap,jy.set(r,i));let a=i.get(t);if(a===void 0){const s=Object.prototype.toString.call(t);a=s.substring(8,s.length-1)===r,i.set(t,a)}return a}function tT(t,r){return typeof WebGLBuffer<"u"&&ku(r,"WebGLBuffer")}function nT(t,r){return typeof WebGLRenderbuffer<"u"&&ku(r,"WebGLRenderbuffer")}function Zh(t,r){return typeof WebGLTexture<"u"&&ku(r,"WebGLTexture")}function rT(t,r){return typeof WebGLSampler<"u"&&ku(r,"WebGLSampler")}const Uv=35044,Pr=34962,Hv=34963,iT=34660,oT=5120,aT=5121,lT=5122,sT=5123,uT=5124,cT=5125,Lv=5126,jv={attribPrefix:""};function fT(t,r,i,a,s){t.bindBuffer(r,i),t.bufferData(r,a,s||Uv)}function Qh(t,r,i,a){if(tT(t,r))return r;i=i||Pr;const s=t.createBuffer();return fT(t,i,s,r,a),s}function Fv(t){return t==="indices"}function dT(t){return t===Int8Array||t===Uint8Array}function Kh(t){return t.length?t:t.data}const hT=/coord|texture/i,mT=/color|colour/i;function pT(t,r){let i;if(hT.test(t)?i=2:mT.test(t)?i=4:i=3,r%i>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${i} but ${r} values is not evenly divisible by ${i}. You should specify it.`);return i}function Jh(t,r,i){return t.numComponents||t.size||pT(r,i||Kh(t).length)}function Gu(t,r){if(Ka(t))return t;if(Ka(t.data))return t.data;Array.isArray(t)&&(t={data:t});let i=t.type?Wh(t.type):void 0;return i||(Fv(r)?i=Uint16Array:i=Float32Array),new i(t.data)}function gT(t){return typeof t=="number"?t:t?Ov(t):Lv}function Wh(t){return typeof t=="number"?zv(t):t||Float32Array}function yT(t,r){return{buffer:r.buffer,numValues:24,type:gT(r.type),arrayType:Wh(r.type)}}function xT(t,r){const i=r.data||r,a=Wh(r.type),s=i*a.BYTES_PER_ELEMENT,u=t.createBuffer();return t.bindBuffer(Pr,u),t.bufferData(Pr,s,r.drawType||Uv),{buffer:u,numValues:i,type:Ov(a),arrayType:a}}function vT(t,r,i){const a=Gu(r,i);return{arrayType:a.constructor,buffer:Qh(t,a,void 0,r.drawType),type:Vu(a),numValues:0}}function bT(t,r){const i={};return Object.keys(r).forEach(function(a){if(!Fv(a)){const s=r[a],u=s.attrib||s.name||s.attribName||jv.attribPrefix+a;if(s.value){if(!Array.isArray(s.value)&&!Ka(s.value))throw new Error("array.value is not array or typedarray");i[u]={value:s.value}}else{let f;s.buffer&&s.buffer instanceof WebGLBuffer?f=yT:typeof s=="number"||typeof s.data=="number"?f=xT:f=vT;const{buffer:h,type:p,numValues:m,arrayType:y}=f(t,s,a),g=s.normalize!==void 0?s.normalize:dT(y),x=Jh(s,a,m);i[u]={buffer:h,numComponents:x,type:p,normalize:g,stride:s.stride||0,offset:s.offset||0,divisor:s.divisor===void 0?void 0:s.divisor,drawType:s.drawType}}}}),t.bindBuffer(Pr,null),i}function ET(t,r){return r===oT||r===aT?1:r===lT||r===sT?2:r===uT||r===cT||r===Lv?4:0}const Do=["position","positions","a_position"];function ST(t){let r,i;for(i=0;i<Do.length&&(r=Do[i],!(r in t));++i);i===Do.length&&(r=Object.keys(t)[0]);const a=t[r],s=Kh(a).length;if(s===void 0)return 1;const u=Jh(a,r),f=s/u;if(s%u>0)throw new Error(`numComponents ${u} not correct for length ${s}`);return f}function _T(t,r){let i,a;for(a=0;a<Do.length&&(i=Do[a],!(i in r||(i=jv.attribPrefix+i,i in r)));++a);a===Do.length&&(i=Object.keys(r)[0]);const s=r[i];if(!s.buffer)return 1;t.bindBuffer(Pr,s.buffer);const u=t.getBufferParameter(Pr,iT);t.bindBuffer(Pr,null);const f=ET(t,s.type),h=u/f,p=s.numComponents||s.size,m=h/p;if(m%1!==0)throw new Error(`numComponents ${p} not correct for length ${length}`);return m}function wT(t,r,i){const a=bT(t,r),s=Object.assign({},i||{});s.attribs=Object.assign({},i?i.attribs:{},a);const u=r.indices;if(u){const f=Gu(u,"indices");s.indices=Qh(t,f,Hv),s.numElements=f.length,s.elementType=Vu(f)}else s.numElements||(s.numElements=_T(t,s.attribs));return s}function TT(t,r,i){const a=i==="indices"?Hv:Pr,s=Gu(r,i);return Qh(t,s,a)}function AT(t,r){const i={};return Object.keys(r).forEach(function(a){i[a]=TT(t,r[a],a)}),r.indices?(i.numElements=r.indices.length,i.elementType=Vu(Gu(r.indices))):i.numElements=ST(r),i}const wi=Kh,NT=Jh;function Vv(t,r){let i=0;return t.push=function(){for(let a=0;a<arguments.length;++a){const s=arguments[a];if(s instanceof Array||Ka(s))for(let u=0;u<s.length;++u)t[i++]=s[u];else t[i++]=s}},t.reset=function(a){i=a||0},t.numComponents=r,Object.defineProperty(t,"numElements",{get:function(){return this.length/this.numComponents|0}}),t}function Oe(t,r,i){const a=i||Float32Array;return Vv(new a(t*r),t)}function CT(t){return t!=="indices"}function RT(t){const r=t.indices,i={},a=r.length;function s(u){const f=t[u],h=f.numComponents,p=Oe(h,a,f.constructor);for(let m=0;m<a;++m){const g=r[m]*h;for(let x=0;x<h;++x)p.push(f[g+x])}i[u]=p}return Object.keys(t).filter(CT).forEach(s),i}function MT(t){if(t.indices)throw new Error("can not flatten normals of indexed vertices. deindex them first");const r=t.normal,i=r.length;for(let a=0;a<i;a+=9){const s=r[a+0],u=r[a+1],f=r[a+2],h=r[a+3],p=r[a+4],m=r[a+5],y=r[a+6],g=r[a+7],x=r[a+8];let b=s+h+y,E=u+p+g,S=f+m+x;const N=Math.sqrt(b*b+E*E+S*S);b/=N,E/=N,S/=N,r[a+0]=b,r[a+1]=E,r[a+2]=S,r[a+3]=b,r[a+4]=E,r[a+5]=S,r[a+6]=b,r[a+7]=E,r[a+8]=S}return t}function e0(t,r,i){const a=t.length,s=new Float32Array(3);for(let u=0;u<a;u+=3)i(r,[t[u],t[u+1],t[u+2]],s),t[u]=s[0],t[u+1]=s[1],t[u+2]=s[2]}function DT(t,r,i){i=i||Gh();const a=r[0],s=r[1],u=r[2];return i[0]=a*t[0]+s*t[1]+u*t[2],i[1]=a*t[4]+s*t[5]+u*t[6],i[2]=a*t[8]+s*t[9]+u*t[10],i}function kv(t,r){return e0(t,r,Yw),t}function Gv(t,r){return e0(t,Gw(r),DT),t}function qv(t,r){return e0(t,r,qw),t}function Yv(t,r){return Object.keys(t).forEach(function(i){const a=t[i];i.indexOf("pos")>=0?qv(a,r):i.indexOf("tan")>=0||i.indexOf("binorm")>=0?kv(a,r):i.indexOf("norm")>=0&&Gv(a,r)}),t}function t0(t,r,i){return t=t||2,r=r||0,i=i||0,t*=.5,{position:{numComponents:2,data:[r+-1*t,i+-1*t,r+1*t,i+-1*t,r+-1*t,i+1*t,r+1*t,i+1*t]},normal:[0,0,1,0,0,1,0,0,1,0,0,1],texcoord:[0,0,1,0,0,1,1,1],indices:[0,1,2,2,1,3]}}function n0(t,r,i,a,s){t=t||1,r=r||1,i=i||1,a=a||1,s=s||kw();const u=(i+1)*(a+1),f=Oe(3,u),h=Oe(3,u),p=Oe(2,u);for(let x=0;x<=a;x++)for(let b=0;b<=i;b++){const E=b/i,S=x/a;f.push(t*E-t*.5,0,r*S-r*.5),h.push(0,1,0),p.push(E,S)}const m=i+1,y=Oe(3,i*a*2,Uint16Array);for(let x=0;x<a;x++)for(let b=0;b<i;b++)y.push((x+0)*m+b,(x+1)*m+b,(x+0)*m+b+1),y.push((x+1)*m+b,(x+1)*m+b+1,(x+0)*m+b+1);return Yv({position:f,normal:h,texcoord:p,indices:y},s)}function r0(t,r,i,a,s,u,f){if(r<=0||i<=0)throw new Error("subdivisionAxis and subdivisionHeight must be > 0");a=a||0,s=s||Math.PI,u=u||0,f=f||Math.PI*2;const h=s-a,p=f-u,m=(r+1)*(i+1),y=Oe(3,m),g=Oe(3,m),x=Oe(2,m);for(let S=0;S<=i;S++)for(let N=0;N<=r;N++){const w=N/r,O=S/i,_=p*w+u,C=h*O+a,D=Math.sin(_),z=Math.cos(_),U=Math.sin(C),V=Math.cos(C),Y=z*U,ae=V,X=D*U;y.push(t*Y,t*ae,t*X),g.push(Y,ae,X),x.push(1-w,O)}const b=r+1,E=Oe(3,r*i*2,Uint16Array);for(let S=0;S<r;S++)for(let N=0;N<i;N++)E.push((N+0)*b+S,(N+0)*b+S+1,(N+1)*b+S),E.push((N+1)*b+S,(N+0)*b+S+1,(N+1)*b+S+1);return{position:y,normal:g,texcoord:x,indices:E}}const OT=[[3,7,5,1],[6,2,0,4],[6,7,3,2],[0,1,5,4],[7,6,4,5],[2,3,1,0]];function i0(t){t=t||1;const r=t/2,i=[[-r,-r,-r],[+r,-r,-r],[-r,+r,-r],[+r,+r,-r],[-r,-r,+r],[+r,-r,+r],[-r,+r,+r],[+r,+r,+r]],a=[[1,0,0],[-1,0,0],[0,1,0],[0,-1,0],[0,0,1],[0,0,-1]],s=[[1,0],[0,0],[0,1],[1,1]],u=24,f=Oe(3,u),h=Oe(3,u),p=Oe(2,u),m=Oe(3,12,Uint16Array);for(let y=0;y<6;++y){const g=OT[y];for(let b=0;b<4;++b){const E=i[g[b]],S=a[y],N=s[b];f.push(E),h.push(S),p.push(N)}const x=4*y;m.push(x+0,x+1,x+2),m.push(x+0,x+2,x+3)}return{position:f,normal:h,texcoord:p,indices:m}}function qu(t,r,i,a,s,u,f){if(a<3)throw new Error("radialSubdivisions must be 3 or greater");if(s<1)throw new Error("verticalSubdivisions must be 1 or greater");const h=u===void 0?!0:u,p=f===void 0?!0:f,m=(h?2:0)+(p?2:0),y=(a+1)*(s+1+m),g=Oe(3,y),x=Oe(3,y),b=Oe(2,y),E=Oe(3,a*(s+m/2)*2,Uint16Array),S=a+1,N=Math.atan2(t-r,i),w=Math.cos(N),O=Math.sin(N),_=h?-2:0,C=s+(p?2:0);for(let D=_;D<=C;++D){let z=D/s,U=i*z,V;D<0?(U=0,z=1,V=t):D>s?(U=i,z=1,V=r):V=t+(r-t)*(D/s),(D===-2||D===s+2)&&(V=0,z=0),U-=i/2;for(let Y=0;Y<S;++Y){const ae=Math.sin(Y*Math.PI*2/a),X=Math.cos(Y*Math.PI*2/a);g.push(ae*V,U,X*V),D<0?x.push(0,-1,0):D>s?x.push(0,1,0):V===0?x.push(0,0,0):x.push(ae*w,O,X*w),b.push(Y/a,1-z)}}for(let D=0;D<s+m;++D)if(!(D===1&&h||D===s+m-2&&p))for(let z=0;z<a;++z)E.push(S*(D+0)+0+z,S*(D+0)+1+z,S*(D+1)+1+z),E.push(S*(D+0)+0+z,S*(D+1)+1+z,S*(D+1)+0+z);return{position:g,normal:x,texcoord:b,indices:E}}function Fy(t,r){r=r||[];const i=[];for(let a=0;a<t.length;a+=4){const s=t[a],u=t.slice(a+1,a+4);u.push.apply(u,r);for(let f=0;f<s;++f)i.push.apply(i,u)}return i}function o0(){const t=[0,0,0,0,150,0,30,0,0,0,150,0,30,150,0,30,0,0,30,0,0,30,30,0,100,0,0,30,30,0,100,30,0,100,0,0,30,60,0,30,90,0,67,60,0,30,90,0,67,90,0,67,60,0,0,0,30,30,0,30,0,150,30,0,150,30,30,0,30,30,150,30,30,0,30,100,0,30,30,30,30,30,30,30,100,0,30,100,30,30,30,60,30,67,60,30,30,90,30,30,90,30,67,60,30,67,90,30,0,0,0,100,0,0,100,0,30,0,0,0,100,0,30,0,0,30,100,0,0,100,30,0,100,30,30,100,0,0,100,30,30,100,0,30,30,30,0,30,30,30,100,30,30,30,30,0,100,30,30,100,30,0,30,30,0,30,60,30,30,30,30,30,30,0,30,60,0,30,60,30,30,60,0,67,60,30,30,60,30,30,60,0,67,60,0,67,60,30,67,60,0,67,90,30,67,60,30,67,60,0,67,90,0,67,90,30,30,90,0,30,90,30,67,90,30,30,90,0,67,90,30,67,90,0,30,90,0,30,150,30,30,90,30,30,90,0,30,150,0,30,150,30,0,150,0,0,150,30,30,150,30,0,150,0,30,150,30,30,150,0,0,0,0,0,0,30,0,150,30,0,0,0,0,150,30,0,150,0],r=[.22,.19,.22,.79,.34,.19,.22,.79,.34,.79,.34,.19,.34,.19,.34,.31,.62,.19,.34,.31,.62,.31,.62,.19,.34,.43,.34,.55,.49,.43,.34,.55,.49,.55,.49,.43,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,0],i=Fy([18,0,0,1,18,0,0,-1,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,1,0,6,1,0,0,6,0,-1,0,6,1,0,0,6,0,-1,0,6,-1,0,0]),a=Fy([18,200,70,120,18,80,70,200,6,70,200,210,6,200,200,70,6,210,100,70,6,210,160,70,6,70,180,210,6,100,70,210,6,76,210,100,6,140,210,80,6,90,130,110,6,160,160,220],[255]),s=t.length/3,u={position:Oe(3,s),texcoord:Oe(2,s),normal:Oe(3,s),color:Oe(4,s,Uint8Array),indices:Oe(3,s/3,Uint16Array)};u.position.push(t),u.texcoord.push(r),u.normal.push(i),u.color.push(a);for(let f=0;f<s;++f)u.indices.push(f);return u}function Yu(t,r,i,a,s,u,f){if(s<=0)throw new Error("subdivisionDown must be > 0");u=u||0,f=f||1;const h=2,p=f-u,m=(s+1)*2*(2+h),y=Oe(3,m),g=Oe(3,m),x=Oe(2,m);function b(O,_,C){return O+(_-O)*C}function E(O,_,C,D,z,U){for(let V=0;V<=s;V++){const Y=_/(h-1),ae=V/s,X=(Y-.5)*2,P=(u+ae*p)*Math.PI,re=Math.sin(P),B=Math.cos(P),q=b(t,O,re),R=X*a,L=B*t,k=re*q;y.push(R,L,k);const $=Fw(Vw([0,re,B],C),D);g.push($),x.push(Y*z+U,ae)}}for(let O=0;O<h;O++){const _=(O/(h-1)-.5)*2;E(r,O,[1,1,1],[0,0,0],1,0),E(r,O,[0,0,0],[_,0,0],0,0),E(i,O,[1,1,1],[0,0,0],1,0),E(i,O,[0,0,0],[_,0,0],0,1)}const S=Oe(3,s*2*(2+h),Uint16Array);function N(O,_){for(let C=0;C<s;++C)S.push(O+C+0,O+C+1,_+C+0),S.push(O+C+1,_+C+1,_+C+0)}const w=s+1;return N(w*0,w*4),N(w*5,w*7),N(w*6,w*2),N(w*3,w*1),{position:y,normal:g,texcoord:x,indices:S}}function a0(t,r,i,a,s,u){return qu(t,t,r,i,a,s,u)}function l0(t,r,i,a,s,u){if(i<3)throw new Error("radialSubdivisions must be 3 or greater");if(a<3)throw new Error("verticalSubdivisions must be 3 or greater");s=s||0,u=u||Math.PI*2;const f=u-s,h=i+1,p=a+1,m=h*p,y=Oe(3,m),g=Oe(3,m),x=Oe(2,m),b=Oe(3,i*a*2,Uint16Array);for(let E=0;E<p;++E){const S=E/a,N=S*Math.PI*2,w=Math.sin(N),O=t+w*r,_=Math.cos(N),C=_*r;for(let D=0;D<h;++D){const z=D/i,U=s+z*f,V=Math.sin(U),Y=Math.cos(U),ae=V*O,X=Y*O,P=V*w,re=Y*w;y.push(ae,C,X),g.push(P,_,re),x.push(z,1-S)}}for(let E=0;E<a;++E)for(let S=0;S<i;++S){const N=1+S,w=1+E;b.push(h*E+S,h*w+S,h*E+N),b.push(h*w+S,h*w+N,h*E+N)}return{position:y,normal:g,texcoord:x,indices:b}}function s0(t,r,i,a,s){if(r<3)throw new Error("divisions must be at least 3");i=i||1,s=s||1,a=a||0;const u=(r+1)*(i+1),f=Oe(3,u),h=Oe(3,u),p=Oe(2,u),m=Oe(3,i*r*2,Uint16Array);let y=0;const g=t-a,x=r+1;for(let b=0;b<=i;++b){const E=a+g*Math.pow(b/i,s);for(let S=0;S<=r;++S){const N=2*Math.PI*S/r,w=E*Math.cos(N),O=E*Math.sin(N);if(f.push(w,0,O),h.push(0,1,0),p.push(1-S/r,b/i),b>0&&S!==r){const _=y+(S+1),C=y+S,D=y+S-x,z=y+(S+1)-x;m.push(_,C,D),m.push(_,D,z)}}y+=r+1}return{position:f,normal:h,texcoord:p,indices:m}}function zT(t){return Math.random()*t|0}function BT(t,r){r=r||{};const i=t.position.numElements,a=Oe(4,i,Uint8Array),s=r.rand||function(u,f){return f<3?zT(256):255};if(t.color=a,t.indices)for(let u=0;u<i;++u)a.push(s(u,0),s(u,1),s(u,2),s(u,3));else{const u=r.vertsPerColor||3,f=i/u;for(let h=0;h<f;++h){const p=[s(h,0),s(h,1),s(h,2),s(h,3)];for(let m=0;m<u;++m)a.push(p)}}return t}function Un(t){return function(r){const i=t.apply(this,Array.prototype.slice.call(arguments,1));return AT(r,i)}}function Hn(t){return function(r){const i=t.apply(null,Array.prototype.slice.call(arguments,1));return wT(r,i)}}const UT=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function hh(t,r,i,a){a=a||0;const s=t.length;for(let u=0;u<s;++u)r[i+u]=t[u]+a}function Xv(t,r){const i=wi(t),a=new i.constructor(r);let s=a;return i.numComponents&&i.numElements&&Vv(a,i.numComponents),t.data&&(s={data:a},eT(UT,t,s)),s}function HT(t){const r={};let i;for(let h=0;h<t.length;++h){const p=t[h];Object.keys(p).forEach(function(m){r[m]||(r[m]=[]),!i&&m!=="indices"&&(i=m);const y=p[m],g=NT(y,m),b=wi(y).length/g;r[m].push(b)})}function a(h){let p=0,m;for(let y=0;y<t.length;++y){const x=t[y][h],b=wi(x);p+=b.length,(!m||x.data)&&(m=x)}return{length:p,spec:m}}function s(h,p,m){let y=0,g=0;for(let x=0;x<t.length;++x){const E=t[x][h],S=wi(E);h==="indices"?(hh(S,m,g,y),y+=p[x]):hh(S,m,g),g+=S.length}}const u=r[i],f={};return Object.keys(r).forEach(function(h){const p=a(h),m=Xv(p.spec,p.length);s(h,u,wi(m)),f[h]=m}),f}function LT(t){const r={};return Object.keys(t).forEach(function(i){const a=t[i],s=wi(a),u=Xv(a,s.length);hh(s,wi(u),0),r[i]=u}),r}const jT=Hn(o0),FT=Un(o0),VT=Hn(i0),kT=Un(i0),GT=Hn(n0),qT=Un(n0),YT=Hn(r0),XT=Un(r0),IT=Hn(qu),$T=Un(qu),PT=Hn(t0),ZT=Un(t0),Iv=Hn(Yu),$v=Un(Yu),QT=Hn(a0),KT=Un(a0),JT=Hn(l0),WT=Un(l0),eA=Hn(s0),tA=Un(s0),nA=Iv,rA=$v,iA=Yu;var oA=Object.freeze({__proto__:null,create3DFBufferInfo:jT,create3DFBuffers:FT,create3DFVertices:o0,createAugmentedTypedArray:Oe,createCubeBufferInfo:VT,createCubeBuffers:kT,createCubeVertices:i0,createPlaneBufferInfo:GT,createPlaneBuffers:qT,createPlaneVertices:n0,createSphereBufferInfo:YT,createSphereBuffers:XT,createSphereVertices:r0,createTruncatedConeBufferInfo:IT,createTruncatedConeBuffers:$T,createTruncatedConeVertices:qu,createXYQuadBufferInfo:PT,createXYQuadBuffers:ZT,createXYQuadVertices:t0,createCresentBufferInfo:nA,createCresentBuffers:rA,createCresentVertices:iA,createCrescentBufferInfo:Iv,createCrescentBuffers:$v,createCrescentVertices:Yu,createCylinderBufferInfo:QT,createCylinderBuffers:KT,createCylinderVertices:a0,createTorusBufferInfo:JT,createTorusBuffers:WT,createTorusVertices:l0,createDiscBufferInfo:eA,createDiscBuffers:tA,createDiscVertices:s0,deindexVertices:RT,flattenNormals:MT,makeRandomVertexColors:BT,reorientDirections:kv,reorientNormals:Gv,reorientPositions:qv,reorientVertices:Yv,concatVertices:HT,duplicateVertices:LT});function fl(t){return!!t.texStorage2D}const Pv=(function(){const t={},r={};function i(a){const s=a.constructor.name;if(!t[s]){for(const u in a)if(typeof a[u]=="number"){const f=r[a[u]];r[a[u]]=f?`${f} | ${u}`:u}t[s]=!0}}return function(s,u){return i(s),r[u]||(typeof u=="number"?`0x${u.toString(16)}`:u)}})(),Va=void 0,Qr={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},Ja=Ka,Zv=(function(){let t;return function(){return t=t||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),t}})(),Vy=6406,Cn=6407,et=6408,ky=6409,Gy=6410,ka=6402,qy=34041,bu=33071,Fd=9728,Vd=9729,aA=9986,cr=3553,fr=34067,Bi=32879,Ri=35866,u0=34069,lA=34070,sA=34071,uA=34072,cA=34073,fA=34074,Eu=10241,Su=10240,_u=10242,wu=10243,Yy=32882,dA=33082,hA=33083,mA=33084,pA=33085,gA=34892,yA=34893,c0=3317,Qv=3314,Kv=32878,Jv=3316,Wv=3315,eb=32877,du=37443,hu=37441,mu=37440,xA=33321,vA=36756,bA=33325,EA=33326,SA=33330,_A=33329,wA=33338,TA=33337,AA=33340,NA=33339,CA=33323,RA=36757,MA=33327,DA=33328,OA=33336,zA=33335,BA=33332,UA=33331,HA=33334,LA=33333,jA=32849,FA=35905,VA=36194,kA=36758,GA=35898,qA=35901,YA=34843,XA=34837,IA=36221,$A=36239,PA=36215,ZA=36233,QA=36209,KA=36227,JA=32856,WA=35907,e3=36759,t3=32855,n3=32854,r3=32857,i3=34842,o3=34836,a3=36220,l3=36238,s3=36975,u3=36214,c3=36232,f3=36226,d3=36208,h3=33189,m3=33190,p3=36012,g3=36013,y3=35056,Gr=5120,Qe=5121,$s=5122,wo=5123,Ps=5124,Ei=5125,_t=5126,Xy=32819,Iy=32820,$y=33635,fn=5131,Ga=36193,kd=33640,x3=35899,v3=35902,b3=36269,E3=34042,Zs=33319,To=33320,Qs=6403,Ao=36244,No=36248,Si=36249,Py=33776,Zy=33777,Qy=33778,Ky=33779,Jy=35916,Wy=35917,ex=35918,tx=35919,nx=36196,rx=37488,ix=37489,ox=37490,ax=37491,lx=37492,sx=37493,ux=37494,cx=37495,fx=37496,dx=37497,hx=35840,mx=35841,px=35842,gx=35843,yx=37808,xx=37809,vx=37810,bx=37811,Ex=37812,Sx=37813,_x=37814,wx=37815,Tx=37816,Ax=37817,Nx=37818,Cx=37819,Rx=37820,Mx=37821,Dx=37840,Ox=37841,zx=37842,Bx=37843,Ux=37844,Hx=37845,Lx=37846,jx=37847,Fx=37848,Vx=37849,kx=37850,Gx=37851,qx=37852,Yx=37853,Xx=36492,Ix=36493,$x=36494,Px=36495,Zx=36283,Qx=36284,Kx=36285,Jx=36286;let Gd;function qo(t){if(!Gd){const i={};i[Vy]={textureFormat:Vy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Qe,fn,Ga,_t]},i[ky]={textureFormat:ky,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Qe,fn,Ga,_t]},i[Gy]={textureFormat:Gy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[Qe,fn,Ga,_t]},i[Cn]={textureFormat:Cn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[Qe,fn,Ga,_t,$y]},i[et]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[Qe,fn,Ga,_t,Xy,Iy]},i[ka]={textureFormat:ka,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ei,wo]},i[xA]={textureFormat:Qs,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[Qe]},i[vA]={textureFormat:Qs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[Gr]},i[bA]={textureFormat:Qs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[_t,fn]},i[EA]={textureFormat:Qs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[_t]},i[SA]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Qe]},i[_A]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Gr]},i[BA]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[wo]},i[UA]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[$s]},i[HA]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ei]},i[LA]={textureFormat:Ao,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ps]},i[CA]={textureFormat:Zs,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[Qe]},i[RA]={textureFormat:Zs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[Gr]},i[MA]={textureFormat:Zs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[_t,fn]},i[DA]={textureFormat:Zs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[_t]},i[OA]={textureFormat:To,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Qe]},i[zA]={textureFormat:To,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Gr]},i[wA]={textureFormat:To,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[wo]},i[TA]={textureFormat:To,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[$s]},i[AA]={textureFormat:To,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ei]},i[NA]={textureFormat:To,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ps]},i[jA]={textureFormat:Cn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[Qe]},i[FA]={textureFormat:Cn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Qe]},i[VA]={textureFormat:Cn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[Qe,$y]},i[kA]={textureFormat:Cn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Gr]},i[GA]={textureFormat:Cn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[_t,fn,x3]},i[qA]={textureFormat:Cn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[_t,fn,v3]},i[YA]={textureFormat:Cn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[_t,fn]},i[XA]={textureFormat:Cn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[_t]},i[IA]={textureFormat:No,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Qe]},i[$A]={textureFormat:No,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Gr]},i[PA]={textureFormat:No,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[wo]},i[ZA]={textureFormat:No,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[$s]},i[QA]={textureFormat:No,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ei]},i[KA]={textureFormat:No,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ps]},i[JA]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Qe]},i[WA]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Qe]},i[e3]={textureFormat:et,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[Gr]},i[t3]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[Qe,Iy,kd]},i[n3]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[Qe,Xy]},i[r3]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[kd]},i[i3]={textureFormat:et,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[_t,fn]},i[o3]={textureFormat:et,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[_t]},i[a3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Qe]},i[l3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Gr]},i[s3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[kd]},i[u3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[wo]},i[c3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[$s]},i[f3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ps]},i[d3]={textureFormat:Si,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ei]},i[h3]={textureFormat:ka,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[wo,Ei]},i[m3]={textureFormat:ka,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ei]},i[p3]={textureFormat:ka,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[_t]},i[y3]={textureFormat:qy,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[E3]},i[g3]={textureFormat:qy,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[b3]},Object.keys(i).forEach(function(u){const f=i[u];f.bytesPerElementMap={},f.bytesPerElement.forEach(function(h,p){const m=f.type[p];f.bytesPerElementMap[m]=h})});const a={bytes:8,width:4,height:4},s={bytes:16,width:4,height:4};i[Py]={textureFormat:Py,colorRenderable:!1,textureFilterable:!0,block:a},i[Zy]={textureFormat:Zy,colorRenderable:!1,textureFilterable:!0,block:a},i[Qy]={textureFormat:Qy,colorRenderable:!1,textureFilterable:!0,block:s},i[Ky]={textureFormat:Ky,colorRenderable:!1,textureFilterable:!0,block:s},i[Jy]={textureFormat:Jy,colorRenderable:!1,textureFilterable:!0,block:a},i[Wy]={textureFormat:Wy,colorRenderable:!1,textureFilterable:!0,block:a},i[ex]={textureFormat:ex,colorRenderable:!1,textureFilterable:!0,block:s},i[tx]={textureFormat:tx,colorRenderable:!1,textureFilterable:!0,block:s},i[nx]={textureFormat:nx,colorRenderable:!1,textureFilterable:!0,block:a},i[rx]={textureFormat:rx,colorRenderable:!1,textureFilterable:!0,block:a},i[ix]={textureFormat:ix,colorRenderable:!1,textureFilterable:!0,block:a},i[ox]={textureFormat:ox,colorRenderable:!1,textureFilterable:!0,block:s},i[ax]={textureFormat:ax,colorRenderable:!1,textureFilterable:!0,block:s},i[lx]={textureFormat:lx,colorRenderable:!1,textureFilterable:!0,block:a},i[sx]={textureFormat:sx,colorRenderable:!1,textureFilterable:!0,block:a},i[ux]={textureFormat:ux,colorRenderable:!1,textureFilterable:!0,block:a},i[cx]={textureFormat:cx,colorRenderable:!1,textureFilterable:!0,block:a},i[fx]={textureFormat:fx,colorRenderable:!1,textureFilterable:!0,block:s},i[dx]={textureFormat:dx,colorRenderable:!1,textureFilterable:!0,block:s},i[hx]={textureFormat:hx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:8,height:8}},i[mx]={textureFormat:mx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:16,height:8}},i[px]={textureFormat:px,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:8,height:8}},i[gx]={textureFormat:gx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:16,height:8}},i[yx]={textureFormat:yx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:4,height:4}},i[xx]={textureFormat:xx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:4}},i[vx]={textureFormat:vx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:5}},i[bx]={textureFormat:bx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:5}},i[Ex]={textureFormat:Ex,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:6}},i[Sx]={textureFormat:Sx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:5}},i[_x]={textureFormat:_x,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:6}},i[wx]={textureFormat:wx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:8}},i[Tx]={textureFormat:Tx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:5}},i[Ax]={textureFormat:Ax,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:6}},i[Nx]={textureFormat:Nx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:8}},i[Cx]={textureFormat:Cx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:10}},i[Rx]={textureFormat:Rx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:10}},i[Mx]={textureFormat:Mx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:12}},i[Dx]={textureFormat:Dx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:4,height:4}},i[Ox]={textureFormat:Ox,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:4}},i[zx]={textureFormat:zx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:5}},i[Bx]={textureFormat:Bx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:5}},i[Ux]={textureFormat:Ux,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:6}},i[Hx]={textureFormat:Hx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:5}},i[Lx]={textureFormat:Lx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:6}},i[jx]={textureFormat:jx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:8}},i[Fx]={textureFormat:Fx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:5}},i[Vx]={textureFormat:Vx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:6}},i[kx]={textureFormat:kx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:8}},i[Gx]={textureFormat:Gx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:10}},i[qx]={textureFormat:qx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:10}},i[Yx]={textureFormat:Yx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:12}},i[Xx]={textureFormat:Xx,colorRenderable:!1,textureFilterable:!0,block:s},i[Ix]={textureFormat:Ix,colorRenderable:!1,textureFilterable:!0,block:s},i[$x]={textureFormat:$x,colorRenderable:!1,textureFilterable:!0,block:s},i[Px]={textureFormat:Px,colorRenderable:!1,textureFilterable:!0,block:s},i[Zx]={textureFormat:Zx,colorRenderable:!1,textureFilterable:!0,block:a},i[Qx]={textureFormat:Qx,colorRenderable:!1,textureFilterable:!0,block:a},i[Kx]={textureFormat:Kx,colorRenderable:!1,textureFilterable:!0,block:a},i[Jx]={textureFormat:Jx,colorRenderable:!1,textureFilterable:!0,block:a},Gd=i}const r=Gd[t];if(!r)throw new Error("unknown internal format");return r}function tb(t,r){const a=qo(t).bytesPerElementMap[r];if(a===void 0)throw new Error("type not supported for internal format");return a}function dl(t){const r=qo(t);if(!r)throw new Error("unknown internal format");return{format:r.textureFormat,type:r.type?.[0]??Qe}}function nb(t){return!!qo(t).block}function S3(t,r){const i=qo(t);return i.block?{blockWidth:i.block.width,blockHeight:i.block.height,bytesPerBlock:i.block.bytes}:{blockWidth:1,blockHeight:1,bytesPerBlock:tb(t,r)}}function Wx(t){return(t&t-1)===0}function _3(t,r,i,a){if(!fl(t))return Wx(r)&&Wx(i);const s=qo(a);return s.colorRenderable&&s.textureFilterable}function qd(t){return qo(t).textureFilterable}function w3(t,r,i){return Ja(r)?Vu(r):i||Qe}function Ks(t,r,i,a,s){if(s%1!==0)throw new Error("can't guess dimensions");if(!i&&!a){const u=Math.sqrt(s/(r===fr?6:1));u%1===0?(i=u,a=u):(i=s,a=1)}else if(a){if(!i&&(i=s/a,i%1))throw new Error("can't guess dimensions")}else if(a=s/i,a%1)throw new Error("can't guess dimensions");return{width:i,height:a}}function Ir(t,r,i){let a,s,u;r.colorspaceConversion!==void 0&&(a=t.getParameter(du),t.pixelStorei(du,r.colorspaceConversion)),r.premultiplyAlpha!==void 0&&(s=t.getParameter(hu),t.pixelStorei(hu,r.premultiplyAlpha)),r.flipY!==void 0&&(u=t.getParameter(mu),t.pixelStorei(mu,r.flipY)),i(),a!==void 0&&t.pixelStorei(du,a),s!==void 0&&t.pixelStorei(hu,s),u!==void 0&&t.pixelStorei(mu,u)}function Yd(t,r,i,a){const s=r[i];return{[i]:s===void 0?t.getParameter(a):s}}function f0(t,r){return{...r,...Yd(t,r,"flipY",mu),...Yd(t,r,"premultiplyAlpha",hu),...Yd(t,r,"colorspaceConversion",du)}}function rb(t){t.pixelStorei(c0,4),fl(t)&&(t.pixelStorei(Qv,0),t.pixelStorei(Kv,0),t.pixelStorei(Jv,0),t.pixelStorei(Wv,0),t.pixelStorei(eb,0))}function T3(t,r,i,a){a.minMag&&(i.call(t,r,Eu,a.minMag),i.call(t,r,Su,a.minMag)),a.min&&i.call(t,r,Eu,a.min),a.mag&&i.call(t,r,Su,a.mag),a.wrap&&(i.call(t,r,_u,a.wrap),i.call(t,r,wu,a.wrap),(r===Bi||rT(t,r))&&i.call(t,r,Yy,a.wrap)),a.wrapR&&i.call(t,r,Yy,a.wrapR),a.wrapS&&i.call(t,r,_u,a.wrapS),a.wrapT&&i.call(t,r,wu,a.wrapT),a.minLod!==void 0&&i.call(t,r,dA,a.minLod),a.maxLod!==void 0&&i.call(t,r,hA,a.maxLod),a.baseLevel!==void 0&&i.call(t,r,mA,a.baseLevel),a.maxLevel!==void 0&&i.call(t,r,pA,a.maxLevel),a.compareFunc!==void 0&&i.call(t,r,yA,a.compareFunc),a.compareMode!==void 0&&i.call(t,r,gA,a.compareMode)}function ib(t,r,i){const a=i.target||cr;t.bindTexture(a,r),T3(t,a,t.texParameteri,i)}function A3(t){return t=t||Qr.textureColor,Ja(t)?t:new Uint8Array([t[0]*255,t[1]*255,t[2]*255,t[3]*255])}function ob(t,r,{options:i,width:a,height:s,internalFormat:u,lastMipLevelUploaded:f}){i=i||Qr.textureOptions,u=u||et;const h=i.target||cr;if(a=a||i.width,s=s||i.height,t.bindTexture(h,r),f>1){const p=Math.max(1,a>>f),m=Math.max(1,s>>f),y=p===1&&m===1,g=qd(u)?Vd:Fd,x=qd(u)?y?aA:Vd:Fd;t.texParameteri(h,Su,g),t.texParameteri(h,Eu,x)}else if(_3(t,a,s,u))t.generateMipmap(h);else{const p=qd(u)?Vd:Fd;t.texParameteri(h,Eu,p),t.texParameteri(h,Su,p),t.texParameteri(h,_u,bu),t.texParameteri(h,wu,bu)}}function e1(t,r,i,a,s,u){ob(t,r,{options:i,width:a,height:s,internalFormat:u})}function Wa(t){return t.auto===!0||t.auto===void 0&&t.level===void 0}function mh(t,r){return r=r||{},r.cubeFaceOrder||[u0,lA,sA,uA,cA,fA]}function ph(t,r){const a=mh(t,r).map(function(s,u){return{face:s,ndx:u}});return a.sort(function(s,u){return s.face-u.face}),a}function Tu(t,r,i,a){a=a||Qr.textureOptions;const s=a.target||cr,u=a.level||0;let f=i.width,h=i.height;const p=a.internalFormat||a.format||et,m=dl(p),y=a.format||m.format,g=a.type||m.type;if(t.bindTexture(s,r),s===fr){const x=i.width,b=i.height;let E,S;if(x/6===b)E=b,S=[0,0,1,0,2,0,3,0,4,0,5,0];else if(b/6===x)E=x,S=[0,0,0,1,0,2,0,3,0,4,0,5];else if(x/3===b/2)E=x/3,S=[0,0,1,0,2,0,0,1,1,1,2,1];else if(x/2===b/3)E=x/2,S=[0,0,1,0,0,1,1,1,0,2,1,2];else throw new Error(`can't figure out cube map from element: ${i.src?i.src:i.nodeName}`);const N=Zv();N?(N.canvas.width=E,N.canvas.height=E,f=E,h=E,Ir(t,a,()=>{ph(t,a).forEach(function(w){const O=S[w.ndx*2+0]*E,_=S[w.ndx*2+1]*E;N.drawImage(i,O,_,E,E,0,0,E,E),t.texImage2D(w.face,u,p,y,g,N.canvas)}),N.canvas.width=1,N.canvas.height=1})):typeof createImageBitmap<"u"&&(f=E,h=E,ph(t,a).forEach(function(w){const O=S[w.ndx*2+0]*E,_=S[w.ndx*2+1]*E;t.texImage2D(w.face,u,p,E,E,0,y,g,null),createImageBitmap(i,O,_,E,E,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(C){Ir(t,a,()=>{t.bindTexture(s,r),t.texImage2D(w.face,u,p,y,g,C),Wa(a)&&e1(t,r,a,f,h,p)})})}))}else s===Bi||s===Ri?Ir(t,a,()=>{const x=Math.min(i.width,i.height),b=Math.max(i.width,i.height),E=b/x;if(E%1!==0)throw new Error("can not compute 3D dimensions of element");const S=i.width===b?1:0,N=i.height===b?1:0;t.pixelStorei(c0,1),t.pixelStorei(Qv,i.width),t.pixelStorei(Kv,0),t.pixelStorei(eb,0),t.texImage3D(s,u,p,x,x,x,0,y,g,null);for(let w=0;w<E;++w){const O=w*x*S,_=w*x*N;t.pixelStorei(Jv,O),t.pixelStorei(Wv,_),t.texSubImage3D(s,u,0,0,w,x,x,1,y,g,i)}rb(t)}):Ir(t,a,()=>{t.texImage2D(s,u,p,y,g,i)});Wa(a)&&e1(t,r,a,f,h,p),ib(t,r,a)}function hl(){}function N3(t){if(typeof document<"u"){const r=document.createElement("a");return r.href=t,r.hostname===location.hostname&&r.port===location.port&&r.protocol===location.protocol}else{const r=new URL(location.href).origin;return new URL(t,location.href).origin===r}}function C3(t,r){return r===void 0&&!N3(t)?"anonymous":r}function R3(t,r,i){i=i||hl;let a;if(r=r!==void 0?r:Qr.crossOrigin,r=C3(t,r),typeof Image<"u"){a=new Image,r!==void 0&&(a.crossOrigin=r);const s=function(){a.removeEventListener("error",u),a.removeEventListener("load",f),a=null},u=function(){const p="couldn't load image: "+t;Bv(p),i(p,a),s()},f=function(){i(null,a),s()};return a.addEventListener("error",u),a.addEventListener("load",f),a.src=t,a}else if(typeof ImageBitmap<"u"){let s,u;const f=function(){i(s,u)},h={};r&&(h.mode="cors"),fetch(t,h).then(function(p){if(!p.ok)throw p;return p.blob()}).then(function(p){return createImageBitmap(p,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(p){u=p,setTimeout(f)}).catch(function(p){s=p,setTimeout(f)}),a=null}return a}function ab(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof ImageData<"u"&&t instanceof ImageData||typeof HTMLElement<"u"&&t instanceof HTMLElement}function d0(t,r,i){return ab(t)?(setTimeout(function(){i(null,t)}),t):R3(t,r,i)}function h0(t,r,i){i=i||Qr.textureOptions;const a=i.target||cr;if(t.bindTexture(a,r),i.color===!1)return;const s=A3(i.color);if(a===fr)for(let u=0;u<6;++u)t.texImage2D(u0+u,0,et,1,1,0,et,Qe,s);else a===Bi||a===Ri?t.texImage3D(a,0,et,1,1,1,0,et,Qe,s):t.texImage2D(a,0,et,1,1,0,et,Qe,s)}function M3(t,r,i,a){return a=a||hl,i=i||Qr.textureOptions,h0(t,r,i),i=f0(t,i),d0(i.src,i.crossOrigin,function(u,f){u?a(u,r,f):(Tu(t,r,f,i),a(null,r,f))})}function D3(t,r,i,a){a=a||hl;const s=i.src;if(s.length!==6)throw new Error("there must be 6 urls for a cubemap");const u=i.level||0,f=i.internalFormat||i.format||et,h=dl(f),p=i.format||h.format,m=i.type||Qe,y=i.target||cr;if(y!==fr)throw new Error("target must be TEXTURE_CUBE_MAP");h0(t,r,i),i=f0(t,i);let g=6;const x=[],b=mh(t,i);let E;function S(N){return function(w,O){--g,w?x.push(w):O.width!==O.height?x.push("cubemap face img is not a square: "+O.src):Ir(t,i,()=>{t.bindTexture(y,r),g===5?mh().forEach(function(_){t.texImage2D(_,u,f,p,m,O)}):t.texImage2D(N,u,f,p,m,O),Wa(i)&&t.generateMipmap(y)}),g===0&&a(x.length?x:void 0,r,E)}}E=s.map(function(N,w){return d0(N,i.crossOrigin,S(b[w]))})}function O3(t,r,i,a){a=a||hl;const s=i.src,u=i.internalFormat||i.format||et,f=dl(u),h=i.format||f.format,p=i.type||Qe,m=i.target||Ri;if(m!==Bi&&m!==Ri)throw new Error("target must be TEXTURE_3D or TEXTURE_2D_ARRAY");h0(t,r,i),i=f0(t,i);let y=s.length;const g=[];let x;const b=i.level||0;let E=i.width,S=i.height;const N=s.length;let w=!0;function O(_){return function(C,D){--y,C?g.push(C):Ir(t,i,()=>{if(t.bindTexture(m,r),w){w=!1,E=i.width||D.width,S=i.height||D.height,t.texImage3D(m,b,u,E,S,N,0,h,p,null);for(let z=0;z<N;++z)t.texSubImage3D(m,b,0,0,z,E,S,1,h,p,D)}else{let z=D,U;(D.width!==E||D.height!==S)&&(U=Zv(),z=U.canvas,U.canvas.width=E,U.canvas.height=S,U.drawImage(D,0,0,E,S)),t.texSubImage3D(m,b,0,0,_,E,S,1,h,p,z),U&&z===U.canvas&&(U.canvas.width=0,U.canvas.height=0)}Wa(i)&&t.generateMipmap(m)}),y===0&&a(g.length?g:void 0,r,x)}}x=s.map(function(_,C){return d0(_,i.crossOrigin,O(C))})}function gh(t,r,i,a){a=a||Qr.textureOptions;const s=a.target||cr;t.bindTexture(s,r);const u=a.level||0,f=a.internalFormat||a.format||et,h=dl(f),p=a.format||h.format,m=a.type||w3(t,i,h.type);if(Ja(i))i instanceof Uint8ClampedArray&&(i=new Uint8Array(i.buffer));else{const S=zv(m);i=new S(i)}const{width:y,height:g,depth:x}=z3(s,i,a,f,p,m),b=nb(f);rb(t),t.pixelStorei(c0,a.unpackAlignment||1);let E=0;return Ir(t,a,()=>{let S=0;const{blockWidth:N,blockHeight:w,bytesPerBlock:O}=S3(f,m);for(;S<i.byteLength;){const _=Math.max(1,y>>E),C=Math.max(1,g>>E),D=s===cr?Math.max(1,x>>E):x,z=Math.ceil(_/N),U=Math.ceil(C/w),V=s===fr?6:1,Y=z*U*O*D*V;if(S+Y>i.byteLength)throw new Error("src size does not match number of mip levels");const ae=i.subarray(S/i.BYTES_PER_ELEMENT,(S+Y)/i.BYTES_PER_ELEMENT),X=u+E;if(s===fr){const P=ae.length/6;ph(t,a).forEach(re=>{const B=P*re.ndx,q=ae.subarray(B,B+P);b?t.compressedTexImage2D(re.face,X,f,_,C,0,q):t.texImage2D(re.face,X,f,_,C,0,p,m,q)})}else s===Bi||s===Ri?t.texImage3D(s,X,f,_,C,D,0,p,m,ae):b?t.compressedTexImage2D(s,X,f,_,C,0,ae):t.texImage2D(s,X,f,_,C,0,p,m,ae);if(++E,S+=Y,_===1&&C===1&&D===1&&S!==i.byteLength)throw new Error("src size has more data than can fit in mip levels")}}),{width:y,height:g,depth:x,type:m,lastMipLevelUploaded:u+E-1}}function z3(t,r,i,a,s,u){let f=i.width,h=i.height,p=i.depth;const m=nb(a);if(m){if(!f||!h)throw new Error("compressed texture needs to set width and height!");p=p||1}else{const y=tb(a,u),g=r.byteLength/y;if(g%1)throw new Error(`length wrong size for format: ${Pv(Va,s)}`);if(m&&(!f||!h))throw new Error("compressed texture needs to set width and height!");let x;if(t===Bi||t===Ri)if(!f&&!h&&!p){const b=Math.cbrt(g);if(b%1!==0)throw new Error(`can't guess cube size of array of numElements: ${g}`);f=b,h=b,p=b}else f&&(!h||!p)?(x=Ks(Va,t,h,p,g/f),h=x.width,p=x.height):h&&(!f||!p)?(x=Ks(Va,t,f,p,g/h),f=x.width,p=x.height):(x=Ks(Va,t,f,h,g/p),f=x.width,h=x.height);else x=Ks(Va,t,f,h,g),f=x.width,h=x.height}return{width:f,height:h,depth:p}}function B3(t,r,i){const a=i.target||cr;t.bindTexture(a,r);const s=i.level||0,u=i.internalFormat||i.format||et,f=dl(u),h=i.format||f.format,p=i.type||f.type;Ir(t,i,()=>{if(a===fr)for(let m=0;m<6;++m)t.texImage2D(u0+m,s,u,i.width,i.height,0,h,p,null);else a===Bi||a===Ri?t.texImage3D(a,s,u,i.width,i.height,i.depth,0,h,p,null):t.texImage2D(a,s,u,i.width,i.height,0,h,p,null)})}function yh(t,r,i){i=i||hl,r=r||Qr.textureOptions;const a=t.createTexture(),s=r.target||cr;let u=r.width||1,f=r.height||1,h=0;const p=r.internalFormat||et;t.bindTexture(s,a),s===fr&&(t.texParameteri(s,_u,bu),t.texParameteri(s,wu,bu));let m=r.src;if(m)if(typeof m=="function"&&(m=m(t,r)),typeof m=="string")M3(t,a,r,i);else if(Ja(m)||Array.isArray(m)&&(typeof m[0]=="number"||Array.isArray(m[0])||Ja(m[0]))){const y=gh(t,a,m,r);u=y.width,f=y.height,h=y.lastMipLevelUploaded}else Array.isArray(m)&&(typeof m[0]=="string"||ab(m[0]))?s===fr?D3(t,a,r,i):O3(t,a,r,i):(Tu(t,a,m,r),u=m.width,f=m.height);else B3(t,a,r);return Wa(r)&&ob(t,a,{options:r,width:u,height:f,internalFormat:p,lastMipLevelUploaded:h}),ib(t,a,r),a}const m0=Bv;function lb(t){return typeof document<"u"&&document.getElementById?document.getElementById(t):null}const Au=33984,Xu=34962,U3=34963,H3=35713,L3=35714,j3=35632,F3=35633,V3=35981,sb=35718,k3=35721,G3=35971,q3=35382,Y3=35396,X3=35398,I3=35392,$3=35395,Iu=5126,ub=35664,cb=35665,fb=35666,p0=5124,db=35667,hb=35668,mb=35669,pb=35670,gb=35671,yb=35672,xb=35673,vb=35674,bb=35675,Eb=35676,P3=35678,Z3=35680,Q3=35679,K3=35682,J3=35685,W3=35686,eN=35687,tN=35688,nN=35689,rN=35690,iN=36289,oN=36292,aN=36293,g0=5125,Sb=36294,_b=36295,wb=36296,lN=36298,sN=36299,uN=36300,cN=36303,fN=36306,dN=36307,hN=36308,mN=36311,$u=3553,Pu=34067,y0=32879,Zu=35866,we={};function Tb(t,r){return we[r].bindPoint}function pN(t,r){return function(i){t.uniform1f(r,i)}}function gN(t,r){return function(i){t.uniform1fv(r,i)}}function yN(t,r){return function(i){t.uniform2fv(r,i)}}function xN(t,r){return function(i){t.uniform3fv(r,i)}}function vN(t,r){return function(i){t.uniform4fv(r,i)}}function Ab(t,r){return function(i){t.uniform1i(r,i)}}function Nb(t,r){return function(i){t.uniform1iv(r,i)}}function Cb(t,r){return function(i){t.uniform2iv(r,i)}}function Rb(t,r){return function(i){t.uniform3iv(r,i)}}function Mb(t,r){return function(i){t.uniform4iv(r,i)}}function bN(t,r){return function(i){t.uniform1ui(r,i)}}function EN(t,r){return function(i){t.uniform1uiv(r,i)}}function SN(t,r){return function(i){t.uniform2uiv(r,i)}}function _N(t,r){return function(i){t.uniform3uiv(r,i)}}function wN(t,r){return function(i){t.uniform4uiv(r,i)}}function TN(t,r){return function(i){t.uniformMatrix2fv(r,!1,i)}}function AN(t,r){return function(i){t.uniformMatrix3fv(r,!1,i)}}function NN(t,r){return function(i){t.uniformMatrix4fv(r,!1,i)}}function CN(t,r){return function(i){t.uniformMatrix2x3fv(r,!1,i)}}function RN(t,r){return function(i){t.uniformMatrix3x2fv(r,!1,i)}}function MN(t,r){return function(i){t.uniformMatrix2x4fv(r,!1,i)}}function DN(t,r){return function(i){t.uniformMatrix4x2fv(r,!1,i)}}function ON(t,r){return function(i){t.uniformMatrix3x4fv(r,!1,i)}}function zN(t,r){return function(i){t.uniformMatrix4x3fv(r,!1,i)}}function Rt(t,r,i,a){const s=Tb(t,r);return fl(t)?function(u){let f,h;!u||Zh(t,u)?(f=u,h=null):(f=u.texture,h=u.sampler),t.uniform1i(a,i),t.activeTexture(Au+i),t.bindTexture(s,f),t.bindSampler(i,h)}:function(u){t.uniform1i(a,i),t.activeTexture(Au+i),t.bindTexture(s,u)}}function Mt(t,r,i,a,s){const u=Tb(t,r),f=new Int32Array(s);for(let h=0;h<s;++h)f[h]=i+h;return fl(t)?function(h){t.uniform1iv(a,f),h.forEach(function(p,m){t.activeTexture(Au+f[m]);let y,g;!p||Zh(t,p)?(y=p,g=null):(y=p.texture,g=p.sampler),t.bindSampler(i,g),t.bindTexture(u,y)})}:function(h){t.uniform1iv(a,f),h.forEach(function(p,m){t.activeTexture(Au+f[m]),t.bindTexture(u,p)})}}we[Iu]={Type:Float32Array,size:4,setter:pN,arraySetter:gN};we[ub]={Type:Float32Array,size:8,setter:yN,cols:2};we[cb]={Type:Float32Array,size:12,setter:xN,cols:3};we[fb]={Type:Float32Array,size:16,setter:vN,cols:4};we[p0]={Type:Int32Array,size:4,setter:Ab,arraySetter:Nb};we[db]={Type:Int32Array,size:8,setter:Cb,cols:2};we[hb]={Type:Int32Array,size:12,setter:Rb,cols:3};we[mb]={Type:Int32Array,size:16,setter:Mb,cols:4};we[g0]={Type:Uint32Array,size:4,setter:bN,arraySetter:EN};we[Sb]={Type:Uint32Array,size:8,setter:SN,cols:2};we[_b]={Type:Uint32Array,size:12,setter:_N,cols:3};we[wb]={Type:Uint32Array,size:16,setter:wN,cols:4};we[pb]={Type:Uint32Array,size:4,setter:Ab,arraySetter:Nb};we[gb]={Type:Uint32Array,size:8,setter:Cb,cols:2};we[yb]={Type:Uint32Array,size:12,setter:Rb,cols:3};we[xb]={Type:Uint32Array,size:16,setter:Mb,cols:4};we[vb]={Type:Float32Array,size:32,setter:TN,rows:2,cols:2};we[bb]={Type:Float32Array,size:48,setter:AN,rows:3,cols:3};we[Eb]={Type:Float32Array,size:64,setter:NN,rows:4,cols:4};we[J3]={Type:Float32Array,size:32,setter:CN,rows:2,cols:3};we[W3]={Type:Float32Array,size:32,setter:MN,rows:2,cols:4};we[eN]={Type:Float32Array,size:48,setter:RN,rows:3,cols:2};we[tN]={Type:Float32Array,size:48,setter:ON,rows:3,cols:4};we[nN]={Type:Float32Array,size:64,setter:DN,rows:4,cols:2};we[rN]={Type:Float32Array,size:64,setter:zN,rows:4,cols:3};we[P3]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[Z3]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[Q3]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:y0};we[K3]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[iN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};we[oN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};we[aN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[lN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[sN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:y0};we[uN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[cN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};we[fN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[dN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:y0};we[hN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[mN]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};function Qu(t,r){return function(i){if(i.value)switch(t.disableVertexAttribArray(r),i.value.length){case 4:t.vertexAttrib4fv(r,i.value);break;case 3:t.vertexAttrib3fv(r,i.value);break;case 2:t.vertexAttrib2fv(r,i.value);break;case 1:t.vertexAttrib1fv(r,i.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else t.bindBuffer(Xu,i.buffer),t.enableVertexAttribArray(r),t.vertexAttribPointer(r,i.numComponents||i.size,i.type||Iu,i.normalize||!1,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,i.divisor||0)}}function Kr(t,r){return function(i){if(i.value)if(t.disableVertexAttribArray(r),i.value.length===4)t.vertexAttrib4iv(r,i.value);else throw new Error("The length of an integer constant value must be 4!");else t.bindBuffer(Xu,i.buffer),t.enableVertexAttribArray(r),t.vertexAttribIPointer(r,i.numComponents||i.size,i.type||p0,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,i.divisor||0)}}function Ku(t,r){return function(i){if(i.value)if(t.disableVertexAttribArray(r),i.value.length===4)t.vertexAttrib4uiv(r,i.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else t.bindBuffer(Xu,i.buffer),t.enableVertexAttribArray(r),t.vertexAttribIPointer(r,i.numComponents||i.size,i.type||g0,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,i.divisor||0)}}function x0(t,r,i){const a=i.size,s=i.count;return function(u){t.bindBuffer(Xu,u.buffer);const f=u.size||u.numComponents||a,h=f/s,p=u.type||Iu,y=we[p].size*f,g=u.normalize||!1,x=u.offset||0,b=y/s;for(let E=0;E<s;++E)t.enableVertexAttribArray(r+E),t.vertexAttribPointer(r+E,h,p,g,y,x+b*E),t.vertexAttribDivisor&&t.vertexAttribDivisor(r+E,u.divisor||0)}}const ft={};ft[Iu]={size:4,setter:Qu};ft[ub]={size:8,setter:Qu};ft[cb]={size:12,setter:Qu};ft[fb]={size:16,setter:Qu};ft[p0]={size:4,setter:Kr};ft[db]={size:8,setter:Kr};ft[hb]={size:12,setter:Kr};ft[mb]={size:16,setter:Kr};ft[g0]={size:4,setter:Ku};ft[Sb]={size:8,setter:Ku};ft[_b]={size:12,setter:Ku};ft[wb]={size:16,setter:Ku};ft[pb]={size:4,setter:Kr};ft[gb]={size:8,setter:Kr};ft[yb]={size:12,setter:Kr};ft[xb]={size:16,setter:Kr};ft[vb]={size:4,setter:x0,count:2};ft[bb]={size:9,setter:x0,count:3};ft[Eb]={size:16,setter:x0,count:4};const BN=/ERROR:\s*\d+:(\d+)/gi;function UN(t,r="",i=0){const a=[...r.matchAll(BN)],s=new Map(a.map((u,f)=>{const h=parseInt(u[1]),p=a[f+1],m=p?p.index:r.length,y=r.substring(u.index,m);return[h-1,y]}));return t.split(`
10
- `).map((u,f)=>{const h=s.get(f);return`${f+1+i}: ${u}${h?`
11
-
12
- ^^^ ${h}`:""}`}).join(`
13
- `)}const t1=/^[ \t]*\n/;function Db(t){let r=0;return t1.test(t)&&(r=1,t=t.replace(t1,"")),{lineOffset:r,shaderSource:t}}function HN(t,r){return t.errorCallback(r),t.callback&&setTimeout(()=>{t.callback(`${r}
14
- ${t.errors.join(`
15
- `)}`)}),null}function LN(t,r,i,a){if(a=a||m0,!t.getShaderParameter(i,H3)){const u=t.getShaderInfoLog(i),{lineOffset:f,shaderSource:h}=Db(t.getShaderSource(i)),p=`${UN(h,u,f)}
16
- Error compiling ${Pv(t,r)}: ${u}`;return a(p),p}return""}function v0(t,r,i){let a,s,u;if(typeof r=="function"&&(i=r,r=void 0),typeof t=="function")i=t,t=void 0;else if(t&&!Array.isArray(t)){const m=t;i=m.errorCallback,t=m.attribLocations,a=m.transformFeedbackVaryings,s=m.transformFeedbackMode,u=m.callback}const f=i||m0,h=[],p={errorCallback(m,...y){h.push(m),f(m,...y)},transformFeedbackVaryings:a,transformFeedbackMode:s,callback:u,errors:h};{let m={};Array.isArray(t)?t.forEach(function(y,g){m[y]=r?r[g]:g}):m=t||{},p.attribLocations=m}return p}const jN=["VERTEX_SHADER","FRAGMENT_SHADER"];function FN(t,r){if(r.indexOf("frag")>=0)return j3;if(r.indexOf("vert")>=0)return F3}function VN(t,r,i){const a=t.getAttachedShaders(r);for(const s of a)i.has(s)||t.deleteShader(s);t.deleteProgram(r)}const kN=(t=0)=>new Promise(r=>setTimeout(r,t));function GN(t,r,i){const a=t.createProgram(),{attribLocations:s,transformFeedbackVaryings:u,transformFeedbackMode:f}=v0(i);for(let h=0;h<r.length;++h){let p=r[h];if(typeof p=="string"){const m=lb(p),y=m?m.text:p;let g=t[jN[h]];m&&m.type&&(g=FN(t,m.type)||g),p=t.createShader(g),t.shaderSource(p,Db(y).shaderSource),t.compileShader(p)}t.attachShader(a,p)}Object.entries(s).forEach(([h,p])=>t.bindAttribLocation(a,p,h));{let h=u;h&&(h.attribs&&(h=h.attribs),Array.isArray(h)||(h=Object.keys(h)),t.transformFeedbackVaryings(a,h,f||V3))}return t.linkProgram(a),a}function qN(t,r,i,a,s){const u=v0(i,a,s),f=new Set(r),h=GN(t,r,u);function p(m,y){const g=XN(m,y,u.errorCallback);return g&&VN(m,y,f),g}if(u.callback){YN(t,h).then(()=>{const m=p(t,h);u.callback(m,m?void 0:h)});return}return p(t,h)?void 0:h}async function YN(t,r){const i=t.getExtension("KHR_parallel_shader_compile"),a=i?(u,f)=>u.getProgramParameter(f,i.COMPLETION_STATUS_KHR):()=>!0;let s=0;do await kN(s),s=1e3/60;while(!a(t,r))}function XN(t,r,i){if(i=i||m0,!t.getProgramParameter(r,L3)){const s=t.getProgramInfoLog(r);i(`Error in program linking: ${s}`);const f=t.getAttachedShaders(r).map(h=>LN(t,t.getShaderParameter(h,t.SHADER_TYPE),h,i));return`${s}
17
- ${f.filter(h=>h).join(`
18
- `)}`}}function IN(t,r,i,a,s){return qN(t,r,i,a,s)}function Ob(t){const r=t.name;return r.startsWith("gl_")||r.startsWith("webgl_")}const $N=/(\.|\[|]|\w+)/g,PN=t=>t>="0"&&t<="9";function ZN(t,r,i,a){const s=t.split($N).filter(h=>h!=="");let u=0,f="";for(;;){const h=s[u++];f+=h;const p=PN(h[0]),m=p?parseInt(h):h;if(p&&(f+=s[u++]),u===s.length){i[m]=r;break}else{const g=s[u++],x=g==="[",b=i[m]||(x?[]:{});i[m]=b,i=b,a[f]=a[f]||(function(E){return function(S){zb(E,S)}})(b),f+=g}}}function QN(t,r){let i=0;function a(h,p,m){const y=p.name.endsWith("[0]"),g=p.type,x=we[g];if(!x)throw new Error(`unknown type: 0x${g.toString(16)}`);let b;if(x.bindPoint){const E=i;i+=p.size,y?b=x.arraySetter(t,g,E,m,p.size):b=x.setter(t,g,E,m,p.size)}else x.arraySetter&&y?b=x.arraySetter(t,m):b=x.setter(t,m);return b.location=m,b}const s={},u={},f=t.getProgramParameter(r,sb);for(let h=0;h<f;++h){const p=t.getActiveUniform(r,h);if(Ob(p))continue;let m=p.name;m.endsWith("[0]")&&(m=m.substr(0,m.length-3));const y=t.getUniformLocation(r,p.name);if(y){const g=a(r,p,y);s[m]=g,ZN(m,g,u,s)}}return s}function KN(t,r){const i={},a=t.getProgramParameter(r,G3);for(let s=0;s<a;++s){const u=t.getTransformFeedbackVarying(r,s);i[u.name]={index:s,type:u.type,size:u.size}}return i}function JN(t,r){const i=t.getProgramParameter(r,sb),a=[],s=[];for(let h=0;h<i;++h){s.push(h),a.push({});const p=t.getActiveUniform(r,h);a[h].name=p.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(h){const p=h[0],m=h[1];t.getActiveUniforms(r,s,t[p]).forEach(function(y,g){a[g][m]=y})});const u={},f=t.getProgramParameter(r,q3);for(let h=0;h<f;++h){const p=t.getActiveUniformBlockName(r,h),m={index:t.getUniformBlockIndex(r,p),usedByVertexShader:t.getActiveUniformBlockParameter(r,h,Y3),usedByFragmentShader:t.getActiveUniformBlockParameter(r,h,X3),size:t.getActiveUniformBlockParameter(r,h,I3),uniformIndices:t.getActiveUniformBlockParameter(r,h,$3)};m.used=m.usedByVertexShader||m.usedByFragmentShader,u[p]=m}return{blockSpecs:u,uniformData:a}}function zb(t,r){for(const i in r){const a=t[i];typeof a=="function"?a(r[i]):zb(t[i],r[i])}}function Bb(t,...r){const i=t.uniformSetters||t,a=r.length;for(let s=0;s<a;++s){const u=r[s];if(Array.isArray(u)){const f=u.length;for(let h=0;h<f;++h)Bb(i,u[h])}else for(const f in u){const h=i[f];h&&h(u[f])}}}function WN(t,r){const i={},a=t.getProgramParameter(r,k3);for(let s=0;s<a;++s){const u=t.getActiveAttrib(r,s);if(Ob(u))continue;const f=t.getAttribLocation(r,u.name),h=ft[u.type],p=h.setter(t,f,h);p.location=f,i[u.name]=p}return i}function eC(t,r){for(const i in r){const a=t[i];a&&a(r[i])}}function tC(t,r,i){i.vertexArrayObject?t.bindVertexArray(i.vertexArrayObject):(eC(r.attribSetters||r,i.attribs),i.indices&&t.bindBuffer(U3,i.indices))}function n1(t,r){const i=QN(t,r),a=WN(t,r),s={program:r,uniformSetters:i,attribSetters:a,uniformLocations:Object.fromEntries(Object.entries(i).map(([u,f])=>[u,f.location])),attribLocations:Object.fromEntries(Object.entries(a).map(([u,f])=>[u,f.location]))};return fl(t)&&(s.uniformBlockSpec=JN(t,r),s.transformFeedbackInfo=KN(t,r)),s}const nC=/\s|{|}|;/;function rC(t,r,i,a,s){const u=v0(i,a,s),f=[];if(r=r.map(function(m){if(!nC.test(m)){const y=lb(m);if(y)m=y.text;else{const g=`no element with id: ${m}`;u.errorCallback(g),f.push(g)}}return m}),f.length)return HN(u,"");const h=u.callback;h&&(u.callback=(m,y)=>{h(m,m?void 0:n1(t,y))});const p=IN(t,r,u);return p?n1(t,p):null}const iC=4,r1=5123;function oC(t,r,i,a,s,u){i=i===void 0?iC:i;const f=r.indices,h=r.elementType,p=a===void 0?r.numElements:a;s=s===void 0?0:s,h||f?u!==void 0?t.drawElementsInstanced(i,p,h===void 0?r1:r.elementType,s,u):t.drawElements(i,p,h===void 0?r1:r.elementType,s):u!==void 0?t.drawArraysInstanced(i,s,p,u):t.drawArrays(i,s,p)}const Ub=36160,Js=36161,aC=3553,lC=5121,sC=6402,uC=6408,cC=33190,fC=36012,dC=35056,hC=36013,mC=32854,pC=32855,gC=36194,Hb=33189,Lb=6401,jb=36168,b0=34041,xh=36064,Ju=36096,Fb=36128,E0=33306,vh=33071,bh=9729,yC=[{format:uC,type:lC,min:bh,wrap:vh},{format:b0}],yn={};yn[b0]=E0;yn[Lb]=Fb;yn[jb]=Fb;yn[sC]=Ju;yn[Hb]=Ju;yn[cC]=Ju;yn[fC]=Ju;yn[dC]=E0;yn[hC]=E0;function xC(t,r){return yn[t]||yn[r]}const Jr={};Jr[mC]=!0;Jr[pC]=!0;Jr[gC]=!0;Jr[b0]=!0;Jr[Hb]=!0;Jr[Lb]=!0;Jr[jb]=!0;function vC(t){return Jr[t]}const bC=32;function EC(t){return t>=xh&&t<xh+bC}function SC(t,r,i,a){const s=Ub,u=t.createFramebuffer();t.bindFramebuffer(s,u),i=i||t.drawingBufferWidth,a=a||t.drawingBufferHeight,r=r||yC;const f=[],h={framebuffer:u,attachments:[],width:i,height:a};return r.forEach(function(p,m){let y=p.attachment;const g=p.samples,x=p.format;let b=p.attachmentPoint||xC(x,p.internalFormat);if(b||(b=xh+m),EC(b)&&f.push(b),!y)if(g!==void 0||vC(x))y=t.createRenderbuffer(),t.bindRenderbuffer(Js,y),g>1?t.renderbufferStorageMultisample(Js,g,x,i,a):t.renderbufferStorage(Js,x,i,a);else{const E=Object.assign({},p);E.width=i,E.height=a,E.auto===void 0&&(E.auto=!1,E.min=E.min||E.minMag||bh,E.mag=E.mag||E.minMag||bh,E.wrapS=E.wrapS||E.wrap||vh,E.wrapT=E.wrapT||E.wrap||vh),y=yh(t,E)}if(nT(t,y))t.framebufferRenderbuffer(s,b,Js,y);else if(Zh(t,y))p.layer!==void 0?t.framebufferTextureLayer(s,b,y,p.level||0,p.layer):t.framebufferTexture2D(s,b,p.target||aC,y,p.level||0);else throw new Error("unknown attachment type");h.attachments.push(y)}),t.drawBuffers&&t.drawBuffers(f),h}function i1(t,r,i){i=i||Ub,r?(t.bindFramebuffer(i,r.framebuffer),t.viewport(0,0,r.width,r.height)):(t.bindFramebuffer(i,null),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight))}const o1=t=>{const r=t.replace("#","");return[parseInt(r.substring(0,2),16),parseInt(r.substring(2,4),16),parseInt(r.substring(4,6),16)]},_C=(t,r,i)=>{const[a,s,u]=o1(t),[f,h,p]=o1(r),m=Math.round(a+(f-a)*i).toString(16).padStart(2,"0"),y=Math.round(s+(h-s)*i).toString(16).padStart(2,"0"),g=Math.round(u+(p-u)*i).toString(16).padStart(2,"0");return`#${m}${y}${g}`},Vb=(t,r)=>{const i=Math.max(0,Math.min(1,r)),a=[...t].sort((p,m)=>p.position-m.position);if(a.length===0)return"#000000";if(a.length===1||i<=a[0].position)return a[0].color;if(i>=a[a.length-1].position)return a[a.length-1].color;let s=a[0],u=a[a.length-1];for(let p=0;p<a.length-1;p++)if(i>=a[p].position&&i<=a[p+1].position){s=a[p],u=a[p+1];break}const f=u.position-s.position,h=f===0?0:(i-s.position)/f;return _C(s.color,u.color,h)},wC=t=>typeof t=="object"&&t!==null&&t.type==="texture"&&"src"in t,TC=t=>typeof t=="object"&&t!==null&&t.type==="gradient",AC=`#version 300 es
19
-
20
- precision highp float;
21
-
22
- in vec2 position;
23
- in vec2 texcoord;
24
-
25
- out vec2 vUv;
26
-
27
- void main() {
28
- vUv = vec2(texcoord.x, texcoord.y);
29
- gl_Position = vec4(position, 0.0, 1.0);
30
- }
31
- `;class NC{programs={};fbos={};renderOrder=[];dependencyMapping={};quad;textures={};textureSrcs={};gradientCanvases={};defaultTexture;patch;gl;uniforms;onTextureLoaded;error=null;constructor(r,i){this.patch=i,this.gl=r,this.defaultTexture=yh(this.gl,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),gh(this.gl,this.defaultTexture,new Uint8Array([0,0,0,255]),{width:1,height:1,minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});let a=!1;for(let h=0;h<i.shaders.length&&!a;h++){const p=i.shaders[h];if(this.programs[p.id]=rC(this.gl,[AC,p.source],void 0,m=>{const y=m.match(/ERROR:\s*\d+:(\d+):/),g=y?parseInt(y[1],10):0;this.error={message:m,line:g,shaderName:p.name},a=!0}),a)break;this.fbos[p.id]=SC(this.gl,[{format:this.gl.RGBA,min:this.gl.NEAREST,mag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}],p.resolution.width,p.resolution.height)}this.quad=oA.createXYQuadBufferInfo(this.gl);const s={},u={};this.uniforms={};for(let h=0;h<this.patch.shaders.length;h++){const p=this.patch.shaders[h];s[p.id]=[],u[p.id]=0,this.dependencyMapping[p.id]=[],this.uniforms[p.id]={}}for(const h of this.patch.connections)s[h.from].push(h.to),u[h.to]+=1,this.dependencyMapping[h.to].push({input:h.input,from:h.from});const f=[...Object.entries(u)].reduce((h,[p,m])=>m===0?[...h,p]:h,[]);for(;f.length>0;){const h=f.shift();this.renderOrder.push(h);for(const p of s[h]){const m=u[p]-1;u[p]=m,m===0&&f.push(p)}}if(this.renderOrder.length<this.patch.shaders.length)throw Error("Cycle detected in graph")}_getOrCreateTexture(r){if(!this.textures[r]){const i=yh(this.gl,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});gh(this.gl,i,new Uint8Array([0,0,0,255]),{width:1,height:1,minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),this.textures[r]=i}return this.textures[r]}_updateGradientUniform(r,i){let a=this.gradientCanvases[r];a||(a=document.createElement("canvas"),a.width=256,a.height=1,this.gradientCanvases[r]=a);const s=a.getContext("2d");for(let u=0;u<256;u++)s.fillStyle=Vb(i.stops,u/255),s.fillRect(u,0,1,1);return this._updateTextureUniform(r,{type:"texture",src:a})}_updateTextureUniform(r,i){const a=this._getOrCreateTexture(r),s=i.src;if(typeof s=="string"){if(this.textureSrcs[r]!==s){this.textureSrcs[r]=s;const u=new Image;u.onload=()=>{this.textures[r]===a&&(Tu(this.gl,a,u,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),this.onTextureLoaded?.())},u.src=s}}else Tu(this.gl,a,s,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});return a}render(){if(!this.error)for(let r=0;r<this.renderOrder.length;r++){const i=this.renderOrder[r],a=this.programs[i],s={...this.uniforms[i]};for(const[u,f]of Object.entries(s))wC(f)?s[u]=this._updateTextureUniform(`${i}::${u}`,f):TC(f)&&(s[u]=this._updateGradientUniform(`${i}::${u}`,f));for(const u of this.dependencyMapping[i])s[u.input]=this.fbos[u.from].attachments[0];this.gl.useProgram(a.program),r!==this.renderOrder.length-1?i1(this.gl,this.fbos[i]):i1(this.gl,null),Bb(a,s),tC(this.gl,a,this.quad),oC(this.gl,this.quad)}}dispose(){for(const r of Object.values(this.programs))r&&r.program&&this.gl.deleteProgram(r.program);this.programs={};for(const r of Object.values(this.fbos)){for(const i of r.attachments)i instanceof WebGLTexture?this.gl.deleteTexture(i):i instanceof WebGLRenderbuffer&&this.gl.deleteRenderbuffer(i);this.gl.deleteFramebuffer(r.framebuffer)}this.fbos={};for(const r of Object.values(this.textures))this.gl.deleteTexture(r);this.textures={},this.textureSrcs={},this.gradientCanvases={},this.gl.deleteTexture(this.defaultTexture),this.quad.indices&&this.gl.deleteBuffer(this.quad.indices);for(const r of Object.values(this.quad.attribs??{}))r.buffer&&this.gl.deleteBuffer(r.buffer)}}const kb=j.forwardRef(({patch:t,uniforms:r,className:i,style:a,width:s=100,height:u=100,animate:f,onError:h},p)=>{const m=j.useRef(null);return j.useEffect(()=>{if(m.current){const y=m.current.getContext("webgl2",{preserveDrawingBuffer:!0}),g=new NC(y,t);h?.(g.error);let x=null;const b=()=>{g.uniforms=r.current,g.render()};return f?x=requestAnimationFrame(function E(){b(),x=requestAnimationFrame(E)}):(g.onTextureLoaded=b,b()),()=>{x!==null&&cancelAnimationFrame(x),g.dispose()}}},[t,s,u,f]),T.jsx("canvas",{className:`image-crisp ${i??""}`,style:a,width:s,height:u,ref:y=>{m.current=y,typeof p=="function"?p(y):p&&(p.current=y)}})}),pt="([-\\d.]+)",$t="\\s*,\\s*",Bo=t=>{const r=[],i=t.source.split(`
32
- `);for(const a of i){const s=a.trim(),u=s.match(new RegExp(`^uniform\\s+float\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${pt}${$t}${pt}${$t}${pt}\\s*\\]`));if(u?.[1]){const w=parseFloat(u[2]),O=parseFloat(u[3]),_=parseFloat(u[4]);r.push({name:u[1],type:"float",min:w,max:O,default:_});continue}const f=s.match(/^uniform\s+float\s+(\w+)\s*;.*\/\/\s*time\b/);if(f?.[1]){r.push({name:f[1],type:"float",special:"time"});continue}const h=s.match(/^uniform\s+float\s+(\w+)\s*;/);if(h?.[1]){r.push({name:h[1],type:"float"});continue}const p=s.match(new RegExp(`^uniform\\s+vec2\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${pt}${$t}${pt}\\s*\\]`));if(p?.[1]){const w=[parseFloat(p[2]),parseFloat(p[3])];r.push({name:p[1],type:"vec2",default:w});continue}const m=s.match(new RegExp(`^uniform\\s+vec3\\s+(\\w+)\\s*;.*\\/\\/\\s*color(?:\\s*\\[\\s*${pt}${$t}${pt}${$t}${pt}\\s*\\])?`));if(m?.[1]){const w=m[2]!==void 0?[parseFloat(m[2]),parseFloat(m[3]),parseFloat(m[4])]:void 0;r.push({name:m[1],type:"vec3",color:!0,...w&&{default:w}});continue}const y=s.match(new RegExp(`^uniform\\s+vec3\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${pt}${$t}${pt}${$t}${pt}\\s*\\]`));if(y?.[1]){const w=[parseFloat(y[2]),parseFloat(y[3]),parseFloat(y[4])];r.push({name:y[1],type:"vec3",default:w});continue}const g=s.match(new RegExp(`^uniform\\s+vec4\\s+(\\w+)\\s*;.*\\/\\/\\s*color(?:\\s*\\[\\s*${pt}${$t}${pt}${$t}${pt}${$t}${pt}\\s*\\])?`));if(g?.[1]){const w=g[2]!==void 0?[parseFloat(g[2]),parseFloat(g[3]),parseFloat(g[4]),parseFloat(g[5])]:void 0;r.push({name:g[1],type:"vec4",color:!0,...w&&{default:w}});continue}const x=s.match(new RegExp(`^uniform\\s+vec4\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${pt}${$t}${pt}${$t}${pt}${$t}${pt}\\s*\\]`));if(x?.[1]){const w=[parseFloat(x[2]),parseFloat(x[3]),parseFloat(x[4]),parseFloat(x[5])];r.push({name:x[1],type:"vec4",default:w});continue}const b=s.match(/^uniform\s+vec2\s+(\w+)\s*;.*\/\/\s*mouse\b/);if(b?.[1]){r.push({name:b[1],type:"vec2",special:"mouse"});continue}const E=s.match(/^uniform\s+vec2\s+(\w+)\s*;.*\/\/\s*resolution\b/);if(E?.[1]){r.push({name:E[1],type:"vec2",special:"resolution"});continue}const S=s.match(/^uniform\s+(vec[234])\s+(\w+)\s*;/);if(S){const w=S[1],O=S[2];w==="vec2"?r.push({name:O,type:"vec2"}):w==="vec3"?r.push({name:O,type:"vec3"}):w==="vec4"&&r.push({name:O,type:"vec4"});continue}const N=s.match(/^uniform\s+sampler2D\s+(\w+)\s*;(?:.*\/\/\s*(texture|gradient)\b)?/);if(N?.[1]){const w=N[2],O=w==="texture"?"texture":w==="gradient"?"gradient":"input";r.push({name:N[1],type:"sampler2D",source:O})}}return r};function CC(t,r){switch(r.type){case"float":return typeof t=="number";case"vec2":return Array.isArray(t)&&t.length===2;case"vec3":return Array.isArray(t)&&t.length===3;case"vec4":return Array.isArray(t)&&t.length===4;case"sampler2D":return r.source==="gradient"?t?.type==="gradient":r.source==="texture"?t?.type==="texture":!1}}function RC(t){if(t.type==="float"||t.type==="vec2"||t.type==="vec3"||t.type==="vec4")return t.default}const MC=`import { RendererComponent, type Uniforms, type Patch } from "@sequenza/lib";
33
- import "@sequenza/lib/style.css";
34
- import { useRef } from "react";
35
-
36
- function SequenzaComponent() {
37
- const uniformRef = useRef<Record<string, Uniforms>>(getInitialUniforms());
38
-
39
- return (
40
- <RendererComponent
41
- patch={getPatch()}
42
- uniforms={uniformRef}
43
- animate={true}
44
- width={100}
45
- height={100}
46
- ></RendererComponent>
47
- );
48
- }
49
-
50
- export default SequenzaComponent;
51
-
52
- function getInitialUniforms(): Record<string, Uniforms> {
53
- throw new Error("placeholder for initial uniforms");
54
- }
55
-
56
- function getPatch(): Patch {
57
- throw new Error("placeholder for patch");
58
- }
59
- `;function DC(t,r){let i=MC;const a=Object.keys(t).filter(u=>!!r.shaders.find(h=>h.id===u)),s={};for(const u of a)s[u]=t[u];return i=i.replace('throw new Error("placeholder for initial uniforms");',`return ${JSON.stringify(s,null,2)};`),i=i.replace('throw new Error("placeholder for patch");',`return ${JSON.stringify(r,null,2)};`),i}function dt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,a;i<t.length;i++)(a=dt(t[i]))!==""&&(r+=(r&&" ")+a);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var OC={value:()=>{}};function Wu(){for(var t=0,r=arguments.length,i={},a;t<r;++t){if(!(a=arguments[t]+"")||a in i||/[\s.]/.test(a))throw new Error("illegal type: "+a);i[a]=[]}return new pu(i)}function pu(t){this._=t}function zC(t,r){return t.trim().split(/^|\s+/).map(function(i){var a="",s=i.indexOf(".");if(s>=0&&(a=i.slice(s+1),i=i.slice(0,s)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:a}})}pu.prototype=Wu.prototype={constructor:pu,on:function(t,r){var i=this._,a=zC(t+"",i),s,u=-1,f=a.length;if(arguments.length<2){for(;++u<f;)if((s=(t=a[u]).type)&&(s=BC(i[s],t.name)))return s;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++u<f;)if(s=(t=a[u]).type)i[s]=a1(i[s],t.name,r);else if(r==null)for(s in i)i[s]=a1(i[s],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new pu(t)},call:function(t,r){if((s=arguments.length-2)>0)for(var i=new Array(s),a=0,s,u;a<s;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],a=0,s=u.length;a<s;++a)u[a].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],s=0,u=a.length;s<u;++s)a[s].value.apply(r,i)}};function BC(t,r){for(var i=0,a=t.length,s;i<a;++i)if((s=t[i]).name===r)return s.value}function a1(t,r,i){for(var a=0,s=t.length;a<s;++a)if(t[a].name===r){t[a]=OC,t=t.slice(0,a).concat(t.slice(a+1));break}return i!=null&&t.push({name:r,value:i}),t}var Eh="http://www.w3.org/1999/xhtml";const l1={svg:"http://www.w3.org/2000/svg",xhtml:Eh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ec(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),l1.hasOwnProperty(r)?{space:l1[r],local:t}:t}function UC(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===Eh&&r.documentElement.namespaceURI===Eh?r.createElement(t):r.createElementNS(i,t)}}function HC(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Gb(t){var r=ec(t);return(r.local?HC:UC)(r)}function LC(){}function S0(t){return t==null?LC:function(){return this.querySelector(t)}}function jC(t){typeof t!="function"&&(t=S0(t));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var u=r[s],f=u.length,h=a[s]=new Array(f),p,m,y=0;y<f;++y)(p=u[y])&&(m=t.call(p,p.__data__,y,u))&&("__data__"in p&&(m.__data__=p.__data__),h[y]=m);return new Zt(a,this._parents)}function FC(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function VC(){return[]}function qb(t){return t==null?VC:function(){return this.querySelectorAll(t)}}function kC(t){return function(){return FC(t.apply(this,arguments))}}function GC(t){typeof t=="function"?t=kC(t):t=qb(t);for(var r=this._groups,i=r.length,a=[],s=[],u=0;u<i;++u)for(var f=r[u],h=f.length,p,m=0;m<h;++m)(p=f[m])&&(a.push(t.call(p,p.__data__,m,f)),s.push(p));return new Zt(a,s)}function Yb(t){return function(){return this.matches(t)}}function Xb(t){return function(r){return r.matches(t)}}var qC=Array.prototype.find;function YC(t){return function(){return qC.call(this.children,t)}}function XC(){return this.firstElementChild}function IC(t){return this.select(t==null?XC:YC(typeof t=="function"?t:Xb(t)))}var $C=Array.prototype.filter;function PC(){return Array.from(this.children)}function ZC(t){return function(){return $C.call(this.children,t)}}function QC(t){return this.selectAll(t==null?PC:ZC(typeof t=="function"?t:Xb(t)))}function KC(t){typeof t!="function"&&(t=Yb(t));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var u=r[s],f=u.length,h=a[s]=[],p,m=0;m<f;++m)(p=u[m])&&t.call(p,p.__data__,m,u)&&h.push(p);return new Zt(a,this._parents)}function Ib(t){return new Array(t.length)}function JC(){return new Zt(this._enter||this._groups.map(Ib),this._parents)}function Nu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Nu.prototype={constructor:Nu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function WC(t){return function(){return t}}function eR(t,r,i,a,s,u){for(var f=0,h,p=r.length,m=u.length;f<m;++f)(h=r[f])?(h.__data__=u[f],a[f]=h):i[f]=new Nu(t,u[f]);for(;f<p;++f)(h=r[f])&&(s[f]=h)}function tR(t,r,i,a,s,u,f){var h,p,m=new Map,y=r.length,g=u.length,x=new Array(y),b;for(h=0;h<y;++h)(p=r[h])&&(x[h]=b=f.call(p,p.__data__,h,r)+"",m.has(b)?s[h]=p:m.set(b,p));for(h=0;h<g;++h)b=f.call(t,u[h],h,u)+"",(p=m.get(b))?(a[h]=p,p.__data__=u[h],m.delete(b)):i[h]=new Nu(t,u[h]);for(h=0;h<y;++h)(p=r[h])&&m.get(x[h])===p&&(s[h]=p)}function nR(t){return t.__data__}function rR(t,r){if(!arguments.length)return Array.from(this,nR);var i=r?tR:eR,a=this._parents,s=this._groups;typeof t!="function"&&(t=WC(t));for(var u=s.length,f=new Array(u),h=new Array(u),p=new Array(u),m=0;m<u;++m){var y=a[m],g=s[m],x=g.length,b=iR(t.call(y,y&&y.__data__,m,a)),E=b.length,S=h[m]=new Array(E),N=f[m]=new Array(E),w=p[m]=new Array(x);i(y,g,S,N,w,b,r);for(var O=0,_=0,C,D;O<E;++O)if(C=S[O]){for(O>=_&&(_=O+1);!(D=N[_])&&++_<E;);C._next=D||null}}return f=new Zt(f,a),f._enter=h,f._exit=p,f}function iR(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function oR(){return new Zt(this._exit||this._groups.map(Ib),this._parents)}function aR(t,r,i){var a=this.enter(),s=this,u=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),r!=null&&(s=r(s),s&&(s=s.selection())),i==null?u.remove():i(u),a&&s?a.merge(s).order():s}function lR(t){for(var r=t.selection?t.selection():t,i=this._groups,a=r._groups,s=i.length,u=a.length,f=Math.min(s,u),h=new Array(s),p=0;p<f;++p)for(var m=i[p],y=a[p],g=m.length,x=h[p]=new Array(g),b,E=0;E<g;++E)(b=m[E]||y[E])&&(x[E]=b);for(;p<s;++p)h[p]=i[p];return new Zt(h,this._parents)}function sR(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var a=t[r],s=a.length-1,u=a[s],f;--s>=0;)(f=a[s])&&(u&&f.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(f,u),u=f);return this}function uR(t){t||(t=cR);function r(g,x){return g&&x?t(g.__data__,x.__data__):!g-!x}for(var i=this._groups,a=i.length,s=new Array(a),u=0;u<a;++u){for(var f=i[u],h=f.length,p=s[u]=new Array(h),m,y=0;y<h;++y)(m=f[y])&&(p[y]=m);p.sort(r)}return new Zt(s,this._parents).order()}function cR(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function fR(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function dR(){return Array.from(this)}function hR(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],s=0,u=a.length;s<u;++s){var f=a[s];if(f)return f}return null}function mR(){let t=0;for(const r of this)++t;return t}function pR(){return!this.node()}function gR(t){for(var r=this._groups,i=0,a=r.length;i<a;++i)for(var s=r[i],u=0,f=s.length,h;u<f;++u)(h=s[u])&&t.call(h,h.__data__,u,s);return this}function yR(t){return function(){this.removeAttribute(t)}}function xR(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vR(t,r){return function(){this.setAttribute(t,r)}}function bR(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function ER(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function SR(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function _R(t,r){var i=ec(t);if(arguments.length<2){var a=this.node();return i.local?a.getAttributeNS(i.space,i.local):a.getAttribute(i)}return this.each((r==null?i.local?xR:yR:typeof r=="function"?i.local?SR:ER:i.local?bR:vR)(i,r))}function $b(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function wR(t){return function(){this.style.removeProperty(t)}}function TR(t,r,i){return function(){this.style.setProperty(t,r,i)}}function AR(t,r,i){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,i)}}function NR(t,r,i){return arguments.length>1?this.each((r==null?wR:typeof r=="function"?AR:TR)(t,r,i??"")):Uo(this.node(),t)}function Uo(t,r){return t.style.getPropertyValue(r)||$b(t).getComputedStyle(t,null).getPropertyValue(r)}function CR(t){return function(){delete this[t]}}function RR(t,r){return function(){this[t]=r}}function MR(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function DR(t,r){return arguments.length>1?this.each((r==null?CR:typeof r=="function"?MR:RR)(t,r)):this.node()[t]}function Pb(t){return t.trim().split(/^|\s+/)}function _0(t){return t.classList||new Zb(t)}function Zb(t){this._node=t,this._names=Pb(t.getAttribute("class")||"")}Zb.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Qb(t,r){for(var i=_0(t),a=-1,s=r.length;++a<s;)i.add(r[a])}function Kb(t,r){for(var i=_0(t),a=-1,s=r.length;++a<s;)i.remove(r[a])}function OR(t){return function(){Qb(this,t)}}function zR(t){return function(){Kb(this,t)}}function BR(t,r){return function(){(r.apply(this,arguments)?Qb:Kb)(this,t)}}function UR(t,r){var i=Pb(t+"");if(arguments.length<2){for(var a=_0(this.node()),s=-1,u=i.length;++s<u;)if(!a.contains(i[s]))return!1;return!0}return this.each((typeof r=="function"?BR:r?OR:zR)(i,r))}function HR(){this.textContent=""}function LR(t){return function(){this.textContent=t}}function jR(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function FR(t){return arguments.length?this.each(t==null?HR:(typeof t=="function"?jR:LR)(t)):this.node().textContent}function VR(){this.innerHTML=""}function kR(t){return function(){this.innerHTML=t}}function GR(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function qR(t){return arguments.length?this.each(t==null?VR:(typeof t=="function"?GR:kR)(t)):this.node().innerHTML}function YR(){this.nextSibling&&this.parentNode.appendChild(this)}function XR(){return this.each(YR)}function IR(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $R(){return this.each(IR)}function PR(t){var r=typeof t=="function"?t:Gb(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function ZR(){return null}function QR(t,r){var i=typeof t=="function"?t:Gb(t),a=r==null?ZR:typeof r=="function"?r:S0(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),a.apply(this,arguments)||null)})}function KR(){var t=this.parentNode;t&&t.removeChild(this)}function JR(){return this.each(KR)}function WR(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function eM(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function tM(t){return this.select(t?eM:WR)}function nM(t){return arguments.length?this.property("__data__",t):this.node().__data__}function rM(t){return function(r){t.call(this,r,this.__data__)}}function iM(t){return t.trim().split(/^|\s+/).map(function(r){var i="",a=r.indexOf(".");return a>=0&&(i=r.slice(a+1),r=r.slice(0,a)),{type:r,name:i}})}function oM(t){return function(){var r=this.__on;if(r){for(var i=0,a=-1,s=r.length,u;i<s;++i)u=r[i],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):r[++a]=u;++a?r.length=a:delete this.__on}}}function aM(t,r,i){return function(){var a=this.__on,s,u=rM(r);if(a){for(var f=0,h=a.length;f<h;++f)if((s=a[f]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=u,s.options=i),s.value=r;return}}this.addEventListener(t.type,u,i),s={type:t.type,name:t.name,value:r,listener:u,options:i},a?a.push(s):this.__on=[s]}}function lM(t,r,i){var a=iM(t+""),s,u=a.length,f;if(arguments.length<2){var h=this.node().__on;if(h){for(var p=0,m=h.length,y;p<m;++p)for(s=0,y=h[p];s<u;++s)if((f=a[s]).type===y.type&&f.name===y.name)return y.value}return}for(h=r?aM:oM,s=0;s<u;++s)this.each(h(a[s],r,i));return this}function Jb(t,r,i){var a=$b(t),s=a.CustomEvent;typeof s=="function"?s=new s(r,i):(s=a.document.createEvent("Event"),i?(s.initEvent(r,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(r,!1,!1)),t.dispatchEvent(s)}function sM(t,r){return function(){return Jb(this,t,r)}}function uM(t,r){return function(){return Jb(this,t,r.apply(this,arguments))}}function cM(t,r){return this.each((typeof r=="function"?uM:sM)(t,r))}function*fM(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var a=t[r],s=0,u=a.length,f;s<u;++s)(f=a[s])&&(yield f)}var Wb=[null];function Zt(t,r){this._groups=t,this._parents=r}function ml(){return new Zt([[document.documentElement]],Wb)}function dM(){return this}Zt.prototype=ml.prototype={constructor:Zt,select:jC,selectAll:GC,selectChild:IC,selectChildren:QC,filter:KC,data:rR,enter:JC,exit:oR,join:aR,merge:lR,selection:dM,order:sR,sort:uR,call:fR,nodes:dR,node:hR,size:mR,empty:pR,each:gR,attr:_R,style:NR,property:DR,classed:UR,text:FR,html:qR,raise:XR,lower:$R,append:PR,insert:QR,remove:JR,clone:tM,datum:nM,on:lM,dispatch:cM,[Symbol.iterator]:fM};function Pt(t){return typeof t=="string"?new Zt([[document.querySelector(t)]],[document.documentElement]):new Zt([[t]],Wb)}function hM(t){let r;for(;r=t.sourceEvent;)t=r;return t}function hn(t,r){if(t=hM(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var a=i.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(r.getScreenCTM().inverse()),[a.x,a.y]}if(r.getBoundingClientRect){var s=r.getBoundingClientRect();return[t.clientX-s.left-r.clientLeft,t.clientY-s.top-r.clientTop]}}return[t.pageX,t.pageY]}const mM={passive:!1},el={capture:!0,passive:!1};function Xd(t){t.stopImmediatePropagation()}function Oo(t){t.preventDefault(),t.stopImmediatePropagation()}function eE(t){var r=t.document.documentElement,i=Pt(t).on("dragstart.drag",Oo,el);"onselectstart"in r?i.on("selectstart.drag",Oo,el):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function tE(t,r){var i=t.document.documentElement,a=Pt(t).on("dragstart.drag",null);r&&(a.on("click.drag",Oo,el),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in i?a.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Ws=t=>()=>t;function Sh(t,{sourceEvent:r,subject:i,target:a,identifier:s,active:u,x:f,y:h,dx:p,dy:m,dispatch:y}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:f,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:p,enumerable:!0,configurable:!0},dy:{value:m,enumerable:!0,configurable:!0},_:{value:y}})}Sh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function pM(t){return!t.ctrlKey&&!t.button}function gM(){return this.parentNode}function yM(t,r){return r??{x:t.x,y:t.y}}function xM(){return navigator.maxTouchPoints||"ontouchstart"in this}function nE(){var t=pM,r=gM,i=yM,a=xM,s={},u=Wu("start","drag","end"),f=0,h,p,m,y,g=0;function x(C){C.on("mousedown.drag",b).filter(a).on("touchstart.drag",N).on("touchmove.drag",w,mM).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(C,D){if(!(y||!t.call(this,C,D))){var z=_(this,r.call(this,C,D),C,D,"mouse");z&&(Pt(C.view).on("mousemove.drag",E,el).on("mouseup.drag",S,el),eE(C.view),Xd(C),m=!1,h=C.clientX,p=C.clientY,z("start",C))}}function E(C){if(Oo(C),!m){var D=C.clientX-h,z=C.clientY-p;m=D*D+z*z>g}s.mouse("drag",C)}function S(C){Pt(C.view).on("mousemove.drag mouseup.drag",null),tE(C.view,m),Oo(C),s.mouse("end",C)}function N(C,D){if(t.call(this,C,D)){var z=C.changedTouches,U=r.call(this,C,D),V=z.length,Y,ae;for(Y=0;Y<V;++Y)(ae=_(this,U,C,D,z[Y].identifier,z[Y]))&&(Xd(C),ae("start",C,z[Y]))}}function w(C){var D=C.changedTouches,z=D.length,U,V;for(U=0;U<z;++U)(V=s[D[U].identifier])&&(Oo(C),V("drag",C,D[U]))}function O(C){var D=C.changedTouches,z=D.length,U,V;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),U=0;U<z;++U)(V=s[D[U].identifier])&&(Xd(C),V("end",C,D[U]))}function _(C,D,z,U,V,Y){var ae=u.copy(),X=hn(Y||z,D),P,re,B;if((B=i.call(C,new Sh("beforestart",{sourceEvent:z,target:x,identifier:V,active:f,x:X[0],y:X[1],dx:0,dy:0,dispatch:ae}),U))!=null)return P=B.x-X[0]||0,re=B.y-X[1]||0,function q(R,L,k){var $=X,ee;switch(R){case"start":s[V]=q,ee=f++;break;case"end":delete s[V],--f;case"drag":X=hn(k||L,D),ee=f;break}ae.call(R,C,new Sh(R,{sourceEvent:L,subject:B,target:x,identifier:V,active:ee,x:X[0]+P,y:X[1]+re,dx:X[0]-$[0],dy:X[1]-$[1],dispatch:ae}),U)}}return x.filter=function(C){return arguments.length?(t=typeof C=="function"?C:Ws(!!C),x):t},x.container=function(C){return arguments.length?(r=typeof C=="function"?C:Ws(C),x):r},x.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Ws(C),x):i},x.touchable=function(C){return arguments.length?(a=typeof C=="function"?C:Ws(!!C),x):a},x.on=function(){var C=u.on.apply(u,arguments);return C===u?x:C},x.clickDistance=function(C){return arguments.length?(g=(C=+C)*C,x):Math.sqrt(g)},x}function w0(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function rE(t,r){var i=Object.create(t.prototype);for(var a in r)i[a]=r[a];return i}function pl(){}var tl=.7,Cu=1/tl,zo="\\s*([+-]?\\d+)\\s*",nl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vM=/^#([0-9a-f]{3,8})$/,bM=new RegExp(`^rgb\\(${zo},${zo},${zo}\\)$`),EM=new RegExp(`^rgb\\(${Dn},${Dn},${Dn}\\)$`),SM=new RegExp(`^rgba\\(${zo},${zo},${zo},${nl}\\)$`),_M=new RegExp(`^rgba\\(${Dn},${Dn},${Dn},${nl}\\)$`),wM=new RegExp(`^hsl\\(${nl},${Dn},${Dn}\\)$`),TM=new RegExp(`^hsla\\(${nl},${Dn},${Dn},${nl}\\)$`),s1={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};w0(pl,Mi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:u1,formatHex:u1,formatHex8:AM,formatHsl:NM,formatRgb:c1,toString:c1});function u1(){return this.rgb().formatHex()}function AM(){return this.rgb().formatHex8()}function NM(){return iE(this).formatHsl()}function c1(){return this.rgb().formatRgb()}function Mi(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=vM.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?f1(r):i===3?new Ft(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?eu(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?eu(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=bM.exec(t))?new Ft(r[1],r[2],r[3],1):(r=EM.exec(t))?new Ft(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=SM.exec(t))?eu(r[1],r[2],r[3],r[4]):(r=_M.exec(t))?eu(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=wM.exec(t))?m1(r[1],r[2]/100,r[3]/100,1):(r=TM.exec(t))?m1(r[1],r[2]/100,r[3]/100,r[4]):s1.hasOwnProperty(t)?f1(s1[t]):t==="transparent"?new Ft(NaN,NaN,NaN,0):null}function f1(t){return new Ft(t>>16&255,t>>8&255,t&255,1)}function eu(t,r,i,a){return a<=0&&(t=r=i=NaN),new Ft(t,r,i,a)}function CM(t){return t instanceof pl||(t=Mi(t)),t?(t=t.rgb(),new Ft(t.r,t.g,t.b,t.opacity)):new Ft}function _h(t,r,i,a){return arguments.length===1?CM(t):new Ft(t,r,i,a??1)}function Ft(t,r,i,a){this.r=+t,this.g=+r,this.b=+i,this.opacity=+a}w0(Ft,_h,rE(pl,{brighter(t){return t=t==null?Cu:Math.pow(Cu,t),new Ft(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?tl:Math.pow(tl,t),new Ft(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ft(Ai(this.r),Ai(this.g),Ai(this.b),Ru(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:d1,formatHex:d1,formatHex8:RM,formatRgb:h1,toString:h1}));function d1(){return`#${Ti(this.r)}${Ti(this.g)}${Ti(this.b)}`}function RM(){return`#${Ti(this.r)}${Ti(this.g)}${Ti(this.b)}${Ti((isNaN(this.opacity)?1:this.opacity)*255)}`}function h1(){const t=Ru(this.opacity);return`${t===1?"rgb(":"rgba("}${Ai(this.r)}, ${Ai(this.g)}, ${Ai(this.b)}${t===1?")":`, ${t})`}`}function Ru(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ai(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ti(t){return t=Ai(t),(t<16?"0":"")+t.toString(16)}function m1(t,r,i,a){return a<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new mn(t,r,i,a)}function iE(t){if(t instanceof mn)return new mn(t.h,t.s,t.l,t.opacity);if(t instanceof pl||(t=Mi(t)),!t)return new mn;if(t instanceof mn)return t;t=t.rgb();var r=t.r/255,i=t.g/255,a=t.b/255,s=Math.min(r,i,a),u=Math.max(r,i,a),f=NaN,h=u-s,p=(u+s)/2;return h?(r===u?f=(i-a)/h+(i<a)*6:i===u?f=(a-r)/h+2:f=(r-i)/h+4,h/=p<.5?u+s:2-u-s,f*=60):h=p>0&&p<1?0:f,new mn(f,h,p,t.opacity)}function MM(t,r,i,a){return arguments.length===1?iE(t):new mn(t,r,i,a??1)}function mn(t,r,i,a){this.h=+t,this.s=+r,this.l=+i,this.opacity=+a}w0(mn,MM,rE(pl,{brighter(t){return t=t==null?Cu:Math.pow(Cu,t),new mn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?tl:Math.pow(tl,t),new mn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,a=i+(i<.5?i:1-i)*r,s=2*i-a;return new Ft(Id(t>=240?t-240:t+120,s,a),Id(t,s,a),Id(t<120?t+240:t-120,s,a),this.opacity)},clamp(){return new mn(p1(this.h),tu(this.s),tu(this.l),Ru(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 t=Ru(this.opacity);return`${t===1?"hsl(":"hsla("}${p1(this.h)}, ${tu(this.s)*100}%, ${tu(this.l)*100}%${t===1?")":`, ${t})`}`}}));function p1(t){return t=(t||0)%360,t<0?t+360:t}function tu(t){return Math.max(0,Math.min(1,t||0))}function Id(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const T0=t=>()=>t;function DM(t,r){return function(i){return t+i*r}}function OM(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(a){return Math.pow(t+a*r,i)}}function zM(t){return(t=+t)==1?oE:function(r,i){return i-r?OM(r,i,t):T0(isNaN(r)?i:r)}}function oE(t,r){var i=r-t;return i?DM(t,i):T0(isNaN(t)?r:t)}const Mu=(function t(r){var i=zM(r);function a(s,u){var f=i((s=_h(s)).r,(u=_h(u)).r),h=i(s.g,u.g),p=i(s.b,u.b),m=oE(s.opacity,u.opacity);return function(y){return s.r=f(y),s.g=h(y),s.b=p(y),s.opacity=m(y),s+""}}return a.gamma=t,a})(1);function BM(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,a=r.slice(),s;return function(u){for(s=0;s<i;++s)a[s]=t[s]*(1-u)+r[s]*u;return a}}function UM(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function HM(t,r){var i=r?r.length:0,a=t?Math.min(i,t.length):0,s=new Array(a),u=new Array(i),f;for(f=0;f<a;++f)s[f]=Pa(t[f],r[f]);for(;f<i;++f)u[f]=r[f];return function(h){for(f=0;f<a;++f)u[f]=s[f](h);return u}}function LM(t,r){var i=new Date;return t=+t,r=+r,function(a){return i.setTime(t*(1-a)+r*a),i}}function Rn(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function jM(t,r){var i={},a={},s;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(s in r)s in t?i[s]=Pa(t[s],r[s]):a[s]=r[s];return function(u){for(s in i)a[s]=i[s](u);return a}}var wh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$d=new RegExp(wh.source,"g");function FM(t){return function(){return t}}function VM(t){return function(r){return t(r)+""}}function aE(t,r){var i=wh.lastIndex=$d.lastIndex=0,a,s,u,f=-1,h=[],p=[];for(t=t+"",r=r+"";(a=wh.exec(t))&&(s=$d.exec(r));)(u=s.index)>i&&(u=r.slice(i,u),h[f]?h[f]+=u:h[++f]=u),(a=a[0])===(s=s[0])?h[f]?h[f]+=s:h[++f]=s:(h[++f]=null,p.push({i:f,x:Rn(a,s)})),i=$d.lastIndex;return i<r.length&&(u=r.slice(i),h[f]?h[f]+=u:h[++f]=u),h.length<2?p[0]?VM(p[0].x):FM(r):(r=p.length,function(m){for(var y=0,g;y<r;++y)h[(g=p[y]).i]=g.x(m);return h.join("")})}function Pa(t,r){var i=typeof r,a;return r==null||i==="boolean"?T0(r):(i==="number"?Rn:i==="string"?(a=Mi(r))?(r=a,Mu):aE:r instanceof Mi?Mu:r instanceof Date?LM:UM(r)?BM:Array.isArray(r)?HM:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?jM:Rn)(t,r)}var g1=180/Math.PI,Th={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function lE(t,r,i,a,s,u){var f,h,p;return(f=Math.sqrt(t*t+r*r))&&(t/=f,r/=f),(p=t*i+r*a)&&(i-=t*p,a-=r*p),(h=Math.sqrt(i*i+a*a))&&(i/=h,a/=h,p/=h),t*a<r*i&&(t=-t,r=-r,p=-p,f=-f),{translateX:s,translateY:u,rotate:Math.atan2(r,t)*g1,skewX:Math.atan(p)*g1,scaleX:f,scaleY:h}}var nu;function kM(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Th:lE(r.a,r.b,r.c,r.d,r.e,r.f)}function GM(t){return t==null||(nu||(nu=document.createElementNS("http://www.w3.org/2000/svg","g")),nu.setAttribute("transform",t),!(t=nu.transform.baseVal.consolidate()))?Th:(t=t.matrix,lE(t.a,t.b,t.c,t.d,t.e,t.f))}function sE(t,r,i,a){function s(m){return m.length?m.pop()+" ":""}function u(m,y,g,x,b,E){if(m!==g||y!==x){var S=b.push("translate(",null,r,null,i);E.push({i:S-4,x:Rn(m,g)},{i:S-2,x:Rn(y,x)})}else(g||x)&&b.push("translate("+g+r+x+i)}function f(m,y,g,x){m!==y?(m-y>180?y+=360:y-m>180&&(m+=360),x.push({i:g.push(s(g)+"rotate(",null,a)-2,x:Rn(m,y)})):y&&g.push(s(g)+"rotate("+y+a)}function h(m,y,g,x){m!==y?x.push({i:g.push(s(g)+"skewX(",null,a)-2,x:Rn(m,y)}):y&&g.push(s(g)+"skewX("+y+a)}function p(m,y,g,x,b,E){if(m!==g||y!==x){var S=b.push(s(b)+"scale(",null,",",null,")");E.push({i:S-4,x:Rn(m,g)},{i:S-2,x:Rn(y,x)})}else(g!==1||x!==1)&&b.push(s(b)+"scale("+g+","+x+")")}return function(m,y){var g=[],x=[];return m=t(m),y=t(y),u(m.translateX,m.translateY,y.translateX,y.translateY,g,x),f(m.rotate,y.rotate,g,x),h(m.skewX,y.skewX,g,x),p(m.scaleX,m.scaleY,y.scaleX,y.scaleY,g,x),m=y=null,function(b){for(var E=-1,S=x.length,N;++E<S;)g[(N=x[E]).i]=N.x(b);return g.join("")}}}var qM=sE(kM,"px, ","px)","deg)"),YM=sE(GM,", ",")",")"),XM=1e-12;function y1(t){return((t=Math.exp(t))+1/t)/2}function IM(t){return((t=Math.exp(t))-1/t)/2}function $M(t){return((t=Math.exp(2*t))-1)/(t+1)}const gu=(function t(r,i,a){function s(u,f){var h=u[0],p=u[1],m=u[2],y=f[0],g=f[1],x=f[2],b=y-h,E=g-p,S=b*b+E*E,N,w;if(S<XM)w=Math.log(x/m)/r,N=function(U){return[h+U*b,p+U*E,m*Math.exp(r*U*w)]};else{var O=Math.sqrt(S),_=(x*x-m*m+a*S)/(2*m*i*O),C=(x*x-m*m-a*S)/(2*x*i*O),D=Math.log(Math.sqrt(_*_+1)-_),z=Math.log(Math.sqrt(C*C+1)-C);w=(z-D)/r,N=function(U){var V=U*w,Y=y1(D),ae=m/(i*O)*(Y*$M(r*V+D)-IM(D));return[h+ae*b,p+ae*E,m*Y/y1(r*V+D)]}}return N.duration=w*1e3*r/Math.SQRT2,N}return s.rho=function(u){var f=Math.max(.001,+u),h=f*f,p=h*h;return t(f,h,p)},s})(Math.SQRT2,2,4);var Ho=0,Ia=0,qa=0,uE=1e3,Du,$a,Ou=0,Di=0,tc=0,rl=typeof performance=="object"&&performance.now?performance:Date,cE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function A0(){return Di||(cE(PM),Di=rl.now()+tc)}function PM(){Di=0}function zu(){this._call=this._time=this._next=null}zu.prototype=fE.prototype={constructor:zu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?A0():+i)+(r==null?0:+r),!this._next&&$a!==this&&($a?$a._next=this:Du=this,$a=this),this._call=t,this._time=i,Ah()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ah())}};function fE(t,r,i){var a=new zu;return a.restart(t,r,i),a}function ZM(){A0(),++Ho;for(var t=Du,r;t;)(r=Di-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ho}function x1(){Di=(Ou=rl.now())+tc,Ho=Ia=0;try{ZM()}finally{Ho=0,KM(),Di=0}}function QM(){var t=rl.now(),r=t-Ou;r>uE&&(tc-=r,Ou=t)}function KM(){for(var t,r=Du,i,a=1/0;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:Du=i);$a=t,Ah(a)}function Ah(t){if(!Ho){Ia&&(Ia=clearTimeout(Ia));var r=t-Di;r>24?(t<1/0&&(Ia=setTimeout(x1,t-rl.now()-tc)),qa&&(qa=clearInterval(qa))):(qa||(Ou=rl.now(),qa=setInterval(QM,uE)),Ho=1,cE(x1))}}function v1(t,r,i){var a=new zu;return r=r==null?0:+r,a.restart(s=>{a.stop(),t(s+r)},r,i),a}var JM=Wu("start","end","cancel","interrupt"),WM=[],dE=0,b1=1,Nh=2,yu=3,E1=4,Ch=5,xu=6;function nc(t,r,i,a,s,u){var f=t.__transition;if(!f)t.__transition={};else if(i in f)return;e4(t,i,{name:r,index:a,group:s,on:JM,tween:WM,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:dE})}function N0(t,r){var i=xn(t,r);if(i.state>dE)throw new Error("too late; already scheduled");return i}function Ln(t,r){var i=xn(t,r);if(i.state>yu)throw new Error("too late; already running");return i}function xn(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function e4(t,r,i){var a=t.__transition,s;a[r]=i,i.timer=fE(u,0,i.time);function u(m){i.state=b1,i.timer.restart(f,i.delay,i.time),i.delay<=m&&f(m-i.delay)}function f(m){var y,g,x,b;if(i.state!==b1)return p();for(y in a)if(b=a[y],b.name===i.name){if(b.state===yu)return v1(f);b.state===E1?(b.state=xu,b.timer.stop(),b.on.call("interrupt",t,t.__data__,b.index,b.group),delete a[y]):+y<r&&(b.state=xu,b.timer.stop(),b.on.call("cancel",t,t.__data__,b.index,b.group),delete a[y])}if(v1(function(){i.state===yu&&(i.state=E1,i.timer.restart(h,i.delay,i.time),h(m))}),i.state=Nh,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Nh){for(i.state=yu,s=new Array(x=i.tween.length),y=0,g=-1;y<x;++y)(b=i.tween[y].value.call(t,t.__data__,i.index,i.group))&&(s[++g]=b);s.length=g+1}}function h(m){for(var y=m<i.duration?i.ease.call(null,m/i.duration):(i.timer.restart(p),i.state=Ch,1),g=-1,x=s.length;++g<x;)s[g].call(t,y);i.state===Ch&&(i.on.call("end",t,t.__data__,i.index,i.group),p())}function p(){i.state=xu,i.timer.stop(),delete a[r];for(var m in a)return;delete t.__transition}}function vu(t,r){var i=t.__transition,a,s,u=!0,f;if(i){r=r==null?null:r+"";for(f in i){if((a=i[f]).name!==r){u=!1;continue}s=a.state>Nh&&a.state<Ch,a.state=xu,a.timer.stop(),a.on.call(s?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete i[f]}u&&delete t.__transition}}function t4(t){return this.each(function(){vu(this,t)})}function n4(t,r){var i,a;return function(){var s=Ln(this,t),u=s.tween;if(u!==i){a=i=u;for(var f=0,h=a.length;f<h;++f)if(a[f].name===r){a=a.slice(),a.splice(f,1);break}}s.tween=a}}function r4(t,r,i){var a,s;if(typeof i!="function")throw new Error;return function(){var u=Ln(this,t),f=u.tween;if(f!==a){s=(a=f).slice();for(var h={name:r,value:i},p=0,m=s.length;p<m;++p)if(s[p].name===r){s[p]=h;break}p===m&&s.push(h)}u.tween=s}}function i4(t,r){var i=this._id;if(t+="",arguments.length<2){for(var a=xn(this.node(),i).tween,s=0,u=a.length,f;s<u;++s)if((f=a[s]).name===t)return f.value;return null}return this.each((r==null?n4:r4)(i,t,r))}function C0(t,r,i){var a=t._id;return t.each(function(){var s=Ln(this,a);(s.value||(s.value={}))[r]=i.apply(this,arguments)}),function(s){return xn(s,a).value[r]}}function hE(t,r){var i;return(typeof r=="number"?Rn:r instanceof Mi?Mu:(i=Mi(r))?(r=i,Mu):aE)(t,r)}function o4(t){return function(){this.removeAttribute(t)}}function a4(t){return function(){this.removeAttributeNS(t.space,t.local)}}function l4(t,r,i){var a,s=i+"",u;return function(){var f=this.getAttribute(t);return f===s?null:f===a?u:u=r(a=f,i)}}function s4(t,r,i){var a,s=i+"",u;return function(){var f=this.getAttributeNS(t.space,t.local);return f===s?null:f===a?u:u=r(a=f,i)}}function u4(t,r,i){var a,s,u;return function(){var f,h=i(this),p;return h==null?void this.removeAttribute(t):(f=this.getAttribute(t),p=h+"",f===p?null:f===a&&p===s?u:(s=p,u=r(a=f,h)))}}function c4(t,r,i){var a,s,u;return function(){var f,h=i(this),p;return h==null?void this.removeAttributeNS(t.space,t.local):(f=this.getAttributeNS(t.space,t.local),p=h+"",f===p?null:f===a&&p===s?u:(s=p,u=r(a=f,h)))}}function f4(t,r){var i=ec(t),a=i==="transform"?YM:hE;return this.attrTween(t,typeof r=="function"?(i.local?c4:u4)(i,a,C0(this,"attr."+t,r)):r==null?(i.local?a4:o4)(i):(i.local?s4:l4)(i,a,r))}function d4(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function h4(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function m4(t,r){var i,a;function s(){var u=r.apply(this,arguments);return u!==a&&(i=(a=u)&&h4(t,u)),i}return s._value=r,s}function p4(t,r){var i,a;function s(){var u=r.apply(this,arguments);return u!==a&&(i=(a=u)&&d4(t,u)),i}return s._value=r,s}function g4(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var a=ec(t);return this.tween(i,(a.local?m4:p4)(a,r))}function y4(t,r){return function(){N0(this,t).delay=+r.apply(this,arguments)}}function x4(t,r){return r=+r,function(){N0(this,t).delay=r}}function v4(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?y4:x4)(r,t)):xn(this.node(),r).delay}function b4(t,r){return function(){Ln(this,t).duration=+r.apply(this,arguments)}}function E4(t,r){return r=+r,function(){Ln(this,t).duration=r}}function S4(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?b4:E4)(r,t)):xn(this.node(),r).duration}function _4(t,r){if(typeof r!="function")throw new Error;return function(){Ln(this,t).ease=r}}function w4(t){var r=this._id;return arguments.length?this.each(_4(r,t)):xn(this.node(),r).ease}function T4(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Ln(this,t).ease=i}}function A4(t){if(typeof t!="function")throw new Error;return this.each(T4(this._id,t))}function N4(t){typeof t!="function"&&(t=Yb(t));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var u=r[s],f=u.length,h=a[s]=[],p,m=0;m<f;++m)(p=u[m])&&t.call(p,p.__data__,m,u)&&h.push(p);return new dr(a,this._parents,this._name,this._id)}function C4(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,a=r.length,s=i.length,u=Math.min(a,s),f=new Array(a),h=0;h<u;++h)for(var p=r[h],m=i[h],y=p.length,g=f[h]=new Array(y),x,b=0;b<y;++b)(x=p[b]||m[b])&&(g[b]=x);for(;h<a;++h)f[h]=r[h];return new dr(f,this._parents,this._name,this._id)}function R4(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function M4(t,r,i){var a,s,u=R4(r)?N0:Ln;return function(){var f=u(this,t),h=f.on;h!==a&&(s=(a=h).copy()).on(r,i),f.on=s}}function D4(t,r){var i=this._id;return arguments.length<2?xn(this.node(),i).on.on(t):this.each(M4(i,t,r))}function O4(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function z4(){return this.on("end.remove",O4(this._id))}function B4(t){var r=this._name,i=this._id;typeof t!="function"&&(t=S0(t));for(var a=this._groups,s=a.length,u=new Array(s),f=0;f<s;++f)for(var h=a[f],p=h.length,m=u[f]=new Array(p),y,g,x=0;x<p;++x)(y=h[x])&&(g=t.call(y,y.__data__,x,h))&&("__data__"in y&&(g.__data__=y.__data__),m[x]=g,nc(m[x],r,i,x,m,xn(y,i)));return new dr(u,this._parents,r,i)}function U4(t){var r=this._name,i=this._id;typeof t!="function"&&(t=qb(t));for(var a=this._groups,s=a.length,u=[],f=[],h=0;h<s;++h)for(var p=a[h],m=p.length,y,g=0;g<m;++g)if(y=p[g]){for(var x=t.call(y,y.__data__,g,p),b,E=xn(y,i),S=0,N=x.length;S<N;++S)(b=x[S])&&nc(b,r,i,S,x,E);u.push(x),f.push(y)}return new dr(u,f,r,i)}var H4=ml.prototype.constructor;function L4(){return new H4(this._groups,this._parents)}function j4(t,r){var i,a,s;return function(){var u=Uo(this,t),f=(this.style.removeProperty(t),Uo(this,t));return u===f?null:u===i&&f===a?s:s=r(i=u,a=f)}}function mE(t){return function(){this.style.removeProperty(t)}}function F4(t,r,i){var a,s=i+"",u;return function(){var f=Uo(this,t);return f===s?null:f===a?u:u=r(a=f,i)}}function V4(t,r,i){var a,s,u;return function(){var f=Uo(this,t),h=i(this),p=h+"";return h==null&&(p=h=(this.style.removeProperty(t),Uo(this,t))),f===p?null:f===a&&p===s?u:(s=p,u=r(a=f,h))}}function k4(t,r){var i,a,s,u="style."+r,f="end."+u,h;return function(){var p=Ln(this,t),m=p.on,y=p.value[u]==null?h||(h=mE(r)):void 0;(m!==i||s!==y)&&(a=(i=m).copy()).on(f,s=y),p.on=a}}function G4(t,r,i){var a=(t+="")=="transform"?qM:hE;return r==null?this.styleTween(t,j4(t,a)).on("end.style."+t,mE(t)):typeof r=="function"?this.styleTween(t,V4(t,a,C0(this,"style."+t,r))).each(k4(this._id,t)):this.styleTween(t,F4(t,a,r),i).on("end.style."+t,null)}function q4(t,r,i){return function(a){this.style.setProperty(t,r.call(this,a),i)}}function Y4(t,r,i){var a,s;function u(){var f=r.apply(this,arguments);return f!==s&&(a=(s=f)&&q4(t,f,i)),a}return u._value=r,u}function X4(t,r,i){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(r==null)return this.tween(a,null);if(typeof r!="function")throw new Error;return this.tween(a,Y4(t,r,i??""))}function I4(t){return function(){this.textContent=t}}function $4(t){return function(){var r=t(this);this.textContent=r??""}}function P4(t){return this.tween("text",typeof t=="function"?$4(C0(this,"text",t)):I4(t==null?"":t+""))}function Z4(t){return function(r){this.textContent=t.call(this,r)}}function Q4(t){var r,i;function a(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Z4(s)),r}return a._value=t,a}function K4(t){var r="text";if(arguments.length<1)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,Q4(t))}function J4(){for(var t=this._name,r=this._id,i=pE(),a=this._groups,s=a.length,u=0;u<s;++u)for(var f=a[u],h=f.length,p,m=0;m<h;++m)if(p=f[m]){var y=xn(p,r);nc(p,t,i,m,f,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new dr(a,this._parents,t,i)}function W4(){var t,r,i=this,a=i._id,s=i.size();return new Promise(function(u,f){var h={value:f},p={value:function(){--s===0&&u()}};i.each(function(){var m=Ln(this,a),y=m.on;y!==t&&(r=(t=y).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(p)),m.on=r}),s===0&&u()})}var e8=0;function dr(t,r,i,a){this._groups=t,this._parents=r,this._name=i,this._id=a}function pE(){return++e8}var sr=ml.prototype;dr.prototype={constructor:dr,select:B4,selectAll:U4,selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:N4,merge:C4,selection:L4,transition:J4,call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.each,on:D4,attr:f4,attrTween:g4,style:G4,styleTween:X4,text:P4,textTween:K4,remove:z4,tween:i4,delay:v4,duration:S4,ease:w4,easeVarying:A4,end:W4,[Symbol.iterator]:sr[Symbol.iterator]};function t8(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var n8={time:null,delay:0,duration:250,ease:t8};function r8(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function i8(t){var r,i;t instanceof dr?(r=t._id,t=t._name):(r=pE(),(i=n8).time=A0(),t=t==null?null:t+"");for(var a=this._groups,s=a.length,u=0;u<s;++u)for(var f=a[u],h=f.length,p,m=0;m<h;++m)(p=f[m])&&nc(p,t,r,m,f,i||r8(p,r));return new dr(a,this._parents,t,r)}ml.prototype.interrupt=t4;ml.prototype.transition=i8;const ru=t=>()=>t;function o8(t,{sourceEvent:r,target:i,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function ur(t,r,i){this.k=t,this.x=r,this.y=i}ur.prototype={constructor:ur,scale:function(t){return t===1?this:new ur(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new ur(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rc=new ur(1,0,0);gE.prototype=ur.prototype;function gE(t){for(;!t.__zoom;)if(!(t=t.parentNode))return rc;return t.__zoom}function Pd(t){t.stopImmediatePropagation()}function Ya(t){t.preventDefault(),t.stopImmediatePropagation()}function a8(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function l8(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function S1(){return this.__zoom||rc}function s8(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function u8(){return navigator.maxTouchPoints||"ontouchstart"in this}function c8(t,r,i){var a=t.invertX(r[0][0])-i[0][0],s=t.invertX(r[1][0])-i[1][0],u=t.invertY(r[0][1])-i[0][1],f=t.invertY(r[1][1])-i[1][1];return t.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),f>u?(u+f)/2:Math.min(0,u)||Math.max(0,f))}function yE(){var t=a8,r=l8,i=c8,a=s8,s=u8,u=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],h=250,p=gu,m=Wu("start","zoom","end"),y,g,x,b=500,E=150,S=0,N=10;function w(B){B.property("__zoom",S1).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",Y).on("dblclick.zoom",ae).filter(s).on("touchstart.zoom",X).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(B,q,R,L){var k=B.selection?B.selection():B;k.property("__zoom",S1),B!==k?D(B,q,R,L):k.interrupt().each(function(){z(this,arguments).event(L).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},w.scaleBy=function(B,q,R,L){w.scaleTo(B,function(){var k=this.__zoom.k,$=typeof q=="function"?q.apply(this,arguments):q;return k*$},R,L)},w.scaleTo=function(B,q,R,L){w.transform(B,function(){var k=r.apply(this,arguments),$=this.__zoom,ee=R==null?C(k):typeof R=="function"?R.apply(this,arguments):R,M=$.invert(ee),F=typeof q=="function"?q.apply(this,arguments):q;return i(_(O($,F),ee,M),k,f)},R,L)},w.translateBy=function(B,q,R,L){w.transform(B,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof R=="function"?R.apply(this,arguments):R),r.apply(this,arguments),f)},null,L)},w.translateTo=function(B,q,R,L,k){w.transform(B,function(){var $=r.apply(this,arguments),ee=this.__zoom,M=L==null?C($):typeof L=="function"?L.apply(this,arguments):L;return i(rc.translate(M[0],M[1]).scale(ee.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof R=="function"?-R.apply(this,arguments):-R),$,f)},L,k)};function O(B,q){return q=Math.max(u[0],Math.min(u[1],q)),q===B.k?B:new ur(q,B.x,B.y)}function _(B,q,R){var L=q[0]-R[0]*B.k,k=q[1]-R[1]*B.k;return L===B.x&&k===B.y?B:new ur(B.k,L,k)}function C(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function D(B,q,R,L){B.on("start.zoom",function(){z(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(L).end()}).tween("zoom",function(){var k=this,$=arguments,ee=z(k,$).event(L),M=r.apply(k,$),F=R==null?C(M):typeof R=="function"?R.apply(k,$):R,J=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),te=k.__zoom,se=typeof q=="function"?q.apply(k,$):q,he=p(te.invert(F).concat(J/te.k),se.invert(F).concat(J/se.k));return function(fe){if(fe===1)fe=se;else{var ue=he(fe),me=J/ue[2];fe=new ur(me,F[0]-ue[0]*me,F[1]-ue[1]*me)}ee.zoom(null,fe)}})}function z(B,q,R){return!R&&B.__zooming||new U(B,q)}function U(B,q){this.that=B,this.args=q,this.active=0,this.sourceEvent=null,this.extent=r.apply(B,q),this.taps=0}U.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,q){return this.mouse&&B!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var q=Pt(this.that).datum();m.call(B,this.that,new o8(B,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:m}),q)}};function V(B,...q){if(!t.apply(this,arguments))return;var R=z(this,q).event(B),L=this.__zoom,k=Math.max(u[0],Math.min(u[1],L.k*Math.pow(2,a.apply(this,arguments)))),$=hn(B);if(R.wheel)(R.mouse[0][0]!==$[0]||R.mouse[0][1]!==$[1])&&(R.mouse[1]=L.invert(R.mouse[0]=$)),clearTimeout(R.wheel);else{if(L.k===k)return;R.mouse=[$,L.invert($)],vu(this),R.start()}Ya(B),R.wheel=setTimeout(ee,E),R.zoom("mouse",i(_(O(L,k),R.mouse[0],R.mouse[1]),R.extent,f));function ee(){R.wheel=null,R.end()}}function Y(B,...q){if(x||!t.apply(this,arguments))return;var R=B.currentTarget,L=z(this,q,!0).event(B),k=Pt(B.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",J,!0),$=hn(B,R),ee=B.clientX,M=B.clientY;eE(B.view),Pd(B),L.mouse=[$,this.__zoom.invert($)],vu(this),L.start();function F(te){if(Ya(te),!L.moved){var se=te.clientX-ee,he=te.clientY-M;L.moved=se*se+he*he>S}L.event(te).zoom("mouse",i(_(L.that.__zoom,L.mouse[0]=hn(te,R),L.mouse[1]),L.extent,f))}function J(te){k.on("mousemove.zoom mouseup.zoom",null),tE(te.view,L.moved),Ya(te),L.event(te).end()}}function ae(B,...q){if(t.apply(this,arguments)){var R=this.__zoom,L=hn(B.changedTouches?B.changedTouches[0]:B,this),k=R.invert(L),$=R.k*(B.shiftKey?.5:2),ee=i(_(O(R,$),L,k),r.apply(this,q),f);Ya(B),h>0?Pt(this).transition().duration(h).call(D,ee,L,B):Pt(this).call(w.transform,ee,L,B)}}function X(B,...q){if(t.apply(this,arguments)){var R=B.touches,L=R.length,k=z(this,q,B.changedTouches.length===L).event(B),$,ee,M,F;for(Pd(B),ee=0;ee<L;++ee)M=R[ee],F=hn(M,this),F=[F,this.__zoom.invert(F),M.identifier],k.touch0?!k.touch1&&k.touch0[2]!==F[2]&&(k.touch1=F,k.taps=0):(k.touch0=F,$=!0,k.taps=1+!!y);y&&(y=clearTimeout(y)),$&&(k.taps<2&&(g=F[0],y=setTimeout(function(){y=null},b)),vu(this),k.start())}}function P(B,...q){if(this.__zooming){var R=z(this,q).event(B),L=B.changedTouches,k=L.length,$,ee,M,F;for(Ya(B),$=0;$<k;++$)ee=L[$],M=hn(ee,this),R.touch0&&R.touch0[2]===ee.identifier?R.touch0[0]=M:R.touch1&&R.touch1[2]===ee.identifier&&(R.touch1[0]=M);if(ee=R.that.__zoom,R.touch1){var J=R.touch0[0],te=R.touch0[1],se=R.touch1[0],he=R.touch1[1],fe=(fe=se[0]-J[0])*fe+(fe=se[1]-J[1])*fe,ue=(ue=he[0]-te[0])*ue+(ue=he[1]-te[1])*ue;ee=O(ee,Math.sqrt(fe/ue)),M=[(J[0]+se[0])/2,(J[1]+se[1])/2],F=[(te[0]+he[0])/2,(te[1]+he[1])/2]}else if(R.touch0)M=R.touch0[0],F=R.touch0[1];else return;R.zoom("touch",i(_(ee,M,F),R.extent,f))}}function re(B,...q){if(this.__zooming){var R=z(this,q).event(B),L=B.changedTouches,k=L.length,$,ee;for(Pd(B),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),$=0;$<k;++$)ee=L[$],R.touch0&&R.touch0[2]===ee.identifier?delete R.touch0:R.touch1&&R.touch1[2]===ee.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(ee=hn(ee,this),Math.hypot(g[0]-ee[0],g[1]-ee[1])<N)){var M=Pt(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return w.wheelDelta=function(B){return arguments.length?(a=typeof B=="function"?B:ru(+B),w):a},w.filter=function(B){return arguments.length?(t=typeof B=="function"?B:ru(!!B),w):t},w.touchable=function(B){return arguments.length?(s=typeof B=="function"?B:ru(!!B),w):s},w.extent=function(B){return arguments.length?(r=typeof B=="function"?B:ru([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),w):r},w.scaleExtent=function(B){return arguments.length?(u[0]=+B[0],u[1]=+B[1],w):[u[0],u[1]]},w.translateExtent=function(B){return arguments.length?(f[0][0]=+B[0][0],f[1][0]=+B[1][0],f[0][1]=+B[0][1],f[1][1]=+B[1][1],w):[[f[0][0],f[0][1]],[f[1][0],f[1][1]]]},w.constrain=function(B){return arguments.length?(i=B,w):i},w.duration=function(B){return arguments.length?(h=+B,w):h},w.interpolate=function(B){return arguments.length?(p=B,w):p},w.on=function(){var B=m.on.apply(m,arguments);return B===m?w:B},w.clickDistance=function(B){return arguments.length?(S=(B=+B)*B,w):Math.sqrt(S)},w.tapDistance=function(B){return arguments.length?(N=+B,w):N},w}const zn={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:a}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},il=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],xE=["Enter"," ","Escape"],vE={"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:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"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 Lo;(function(t){t.Strict="strict",t.Loose="loose"})(Lo||(Lo={}));var Ni;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ni||(Ni={}));var ol;(function(t){t.Partial="partial",t.Full="full"})(ol||(ol={}));const bE={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Xr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Xr||(Xr={}));var Bu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Bu||(Bu={}));var ve;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(ve||(ve={}));const _1={[ve.Left]:ve.Right,[ve.Right]:ve.Left,[ve.Top]:ve.Bottom,[ve.Bottom]:ve.Top};function EE(t){return t===null?null:t?"valid":"invalid"}const SE=t=>"id"in t&&"source"in t&&"target"in t,f8=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),R0=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),_E=(t,r,i)=>{if(!t.id)return[];const a=new Set;return i.forEach(s=>{s.source===t.id&&a.add(s.target)}),r.filter(s=>a.has(s.id))},gl=(t,r=[0,0])=>{const{width:i,height:a}=hr(t),s=t.origin??r,u=i*s[0],f=a*s[1];return{x:t.position.x-u,y:t.position.y-f}},d8=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((a,s)=>{const u=typeof s=="string";let f=!r.nodeLookup&&!u?s:void 0;r.nodeLookup&&(f=u?r.nodeLookup.get(s):R0(s)?s:r.nodeLookup.get(s.id));const h=f?Uu(f,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ic(a,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return oc(i)},yl=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(s=>{(r.filter===void 0||r.filter(s))&&(i=ic(i,Uu(s)),a=!0)}),a?oc(i):{x:0,y:0,width:0,height:0}},M0=(t,r,[i,a,s]=[0,0,1],u=!1,f=!1)=>{const h={...vl(r,[i,a,s]),width:r.width/s,height:r.height/s},p=[];for(const m of t.values()){const{measured:y,selectable:g=!0,hidden:x=!1}=m;if(f&&!g||x)continue;const b=y.width??m.width??m.initialWidth??null,E=y.height??m.height??m.initialHeight??null,S=al(h,Fo(m)),N=(b??0)*(E??0),w=u&&S>0;(!m.internals.handleBounds||w||S>=N||m.dragging)&&p.push(m)}return p},h8=(t,r)=>{const i=new Set;return t.forEach(a=>{i.add(a.id)}),r.filter(a=>i.has(a.source)||i.has(a.target))};function m8(t,r){const i=new Map,a=r?.nodes?new Set(r.nodes.map(s=>s.id)):null;return t.forEach(s=>{s.measured.width&&s.measured.height&&(r?.includeHiddenNodes||!s.hidden)&&(!a||a.has(s.id))&&i.set(s.id,s)}),i}async function p8({nodes:t,width:r,height:i,panZoom:a,minZoom:s,maxZoom:u},f){if(t.size===0)return Promise.resolve(!0);const h=m8(t,f),p=yl(h),m=D0(p,r,i,f?.minZoom??s,f?.maxZoom??u,f?.padding??.1);return await a.setViewport(m,{duration:f?.duration,ease:f?.ease,interpolate:f?.interpolate}),Promise.resolve(!0)}function wE({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:a=[0,0],nodeExtent:s,onError:u}){const f=i.get(t),h=f.parentId?i.get(f.parentId):void 0,{x:p,y:m}=h?h.internals.positionAbsolute:{x:0,y:0},y=f.origin??a;let g=f.extent||s;if(f.extent==="parent"&&!f.expandParent)if(!h)u?.("005",zn.error005());else{const b=h.measured.width,E=h.measured.height;b&&E&&(g=[[p,m],[p+b,m+E]])}else h&&Vo(f.extent)&&(g=[[f.extent[0][0]+p,f.extent[0][1]+m],[f.extent[1][0]+p,f.extent[1][1]+m]]);const x=Vo(g)?Oi(r,g,f.measured):r;return(f.measured.width===void 0||f.measured.height===void 0)&&u?.("015",zn.error015()),{position:{x:x.x-p+(f.measured.width??0)*y[0],y:x.y-m+(f.measured.height??0)*y[1]},positionAbsolute:x}}async function g8({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:a,onBeforeDelete:s}){const u=new Set(t.map(x=>x.id)),f=[];for(const x of i){if(x.deletable===!1)continue;const b=u.has(x.id),E=!b&&x.parentId&&f.find(S=>S.id===x.parentId);(b||E)&&f.push(x)}const h=new Set(r.map(x=>x.id)),p=a.filter(x=>x.deletable!==!1),y=h8(f,p);for(const x of p)h.has(x.id)&&!y.find(E=>E.id===x.id)&&y.push(x);if(!s)return{edges:y,nodes:f};const g=await s({nodes:f,edges:y});return typeof g=="boolean"?g?{edges:y,nodes:f}:{edges:[],nodes:[]}:g}const jo=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Oi=(t={x:0,y:0},r,i)=>({x:jo(t.x,r[0][0],r[1][0]-(i?.width??0)),y:jo(t.y,r[0][1],r[1][1]-(i?.height??0))});function TE(t,r,i){const{width:a,height:s}=hr(i),{x:u,y:f}=i.internals.positionAbsolute;return Oi(t,[[u,f],[u+a,f+s]],r)}const w1=(t,r,i)=>t<r?jo(Math.abs(t-r),1,r)/r:t>i?-jo(Math.abs(t-i),1,r)/r:0,AE=(t,r,i=15,a=40)=>{const s=w1(t.x,a,r.width-a)*i,u=w1(t.y,a,r.height-a)*i;return[s,u]},ic=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Rh=({x:t,y:r,width:i,height:a})=>({x:t,y:r,x2:t+i,y2:r+a}),oc=({x:t,y:r,x2:i,y2:a})=>({x:t,y:r,width:i-t,height:a-r}),Fo=(t,r=[0,0])=>{const{x:i,y:a}=R0(t)?t.internals.positionAbsolute:gl(t,r);return{x:i,y:a,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Uu=(t,r=[0,0])=>{const{x:i,y:a}=R0(t)?t.internals.positionAbsolute:gl(t,r);return{x:i,y:a,x2:i+(t.measured?.width??t.width??t.initialWidth??0),y2:a+(t.measured?.height??t.height??t.initialHeight??0)}},NE=(t,r)=>oc(ic(Rh(t),Rh(r))),al=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),a=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*a)},T1=t=>pn(t.width)&&pn(t.height)&&pn(t.x)&&pn(t.y),pn=t=>!isNaN(t)&&isFinite(t),y8=(t,r)=>{},xl=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),vl=({x:t,y:r},[i,a,s],u=!1,f=[1,1])=>{const h={x:(t-i)/s,y:(r-a)/s};return u?xl(h,f):h},Hu=({x:t,y:r},[i,a,s])=>({x:t*s+i,y:r*s+a});function Co(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function x8(t,r,i){if(typeof t=="string"||typeof t=="number"){const a=Co(t,i),s=Co(t,r);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof t=="object"){const a=Co(t.top??t.y??0,i),s=Co(t.bottom??t.y??0,i),u=Co(t.left??t.x??0,r),f=Co(t.right??t.x??0,r);return{top:a,right:f,bottom:s,left:u,x:u+f,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function v8(t,r,i,a,s,u){const{x:f,y:h}=Hu(t,[r,i,a]),{x:p,y:m}=Hu({x:t.x+t.width,y:t.y+t.height},[r,i,a]),y=s-p,g=u-m;return{left:Math.floor(f),top:Math.floor(h),right:Math.floor(y),bottom:Math.floor(g)}}const D0=(t,r,i,a,s,u)=>{const f=x8(u,r,i),h=(r-f.x)/t.width,p=(i-f.y)/t.height,m=Math.min(h,p),y=jo(m,a,s),g=t.x+t.width/2,x=t.y+t.height/2,b=r/2-g*y,E=i/2-x*y,S=v8(t,b,E,y,r,i),N={left:Math.min(S.left-f.left,0),top:Math.min(S.top-f.top,0),right:Math.min(S.right-f.right,0),bottom:Math.min(S.bottom-f.bottom,0)};return{x:b-N.left+N.right,y:E-N.top+N.bottom,zoom:y}},ll=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Vo(t){return t!=null&&t!=="parent"}function hr(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function CE(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function RE(t,r={width:0,height:0},i,a,s){const u={...t},f=a.get(i);if(f){const h=f.origin||s;u.x+=f.internals.positionAbsolute.x-(r.width??0)*h[0],u.y+=f.internals.positionAbsolute.y-(r.height??0)*h[1]}return u}function A1(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function b8(){let t,r;return{promise:new Promise((a,s)=>{t=a,r=s}),resolve:t,reject:r}}function E8(t){return{...vE,...t||{}}}function Za(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:a,containerBounds:s}){const{x:u,y:f}=gn(t),h=vl({x:u-(s?.left??0),y:f-(s?.top??0)},a),{x:p,y:m}=i?xl(h,r):h;return{xSnapped:p,ySnapped:m,...h}}const O0=t=>({width:t.offsetWidth,height:t.offsetHeight}),ME=t=>t?.getRootNode?.()||window?.document,S8=["INPUT","SELECT","TEXTAREA"];function DE(t){const r=t.composedPath?.()?.[0]||t.target;return r?.nodeType!==1?!1:S8.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const OE=t=>"clientX"in t,gn=(t,r)=>{const i=OE(t),a=i?t.clientX:t.touches?.[0].clientX,s=i?t.clientY:t.touches?.[0].clientY;return{x:a-(r?.left??0),y:s-(r?.top??0)}},N1=(t,r,i,a,s)=>{const u=r.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(f=>{const h=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),type:t,nodeId:s,position:f.getAttribute("data-handlepos"),x:(h.left-i.left)/a,y:(h.top-i.top)/a,...O0(f)}})};function zE({sourceX:t,sourceY:r,targetX:i,targetY:a,sourceControlX:s,sourceControlY:u,targetControlX:f,targetControlY:h}){const p=t*.125+s*.375+f*.375+i*.125,m=r*.125+u*.375+h*.375+a*.125,y=Math.abs(p-t),g=Math.abs(m-r);return[p,m,y,g]}function iu(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function C1({pos:t,x1:r,y1:i,x2:a,y2:s,c:u}){switch(t){case ve.Left:return[r-iu(r-a,u),i];case ve.Right:return[r+iu(a-r,u),i];case ve.Top:return[r,i-iu(i-s,u)];case ve.Bottom:return[r,i+iu(s-i,u)]}}function ac({sourceX:t,sourceY:r,sourcePosition:i=ve.Bottom,targetX:a,targetY:s,targetPosition:u=ve.Top,curvature:f=.25}){const[h,p]=C1({pos:i,x1:t,y1:r,x2:a,y2:s,c:f}),[m,y]=C1({pos:u,x1:a,y1:s,x2:t,y2:r,c:f}),[g,x,b,E]=zE({sourceX:t,sourceY:r,targetX:a,targetY:s,sourceControlX:h,sourceControlY:p,targetControlX:m,targetControlY:y});return[`M${t},${r} C${h},${p} ${m},${y} ${a},${s}`,g,x,b,E]}function BE({sourceX:t,sourceY:r,targetX:i,targetY:a}){const s=Math.abs(i-t)/2,u=i<t?i+s:i-s,f=Math.abs(a-r)/2,h=a<r?a+f:a-f;return[u,h,s,f]}function _8({sourceNode:t,targetNode:r,selected:i=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:u="basic"}){if(u==="manual")return a;const f=s&&i?a+1e3:a,h=Math.max(t.parentId||s&&t.selected?t.internals.z:0,r.parentId||s&&r.selected?r.internals.z:0);return f+h}function w8({sourceNode:t,targetNode:r,width:i,height:a,transform:s}){const u=ic(Uu(t),Uu(r));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const f={x:-s[0]/s[2],y:-s[1]/s[2],width:i/s[2],height:a/s[2]};return al(f,oc(u))>0}const T8=({source:t,sourceHandle:r,target:i,targetHandle:a})=>`xy-edge__${t}${r||""}-${i}${a||""}`,A8=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),Mh=(t,r,i={})=>{if(!t.source||!t.target)return r;const a=i.getEdgeId||T8;let s;return SE(t)?s={...t}:s={...t,id:a(t)},A8(s,r)?r:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,r.concat(s))};function UE({sourceX:t,sourceY:r,targetX:i,targetY:a}){const[s,u,f,h]=BE({sourceX:t,sourceY:r,targetX:i,targetY:a});return[`M ${t},${r}L ${i},${a}`,s,u,f,h]}const R1={[ve.Left]:{x:-1,y:0},[ve.Right]:{x:1,y:0},[ve.Top]:{x:0,y:-1},[ve.Bottom]:{x:0,y:1}},N8=({source:t,sourcePosition:r=ve.Bottom,target:i})=>r===ve.Left||r===ve.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},M1=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function C8({source:t,sourcePosition:r=ve.Bottom,target:i,targetPosition:a=ve.Top,center:s,offset:u,stepPosition:f}){const h=R1[r],p=R1[a],m={x:t.x+h.x*u,y:t.y+h.y*u},y={x:i.x+p.x*u,y:i.y+p.y*u},g=N8({source:m,sourcePosition:r,target:y}),x=g.x!==0?"x":"y",b=g[x];let E=[],S,N;const w={x:0,y:0},O={x:0,y:0},[,,_,C]=BE({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[x]*p[x]===-1){x==="x"?(S=s.x??m.x+(y.x-m.x)*f,N=s.y??(m.y+y.y)/2):(S=s.x??(m.x+y.x)/2,N=s.y??m.y+(y.y-m.y)*f);const z=[{x:S,y:m.y},{x:S,y:y.y}],U=[{x:m.x,y:N},{x:y.x,y:N}];h[x]===b?E=x==="x"?z:U:E=x==="x"?U:z}else{const z=[{x:m.x,y:y.y}],U=[{x:y.x,y:m.y}];if(x==="x"?E=h.x===b?U:z:E=h.y===b?z:U,r===a){const P=Math.abs(t[x]-i[x]);if(P<=u){const re=Math.min(u-1,u-P);h[x]===b?w[x]=(m[x]>t[x]?-1:1)*re:O[x]=(y[x]>i[x]?-1:1)*re}}if(r!==a){const P=x==="x"?"y":"x",re=h[x]===p[P],B=m[P]>y[P],q=m[P]<y[P];(h[x]===1&&(!re&&B||re&&q)||h[x]!==1&&(!re&&q||re&&B))&&(E=x==="x"?z:U)}const V={x:m.x+w.x,y:m.y+w.y},Y={x:y.x+O.x,y:y.y+O.y},ae=Math.max(Math.abs(V.x-E[0].x),Math.abs(Y.x-E[0].x)),X=Math.max(Math.abs(V.y-E[0].y),Math.abs(Y.y-E[0].y));ae>=X?(S=(V.x+Y.x)/2,N=E[0].y):(S=E[0].x,N=(V.y+Y.y)/2)}return[[t,{x:m.x+w.x,y:m.y+w.y},...E,{x:y.x+O.x,y:y.y+O.y},i],S,N,_,C]}function R8(t,r,i,a){const s=Math.min(M1(t,r)/2,M1(r,i)/2,a),{x:u,y:f}=r;if(t.x===u&&u===i.x||t.y===f&&f===i.y)return`L${u} ${f}`;if(t.y===f){const m=t.x<i.x?-1:1,y=t.y<i.y?1:-1;return`L ${u+s*m},${f}Q ${u},${f} ${u},${f+s*y}`}const h=t.x<i.x?1:-1,p=t.y<i.y?-1:1;return`L ${u},${f+s*p}Q ${u},${f} ${u+s*h},${f}`}function Dh({sourceX:t,sourceY:r,sourcePosition:i=ve.Bottom,targetX:a,targetY:s,targetPosition:u=ve.Top,borderRadius:f=5,centerX:h,centerY:p,offset:m=20,stepPosition:y=.5}){const[g,x,b,E,S]=C8({source:{x:t,y:r},sourcePosition:i,target:{x:a,y:s},targetPosition:u,center:{x:h,y:p},offset:m,stepPosition:y});return[g.reduce((w,O,_)=>{let C="";return _>0&&_<g.length-1?C=R8(g[_-1],O,g[_+1],f):C=`${_===0?"M":"L"}${O.x} ${O.y}`,w+=C,w},""),x,b,E,S]}function D1(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function M8(t){const{sourceNode:r,targetNode:i}=t;if(!D1(r)||!D1(i))return null;const a=r.internals.handleBounds||O1(r.handles),s=i.internals.handleBounds||O1(i.handles),u=z1(a?.source??[],t.sourceHandle),f=z1(t.connectionMode===Lo.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),t.targetHandle);if(!u||!f)return t.onError?.("008",zn.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=u?.position||ve.Bottom,p=f?.position||ve.Top,m=zi(r,u,h),y=zi(i,f,p);return{sourceX:m.x,sourceY:m.y,targetX:y.x,targetY:y.y,sourcePosition:h,targetPosition:p}}function O1(t){if(!t)return null;const r=[],i=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&i.push(a);return{source:r,target:i}}function zi(t,r,i=ve.Left,a=!1){const s=(r?.x??0)+t.internals.positionAbsolute.x,u=(r?.y??0)+t.internals.positionAbsolute.y,{width:f,height:h}=r??hr(t);if(a)return{x:s+f/2,y:u+h/2};switch(r?.position??i){case ve.Top:return{x:s+f/2,y:u};case ve.Right:return{x:s+f,y:u+h/2};case ve.Bottom:return{x:s+f/2,y:u+h};case ve.Left:return{x:s,y:u+h/2}}}function z1(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Oh(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function D8(t,{id:r,defaultColor:i,defaultMarkerStart:a,defaultMarkerEnd:s}){const u=new Set;return t.reduce((f,h)=>([h.markerStart||a,h.markerEnd||s].forEach(p=>{if(p&&typeof p=="object"){const m=Oh(p,r);u.has(m)||(f.push({id:m,color:p.color||i,...p}),u.add(m))}}),f),[]).sort((f,h)=>f.id.localeCompare(h.id))}const HE=1e3,O8=10,z0={nodeOrigin:[0,0],nodeExtent:il,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},z8={...z0,checkEquality:!0};function B0(t,r){const i={...t};for(const a in r)r[a]!==void 0&&(i[a]=r[a]);return i}function B8(t,r,i){const a=B0(z0,i);for(const s of t.values())if(s.parentId)H0(s,t,r,a);else{const u=gl(s,a.nodeOrigin),f=Vo(s.extent)?s.extent:a.nodeExtent,h=Oi(u,f,hr(s));s.internals.positionAbsolute=h}}function U8(t,r){if(!t.handles)return t.measured?r?.internals.handleBounds:void 0;const i=[],a=[];for(const s of t.handles){const u={id:s.id,width:s.width??1,height:s.height??1,nodeId:t.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?i.push(u):s.type==="target"&&a.push(u)}return{source:i,target:a}}function U0(t){return t==="manual"}function zh(t,r,i,a={}){const s=B0(z8,a),u={i:0},f=new Map(r),h=s?.elevateNodesOnSelect&&!U0(s.zIndexMode)?HE:0;let p=t.length>0;r.clear(),i.clear();for(const m of t){let y=f.get(m.id);if(s.checkEquality&&m===y?.internals.userNode)r.set(m.id,y);else{const g=gl(m,s.nodeOrigin),x=Vo(m.extent)?m.extent:s.nodeExtent,b=Oi(g,x,hr(m));y={...s.defaults,...m,measured:{width:m.measured?.width,height:m.measured?.height},internals:{positionAbsolute:b,handleBounds:U8(m,y),z:LE(m,h,s.zIndexMode),userNode:m}},r.set(m.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(p=!1),m.parentId&&H0(y,r,i,a,u)}return p}function H8(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function H0(t,r,i,a,s){const{elevateNodesOnSelect:u,nodeOrigin:f,nodeExtent:h,zIndexMode:p}=B0(z0,a),m=t.parentId,y=r.get(m);if(!y){console.warn(`Parent node ${m} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}H8(t,i),s&&!y.parentId&&y.internals.rootParentIndex===void 0&&p==="auto"&&(y.internals.rootParentIndex=++s.i,y.internals.z=y.internals.z+s.i*O8),s&&y.internals.rootParentIndex!==void 0&&(s.i=y.internals.rootParentIndex);const g=u&&!U0(p)?HE:0,{x,y:b,z:E}=L8(t,y,f,h,g,p),{positionAbsolute:S}=t.internals,N=x!==S.x||b!==S.y;(N||E!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:N?{x,y:b}:S,z:E}})}function LE(t,r,i){const a=pn(t.zIndex)?t.zIndex:0;return U0(i)?a:a+(t.selected?r:0)}function L8(t,r,i,a,s,u){const{x:f,y:h}=r.internals.positionAbsolute,p=hr(t),m=gl(t,i),y=Vo(t.extent)?Oi(m,t.extent,p):m;let g=Oi({x:f+y.x,y:h+y.y},a,p);t.extent==="parent"&&(g=TE(g,p,r));const x=LE(t,s,u),b=r.internals.z??0;return{x:g.x,y:g.y,z:b>=x?b+1:x}}function L0(t,r,i,a=[0,0]){const s=[],u=new Map;for(const f of t){const h=r.get(f.parentId);if(!h)continue;const p=u.get(f.parentId)?.expandedRect??Fo(h),m=NE(p,f.rect);u.set(f.parentId,{expandedRect:m,parent:h})}return u.size>0&&u.forEach(({expandedRect:f,parent:h},p)=>{const m=h.internals.positionAbsolute,y=hr(h),g=h.origin??a,x=f.x<m.x?Math.round(Math.abs(m.x-f.x)):0,b=f.y<m.y?Math.round(Math.abs(m.y-f.y)):0,E=Math.max(y.width,Math.round(f.width)),S=Math.max(y.height,Math.round(f.height)),N=(E-y.width)*g[0],w=(S-y.height)*g[1];(x>0||b>0||N||w)&&(s.push({id:p,type:"position",position:{x:h.position.x-x+N,y:h.position.y-b+w}}),i.get(p)?.forEach(O=>{t.some(_=>_.id===O.id)||s.push({id:O.id,type:"position",position:{x:O.position.x+x,y:O.position.y+b}})})),(y.width<f.width||y.height<f.height||x||b)&&s.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:E+(x?g[0]*x-N:0),height:S+(b?g[1]*b-w:0)}})}),s}function j8(t,r,i,a,s,u,f){const h=a?.querySelector(".xyflow__viewport");let p=!1;if(!h)return{changes:[],updatedInternals:p};const m=[],y=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(y.transform),x=[];for(const b of t.values()){const E=r.get(b.id);if(!E)continue;if(E.hidden){r.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),p=!0;continue}const S=O0(b.nodeElement),N=E.measured.width!==S.width||E.measured.height!==S.height;if(!!(S.width&&S.height&&(N||!E.internals.handleBounds||b.force))){const O=b.nodeElement.getBoundingClientRect(),_=Vo(E.extent)?E.extent:u;let{positionAbsolute:C}=E.internals;E.parentId&&E.extent==="parent"?C=TE(C,S,r.get(E.parentId)):_&&(C=Oi(C,_,S));const D={...E,measured:S,internals:{...E.internals,positionAbsolute:C,handleBounds:{source:N1("source",b.nodeElement,O,g,E.id),target:N1("target",b.nodeElement,O,g,E.id)}}};r.set(E.id,D),E.parentId&&H0(D,r,i,{nodeOrigin:s,zIndexMode:f}),p=!0,N&&(m.push({id:E.id,type:"dimensions",dimensions:S}),E.expandParent&&E.parentId&&x.push({id:E.id,parentId:E.parentId,rect:Fo(D,s)}))}}if(x.length>0){const b=L0(x,r,i,s);m.push(...b)}return{changes:m,updatedInternals:p}}async function F8({delta:t,panZoom:r,transform:i,translateExtent:a,width:s,height:u}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const f=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[s,u]],a),h=!!f&&(f.x!==i[0]||f.y!==i[1]||f.k!==i[2]);return Promise.resolve(h)}function B1(t,r,i,a,s,u){let f=s;const h=a.get(f)||new Map;a.set(f,h.set(i,r)),f=`${s}-${t}`;const p=a.get(f)||new Map;if(a.set(f,p.set(i,r)),u){f=`${s}-${t}-${u}`;const m=a.get(f)||new Map;a.set(f,m.set(i,r))}}function jE(t,r,i){t.clear(),r.clear();for(const a of i){const{source:s,target:u,sourceHandle:f=null,targetHandle:h=null}=a,p={edgeId:a.id,source:s,target:u,sourceHandle:f,targetHandle:h},m=`${s}-${f}--${u}-${h}`,y=`${u}-${h}--${s}-${f}`;B1("source",p,y,t,s,f),B1("target",p,m,t,u,h),r.set(a.id,a)}}function FE(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:FE(i,r):!1}function U1(t,r,i){let a=t;do{if(a?.matches?.(r))return!0;if(a===i)return!1;a=a?.parentElement}while(a);return!1}function V8(t,r,i,a){const s=new Map;for(const[u,f]of t)if((f.selected||f.id===a)&&(!f.parentId||!FE(f,t))&&(f.draggable||r&&typeof f.draggable>"u")){const h=t.get(u);h&&s.set(u,{id:u,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return s}function Zd({nodeId:t,dragItems:r,nodeLookup:i,dragging:a=!0}){const s=[];for(const[f,h]of r){const p=i.get(f)?.internals.userNode;p&&s.push({...p,position:h.position,dragging:a})}if(!t)return[s[0],s];const u=i.get(t)?.internals.userNode;return[u?{...u,position:r.get(t)?.position||u.position,dragging:a}:s[0],s]}function k8({dragItems:t,snapGrid:r,x:i,y:a}){const s=t.values().next().value;if(!s)return null;const u={x:i-s.distance.x,y:a-s.distance.y},f=xl(u,r);return{x:f.x-u.x,y:f.y-u.y}}function G8({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:a,onDragStop:s}){let u={x:null,y:null},f=0,h=new Map,p=!1,m={x:0,y:0},y=null,g=!1,x=null,b=!1,E=!1,S=null;function N({noDragClassName:O,handleSelector:_,domNode:C,isSelectable:D,nodeId:z,nodeClickDistance:U=0}){x=Pt(C);function V({x:P,y:re}){const{nodeLookup:B,nodeExtent:q,snapGrid:R,snapToGrid:L,nodeOrigin:k,onNodeDrag:$,onSelectionDrag:ee,onError:M,updateNodePositions:F}=r();u={x:P,y:re};let J=!1;const te=h.size>1,se=te&&q?Rh(yl(h)):null,he=te&&L?k8({dragItems:h,snapGrid:R,x:P,y:re}):null;for(const[fe,ue]of h){if(!B.has(fe))continue;let me={x:P-ue.distance.x,y:re-ue.distance.y};L&&(me=he?{x:Math.round(me.x+he.x),y:Math.round(me.y+he.y)}:xl(me,R));let ne=null;if(te&&q&&!ue.extent&&se){const{positionAbsolute:ge}=ue.internals,xe=ge.x-se.x+q[0][0],Se=ge.x+ue.measured.width-se.x2+q[1][0],Ae=ge.y-se.y+q[0][1],je=ge.y+ue.measured.height-se.y2+q[1][1];ne=[[xe,Ae],[Se,je]]}const{position:ce,positionAbsolute:de}=wE({nodeId:fe,nextPosition:me,nodeLookup:B,nodeExtent:ne||q,nodeOrigin:k,onError:M});J=J||ue.position.x!==ce.x||ue.position.y!==ce.y,ue.position=ce,ue.internals.positionAbsolute=de}if(E=E||J,!!J&&(F(h,!0),S&&(a||$||!z&&ee))){const[fe,ue]=Zd({nodeId:z,dragItems:h,nodeLookup:B});a?.(S,h,fe,ue),$?.(S,fe,ue),z||ee?.(S,ue)}}async function Y(){if(!y)return;const{transform:P,panBy:re,autoPanSpeed:B,autoPanOnNodeDrag:q}=r();if(!q){p=!1,cancelAnimationFrame(f);return}const[R,L]=AE(m,y,B);(R!==0||L!==0)&&(u.x=(u.x??0)-R/P[2],u.y=(u.y??0)-L/P[2],await re({x:R,y:L})&&V(u)),f=requestAnimationFrame(Y)}function ae(P){const{nodeLookup:re,multiSelectionActive:B,nodesDraggable:q,transform:R,snapGrid:L,snapToGrid:k,selectNodesOnDrag:$,onNodeDragStart:ee,onSelectionDragStart:M,unselectNodesAndEdges:F}=r();g=!0,(!$||!D)&&!B&&z&&(re.get(z)?.selected||F()),D&&$&&z&&t?.(z);const J=Za(P.sourceEvent,{transform:R,snapGrid:L,snapToGrid:k,containerBounds:y});if(u=J,h=V8(re,q,J,z),h.size>0&&(i||ee||!z&&M)){const[te,se]=Zd({nodeId:z,dragItems:h,nodeLookup:re});i?.(P.sourceEvent,h,te,se),ee?.(P.sourceEvent,te,se),z||M?.(P.sourceEvent,se)}}const X=nE().clickDistance(U).on("start",P=>{const{domNode:re,nodeDragThreshold:B,transform:q,snapGrid:R,snapToGrid:L}=r();y=re?.getBoundingClientRect()||null,b=!1,E=!1,S=P.sourceEvent,B===0&&ae(P),u=Za(P.sourceEvent,{transform:q,snapGrid:R,snapToGrid:L,containerBounds:y}),m=gn(P.sourceEvent,y)}).on("drag",P=>{const{autoPanOnNodeDrag:re,transform:B,snapGrid:q,snapToGrid:R,nodeDragThreshold:L,nodeLookup:k}=r(),$=Za(P.sourceEvent,{transform:B,snapGrid:q,snapToGrid:R,containerBounds:y});if(S=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||z&&!k.has(z))&&(b=!0),!b){if(!p&&re&&g&&(p=!0,Y()),!g){const ee=gn(P.sourceEvent,y),M=ee.x-m.x,F=ee.y-m.y;Math.sqrt(M*M+F*F)>L&&ae(P)}(u.x!==$.xSnapped||u.y!==$.ySnapped)&&h&&g&&(m=gn(P.sourceEvent,y),V($))}}).on("end",P=>{if(!(!g||b)&&(p=!1,g=!1,cancelAnimationFrame(f),h.size>0)){const{nodeLookup:re,updateNodePositions:B,onNodeDragStop:q,onSelectionDragStop:R}=r();if(E&&(B(h,!1),E=!1),s||q||!z&&R){const[L,k]=Zd({nodeId:z,dragItems:h,nodeLookup:re,dragging:!1});s?.(P.sourceEvent,h,L,k),q?.(P.sourceEvent,L,k),z||R?.(P.sourceEvent,k)}}}).filter(P=>{const re=P.target;return!P.button&&(!O||!U1(re,`.${O}`,C))&&(!_||U1(re,_,C))});x.call(X)}function w(){x?.on(".drag",null)}return{update:N,destroy:w}}function q8(t,r,i){const a=[],s={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const u of r.values())al(s,Fo(u))>0&&a.push(u);return a}const Y8=250;function X8(t,r,i,a){let s=[],u=1/0;const f=q8(t,i,r+Y8);for(const h of f){const p=[...h.internals.handleBounds?.source??[],...h.internals.handleBounds?.target??[]];for(const m of p){if(a.nodeId===m.nodeId&&a.type===m.type&&a.id===m.id)continue;const{x:y,y:g}=zi(h,m,m.position,!0),x=Math.sqrt(Math.pow(y-t.x,2)+Math.pow(g-t.y,2));x>r||(x<u?(s=[{...m,x:y,y:g}],u=x):x===u&&s.push({...m,x:y,y:g}))}}if(!s.length)return null;if(s.length>1){const h=a.type==="source"?"target":"source";return s.find(p=>p.type===h)??s[0]}return s[0]}function VE(t,r,i,a,s,u=!1){const f=a.get(t);if(!f)return null;const h=s==="strict"?f.internals.handleBounds?.[r]:[...f.internals.handleBounds?.source??[],...f.internals.handleBounds?.target??[]],p=(i?h?.find(m=>m.id===i):h?.[0])??null;return p&&u?{...p,...zi(f,p,p.position,!0)}:p}function kE(t,r){return t||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function I8(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const GE=()=>!0;function $8(t,{connectionMode:r,connectionRadius:i,handleId:a,nodeId:s,edgeUpdaterType:u,isTarget:f,domNode:h,nodeLookup:p,lib:m,autoPanOnConnect:y,flowId:g,panBy:x,cancelConnection:b,onConnectStart:E,onConnect:S,onConnectEnd:N,isValidConnection:w=GE,onReconnectEnd:O,updateConnection:_,getTransform:C,getFromHandle:D,autoPanSpeed:z,dragThreshold:U=1,handleDomNode:V}){const Y=ME(t.target);let ae=0,X;const{x:P,y:re}=gn(t),B=kE(u,V),q=h?.getBoundingClientRect();let R=!1;if(!q||!B)return;const L=VE(s,B,a,p,r);if(!L)return;let k=gn(t,q),$=!1,ee=null,M=!1,F=null;function J(){if(!y||!q)return;const[ce,de]=AE(k,q,z);x({x:ce,y:de}),ae=requestAnimationFrame(J)}const te={...L,nodeId:s,type:B,position:L.position},se=p.get(s);let fe={inProgress:!0,isValid:null,from:zi(se,te,ve.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:se,to:k,toHandle:null,toPosition:_1[te.position],toNode:null,pointer:k};function ue(){R=!0,_(fe),E?.(t,{nodeId:s,handleId:a,handleType:B})}U===0&&ue();function me(ce){if(!R){const{x:je,y:Ie}=gn(ce),wt=je-P,Tt=Ie-re;if(!(wt*wt+Tt*Tt>U*U))return;ue()}if(!D()||!te){ne(ce);return}const de=C();k=gn(ce,q),X=X8(vl(k,de,!1,[1,1]),i,p,te),$||(J(),$=!0);const ge=qE(ce,{handle:X,connectionMode:r,fromNodeId:s,fromHandleId:a,fromType:f?"target":"source",isValidConnection:w,doc:Y,lib:m,flowId:g,nodeLookup:p});F=ge.handleDomNode,ee=ge.connection,M=I8(!!X,ge.isValid);const xe=p.get(s),Se=xe?zi(xe,te,ve.Left,!0):fe.from,Ae={...fe,from:Se,isValid:M,to:ge.toHandle&&M?Hu({x:ge.toHandle.x,y:ge.toHandle.y},de):k,toHandle:ge.toHandle,toPosition:M&&ge.toHandle?ge.toHandle.position:_1[te.position],toNode:ge.toHandle?p.get(ge.toHandle.nodeId):null,pointer:k};_(Ae),fe=Ae}function ne(ce){if(!("touches"in ce&&ce.touches.length>0)){if(R){(X||F)&&ee&&M&&S?.(ee);const{inProgress:de,...ge}=fe,xe={...ge,toPosition:fe.toHandle?fe.toPosition:null};N?.(ce,xe),u&&O?.(ce,xe)}b(),cancelAnimationFrame(ae),$=!1,M=!1,ee=null,F=null,Y.removeEventListener("mousemove",me),Y.removeEventListener("mouseup",ne),Y.removeEventListener("touchmove",me),Y.removeEventListener("touchend",ne)}}Y.addEventListener("mousemove",me),Y.addEventListener("mouseup",ne),Y.addEventListener("touchmove",me),Y.addEventListener("touchend",ne)}function qE(t,{handle:r,connectionMode:i,fromNodeId:a,fromHandleId:s,fromType:u,doc:f,lib:h,flowId:p,isValidConnection:m=GE,nodeLookup:y}){const g=u==="target",x=r?f.querySelector(`.${h}-flow__handle[data-id="${p}-${r?.nodeId}-${r?.id}-${r?.type}"]`):null,{x:b,y:E}=gn(t),S=f.elementFromPoint(b,E),N=S?.classList.contains(`${h}-flow__handle`)?S:x,w={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const O=kE(void 0,N),_=N.getAttribute("data-nodeid"),C=N.getAttribute("data-handleid"),D=N.classList.contains("connectable"),z=N.classList.contains("connectableend");if(!_||!O)return w;const U={source:g?_:a,sourceHandle:g?C:s,target:g?a:_,targetHandle:g?s:C};w.connection=U;const Y=D&&z&&(i===Lo.Strict?g&&O==="source"||!g&&O==="target":_!==a||C!==s);w.isValid=Y&&m(U),w.toHandle=VE(_,O,C,y,i,!0)}return w}const Bh={onPointerDown:$8,isValid:qE};function P8({domNode:t,panZoom:r,getTransform:i,getViewScale:a}){const s=Pt(t);function u({translateExtent:h,width:p,height:m,zoomStep:y=1,pannable:g=!0,zoomable:x=!0,inversePan:b=!1}){const E=_=>{if(_.sourceEvent.type!=="wheel"||!r)return;const C=i(),D=_.sourceEvent.ctrlKey&&ll()?10:1,z=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*y,U=C[2]*Math.pow(2,z*D);r.scaleTo(U)};let S=[0,0];const N=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(S=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},w=_=>{const C=i();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!r)return;const D=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],z=[D[0]-S[0],D[1]-S[1]];S=D;const U=a()*Math.max(C[2],Math.log(C[2]))*(b?-1:1),V={x:C[0]-z[0]*U,y:C[1]-z[1]*U},Y=[[0,0],[p,m]];r.setViewportConstrained({x:V.x,y:V.y,zoom:C[2]},Y,h)},O=yE().on("start",N).on("zoom",g?w:null).on("zoom.wheel",x?E:null);s.call(O,{})}function f(){s.on("zoom",null)}return{update:u,destroy:f,pointer:hn}}const lc=t=>({x:t.x,y:t.y,zoom:t.k}),Qd=({x:t,y:r,zoom:i})=>rc.translate(t,r).scale(i),Ro=(t,r)=>t.target.closest(`.${r}`),YE=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),Z8=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Kd=(t,r=0,i=Z8,a=()=>{})=>{const s=typeof r=="number"&&r>0;return s||a(),s?t.transition().duration(r).ease(i).on("end",a):t},XE=t=>{const r=t.ctrlKey&&ll()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function Q8({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:u,zoomOnPinch:f,onPanZoomStart:h,onPanZoom:p,onPanZoomEnd:m}){return y=>{if(Ro(y,r))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const g=i.property("__zoom").k||1;if(y.ctrlKey&&f){const N=hn(y),w=XE(y),O=g*Math.pow(2,w);a.scaleTo(i,O,N,y);return}const x=y.deltaMode===1?20:1;let b=s===Ni.Vertical?0:y.deltaX*x,E=s===Ni.Horizontal?0:y.deltaY*x;!ll()&&y.shiftKey&&s!==Ni.Vertical&&(b=y.deltaY*x,E=0),a.translateBy(i,-(b/g)*u,-(E/g)*u,{internal:!0});const S=lc(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(p?.(y,S),t.panScrollTimeout=setTimeout(()=>{m?.(y,S),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h?.(y,S))}}function K8({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(a,s){const u=a.type==="wheel",f=!r&&u&&!a.ctrlKey,h=Ro(a,t);if(a.ctrlKey&&u&&h&&a.preventDefault(),f||h)return null;a.preventDefault(),i.call(this,a,s)}}function J8({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return a=>{if(a.sourceEvent?.internal)return;const s=lc(a.transform);t.mouseButton=a.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=s,a.sourceEvent?.type==="mousedown"&&r(!0),i&&i?.(a.sourceEvent,s)}}function W8({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:a,onPanZoom:s}){return u=>{t.usedRightMouseButton=!!(i&&YE(r,t.mouseButton??0)),u.sourceEvent?.sync||a([u.transform.x,u.transform.y,u.transform.k]),s&&!u.sourceEvent?.internal&&s?.(u.sourceEvent,lc(u.transform))}}function eD({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:u}){return f=>{if(!f.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,u&&YE(r,t.mouseButton??0)&&!t.usedRightMouseButton&&f.sourceEvent&&u(f.sourceEvent),t.usedRightMouseButton=!1,a(!1),s)){const h=lc(f.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{s?.(f.sourceEvent,h)},i?150:0)}}}function tD({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:u,userSelectionActive:f,noWheelClassName:h,noPanClassName:p,lib:m,connectionInProgress:y}){return g=>{const x=t||r,b=i&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Ro(g,`${m}-flow__node`)||Ro(g,`${m}-flow__edge`)))return!0;if(!a&&!x&&!s&&!u&&!i||f||y&&!E||Ro(g,h)&&E||Ro(g,p)&&(!E||s&&E&&!t)||!i&&g.ctrlKey&&E)return!1;if(!i&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!x&&!s&&!b&&E||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const S=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&S}}function nD({domNode:t,minZoom:r,maxZoom:i,translateExtent:a,viewport:s,onPanZoom:u,onPanZoomStart:f,onPanZoomEnd:h,onDraggingChange:p}){const m={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=t.getBoundingClientRect(),g=yE().scaleExtent([r,i]).translateExtent(a),x=Pt(t).call(g);O({x:s.x,y:s.y,zoom:jo(s.zoom,r,i)},[[0,0],[y.width,y.height]],a);const b=x.on("wheel.zoom"),E=x.on("dblclick.zoom");g.wheelDelta(XE);function S(X,P){return x?new Promise(re=>{g?.interpolate(P?.interpolate==="linear"?Pa:gu).transform(Kd(x,P?.duration,P?.ease,()=>re(!0)),X)}):Promise.resolve(!1)}function N({noWheelClassName:X,noPanClassName:P,onPaneContextMenu:re,userSelectionActive:B,panOnScroll:q,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:k,preventScrolling:$,zoomOnPinch:ee,zoomOnScroll:M,zoomOnDoubleClick:F,zoomActivationKeyPressed:J,lib:te,onTransformChange:se,connectionInProgress:he,paneClickDistance:fe,selectionOnDrag:ue}){B&&!m.isZoomingOrPanning&&w();const me=q&&!J&&!B;g.clickDistance(ue?1/0:!pn(fe)||fe<0?0:fe);const ne=me?Q8({zoomPanValues:m,noWheelClassName:X,d3Selection:x,d3Zoom:g,panOnScrollMode:L,panOnScrollSpeed:k,zoomOnPinch:ee,onPanZoomStart:f,onPanZoom:u,onPanZoomEnd:h}):K8({noWheelClassName:X,preventScrolling:$,d3ZoomHandler:b});if(x.on("wheel.zoom",ne,{passive:!1}),!B){const de=J8({zoomPanValues:m,onDraggingChange:p,onPanZoomStart:f});g.on("start",de);const ge=W8({zoomPanValues:m,panOnDrag:R,onPaneContextMenu:!!re,onPanZoom:u,onTransformChange:se});g.on("zoom",ge);const xe=eD({zoomPanValues:m,panOnDrag:R,panOnScroll:q,onPaneContextMenu:re,onPanZoomEnd:h,onDraggingChange:p});g.on("end",xe)}const ce=tD({zoomActivationKeyPressed:J,panOnDrag:R,zoomOnScroll:M,panOnScroll:q,zoomOnDoubleClick:F,zoomOnPinch:ee,userSelectionActive:B,noPanClassName:P,noWheelClassName:X,lib:te,connectionInProgress:he});g.filter(ce),F?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function w(){g.on("zoom",null)}async function O(X,P,re){const B=Qd(X),q=g?.constrain()(B,P,re);return q&&await S(q),new Promise(R=>R(q))}async function _(X,P){const re=Qd(X);return await S(re,P),new Promise(B=>B(re))}function C(X){if(x){const P=Qd(X),re=x.property("__zoom");(re.k!==X.zoom||re.x!==X.x||re.y!==X.y)&&g?.transform(x,P,null,{sync:!0})}}function D(){const X=x?gE(x.node()):{x:0,y:0,k:1};return{x:X.x,y:X.y,zoom:X.k}}function z(X,P){return x?new Promise(re=>{g?.interpolate(P?.interpolate==="linear"?Pa:gu).scaleTo(Kd(x,P?.duration,P?.ease,()=>re(!0)),X)}):Promise.resolve(!1)}function U(X,P){return x?new Promise(re=>{g?.interpolate(P?.interpolate==="linear"?Pa:gu).scaleBy(Kd(x,P?.duration,P?.ease,()=>re(!0)),X)}):Promise.resolve(!1)}function V(X){g?.scaleExtent(X)}function Y(X){g?.translateExtent(X)}function ae(X){const P=!pn(X)||X<0?0:X;g?.clickDistance(P)}return{update:N,destroy:w,setViewport:_,setViewportConstrained:O,getViewport:D,scaleTo:z,scaleBy:U,setScaleExtent:V,setTranslateExtent:Y,syncViewport:C,setClickDistance:ae}}var ko;(function(t){t.Line="line",t.Handle="handle"})(ko||(ko={}));function rD({width:t,prevWidth:r,height:i,prevHeight:a,affectsX:s,affectsY:u}){const f=t-r,h=i-a,p=[f>0?1:f<0?-1:0,h>0?1:h<0?-1:0];return f&&s&&(p[0]=p[0]*-1),h&&u&&(p[1]=p[1]*-1),p}function H1(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),a=t.includes("left"),s=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:a,affectsY:s}}function qr(t,r){return Math.max(0,r-t)}function Yr(t,r){return Math.max(0,t-r)}function ou(t,r,i){return Math.max(0,r-t,t-i)}function L1(t,r){return t?!r:r}function iD(t,r,i,a,s,u,f,h){let{affectsX:p,affectsY:m}=r;const{isHorizontal:y,isVertical:g}=r,x=y&&g,{xSnapped:b,ySnapped:E}=i,{minWidth:S,maxWidth:N,minHeight:w,maxHeight:O}=a,{x:_,y:C,width:D,height:z,aspectRatio:U}=t;let V=Math.floor(y?b-t.pointerX:0),Y=Math.floor(g?E-t.pointerY:0);const ae=D+(p?-V:V),X=z+(m?-Y:Y),P=-u[0]*D,re=-u[1]*z;let B=ou(ae,S,N),q=ou(X,w,O);if(f){let k=0,$=0;p&&V<0?k=qr(_+V+P,f[0][0]):!p&&V>0&&(k=Yr(_+ae+P,f[1][0])),m&&Y<0?$=qr(C+Y+re,f[0][1]):!m&&Y>0&&($=Yr(C+X+re,f[1][1])),B=Math.max(B,k),q=Math.max(q,$)}if(h){let k=0,$=0;p&&V>0?k=Yr(_+V,h[0][0]):!p&&V<0&&(k=qr(_+ae,h[1][0])),m&&Y>0?$=Yr(C+Y,h[0][1]):!m&&Y<0&&($=qr(C+X,h[1][1])),B=Math.max(B,k),q=Math.max(q,$)}if(s){if(y){const k=ou(ae/U,w,O)*U;if(B=Math.max(B,k),f){let $=0;!p&&!m||p&&!m&&x?$=Yr(C+re+ae/U,f[1][1])*U:$=qr(C+re+(p?V:-V)/U,f[0][1])*U,B=Math.max(B,$)}if(h){let $=0;!p&&!m||p&&!m&&x?$=qr(C+ae/U,h[1][1])*U:$=Yr(C+(p?V:-V)/U,h[0][1])*U,B=Math.max(B,$)}}if(g){const k=ou(X*U,S,N)/U;if(q=Math.max(q,k),f){let $=0;!p&&!m||m&&!p&&x?$=Yr(_+X*U+P,f[1][0])/U:$=qr(_+(m?Y:-Y)*U+P,f[0][0])/U,q=Math.max(q,$)}if(h){let $=0;!p&&!m||m&&!p&&x?$=qr(_+X*U,h[1][0])/U:$=Yr(_+(m?Y:-Y)*U,h[0][0])/U,q=Math.max(q,$)}}}Y=Y+(Y<0?q:-q),V=V+(V<0?B:-B),s&&(x?ae>X*U?Y=(L1(p,m)?-V:V)/U:V=(L1(p,m)?-Y:Y)*U:y?(Y=V/U,m=p):(V=Y*U,p=m));const R=p?_+V:_,L=m?C+Y:C;return{width:D+(p?-V:V),height:z+(m?-Y:Y),x:u[0]*V*(p?-1:1)+R,y:u[1]*Y*(m?-1:1)+L}}const IE={width:0,height:0,x:0,y:0},oD={...IE,pointerX:0,pointerY:0,aspectRatio:1};function aD(t){return[[0,0],[t.measured.width,t.measured.height]]}function lD(t,r,i){const a=r.position.x+t.position.x,s=r.position.y+t.position.y,u=t.measured.width??0,f=t.measured.height??0,h=i[0]*u,p=i[1]*f;return[[a-h,s-p],[a+u-h,s+f-p]]}function sD({domNode:t,nodeId:r,getStoreItems:i,onChange:a,onEnd:s}){const u=Pt(t);let f={controlDirection:H1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:m,boundaries:y,keepAspectRatio:g,resizeDirection:x,onResizeStart:b,onResize:E,onResizeEnd:S,shouldResize:N}){let w={...IE},O={...oD};f={boundaries:y,resizeDirection:x,keepAspectRatio:g,controlDirection:H1(m)};let _,C=null,D=[],z,U,V,Y=!1;const ae=nE().on("start",X=>{const{nodeLookup:P,transform:re,snapGrid:B,snapToGrid:q,nodeOrigin:R,paneDomNode:L}=i();if(_=P.get(r),!_)return;C=L?.getBoundingClientRect()??null;const{xSnapped:k,ySnapped:$}=Za(X.sourceEvent,{transform:re,snapGrid:B,snapToGrid:q,containerBounds:C});w={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},O={...w,pointerX:k,pointerY:$,aspectRatio:w.width/w.height},z=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(z=P.get(_.parentId),U=z&&_.extent==="parent"?aD(z):void 0),D=[],V=void 0;for(const[ee,M]of P)if(M.parentId===r&&(D.push({id:ee,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const F=lD(M,_,M.origin??R);V?V=[[Math.min(F[0][0],V[0][0]),Math.min(F[0][1],V[0][1])],[Math.max(F[1][0],V[1][0]),Math.max(F[1][1],V[1][1])]]:V=F}b?.(X,{...w})}).on("drag",X=>{const{transform:P,snapGrid:re,snapToGrid:B,nodeOrigin:q}=i(),R=Za(X.sourceEvent,{transform:P,snapGrid:re,snapToGrid:B,containerBounds:C}),L=[];if(!_)return;const{x:k,y:$,width:ee,height:M}=w,F={},J=_.origin??q,{width:te,height:se,x:he,y:fe}=iD(O,f.controlDirection,R,f.boundaries,f.keepAspectRatio,J,U,V),ue=te!==ee,me=se!==M,ne=he!==k&&ue,ce=fe!==$&&me;if(!ne&&!ce&&!ue&&!me)return;if((ne||ce||J[0]===1||J[1]===1)&&(F.x=ne?he:w.x,F.y=ce?fe:w.y,w.x=F.x,w.y=F.y,D.length>0)){const Se=he-k,Ae=fe-$;for(const je of D)je.position={x:je.position.x-Se+J[0]*(te-ee),y:je.position.y-Ae+J[1]*(se-M)},L.push(je)}if((ue||me)&&(F.width=ue&&(!f.resizeDirection||f.resizeDirection==="horizontal")?te:w.width,F.height=me&&(!f.resizeDirection||f.resizeDirection==="vertical")?se:w.height,w.width=F.width,w.height=F.height),z&&_.expandParent){const Se=J[0]*(F.width??0);F.x&&F.x<Se&&(w.x=Se,O.x=O.x-(F.x-Se));const Ae=J[1]*(F.height??0);F.y&&F.y<Ae&&(w.y=Ae,O.y=O.y-(F.y-Ae))}const de=rD({width:w.width,prevWidth:ee,height:w.height,prevHeight:M,affectsX:f.controlDirection.affectsX,affectsY:f.controlDirection.affectsY}),ge={...w,direction:de};N?.(X,ge)!==!1&&(Y=!0,E?.(X,ge),a(F,L))}).on("end",X=>{Y&&(S?.(X,{...w}),s?.({...w}),Y=!1)});u.call(ae)}function p(){u.on(".drag",null)}return{update:h,destroy:p}}var Jd={exports:{}},Wd={},eh={exports:{}},th={};var j1;function uD(){if(j1)return th;j1=1;var t=cl();function r(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var i=typeof Object.is=="function"?Object.is:r,a=t.useState,s=t.useEffect,u=t.useLayoutEffect,f=t.useDebugValue;function h(g,x){var b=x(),E=a({inst:{value:b,getSnapshot:x}}),S=E[0].inst,N=E[1];return u(function(){S.value=b,S.getSnapshot=x,p(S)&&N({inst:S})},[g,b,x]),s(function(){return p(S)&&N({inst:S}),g(function(){p(S)&&N({inst:S})})},[g]),f(b),b}function p(g){var x=g.getSnapshot;g=g.value;try{var b=x();return!i(g,b)}catch{return!0}}function m(g,x){return x()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:h;return th.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y,th}var F1;function cD(){return F1||(F1=1,eh.exports=uD()),eh.exports}var V1;function fD(){if(V1)return Wd;V1=1;var t=cl(),r=cD();function i(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var a=typeof Object.is=="function"?Object.is:i,s=r.useSyncExternalStore,u=t.useRef,f=t.useEffect,h=t.useMemo,p=t.useDebugValue;return Wd.useSyncExternalStoreWithSelector=function(m,y,g,x,b){var E=u(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=h(function(){function w(z){if(!O){if(O=!0,_=z,z=x(z),b!==void 0&&S.hasValue){var U=S.value;if(b(U,z))return C=U}return C=z}if(U=C,a(_,z))return U;var V=x(z);return b!==void 0&&b(U,V)?(_=z,U):(_=z,C=V)}var O=!1,_,C,D=g===void 0?null:g;return[function(){return w(y())},D===null?void 0:function(){return w(D())}]},[y,g,x,b]);var N=s(m,E[0],E[1]);return f(function(){S.hasValue=!0,S.value=N},[N]),p(N),N},Wd}var k1;function dD(){return k1||(k1=1,Jd.exports=fD()),Jd.exports}var hD=dD();const mD=pv(hD),pD={},G1=t=>{let r;const i=new Set,a=(y,g)=>{const x=typeof y=="function"?y(r):y;if(!Object.is(x,r)){const b=r;r=g??(typeof x!="object"||x===null)?x:Object.assign({},r,x),i.forEach(E=>E(r,b))}},s=()=>r,p={setState:a,getState:s,getInitialState:()=>m,subscribe:y=>(i.add(y),()=>i.delete(y)),destroy:()=>{(pD?"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."),i.clear()}},m=r=t(a,s,p);return p},gD=t=>t?G1(t):G1,{useDebugValue:yD}=V2,{useSyncExternalStoreWithSelector:xD}=mD,vD=t=>t;function $E(t,r=vD,i){const a=xD(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return yD(a),a}const q1=(t,r)=>{const i=gD(t),a=(s,u=r)=>$E(i,s,u);return Object.assign(a,i),a},bD=(t,r)=>t?q1(t,r):q1;function Je(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[a,s]of t)if(!Object.is(s,r.get(a)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const a of t)if(!r.has(a))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const a of i)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(t[a],r[a]))return!1;return!0}var ED=gv();const sc=j.createContext(null),SD=sc.Provider,PE=zn.error001();function Ue(t,r){const i=j.useContext(sc);if(i===null)throw new Error(PE);return $E(i,t,r)}function We(){const t=j.useContext(sc);if(t===null)throw new Error(PE);return j.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Y1={display:"none"},_D={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ZE="react-flow__node-desc",QE="react-flow__edge-desc",wD="react-flow__aria-live",TD=t=>t.ariaLiveMessage,AD=t=>t.ariaLabelConfig;function ND({rfId:t}){const r=Ue(TD);return T.jsx("div",{id:`${wD}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:_D,children:r})}function CD({rfId:t,disableKeyboardA11y:r}){const i=Ue(AD);return T.jsxs(T.Fragment,{children:[T.jsx("div",{id:`${ZE}-${t}`,style:Y1,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),T.jsx("div",{id:`${QE}-${t}`,style:Y1,children:i["edge.a11yDescription.default"]}),!r&&T.jsx(ND,{rfId:t})]})}const Ci=j.forwardRef(({position:t="top-left",children:r,className:i,style:a,...s},u)=>{const f=`${t}`.split("-");return T.jsx("div",{className:dt(["react-flow__panel",i,...f]),style:a,ref:u,...s,children:r})});Ci.displayName="Panel";function RD({proOptions:t,position:r="bottom-right"}){return t?.hideAttribution?null:T.jsx(Ci,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:T.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const MD=t=>{const r=[],i=[];for(const[,a]of t.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&i.push(a);return{selectedNodes:r,selectedEdges:i}},au=t=>t.id;function DD(t,r){return Je(t.selectedNodes.map(au),r.selectedNodes.map(au))&&Je(t.selectedEdges.map(au),r.selectedEdges.map(au))}function OD({onSelectionChange:t}){const r=We(),{selectedNodes:i,selectedEdges:a}=Ue(MD,DD);return j.useEffect(()=>{const s={nodes:i,edges:a};t?.(s),r.getState().onSelectionChangeHandlers.forEach(u=>u(s))},[i,a,t]),null}const zD=t=>!!t.onSelectionChangeHandlers;function BD({onSelectionChange:t}){const r=Ue(zD);return t||r?T.jsx(OD,{onSelectionChange:t}):null}const KE=[0,0],UD={x:0,y:0,zoom:1},HD=["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"],X1=[...HD,"rfId"],LD=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),I1={translateExtent:il,nodeOrigin:KE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jD(t){const{setNodes:r,setEdges:i,setMinZoom:a,setMaxZoom:s,setTranslateExtent:u,setNodeExtent:f,reset:h,setDefaultNodesAndEdges:p}=Ue(LD,Je),m=We();j.useEffect(()=>(p(t.defaultNodes,t.defaultEdges),()=>{y.current=I1,h()}),[]);const y=j.useRef(I1);return j.useEffect(()=>{for(const g of X1){const x=t[g],b=y.current[g];x!==b&&(typeof t[g]>"u"||(g==="nodes"?r(x):g==="edges"?i(x):g==="minZoom"?a(x):g==="maxZoom"?s(x):g==="translateExtent"?u(x):g==="nodeExtent"?f(x):g==="ariaLabelConfig"?m.setState({ariaLabelConfig:E8(x)}):g==="fitView"?m.setState({fitViewQueued:x}):g==="fitViewOptions"?m.setState({fitViewOptions:x}):m.setState({[g]:x})))}y.current=t},X1.map(g=>t[g])),null}function $1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function FD(t){const[r,i]=j.useState(t==="system"?null:t);return j.useEffect(()=>{if(t!=="system"){i(t);return}const a=$1(),s=()=>i(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[t]),r!==null?r:$1()?.matches?"dark":"light"}const P1=typeof document<"u"?document:null;function sl(t=null,r={target:P1,actInsideInputWithModifier:!0}){const[i,a]=j.useState(!1),s=j.useRef(!1),u=j.useRef(new Set([])),[f,h]=j.useMemo(()=>{if(t!==null){const m=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
60
- `).replace(`
61
-
62
- `,`
63
- +`).split(`
64
- `)),y=m.reduce((g,x)=>g.concat(...x),[]);return[m,y]}return[[],[]]},[t]);return j.useEffect(()=>{const p=r?.target??P1,m=r?.actInsideInputWithModifier??!0;if(t!==null){const y=b=>{if(s.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!s.current||s.current&&!m)&&DE(b))return!1;const S=Q1(b.code,h);if(u.current.add(b[S]),Z1(f,u.current,!1)){const N=b.composedPath?.()?.[0]||b.target,w=N?.nodeName==="BUTTON"||N?.nodeName==="A";r.preventDefault!==!1&&(s.current||!w)&&b.preventDefault(),a(!0)}},g=b=>{const E=Q1(b.code,h);Z1(f,u.current,!0)?(a(!1),u.current.clear()):u.current.delete(b[E]),b.key==="Meta"&&u.current.clear(),s.current=!1},x=()=>{u.current.clear(),a(!1)};return p?.addEventListener("keydown",y),p?.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{p?.removeEventListener("keydown",y),p?.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[t,a]),i}function Z1(t,r,i){return t.filter(a=>i||a.length===r.size).some(a=>a.every(s=>r.has(s)))}function Q1(t,r){return r.includes(t)?"code":"key"}const VD=()=>{const t=We();return j.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(r,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[a,s,u],panZoom:f}=t.getState();return f?(await f.setViewport({x:r.x??a,y:r.y??s,zoom:r.zoom??u},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,a]=t.getState().transform;return{x:r,y:i,zoom:a}},setCenter:async(r,i,a)=>t.getState().setCenter(r,i,a),fitBounds:async(r,i)=>{const{width:a,height:s,minZoom:u,maxZoom:f,panZoom:h}=t.getState(),p=D0(r,a,s,u,f,i?.padding??.1);return h?(await h.setViewport(p,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:a,snapGrid:s,snapToGrid:u,domNode:f}=t.getState();if(!f)return r;const{x:h,y:p}=f.getBoundingClientRect(),m={x:r.x-h,y:r.y-p},y=i.snapGrid??s,g=i.snapToGrid??u;return vl(m,a,g,y)},flowToScreenPosition:r=>{const{transform:i,domNode:a}=t.getState();if(!a)return r;const{x:s,y:u}=a.getBoundingClientRect(),f=Hu(r,i);return{x:f.x+s,y:f.y+u}}}),[])};function JE(t,r){const i=[],a=new Map,s=[];for(const u of t)if(u.type==="add"){s.push(u);continue}else if(u.type==="remove"||u.type==="replace")a.set(u.id,[u]);else{const f=a.get(u.id);f?f.push(u):a.set(u.id,[u])}for(const u of r){const f=a.get(u.id);if(!f){i.push(u);continue}if(f[0].type==="remove")continue;if(f[0].type==="replace"){i.push({...f[0].item});continue}const h={...u};for(const p of f)kD(p,h);i.push(h)}return s.length&&s.forEach(u=>{u.index!==void 0?i.splice(u.index,0,{...u.item}):i.push({...u.item})}),i}function kD(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function WE(t,r){return JE(t,r)}function eS(t,r){return JE(t,r)}function _i(t,r){return{id:t,type:"select",selected:r}}function Mo(t,r=new Set,i=!1){const a=[];for(const[s,u]of t){const f=r.has(s);!(u.selected===void 0&&!f)&&u.selected!==f&&(i&&(u.selected=f),a.push(_i(u.id,f)))}return a}function K1({items:t=[],lookup:r}){const i=[],a=new Map(t.map(s=>[s.id,s]));for(const[s,u]of t.entries()){const f=r.get(u.id),h=f?.internals?.userNode??f;h!==void 0&&h!==u&&i.push({id:u.id,item:u,type:"replace"}),h===void 0&&i.push({item:u,type:"add",index:s})}for(const[s]of r)a.get(s)===void 0&&i.push({id:s,type:"remove"});return i}function J1(t){return{id:t.id,type:"remove"}}const W1=t=>f8(t),GD=t=>SE(t);function tS(t){return j.forwardRef(t)}const qD=typeof window<"u"?j.useLayoutEffect:j.useEffect;function ev(t){const[r,i]=j.useState(BigInt(0)),[a]=j.useState(()=>YD(()=>i(s=>s+BigInt(1))));return qD(()=>{const s=a.get();s.length&&(t(s),a.reset())},[r]),a}function YD(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const nS=j.createContext(null);function XD({children:t}){const r=We(),i=j.useCallback(h=>{const{nodes:p=[],setNodes:m,hasDefaultNodes:y,onNodesChange:g,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:E}=r.getState();let S=p;for(const w of h)S=typeof w=="function"?w(S):w;let N=K1({items:S,lookup:x});for(const w of E.values())N=w(N);y&&m(S),N.length>0?g?.(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:O,setNodes:_}=r.getState();w&&_(O)})},[]),a=ev(i),s=j.useCallback(h=>{const{edges:p=[],setEdges:m,hasDefaultEdges:y,onEdgesChange:g,edgeLookup:x}=r.getState();let b=p;for(const E of h)b=typeof E=="function"?E(b):E;y?m(b):g&&g(K1({items:b,lookup:x}))},[]),u=ev(s),f=j.useMemo(()=>({nodeQueue:a,edgeQueue:u}),[]);return T.jsx(nS.Provider,{value:f,children:t})}function ID(){const t=j.useContext(nS);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const $D=t=>!!t.panZoom;function uc(){const t=VD(),r=We(),i=ID(),a=Ue($D),s=j.useMemo(()=>{const u=g=>r.getState().nodeLookup.get(g),f=g=>{i.nodeQueue.push(g)},h=g=>{i.edgeQueue.push(g)},p=g=>{const{nodeLookup:x,nodeOrigin:b}=r.getState(),E=W1(g)?g:x.get(g.id),S=E.parentId?RE(E.position,E.measured,E.parentId,x,b):E.position,N={...E,position:S,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return Fo(N)},m=(g,x,b={replace:!1})=>{f(E=>E.map(S=>{if(S.id===g){const N=typeof x=="function"?x(S):x;return b.replace&&W1(N)?N:{...S,...N}}return S}))},y=(g,x,b={replace:!1})=>{h(E=>E.map(S=>{if(S.id===g){const N=typeof x=="function"?x(S):x;return b.replace&&GD(N)?N:{...S,...N}}return S}))};return{getNodes:()=>r.getState().nodes.map(g=>({...g})),getNode:g=>u(g)?.internals.userNode,getInternalNode:u,getEdges:()=>{const{edges:g=[]}=r.getState();return g.map(x=>({...x}))},getEdge:g=>r.getState().edgeLookup.get(g),setNodes:f,setEdges:h,addNodes:g=>{const x=Array.isArray(g)?g:[g];i.nodeQueue.push(b=>[...b,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];i.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:b}=r.getState(),[E,S,N]=b;return{nodes:g.map(w=>({...w})),edges:x.map(w=>({...w})),viewport:{x:E,y:S,zoom:N}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:b,edges:E,onNodesDelete:S,onEdgesDelete:N,triggerNodeChanges:w,triggerEdgeChanges:O,onDelete:_,onBeforeDelete:C}=r.getState(),{nodes:D,edges:z}=await g8({nodesToRemove:g,edgesToRemove:x,nodes:b,edges:E,onBeforeDelete:C}),U=z.length>0,V=D.length>0;if(U){const Y=z.map(J1);N?.(z),O(Y)}if(V){const Y=D.map(J1);S?.(D),w(Y)}return(V||U)&&_?.({nodes:D,edges:z}),{deletedNodes:D,deletedEdges:z}},getIntersectingNodes:(g,x=!0,b)=>{const E=T1(g),S=E?g:p(g),N=b!==void 0;return S?(b||r.getState().nodes).filter(w=>{const O=r.getState().nodeLookup.get(w.id);if(O&&!E&&(w.id===g.id||!O.internals.positionAbsolute))return!1;const _=Fo(N?w:O),C=al(_,S);return x&&C>0||C>=_.width*_.height||C>=S.width*S.height}):[]},isNodeIntersecting:(g,x,b=!0)=>{const S=T1(g)?g:p(g);if(!S)return!1;const N=al(S,x);return b&&N>0||N>=x.width*x.height||N>=S.width*S.height},updateNode:m,updateNodeData:(g,x,b={replace:!1})=>{m(g,E=>{const S=typeof x=="function"?x(E):x;return b.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},b)},updateEdge:y,updateEdgeData:(g,x,b={replace:!1})=>{y(g,E=>{const S=typeof x=="function"?x(E):x;return b.replace?{...E,data:S}:{...E,data:{...E.data,...S}}},b)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:b}=r.getState();return d8(g,{nodeLookup:x,nodeOrigin:b})},getHandleConnections:({type:g,id:x,nodeId:b})=>Array.from(r.getState().connectionLookup.get(`${b}-${g}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:x,nodeId:b})=>Array.from(r.getState().connectionLookup.get(`${b}${g?x?`-${g}-${x}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const x=r.getState().fitViewResolver??b8();return r.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),i.nodeQueue.push(b=>[...b]),x.promise}}},[]);return j.useMemo(()=>({...s,...t,viewportInitialized:a}),[a])}const tv=t=>t.selected,PD=typeof window<"u"?window:void 0;function ZD({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=We(),{deleteElements:a}=uc(),s=sl(t,{actInsideInputWithModifier:!1}),u=sl(r,{target:PD});j.useEffect(()=>{if(s){const{edges:f,nodes:h}=i.getState();a({nodes:h.filter(tv),edges:f.filter(tv)}),i.setState({nodesSelectionActive:!1})}},[s]),j.useEffect(()=>{i.setState({multiSelectionActive:u})},[u])}function QD(t){const r=We();j.useEffect(()=>{const i=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const a=O0(t.current);(a.height===0||a.width===0)&&r.getState().onError?.("004",zn.error004()),r.setState({width:a.width||500,height:a.height||500})};if(t.current){i(),window.addEventListener("resize",i);const a=new ResizeObserver(()=>i());return a.observe(t.current),()=>{window.removeEventListener("resize",i),a&&t.current&&a.unobserve(t.current)}}},[])}const cc={position:"absolute",width:"100%",height:"100%",top:0,left:0},KD=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function JD({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:u=Ni.Free,zoomOnDoubleClick:f=!0,panOnDrag:h=!0,defaultViewport:p,translateExtent:m,minZoom:y,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:b=!0,children:E,noWheelClassName:S,noPanClassName:N,onViewportChange:w,isControlledViewport:O,paneClickDistance:_,selectionOnDrag:C}){const D=We(),z=j.useRef(null),{userSelectionActive:U,lib:V,connectionInProgress:Y}=Ue(KD,Je),ae=sl(x),X=j.useRef();QD(z);const P=j.useCallback(re=>{w?.({x:re[0],y:re[1],zoom:re[2]}),O||D.setState({transform:re})},[w,O]);return j.useEffect(()=>{if(z.current){X.current=nD({domNode:z.current,minZoom:y,maxZoom:g,translateExtent:m,viewport:p,onDraggingChange:R=>D.setState(L=>L.paneDragging===R?L:{paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:k,onMoveStart:$}=D.getState();$?.(R,L),k?.(L)},onPanZoom:(R,L)=>{const{onViewportChange:k,onMove:$}=D.getState();$?.(R,L),k?.(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:k,onMoveEnd:$}=D.getState();$?.(R,L),k?.(L)}});const{x:re,y:B,zoom:q}=X.current.getViewport();return D.setState({panZoom:X.current,transform:[re,B,q],domNode:z.current.closest(".react-flow")}),()=>{X.current?.destroy()}}},[]),j.useEffect(()=>{X.current?.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:u,zoomOnDoubleClick:f,panOnDrag:h,zoomActivationKeyPressed:ae,preventScrolling:b,noPanClassName:N,userSelectionActive:U,noWheelClassName:S,lib:V,onTransformChange:P,connectionInProgress:Y,selectionOnDrag:C,paneClickDistance:_})},[t,r,i,a,s,u,f,h,ae,b,N,U,S,V,P,Y,C,_]),T.jsx("div",{className:"react-flow__renderer",ref:z,style:cc,children:E})}const WD=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function eO(){const{userSelectionActive:t,userSelectionRect:r}=Ue(WD,Je);return t&&r?T.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const nh=(t,r)=>i=>{i.target===r.current&&t?.(i)},tO=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function nO({isSelecting:t,selectionKeyPressed:r,selectionMode:i=ol.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:u,onSelectionStart:f,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:m,onPaneScroll:y,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:b,children:E}){const S=We(),{userSelectionActive:N,elementsSelectable:w,dragging:O,connectionInProgress:_}=Ue(tO,Je),C=w&&(t||N),D=j.useRef(null),z=j.useRef(),U=j.useRef(new Set),V=j.useRef(new Set),Y=j.useRef(!1),ae=k=>{if(Y.current||_){Y.current=!1;return}p?.(k),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},X=k=>{if(Array.isArray(a)&&a?.includes(2)){k.preventDefault();return}m?.(k)},P=y?k=>y(k):void 0,re=k=>{Y.current&&(k.stopPropagation(),Y.current=!1)},B=k=>{const{domNode:$}=S.getState();if(z.current=$?.getBoundingClientRect(),!z.current)return;const ee=k.target===D.current;if(!ee&&!!k.target.closest(".nokey")||!t||!(u&&ee||r)||k.button!==0||!k.isPrimary)return;k.target?.setPointerCapture?.(k.pointerId),Y.current=!1;const{x:J,y:te}=gn(k.nativeEvent,z.current);S.setState({userSelectionRect:{width:0,height:0,startX:J,startY:te,x:J,y:te}}),ee||(k.stopPropagation(),k.preventDefault())},q=k=>{const{userSelectionRect:$,transform:ee,nodeLookup:M,edgeLookup:F,connectionLookup:J,triggerNodeChanges:te,triggerEdgeChanges:se,defaultEdgeOptions:he,resetSelectedElements:fe}=S.getState();if(!z.current||!$)return;const{x:ue,y:me}=gn(k.nativeEvent,z.current),{startX:ne,startY:ce}=$;if(!Y.current){const Ae=r?0:s;if(Math.hypot(ue-ne,me-ce)<=Ae)return;fe(),f?.(k)}Y.current=!0;const de={startX:ne,startY:ce,x:ue<ne?ue:ne,y:me<ce?me:ce,width:Math.abs(ue-ne),height:Math.abs(me-ce)},ge=U.current,xe=V.current;U.current=new Set(M0(M,de,ee,i===ol.Partial,!0).map(Ae=>Ae.id)),V.current=new Set;const Se=he?.selectable??!0;for(const Ae of U.current){const je=J.get(Ae);if(je)for(const{edgeId:Ie}of je.values()){const wt=F.get(Ie);wt&&(wt.selectable??Se)&&V.current.add(Ie)}}if(!A1(ge,U.current)){const Ae=Mo(M,U.current,!0);te(Ae)}if(!A1(xe,V.current)){const Ae=Mo(F,V.current);se(Ae)}S.setState({userSelectionRect:de,userSelectionActive:!0,nodesSelectionActive:!1})},R=k=>{k.button===0&&(k.target?.releasePointerCapture?.(k.pointerId),!N&&k.target===D.current&&S.getState().userSelectionRect&&ae?.(k),S.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(h?.(k),S.setState({nodesSelectionActive:U.current.size>0})))},L=a===!0||Array.isArray(a)&&a.includes(0);return T.jsxs("div",{className:dt(["react-flow__pane",{draggable:L,dragging:O,selection:t}]),onClick:C?void 0:nh(ae,D),onContextMenu:nh(X,D),onWheel:nh(P,D),onPointerEnter:C?void 0:g,onPointerMove:C?q:x,onPointerUp:C?R:void 0,onPointerDownCapture:C?B:void 0,onClickCapture:C?re:void 0,onPointerLeave:b,ref:D,style:cc,children:[E,T.jsx(eO,{})]})}function Uh({id:t,store:r,unselect:i=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:u,multiSelectionActive:f,nodeLookup:h,onError:p}=r.getState(),m=h.get(t);if(!m){p?.("012",zn.error012(t));return}r.setState({nodesSelectionActive:!1}),m.selected?(i||m.selected&&f)&&(u({nodes:[m],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([t])}function rS({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:a,nodeId:s,isSelectable:u,nodeClickDistance:f}){const h=We(),[p,m]=j.useState(!1),y=j.useRef();return j.useEffect(()=>{y.current=G8({getStoreItems:()=>h.getState(),onNodeMouseDown:g=>{Uh({id:g,store:h,nodeRef:t})},onDragStart:()=>{m(!0)},onDragStop:()=>{m(!1)}})},[]),j.useEffect(()=>{if(!(r||!t.current||!y.current))return y.current.update({noDragClassName:i,handleSelector:a,domNode:t.current,isSelectable:u,nodeId:s,nodeClickDistance:f}),()=>{y.current?.destroy()}},[i,a,r,u,t,s,f]),p}const rO=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function iS(){const t=We();return j.useCallback(i=>{const{nodeExtent:a,snapToGrid:s,snapGrid:u,nodesDraggable:f,onError:h,updateNodePositions:p,nodeLookup:m,nodeOrigin:y}=t.getState(),g=new Map,x=rO(f),b=s?u[0]:5,E=s?u[1]:5,S=i.direction.x*b*i.factor,N=i.direction.y*E*i.factor;for(const[,w]of m){if(!x(w))continue;let O={x:w.internals.positionAbsolute.x+S,y:w.internals.positionAbsolute.y+N};s&&(O=xl(O,u));const{position:_,positionAbsolute:C}=wE({nodeId:w.id,nextPosition:O,nodeLookup:m,nodeExtent:a,nodeOrigin:y,onError:h});w.position=_,w.internals.positionAbsolute=C,g.set(w.id,w)}p(g)},[])}const j0=j.createContext(null),iO=j0.Provider;j0.Consumer;const oS=()=>j.useContext(j0),oO=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),aO=(t,r,i)=>a=>{const{connectionClickStartHandle:s,connectionMode:u,connection:f}=a,{fromHandle:h,toHandle:p,isValid:m}=f,y=p?.nodeId===t&&p?.id===r&&p?.type===i;return{connectingFrom:h?.nodeId===t&&h?.id===r&&h?.type===i,connectingTo:y,clickConnecting:s?.nodeId===t&&s?.id===r&&s?.type===i,isPossibleEndHandle:u===Lo.Strict?h?.type!==i:t!==h?.nodeId||r!==h?.id,connectionInProcess:!!h,clickConnectionInProcess:!!s,valid:y&&m}};function lO({type:t="source",position:r=ve.Top,isValidConnection:i,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:u=!0,id:f,onConnect:h,children:p,className:m,onMouseDown:y,onTouchStart:g,...x},b){const E=f||null,S=t==="target",N=We(),w=oS(),{connectOnClick:O,noPanClassName:_,rfId:C}=Ue(oO,Je),{connectingFrom:D,connectingTo:z,clickConnecting:U,isPossibleEndHandle:V,connectionInProcess:Y,clickConnectionInProcess:ae,valid:X}=Ue(aO(w,E,t),Je);w||N.getState().onError?.("010",zn.error010());const P=q=>{const{defaultEdgeOptions:R,onConnect:L,hasDefaultEdges:k}=N.getState(),$={...R,...q};if(k){const{edges:ee,setEdges:M}=N.getState();M(Mh($,ee))}L?.($),h?.($)},re=q=>{if(!w)return;const R=OE(q.nativeEvent);if(s&&(R&&q.button===0||!R)){const L=N.getState();Bh.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:S,handleId:E,nodeId:w,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...k)=>N.getState().onConnectEnd?.(...k),updateConnection:L.updateConnection,onConnect:P,isValidConnection:i||((...k)=>N.getState().isValidConnection?.(...k)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}R?y?.(q):g?.(q)},B=q=>{const{onClickConnectStart:R,onClickConnectEnd:L,connectionClickStartHandle:k,connectionMode:$,isValidConnection:ee,lib:M,rfId:F,nodeLookup:J,connection:te}=N.getState();if(!w||!k&&!s)return;if(!k){R?.(q.nativeEvent,{nodeId:w,handleId:E,handleType:t}),N.setState({connectionClickStartHandle:{nodeId:w,type:t,id:E}});return}const se=ME(q.target),he=i||ee,{connection:fe,isValid:ue}=Bh.isValid(q.nativeEvent,{handle:{nodeId:w,id:E,type:t},connectionMode:$,fromNodeId:k.nodeId,fromHandleId:k.id||null,fromType:k.type,isValidConnection:he,flowId:F,doc:se,lib:M,nodeLookup:J});ue&&fe&&P(fe);const me=structuredClone(te);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,L?.(q,me),N.setState({connectionClickStartHandle:null})};return T.jsx("div",{"data-handleid":E,"data-nodeid":w,"data-handlepos":r,"data-id":`${C}-${w}-${E}-${t}`,className:dt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",_,m,{source:!S,target:S,connectable:a,connectablestart:s,connectableend:u,clickconnecting:U,connectingfrom:D,connectingto:z,valid:X,connectionindicator:a&&(!Y||V)&&(Y||ae?u:s)}]),onMouseDown:re,onTouchStart:re,onClick:O?B:void 0,ref:b,...x,children:p})}const ul=j.memo(tS(lO));function sO({data:t,isConnectable:r,sourcePosition:i=ve.Bottom}){return T.jsxs(T.Fragment,{children:[t?.label,T.jsx(ul,{type:"source",position:i,isConnectable:r})]})}function uO({data:t,isConnectable:r,targetPosition:i=ve.Top,sourcePosition:a=ve.Bottom}){return T.jsxs(T.Fragment,{children:[T.jsx(ul,{type:"target",position:i,isConnectable:r}),t?.label,T.jsx(ul,{type:"source",position:a,isConnectable:r})]})}function cO(){return null}function fO({data:t,isConnectable:r,targetPosition:i=ve.Top}){return T.jsxs(T.Fragment,{children:[T.jsx(ul,{type:"target",position:i,isConnectable:r}),t?.label]})}const Lu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},nv={input:sO,default:uO,output:fO,group:cO};function dO(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const hO=t=>{const{width:r,height:i,x:a,y:s}=yl(t.nodeLookup,{filter:u=>!!u.selected});return{width:pn(r)?r:null,height:pn(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${s}px)`}};function mO({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const a=We(),{width:s,height:u,transformString:f,userSelectionActive:h}=Ue(hO,Je),p=iS(),m=j.useRef(null);j.useEffect(()=>{i||m.current?.focus({preventScroll:!0})},[i]);const y=!h&&s!==null&&u!==null;if(rS({nodeRef:m,disabled:!y}),!y)return null;const g=t?b=>{const E=a.getState().nodes.filter(S=>S.selected);t(b,E)}:void 0,x=b=>{Object.prototype.hasOwnProperty.call(Lu,b.key)&&(b.preventDefault(),p({direction:Lu[b.key],factor:b.shiftKey?4:1}))};return T.jsx("div",{className:dt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:f},children:T.jsx("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:i?void 0:-1,onKeyDown:i?void 0:x,style:{width:s,height:u}})})}const rv=typeof window<"u"?window:void 0,pO=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function aS({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:u,onPaneScroll:f,paneClickDistance:h,deleteKeyCode:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:g,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:E,panActivationKeyCode:S,zoomActivationKeyCode:N,elementsSelectable:w,zoomOnScroll:O,zoomOnPinch:_,panOnScroll:C,panOnScrollSpeed:D,panOnScrollMode:z,zoomOnDoubleClick:U,panOnDrag:V,defaultViewport:Y,translateExtent:ae,minZoom:X,maxZoom:P,preventScrolling:re,onSelectionContextMenu:B,noWheelClassName:q,noPanClassName:R,disableKeyboardA11y:L,onViewportChange:k,isControlledViewport:$}){const{nodesSelectionActive:ee,userSelectionActive:M}=Ue(pO,Je),F=sl(m,{target:rv}),J=sl(S,{target:rv}),te=J||V,se=J||C,he=y&&te!==!0,fe=F||M||he;return ZD({deleteKeyCode:p,multiSelectionKeyCode:E}),T.jsx(JD,{onPaneContextMenu:u,elementsSelectable:w,zoomOnScroll:O,zoomOnPinch:_,panOnScroll:se,panOnScrollSpeed:D,panOnScrollMode:z,zoomOnDoubleClick:U,panOnDrag:!F&&te,defaultViewport:Y,translateExtent:ae,minZoom:X,maxZoom:P,zoomActivationKeyCode:N,preventScrolling:re,noWheelClassName:q,noPanClassName:R,onViewportChange:k,isControlledViewport:$,paneClickDistance:h,selectionOnDrag:he,children:T.jsxs(nO,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:u,onPaneScroll:f,panOnDrag:te,isSelecting:!!fe,selectionMode:g,selectionKeyPressed:F,paneClickDistance:h,selectionOnDrag:he,children:[t,ee&&T.jsx(mO,{onSelectionContextMenu:B,noPanClassName:R,disableKeyboardA11y:L})]})})}aS.displayName="FlowRenderer";const gO=j.memo(aS),yO=t=>r=>t?M0(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function xO(t){return Ue(j.useCallback(yO(t),[t]),Je)}const vO=t=>t.updateNodeInternals;function bO(){const t=Ue(vO),[r]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const a=new Map;i.forEach(s=>{const u=s.target.getAttribute("data-id");a.set(u,{id:u,nodeElement:s.target,force:!0})}),t(a)}));return j.useEffect(()=>()=>{r?.disconnect()},[r]),r}function EO({node:t,nodeType:r,hasDimensions:i,resizeObserver:a}){const s=We(),u=j.useRef(null),f=j.useRef(null),h=j.useRef(t.sourcePosition),p=j.useRef(t.targetPosition),m=j.useRef(r),y=i&&!!t.internals.handleBounds;return j.useEffect(()=>{u.current&&!t.hidden&&(!y||f.current!==u.current)&&(f.current&&a?.unobserve(f.current),a?.observe(u.current),f.current=u.current)},[y,t.hidden]),j.useEffect(()=>()=>{f.current&&(a?.unobserve(f.current),f.current=null)},[]),j.useEffect(()=>{if(u.current){const g=m.current!==r,x=h.current!==t.sourcePosition,b=p.current!==t.targetPosition;(g||x||b)&&(m.current=r,h.current=t.sourcePosition,p.current=t.targetPosition,s.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),u}function SO({id:t,onClick:r,onMouseEnter:i,onMouseMove:a,onMouseLeave:s,onContextMenu:u,onDoubleClick:f,nodesDraggable:h,elementsSelectable:p,nodesConnectable:m,nodesFocusable:y,resizeObserver:g,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:E,rfId:S,nodeTypes:N,nodeClickDistance:w,onError:O}){const{node:_,internals:C,isParent:D}=Ue(ue=>{const me=ue.nodeLookup.get(t),ne=ue.parentLookup.has(t);return{node:me,internals:me.internals,isParent:ne}},Je);let z=_.type||"default",U=N?.[z]||nv[z];U===void 0&&(O?.("003",zn.error003(z)),z="default",U=N?.default||nv.default);const V=!!(_.draggable||h&&typeof _.draggable>"u"),Y=!!(_.selectable||p&&typeof _.selectable>"u"),ae=!!(_.connectable||m&&typeof _.connectable>"u"),X=!!(_.focusable||y&&typeof _.focusable>"u"),P=We(),re=CE(_),B=EO({node:_,nodeType:z,hasDimensions:re,resizeObserver:g}),q=rS({nodeRef:B,disabled:_.hidden||!V,noDragClassName:x,handleSelector:_.dragHandle,nodeId:t,isSelectable:Y,nodeClickDistance:w}),R=iS();if(_.hidden)return null;const L=hr(_),k=dO(_),$=Y||V||r||i||a||s,ee=i?ue=>i(ue,{...C.userNode}):void 0,M=a?ue=>a(ue,{...C.userNode}):void 0,F=s?ue=>s(ue,{...C.userNode}):void 0,J=u?ue=>u(ue,{...C.userNode}):void 0,te=f?ue=>f(ue,{...C.userNode}):void 0,se=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:ne}=P.getState();Y&&(!me||!V||ne>0)&&Uh({id:t,store:P,nodeRef:B}),r&&r(ue,{...C.userNode})},he=ue=>{if(!(DE(ue.nativeEvent)||E)){if(xE.includes(ue.key)&&Y){const me=ue.key==="Escape";Uh({id:t,store:P,unselect:me,nodeRef:B})}else if(V&&_.selected&&Object.prototype.hasOwnProperty.call(Lu,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=P.getState();P.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),R({direction:Lu[ue.key],factor:ue.shiftKey?4:1})}}},fe=()=>{if(E||!B.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:ne,autoPanOnNodeFocus:ce,setCenter:de}=P.getState();if(!ce)return;M0(new Map([[t,_]]),{x:0,y:0,width:me,height:ne},ue,!0).length>0||de(_.position.x+L.width/2,_.position.y+L.height/2,{zoom:ue[2]})};return T.jsx("div",{className:dt(["react-flow__node",`react-flow__node-${z}`,{[b]:V},_.className,{selected:_.selected,selectable:Y,parent:D,draggable:V,dragging:q}]),ref:B,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:re?"visible":"hidden",..._.style,...k},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:ee,onMouseMove:M,onMouseLeave:F,onContextMenu:J,onClick:se,onDoubleClick:te,onKeyDown:X?he:void 0,tabIndex:X?0:void 0,onFocus:X?fe:void 0,role:_.ariaRole??(X?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${ZE}-${S}`,"aria-label":_.ariaLabel,..._.domAttributes,children:T.jsx(iO,{value:t,children:T.jsx(U,{id:t,data:_.data,type:z,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:_.selected??!1,selectable:Y,draggable:V,deletable:_.deletable??!0,isConnectable:ae,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:q,dragHandle:_.dragHandle,zIndex:C.z,parentId:_.parentId,...L})})})}var _O=j.memo(SO);const wO=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function lS(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,onError:u}=Ue(wO,Je),f=xO(t.onlyRenderVisibleElements),h=bO();return T.jsx("div",{className:"react-flow__nodes",style:cc,children:f.map(p=>T.jsx(_O,{id:p,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:t.nodeClickDistance,onError:u},p))})}lS.displayName="NodeRenderer";const TO=j.memo(lS);function AO(t){return Ue(j.useCallback(i=>{if(!t)return i.edges.map(s=>s.id);const a=[];if(i.width&&i.height)for(const s of i.edges){const u=i.nodeLookup.get(s.source),f=i.nodeLookup.get(s.target);u&&f&&w8({sourceNode:u,targetNode:f,width:i.width,height:i.height,transform:i.transform})&&a.push(s.id)}return a},[t]),Je)}const NO=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return T.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},CO=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return T.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},iv={[Bu.Arrow]:NO,[Bu.ArrowClosed]:CO};function RO(t){const r=We();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(iv,t)?iv[t]:(r.getState().onError?.("009",zn.error009(t)),null),[t])}const MO=({id:t,type:r,color:i,width:a=12.5,height:s=12.5,markerUnits:u="strokeWidth",strokeWidth:f,orient:h="auto-start-reverse"})=>{const p=RO(r);return p?T.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:h,refX:"0",refY:"0",children:T.jsx(p,{color:i,strokeWidth:f})}):null},sS=({defaultColor:t,rfId:r})=>{const i=Ue(u=>u.edges),a=Ue(u=>u.defaultEdgeOptions),s=j.useMemo(()=>D8(i,{id:r,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[i,a,r,t]);return s.length?T.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:T.jsx("defs",{children:s.map(u=>T.jsx(MO,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};sS.displayName="MarkerDefinitions";var DO=j.memo(sS);function uS({x:t,y:r,label:i,labelStyle:a,labelShowBg:s=!0,labelBgStyle:u,labelBgPadding:f=[2,4],labelBgBorderRadius:h=2,children:p,className:m,...y}){const[g,x]=j.useState({x:1,y:0,width:0,height:0}),b=dt(["react-flow__edge-textwrapper",m]),E=j.useRef(null);return j.useEffect(()=>{if(E.current){const S=E.current.getBBox();x({x:S.x,y:S.y,width:S.width,height:S.height})}},[i]),i?T.jsxs("g",{transform:`translate(${t-g.width/2} ${r-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...y,children:[s&&T.jsx("rect",{width:g.width+2*f[0],x:-f[0],y:-f[1],height:g.height+2*f[1],className:"react-flow__edge-textbg",style:u,rx:h,ry:h}),T.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:a,children:i}),p]}):null}uS.displayName="EdgeText";const OO=j.memo(uS);function bl({path:t,labelX:r,labelY:i,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,interactionWidth:m=20,...y}){return T.jsxs(T.Fragment,{children:[T.jsx("path",{...y,d:t,fill:"none",className:dt(["react-flow__edge-path",y.className])}),m?T.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}):null,a&&pn(r)&&pn(i)?T.jsx(OO,{x:r,y:i,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p}):null]})}function ov({pos:t,x1:r,y1:i,x2:a,y2:s}){return t===ve.Left||t===ve.Right?[.5*(r+a),i]:[r,.5*(i+s)]}function F0({sourceX:t,sourceY:r,sourcePosition:i=ve.Bottom,targetX:a,targetY:s,targetPosition:u=ve.Top}){const[f,h]=ov({pos:i,x1:t,y1:r,x2:a,y2:s}),[p,m]=ov({pos:u,x1:a,y1:s,x2:t,y2:r}),[y,g,x,b]=zE({sourceX:t,sourceY:r,targetX:a,targetY:s,sourceControlX:f,sourceControlY:h,targetControlX:p,targetControlY:m});return[`M${t},${r} C${f},${h} ${p},${m} ${a},${s}`,y,g,x,b]}function cS(t){return j.memo(({id:r,sourceX:i,sourceY:a,targetX:s,targetY:u,sourcePosition:f,targetPosition:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:N,interactionWidth:w})=>{const[O,_,C]=F0({sourceX:i,sourceY:a,sourcePosition:f,targetX:s,targetY:u,targetPosition:h}),D=t.isInternal?void 0:r;return T.jsx(bl,{id:D,path:O,labelX:_,labelY:C,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:N,interactionWidth:w})})}const zO=cS({isInternal:!1}),fS=cS({isInternal:!0});zO.displayName="SimpleBezierEdge";fS.displayName="SimpleBezierEdgeInternal";function dS(t){return j.memo(({id:r,sourceX:i,sourceY:a,targetX:s,targetY:u,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,sourcePosition:b=ve.Bottom,targetPosition:E=ve.Top,markerEnd:S,markerStart:N,pathOptions:w,interactionWidth:O})=>{const[_,C,D]=Dh({sourceX:i,sourceY:a,sourcePosition:b,targetX:s,targetY:u,targetPosition:E,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),z=t.isInternal?void 0:r;return T.jsx(bl,{id:z,path:_,labelX:C,labelY:D,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:S,markerStart:N,interactionWidth:O})})}const hS=dS({isInternal:!1}),mS=dS({isInternal:!0});hS.displayName="SmoothStepEdge";mS.displayName="SmoothStepEdgeInternal";function pS(t){return j.memo(({id:r,...i})=>{const a=t.isInternal?void 0:r;return T.jsx(hS,{...i,id:a,pathOptions:j.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const BO=pS({isInternal:!1}),gS=pS({isInternal:!0});BO.displayName="StepEdge";gS.displayName="StepEdgeInternal";function yS(t){return j.memo(({id:r,sourceX:i,sourceY:a,targetX:s,targetY:u,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:b,markerStart:E,interactionWidth:S})=>{const[N,w,O]=UE({sourceX:i,sourceY:a,targetX:s,targetY:u}),_=t.isInternal?void 0:r;return T.jsx(bl,{id:_,path:N,labelX:w,labelY:O,label:f,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:b,markerStart:E,interactionWidth:S})})}const UO=yS({isInternal:!1}),xS=yS({isInternal:!0});UO.displayName="StraightEdge";xS.displayName="StraightEdgeInternal";function vS(t){return j.memo(({id:r,sourceX:i,sourceY:a,targetX:s,targetY:u,sourcePosition:f=ve.Bottom,targetPosition:h=ve.Top,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:N,pathOptions:w,interactionWidth:O})=>{const[_,C,D]=ac({sourceX:i,sourceY:a,sourcePosition:f,targetX:s,targetY:u,targetPosition:h,curvature:w?.curvature}),z=t.isInternal?void 0:r;return T.jsx(bl,{id:z,path:_,labelX:C,labelY:D,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:E,markerEnd:S,markerStart:N,interactionWidth:O})})}const HO=vS({isInternal:!1}),bS=vS({isInternal:!0});HO.displayName="BezierEdge";bS.displayName="BezierEdgeInternal";const av={default:bS,straight:xS,step:gS,smoothstep:mS,simplebezier:fS},lv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},LO=(t,r,i)=>i===ve.Left?t-r:i===ve.Right?t+r:t,jO=(t,r,i)=>i===ve.Top?t-r:i===ve.Bottom?t+r:t,sv="react-flow__edgeupdater";function uv({position:t,centerX:r,centerY:i,radius:a=10,onMouseDown:s,onMouseEnter:u,onMouseOut:f,type:h}){return T.jsx("circle",{onMouseDown:s,onMouseEnter:u,onMouseOut:f,className:dt([sv,`${sv}-${h}`]),cx:LO(r,a,t),cy:jO(i,a,t),r:a,stroke:"transparent",fill:"transparent"})}function FO({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:a,sourceY:s,targetX:u,targetY:f,sourcePosition:h,targetPosition:p,onReconnect:m,onReconnectStart:y,onReconnectEnd:g,setReconnecting:x,setUpdateHover:b}){const E=We(),S=(C,D)=>{if(C.button!==0)return;const{autoPanOnConnect:z,domNode:U,connectionMode:V,connectionRadius:Y,lib:ae,onConnectStart:X,cancelConnection:P,nodeLookup:re,rfId:B,panBy:q,updateConnection:R}=E.getState(),L=D.type==="target",k=(M,F)=>{x(!1),g?.(M,i,D.type,F)},$=M=>m?.(i,M),ee=(M,F)=>{x(!0),y?.(C,i,D.type),X?.(M,F)};Bh.onPointerDown(C.nativeEvent,{autoPanOnConnect:z,connectionMode:V,connectionRadius:Y,domNode:U,handleId:D.id,nodeId:D.nodeId,nodeLookup:re,isTarget:L,edgeUpdaterType:D.type,lib:ae,flowId:B,cancelConnection:P,panBy:q,isValidConnection:(...M)=>E.getState().isValidConnection?.(...M)??!0,onConnect:$,onConnectStart:ee,onConnectEnd:(...M)=>E.getState().onConnectEnd?.(...M),onReconnectEnd:k,updateConnection:R,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},N=C=>S(C,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),w=C=>S(C,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),O=()=>b(!0),_=()=>b(!1);return T.jsxs(T.Fragment,{children:[(t===!0||t==="source")&&T.jsx(uv,{position:h,centerX:a,centerY:s,radius:r,onMouseDown:N,onMouseEnter:O,onMouseOut:_,type:"source"}),(t===!0||t==="target")&&T.jsx(uv,{position:p,centerX:u,centerY:f,radius:r,onMouseDown:w,onMouseEnter:O,onMouseOut:_,type:"target"})]})}function VO({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:a,onClick:s,onDoubleClick:u,onContextMenu:f,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,reconnectRadius:y,onReconnect:g,onReconnectStart:x,onReconnectEnd:b,rfId:E,edgeTypes:S,noPanClassName:N,onError:w,disableKeyboardA11y:O}){let _=Ue(de=>de.edgeLookup.get(t));const C=Ue(de=>de.defaultEdgeOptions);_=C?{...C,..._}:_;let D=_.type||"default",z=S?.[D]||av[D];z===void 0&&(w?.("011",zn.error011(D)),D="default",z=S?.default||av.default);const U=!!(_.focusable||r&&typeof _.focusable>"u"),V=typeof g<"u"&&(_.reconnectable||i&&typeof _.reconnectable>"u"),Y=!!(_.selectable||a&&typeof _.selectable>"u"),ae=j.useRef(null),[X,P]=j.useState(!1),[re,B]=j.useState(!1),q=We(),{zIndex:R,sourceX:L,sourceY:k,targetX:$,targetY:ee,sourcePosition:M,targetPosition:F}=Ue(j.useCallback(de=>{const ge=de.nodeLookup.get(_.source),xe=de.nodeLookup.get(_.target);if(!ge||!xe)return{zIndex:_.zIndex,...lv};const Se=M8({id:t,sourceNode:ge,targetNode:xe,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:de.connectionMode,onError:w});return{zIndex:_8({selected:_.selected,zIndex:_.zIndex,sourceNode:ge,targetNode:xe,elevateOnSelect:de.elevateEdgesOnSelect,zIndexMode:de.zIndexMode}),...Se||lv}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),Je),J=j.useMemo(()=>_.markerStart?`url('#${Oh(_.markerStart,E)}')`:void 0,[_.markerStart,E]),te=j.useMemo(()=>_.markerEnd?`url('#${Oh(_.markerEnd,E)}')`:void 0,[_.markerEnd,E]);if(_.hidden||L===null||k===null||$===null||ee===null)return null;const se=de=>{const{addSelectedEdges:ge,unselectNodesAndEdges:xe,multiSelectionActive:Se}=q.getState();Y&&(q.setState({nodesSelectionActive:!1}),_.selected&&Se?(xe({nodes:[],edges:[_]}),ae.current?.blur()):ge([t])),s&&s(de,_)},he=u?de=>{u(de,{..._})}:void 0,fe=f?de=>{f(de,{..._})}:void 0,ue=h?de=>{h(de,{..._})}:void 0,me=p?de=>{p(de,{..._})}:void 0,ne=m?de=>{m(de,{..._})}:void 0,ce=de=>{if(!O&&xE.includes(de.key)&&Y){const{unselectNodesAndEdges:ge,addSelectedEdges:xe}=q.getState();de.key==="Escape"?(ae.current?.blur(),ge({edges:[_]})):xe([t])}};return T.jsx("svg",{style:{zIndex:R},children:T.jsxs("g",{className:dt(["react-flow__edge",`react-flow__edge-${D}`,_.className,N,{selected:_.selected,animated:_.animated,inactive:!Y&&!s,updating:X,selectable:Y}]),onClick:se,onDoubleClick:he,onContextMenu:fe,onMouseEnter:ue,onMouseMove:me,onMouseLeave:ne,onKeyDown:U?ce:void 0,tabIndex:U?0:void 0,role:_.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":U?`${QE}-${E}`:void 0,ref:ae,..._.domAttributes,children:[!re&&T.jsx(z,{id:t,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:Y,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:L,sourceY:k,targetX:$,targetY:ee,sourcePosition:M,targetPosition:F,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:J,markerEnd:te,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),V&&T.jsx(FO,{edge:_,isReconnectable:V,reconnectRadius:y,onReconnect:g,onReconnectStart:x,onReconnectEnd:b,sourceX:L,sourceY:k,targetX:$,targetY:ee,sourcePosition:M,targetPosition:F,setUpdateHover:P,setReconnecting:B})]})})}var kO=j.memo(VO);const GO=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function ES({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:a,noPanClassName:s,onReconnect:u,onEdgeContextMenu:f,onEdgeMouseEnter:h,onEdgeMouseMove:p,onEdgeMouseLeave:m,onEdgeClick:y,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:E,disableKeyboardA11y:S}){const{edgesFocusable:N,edgesReconnectable:w,elementsSelectable:O,onError:_}=Ue(GO,Je),C=AO(r);return T.jsxs("div",{className:"react-flow__edges",children:[T.jsx(DO,{defaultColor:t,rfId:i}),C.map(D=>T.jsx(kO,{id:D,edgesFocusable:N,edgesReconnectable:w,elementsSelectable:O,noPanClassName:s,onReconnect:u,onContextMenu:f,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,onClick:y,reconnectRadius:g,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:E,rfId:i,onError:_,edgeTypes:a,disableKeyboardA11y:S},D))]})}ES.displayName="EdgeRenderer";const qO=j.memo(ES),YO=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function XO({children:t}){const r=Ue(YO);return T.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function IO(t){const r=uc(),i=j.useRef(!1);j.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const $O=t=>t.panZoom?.syncViewport;function PO(t){const r=Ue($O),i=We();return j.useEffect(()=>{t&&(r?.(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function ZO(t){return t.connection.inProgress?{...t.connection,to:vl(t.connection.to,t.transform)}:{...t.connection}}function QO(t){return ZO}function KO(t){const r=QO();return Ue(r,Je)}const JO=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function WO({containerStyle:t,style:r,type:i,component:a}){const{nodesConnectable:s,width:u,height:f,isValid:h,inProgress:p}=Ue(JO,Je);return!(u&&s&&p)?null:T.jsx("svg",{style:t,width:u,height:f,className:"react-flow__connectionline react-flow__container",children:T.jsx("g",{className:dt(["react-flow__connection",EE(h)]),children:T.jsx(SS,{style:r,type:i,CustomComponent:a,isValid:h})})})}const SS=({style:t,type:r=Xr.Bezier,CustomComponent:i,isValid:a})=>{const{inProgress:s,from:u,fromNode:f,fromHandle:h,fromPosition:p,to:m,toNode:y,toHandle:g,toPosition:x,pointer:b}=KO();if(!s)return;if(i)return T.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:f,fromHandle:h,fromX:u.x,fromY:u.y,toX:m.x,toY:m.y,fromPosition:p,toPosition:x,connectionStatus:EE(a),toNode:y,toHandle:g,pointer:b});let E="";const S={sourceX:u.x,sourceY:u.y,sourcePosition:p,targetX:m.x,targetY:m.y,targetPosition:x};switch(r){case Xr.Bezier:[E]=ac(S);break;case Xr.SimpleBezier:[E]=F0(S);break;case Xr.Step:[E]=Dh({...S,borderRadius:0});break;case Xr.SmoothStep:[E]=Dh(S);break;default:[E]=UE(S)}return T.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};SS.displayName="ConnectionLine";const e6={};function cv(t=e6){j.useRef(t),We(),j.useEffect(()=>{},[t])}function t6(){We(),j.useRef(!1),j.useEffect(()=>{},[])}function _S({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:u,onEdgeDoubleClick:f,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:y,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:b,connectionLineType:E,connectionLineStyle:S,connectionLineComponent:N,connectionLineContainerStyle:w,selectionKeyCode:O,selectionOnDrag:_,selectionMode:C,multiSelectionKeyCode:D,panActivationKeyCode:z,zoomActivationKeyCode:U,deleteKeyCode:V,onlyRenderVisibleElements:Y,elementsSelectable:ae,defaultViewport:X,translateExtent:P,minZoom:re,maxZoom:B,preventScrolling:q,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:k,panOnScroll:$,panOnScrollSpeed:ee,panOnScrollMode:M,zoomOnDoubleClick:F,panOnDrag:J,onPaneClick:te,onPaneMouseEnter:se,onPaneMouseMove:he,onPaneMouseLeave:fe,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:ne,nodeClickDistance:ce,onEdgeContextMenu:de,onEdgeMouseEnter:ge,onEdgeMouseMove:xe,onEdgeMouseLeave:Se,reconnectRadius:Ae,onReconnect:je,onReconnectStart:Ie,onReconnectEnd:wt,noDragClassName:Tt,noWheelClassName:vn,noPanClassName:jn,disableKeyboardA11y:Fn,nodeExtent:$e,rfId:bn,viewport:an,onViewportChange:En}){return cv(t),cv(r),t6(),IO(i),PO(an),T.jsx(gO,{onPaneClick:te,onPaneMouseEnter:se,onPaneMouseMove:he,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:ne,deleteKeyCode:V,selectionKeyCode:O,selectionOnDrag:_,selectionMode:C,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:D,panActivationKeyCode:z,zoomActivationKeyCode:U,elementsSelectable:ae,zoomOnScroll:L,zoomOnPinch:k,zoomOnDoubleClick:F,panOnScroll:$,panOnScrollSpeed:ee,panOnScrollMode:M,panOnDrag:J,defaultViewport:X,translateExtent:P,minZoom:re,maxZoom:B,onSelectionContextMenu:g,preventScrolling:q,noDragClassName:Tt,noWheelClassName:vn,noPanClassName:jn,disableKeyboardA11y:Fn,onViewportChange:En,isControlledViewport:!!an,children:T.jsxs(XO,{children:[T.jsx(qO,{edgeTypes:r,onEdgeClick:s,onEdgeDoubleClick:f,onReconnect:je,onReconnectStart:Ie,onReconnectEnd:wt,onlyRenderVisibleElements:Y,onEdgeContextMenu:de,onEdgeMouseEnter:ge,onEdgeMouseMove:xe,onEdgeMouseLeave:Se,reconnectRadius:Ae,defaultMarkerColor:R,noPanClassName:jn,disableKeyboardA11y:Fn,rfId:bn}),T.jsx(WO,{style:S,type:E,component:N,containerStyle:w}),T.jsx("div",{className:"react-flow__edgelabel-renderer"}),T.jsx(TO,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:y,nodeClickDistance:ce,onlyRenderVisibleElements:Y,noPanClassName:jn,noDragClassName:Tt,disableKeyboardA11y:Fn,nodeExtent:$e,rfId:bn}),T.jsx("div",{className:"react-flow__viewport-portal"})]})})}_S.displayName="GraphView";const n6=j.memo(_S),fv=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:p=.5,maxZoom:m=2,nodeOrigin:y,nodeExtent:g,zIndexMode:x="basic"}={})=>{const b=new Map,E=new Map,S=new Map,N=new Map,w=a??r??[],O=i??t??[],_=y??[0,0],C=g??il;jE(S,N,w);const D=zh(O,b,E,{nodeOrigin:_,nodeExtent:C,zIndexMode:x});let z=[0,0,1];if(f&&s&&u){const U=yl(b,{filter:X=>!!((X.width||X.initialWidth)&&(X.height||X.initialHeight))}),{x:V,y:Y,zoom:ae}=D0(U,s,u,p,m,h?.padding??.1);z=[V,Y,ae]}return{rfId:"1",width:s??0,height:u??0,transform:z,nodes:O,nodesInitialized:D,nodeLookup:b,parentLookup:E,edges:w,edgeLookup:N,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:p,maxZoom:m,translateExtent:il,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Lo.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:f??!1,fitViewOptions:h,fitViewResolver:null,connection:{...bE},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:y8,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:vE,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},r6=({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:y,nodeExtent:g,zIndexMode:x})=>bD((b,E)=>{async function S(){const{nodeLookup:N,panZoom:w,fitViewOptions:O,fitViewResolver:_,width:C,height:D,minZoom:z,maxZoom:U}=E();w&&(await p8({nodes:N,width:C,height:D,panZoom:w,minZoom:z,maxZoom:U},O),_?.resolve(!0),b({fitViewResolver:null}))}return{...fv({nodes:t,edges:r,width:s,height:u,fitView:f,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:y,nodeExtent:g,defaultNodes:i,defaultEdges:a,zIndexMode:x}),setNodes:N=>{const{nodeLookup:w,parentLookup:O,nodeOrigin:_,elevateNodesOnSelect:C,fitViewQueued:D,zIndexMode:z}=E(),U=zh(N,w,O,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:z});D&&U?(S(),b({nodes:N,nodesInitialized:U,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:N,nodesInitialized:U})},setEdges:N=>{const{connectionLookup:w,edgeLookup:O}=E();jE(w,O,N),b({edges:N})},setDefaultNodesAndEdges:(N,w)=>{if(N){const{setNodes:O}=E();O(N),b({hasDefaultNodes:!0})}if(w){const{setEdges:O}=E();O(w),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:w,nodeLookup:O,parentLookup:_,domNode:C,nodeOrigin:D,nodeExtent:z,debug:U,fitViewQueued:V,zIndexMode:Y}=E(),{changes:ae,updatedInternals:X}=j8(N,O,_,C,D,z,Y);X&&(B8(O,_,{nodeOrigin:D,nodeExtent:z,zIndexMode:Y}),V?(S(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),ae?.length>0&&(U&&console.log("React Flow: trigger node changes",ae),w?.(ae)))},updateNodePositions:(N,w=!1)=>{const O=[];let _=[];const{nodeLookup:C,triggerNodeChanges:D,connection:z,updateConnection:U,onNodesChangeMiddlewareMap:V}=E();for(const[Y,ae]of N){const X=C.get(Y),P=!!(X?.expandParent&&X?.parentId&&ae?.position),re={id:Y,type:"position",position:P?{x:Math.max(0,ae.position.x),y:Math.max(0,ae.position.y)}:ae.position,dragging:w};if(X&&z.inProgress&&z.fromNode.id===X.id){const B=zi(X,z.fromHandle,ve.Left,!0);U({...z,from:B})}P&&X.parentId&&O.push({id:Y,parentId:X.parentId,rect:{...ae.internals.positionAbsolute,width:ae.measured.width??0,height:ae.measured.height??0}}),_.push(re)}if(O.length>0){const{parentLookup:Y,nodeOrigin:ae}=E(),X=L0(O,C,Y,ae);_.push(...X)}for(const Y of V.values())_=Y(_);D(_)},triggerNodeChanges:N=>{const{onNodesChange:w,setNodes:O,nodes:_,hasDefaultNodes:C,debug:D}=E();if(N?.length){if(C){const z=WE(N,_);O(z)}D&&console.log("React Flow: trigger node changes",N),w?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:w,setEdges:O,edges:_,hasDefaultEdges:C,debug:D}=E();if(N?.length){if(C){const z=eS(N,_);O(z)}D&&console.log("React Flow: trigger edge changes",N),w?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:w,edgeLookup:O,nodeLookup:_,triggerNodeChanges:C,triggerEdgeChanges:D}=E();if(w){const z=N.map(U=>_i(U,!0));C(z);return}C(Mo(_,new Set([...N]),!0)),D(Mo(O))},addSelectedEdges:N=>{const{multiSelectionActive:w,edgeLookup:O,nodeLookup:_,triggerNodeChanges:C,triggerEdgeChanges:D}=E();if(w){const z=N.map(U=>_i(U,!0));D(z);return}D(Mo(O,new Set([...N]))),C(Mo(_,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:w}={})=>{const{edges:O,nodes:_,nodeLookup:C,triggerNodeChanges:D,triggerEdgeChanges:z}=E(),U=N||_,V=w||O,Y=[];for(const X of U){if(!X.selected)continue;const P=C.get(X.id);P&&(P.selected=!1),Y.push(_i(X.id,!1))}const ae=[];for(const X of V)X.selected&&ae.push(_i(X.id,!1));D(Y),z(ae)},setMinZoom:N=>{const{panZoom:w,maxZoom:O}=E();w?.setScaleExtent([N,O]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:w,minZoom:O}=E();w?.setScaleExtent([O,N]),b({maxZoom:N})},setTranslateExtent:N=>{E().panZoom?.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:w,triggerNodeChanges:O,triggerEdgeChanges:_,elementsSelectable:C}=E();if(!C)return;const D=w.reduce((U,V)=>V.selected?[...U,_i(V.id,!1)]:U,[]),z=N.reduce((U,V)=>V.selected?[...U,_i(V.id,!1)]:U,[]);O(D),_(z)},setNodeExtent:N=>{const{nodes:w,nodeLookup:O,parentLookup:_,nodeOrigin:C,elevateNodesOnSelect:D,nodeExtent:z,zIndexMode:U}=E();N[0][0]===z[0][0]&&N[0][1]===z[0][1]&&N[1][0]===z[1][0]&&N[1][1]===z[1][1]||(zh(w,O,_,{nodeOrigin:C,nodeExtent:N,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:U}),b({nodeExtent:N}))},panBy:N=>{const{transform:w,width:O,height:_,panZoom:C,translateExtent:D}=E();return F8({delta:N,panZoom:C,transform:w,translateExtent:D,width:O,height:_})},setCenter:async(N,w,O)=>{const{width:_,height:C,maxZoom:D,panZoom:z}=E();if(!z)return Promise.resolve(!1);const U=typeof O?.zoom<"u"?O.zoom:D;return await z.setViewport({x:_/2-N*U,y:C/2-w*U,zoom:U},{duration:O?.duration,ease:O?.ease,interpolate:O?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...bE}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...fv()})}},Object.is);function wS({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:a,initialWidth:s,initialHeight:u,initialMinZoom:f,initialMaxZoom:h,initialFitViewOptions:p,fitView:m,nodeOrigin:y,nodeExtent:g,zIndexMode:x,children:b}){const[E]=j.useState(()=>r6({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,width:s,height:u,fitView:m,minZoom:f,maxZoom:h,fitViewOptions:p,nodeOrigin:y,nodeExtent:g,zIndexMode:x}));return T.jsx(SD,{value:E,children:T.jsx(XD,{children:b})})}function i6({children:t,nodes:r,edges:i,defaultNodes:a,defaultEdges:s,width:u,height:f,fitView:h,fitViewOptions:p,minZoom:m,maxZoom:y,nodeOrigin:g,nodeExtent:x,zIndexMode:b}){return j.useContext(sc)?T.jsx(T.Fragment,{children:t}):T.jsx(wS,{initialNodes:r,initialEdges:i,defaultNodes:a,defaultEdges:s,initialWidth:u,initialHeight:f,fitView:h,initialFitViewOptions:p,initialMinZoom:m,initialMaxZoom:y,nodeOrigin:g,nodeExtent:x,zIndexMode:b,children:t})}const o6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function a6({nodes:t,edges:r,defaultNodes:i,defaultEdges:a,className:s,nodeTypes:u,edgeTypes:f,onNodeClick:h,onEdgeClick:p,onInit:m,onMove:y,onMoveStart:g,onMoveEnd:x,onConnect:b,onConnectStart:E,onConnectEnd:S,onClickConnectStart:N,onClickConnectEnd:w,onNodeMouseEnter:O,onNodeMouseMove:_,onNodeMouseLeave:C,onNodeContextMenu:D,onNodeDoubleClick:z,onNodeDragStart:U,onNodeDrag:V,onNodeDragStop:Y,onNodesDelete:ae,onEdgesDelete:X,onDelete:P,onSelectionChange:re,onSelectionDragStart:B,onSelectionDrag:q,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:k,onSelectionEnd:$,onBeforeDelete:ee,connectionMode:M,connectionLineType:F=Xr.Bezier,connectionLineStyle:J,connectionLineComponent:te,connectionLineContainerStyle:se,deleteKeyCode:he="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:ue=!1,selectionMode:me=ol.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:ce=ll()?"Meta":"Control",zoomActivationKeyCode:de=ll()?"Meta":"Control",snapToGrid:ge,snapGrid:xe,onlyRenderVisibleElements:Se=!1,selectNodesOnDrag:Ae,nodesDraggable:je,autoPanOnNodeFocus:Ie,nodesConnectable:wt,nodesFocusable:Tt,nodeOrigin:vn=KE,edgesFocusable:jn,edgesReconnectable:Fn,elementsSelectable:$e=!0,defaultViewport:bn=UD,minZoom:an=.5,maxZoom:En=2,translateExtent:Vn=il,preventScrolling:dc=!0,nodeExtent:Hi,defaultMarkerColor:hc="#b1b1b7",zoomOnScroll:mc=!0,zoomOnPinch:Wr=!0,panOnScroll:At=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:Nt=Ni.Free,zoomOnDoubleClick:pc=!0,panOnDrag:gc=!0,onPaneClick:yc,onPaneMouseEnter:Li,onPaneMouseMove:ji,onPaneMouseLeave:Fi,onPaneScroll:kn,onPaneContextMenu:Vi,paneClickDistance:ei=1,nodeClickDistance:xc=0,children:Sl,onReconnect:Yo,onReconnectStart:ti,onReconnectEnd:vc,onEdgeContextMenu:_l,onEdgeDoubleClick:wl,onEdgeMouseEnter:Tl,onEdgeMouseMove:Xo,onEdgeMouseLeave:Io,reconnectRadius:Al=10,onNodesChange:Nl,onEdgesChange:_n,noDragClassName:ht="nodrag",noWheelClassName:Et="nowheel",noPanClassName:Gn="nopan",fitView:ki,fitViewOptions:Cl,connectOnClick:bc,attributionPosition:Rl,proOptions:ni,defaultEdgeOptions:$o,elevateNodesOnSelect:mr=!0,elevateEdgesOnSelect:pr=!1,disableKeyboardA11y:gr=!1,autoPanOnConnect:yr,autoPanOnNodeDrag:ot,autoPanSpeed:Ml,connectionRadius:Dl,isValidConnection:qn,onError:xr,style:Ec,id:Po,nodeDragThreshold:Ol,connectionDragThreshold:Sc,viewport:Gi,onViewportChange:qi,width:ln,height:Dt,colorMode:zl="light",debug:_c,onScroll:Yi,ariaLabelConfig:Bl,zIndexMode:ri="basic",...wc},Ot){const ii=Po||"1",Ul=FD(zl),Zo=j.useCallback(Yn=>{Yn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yi?.(Yn)},[Yi]);return T.jsx("div",{"data-testid":"rf__wrapper",...wc,onScroll:Zo,style:{...Ec,...o6},ref:Ot,className:dt(["react-flow",s,Ul]),id:Po,role:"application",children:T.jsxs(i6,{nodes:t,edges:r,width:ln,height:Dt,fitView:ki,fitViewOptions:Cl,minZoom:an,maxZoom:En,nodeOrigin:vn,nodeExtent:Hi,zIndexMode:ri,children:[T.jsx(n6,{onInit:m,onNodeClick:h,onEdgeClick:p,onNodeMouseEnter:O,onNodeMouseMove:_,onNodeMouseLeave:C,onNodeContextMenu:D,onNodeDoubleClick:z,nodeTypes:u,edgeTypes:f,connectionLineType:F,connectionLineStyle:J,connectionLineComponent:te,connectionLineContainerStyle:se,selectionKeyCode:fe,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:he,multiSelectionKeyCode:ce,panActivationKeyCode:ne,zoomActivationKeyCode:de,onlyRenderVisibleElements:Se,defaultViewport:bn,translateExtent:Vn,minZoom:an,maxZoom:En,preventScrolling:dc,zoomOnScroll:mc,zoomOnPinch:Wr,zoomOnDoubleClick:pc,panOnScroll:At,panOnScrollSpeed:Sn,panOnScrollMode:Nt,panOnDrag:gc,onPaneClick:yc,onPaneMouseEnter:Li,onPaneMouseMove:ji,onPaneMouseLeave:Fi,onPaneScroll:kn,onPaneContextMenu:Vi,paneClickDistance:ei,nodeClickDistance:xc,onSelectionContextMenu:L,onSelectionStart:k,onSelectionEnd:$,onReconnect:Yo,onReconnectStart:ti,onReconnectEnd:vc,onEdgeContextMenu:_l,onEdgeDoubleClick:wl,onEdgeMouseEnter:Tl,onEdgeMouseMove:Xo,onEdgeMouseLeave:Io,reconnectRadius:Al,defaultMarkerColor:hc,noDragClassName:ht,noWheelClassName:Et,noPanClassName:Gn,rfId:ii,disableKeyboardA11y:gr,nodeExtent:Hi,viewport:Gi,onViewportChange:qi}),T.jsx(jD,{nodes:t,edges:r,defaultNodes:i,defaultEdges:a,onConnect:b,onConnectStart:E,onConnectEnd:S,onClickConnectStart:N,onClickConnectEnd:w,nodesDraggable:je,autoPanOnNodeFocus:Ie,nodesConnectable:wt,nodesFocusable:Tt,edgesFocusable:jn,edgesReconnectable:Fn,elementsSelectable:$e,elevateNodesOnSelect:mr,elevateEdgesOnSelect:pr,minZoom:an,maxZoom:En,nodeExtent:Hi,onNodesChange:Nl,onEdgesChange:_n,snapToGrid:ge,snapGrid:xe,connectionMode:M,translateExtent:Vn,connectOnClick:bc,defaultEdgeOptions:$o,fitView:ki,fitViewOptions:Cl,onNodesDelete:ae,onEdgesDelete:X,onDelete:P,onNodeDragStart:U,onNodeDrag:V,onNodeDragStop:Y,onSelectionDrag:q,onSelectionDragStart:B,onSelectionDragStop:R,onMove:y,onMoveStart:g,onMoveEnd:x,noPanClassName:Gn,nodeOrigin:vn,rfId:ii,autoPanOnConnect:yr,autoPanOnNodeDrag:ot,autoPanSpeed:Ml,onError:xr,connectionRadius:Dl,isValidConnection:qn,selectNodesOnDrag:Ae,nodeDragThreshold:Ol,connectionDragThreshold:Sc,onBeforeDelete:ee,debug:_c,ariaLabelConfig:Bl,zIndexMode:ri}),T.jsx(BD,{onSelectionChange:re}),Sl,T.jsx(RD,{proOptions:ni,position:Rl}),T.jsx(CD,{rfId:ii,disableKeyboardA11y:gr})]})})}var l6=tS(a6);const s6=t=>t.domNode?.querySelector(".react-flow__edgelabel-renderer");function u6({children:t}){const r=Ue(s6);return r?ED.createPortal(t,r):null}function c6({dimensions:t,lineWidth:r,variant:i,className:a}){return T.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:dt(["react-flow__background-pattern",i,a])})}function f6({radius:t,className:r}){return T.jsx("circle",{cx:t,cy:t,r:t,className:dt(["react-flow__background-pattern","dots",r])})}var Zr;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Zr||(Zr={}));const d6={[Zr.Dots]:1,[Zr.Lines]:1,[Zr.Cross]:6},h6=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function TS({id:t,variant:r=Zr.Dots,gap:i=20,size:a,lineWidth:s=1,offset:u=0,color:f,bgColor:h,style:p,className:m,patternClassName:y}){const g=j.useRef(null),{transform:x,patternId:b}=Ue(h6,Je),E=a||d6[r],S=r===Zr.Dots,N=r===Zr.Cross,w=Array.isArray(i)?i:[i,i],O=[w[0]*x[2]||1,w[1]*x[2]||1],_=E*x[2],C=Array.isArray(u)?u:[u,u],D=N?[_,_]:O,z=[C[0]*x[2]||1+D[0]/2,C[1]*x[2]||1+D[1]/2],U=`${b}${t||""}`;return T.jsxs("svg",{className:dt(["react-flow__background",m]),style:{...p,...cc,"--xy-background-color-props":h,"--xy-background-pattern-color-props":f},ref:g,"data-testid":"rf__background",children:[T.jsx("pattern",{id:U,x:x[0]%O[0],y:x[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${z[0]},-${z[1]})`,children:S?T.jsx(f6,{radius:_/2,className:y}):T.jsx(c6,{dimensions:D,lineWidth:s,variant:r,className:y})}),T.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}TS.displayName="Background";j.memo(TS);function m6(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:T.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function p6(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:T.jsx("path",{d:"M0 0h32v4.2H0z"})})}function g6(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:T.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 y6(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.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 x6(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.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 lu({children:t,className:r,...i}){return T.jsx("button",{type:"button",className:dt(["react-flow__controls-button",r]),...i,children:t})}const v6=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function AS({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:u,onZoomOut:f,onFitView:h,onInteractiveChange:p,className:m,children:y,position:g="bottom-left",orientation:x="vertical","aria-label":b}){const E=We(),{isInteractive:S,minZoomReached:N,maxZoomReached:w,ariaLabelConfig:O}=Ue(v6,Je),{zoomIn:_,zoomOut:C,fitView:D}=uc(),z=()=>{_(),u?.()},U=()=>{C(),f?.()},V=()=>{D(s),h?.()},Y=()=>{E.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),p?.(!S)},ae=x==="horizontal"?"horizontal":"vertical";return T.jsxs(Ci,{className:dt(["react-flow__controls",ae,m]),position:g,style:t,"data-testid":"rf__controls","aria-label":b??O["controls.ariaLabel"],children:[r&&T.jsxs(T.Fragment,{children:[T.jsx(lu,{onClick:z,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:w,children:T.jsx(m6,{})}),T.jsx(lu,{onClick:U,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:N,children:T.jsx(p6,{})})]}),i&&T.jsx(lu,{className:"react-flow__controls-fitview",onClick:V,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:T.jsx(g6,{})}),a&&T.jsx(lu,{className:"react-flow__controls-interactive",onClick:Y,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:S?T.jsx(x6,{}):T.jsx(y6,{})}),y]})}AS.displayName="Controls";const b6=j.memo(AS);function E6({id:t,x:r,y:i,width:a,height:s,style:u,color:f,strokeColor:h,strokeWidth:p,className:m,borderRadius:y,shapeRendering:g,selected:x,onClick:b}){const{background:E,backgroundColor:S}=u||{},N=f||E||S;return T.jsx("rect",{className:dt(["react-flow__minimap-node",{selected:x},m]),x:r,y:i,rx:y,ry:y,width:a,height:s,style:{fill:N,stroke:h,strokeWidth:p},shapeRendering:g,onClick:b?w=>b(w,t):void 0})}const S6=j.memo(E6),_6=t=>t.nodes.map(r=>r.id),rh=t=>t instanceof Function?t:()=>t;function w6({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:u=S6,onClick:f}){const h=Ue(_6,Je),p=rh(r),m=rh(t),y=rh(i),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.jsx(T.Fragment,{children:h.map(x=>T.jsx(A6,{id:x,nodeColorFunc:p,nodeStrokeColorFunc:m,nodeClassNameFunc:y,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:u,onClick:f,shapeRendering:g},x))})}function T6({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:u,shapeRendering:f,NodeComponent:h,onClick:p}){const{node:m,x:y,y:g,width:x,height:b}=Ue(E=>{const S=E.nodeLookup.get(t);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const N=S.internals.userNode,{x:w,y:O}=S.internals.positionAbsolute,{width:_,height:C}=hr(N);return{node:N,x:w,y:O,width:_,height:C}},Je);return!m||m.hidden||!CE(m)?null:T.jsx(h,{x:y,y:g,width:x,height:b,style:m.style,selected:!!m.selected,className:a(m),color:r(m),borderRadius:s,strokeColor:i(m),strokeWidth:u,shapeRendering:f,onClick:p,id:m.id})}const A6=j.memo(T6);var N6=j.memo(w6);const C6=200,R6=150,M6=t=>!t.hidden,D6=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?NE(yl(t.nodeLookup,{filter:M6}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},O6="react-flow__minimap-desc";function NS({style:t,className:r,nodeStrokeColor:i,nodeColor:a,nodeClassName:s="",nodeBorderRadius:u=5,nodeStrokeWidth:f,nodeComponent:h,bgColor:p,maskColor:m,maskStrokeColor:y,maskStrokeWidth:g,position:x="bottom-right",onClick:b,onNodeClick:E,pannable:S=!1,zoomable:N=!1,ariaLabel:w,inversePan:O,zoomStep:_=1,offsetScale:C=5}){const D=We(),z=j.useRef(null),{boundingRect:U,viewBB:V,rfId:Y,panZoom:ae,translateExtent:X,flowWidth:P,flowHeight:re,ariaLabelConfig:B}=Ue(D6,Je),q=t?.width??C6,R=t?.height??R6,L=U.width/q,k=U.height/R,$=Math.max(L,k),ee=$*q,M=$*R,F=C*$,J=U.x-(ee-U.width)/2-F,te=U.y-(M-U.height)/2-F,se=ee+F*2,he=M+F*2,fe=`${O6}-${Y}`,ue=j.useRef(0),me=j.useRef();ue.current=$,j.useEffect(()=>{if(z.current&&ae)return me.current=P8({domNode:z.current,panZoom:ae,getTransform:()=>D.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[ae]),j.useEffect(()=>{me.current?.update({translateExtent:X,width:P,height:re,inversePan:O,pannable:S,zoomStep:_,zoomable:N})},[S,N,O,_,X,P,re]);const ne=b?ge=>{const[xe,Se]=me.current?.pointer(ge)||[0,0];b(ge,{x:xe,y:Se})}:void 0,ce=E?j.useCallback((ge,xe)=>{const Se=D.getState().nodeLookup.get(xe).internals.userNode;E(ge,Se)},[]):void 0,de=w??B["minimap.ariaLabel"];return T.jsx(Ci,{position:x,style:{...t,"--xy-minimap-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*$:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof f=="number"?f:void 0},className:dt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:T.jsxs("svg",{width:q,height:R,viewBox:`${J} ${te} ${se} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:z,onClick:ne,children:[de&&T.jsx("title",{id:fe,children:de}),T.jsx(N6,{onClick:ce,nodeColor:a,nodeStrokeColor:i,nodeBorderRadius:u,nodeClassName:s,nodeStrokeWidth:f,nodeComponent:h}),T.jsx("path",{className:"react-flow__minimap-mask",d:`M${J-F},${te-F}h${se+F*2}v${he+F*2}h${-se-F*2}z
65
- M${V.x},${V.y}h${V.width}v${V.height}h${-V.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}NS.displayName="MiniMap";j.memo(NS);const z6=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,B6={[ko.Line]:"right",[ko.Handle]:"bottom-right"};function U6({nodeId:t,position:r,variant:i=ko.Handle,className:a,style:s=void 0,children:u,color:f,minWidth:h=10,minHeight:p=10,maxWidth:m=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:b=!0,shouldResize:E,onResizeStart:S,onResize:N,onResizeEnd:w}){const O=oS(),_=typeof t=="string"?t:O,C=We(),D=j.useRef(null),z=i===ko.Handle,U=Ue(j.useCallback(z6(z&&b),[z,b]),Je),V=j.useRef(null),Y=r??B6[i];j.useEffect(()=>{if(!(!D.current||!_))return V.current||(V.current=sD({domNode:D.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:X,transform:P,snapGrid:re,snapToGrid:B,nodeOrigin:q,domNode:R}=C.getState();return{nodeLookup:X,transform:P,snapGrid:re,snapToGrid:B,nodeOrigin:q,paneDomNode:R}},onChange:(X,P)=>{const{triggerNodeChanges:re,nodeLookup:B,parentLookup:q,nodeOrigin:R}=C.getState(),L=[],k={x:X.x,y:X.y},$=B.get(_);if($&&$.expandParent&&$.parentId){const ee=$.origin??R,M=X.width??$.measured.width??0,F=X.height??$.measured.height??0,J={id:$.id,parentId:$.parentId,rect:{width:M,height:F,...RE({x:X.x??$.position.x,y:X.y??$.position.y},{width:M,height:F},$.parentId,B,ee)}},te=L0([J],B,q,R);L.push(...te),k.x=X.x?Math.max(ee[0]*M,X.x):void 0,k.y=X.y?Math.max(ee[1]*F,X.y):void 0}if(k.x!==void 0&&k.y!==void 0){const ee={id:_,type:"position",position:{...k}};L.push(ee)}if(X.width!==void 0&&X.height!==void 0){const M={id:_,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:X.width,height:X.height}};L.push(M)}for(const ee of P){const M={...ee,type:"position"};L.push(M)}re(L)},onEnd:({width:X,height:P})=>{const re={id:_,type:"dimensions",resizing:!1,dimensions:{width:X,height:P}};C.getState().triggerNodeChanges([re])}})),V.current.update({controlPosition:Y,boundaries:{minWidth:h,minHeight:p,maxWidth:m,maxHeight:y},keepAspectRatio:g,resizeDirection:x,onResizeStart:S,onResize:N,onResizeEnd:w,shouldResize:E}),()=>{V.current?.destroy()}},[Y,h,p,m,y,g,S,N,w,E]);const ae=Y.split("-");return T.jsx("div",{className:dt(["react-flow__resize-control","nodrag",...ae,i,a]),ref:D,style:{...s,scale:U,...f&&{[z?"backgroundColor":"borderColor"]:f}},children:u})}j.memo(U6);const dv=16,hv=({id:t,type:r,position:i})=>{const a=r==="source";let s;return a?s="bg-neutral-300 text-neutral-500 hover:border-neutral-500 hover:text-neutral-800 bg-[#78A3C4]":s="bg-neutral-300",T.jsx(ul,{id:t,type:r,position:i,style:{background:"none",border:"none",width:dv,height:dv},children:T.jsx("div",{className:`absolute inset-0 rounded-full flex items-center justify-center text-xs font-mono leading-none pointer-events-none transition-colors ${s}`})})},Bn=({value:t,min:r=-1/0,max:i=1/0,step:a=.01,label:s,onChange:u})=>{const f=j.useRef(!1),h=j.useRef(0),p=j.useRef(0),[m,y]=j.useState(!1),[g,x]=j.useState(""),b=j.useRef(null),E=j.useRef(null),S=D=>Math.min(i,Math.max(r,D)),N=j.useCallback(D=>{m||(f.current=!0,h.current=D.clientX,p.current=t,D.preventDefault())},[t,m]);j.useEffect(()=>{const D=U=>{if(!f.current)return;const V=(U.clientX-h.current)*a;u(S(parseFloat((p.current+V).toFixed(6))))},z=()=>{f.current=!1};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",z),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",z)}},[a,r,i,u]);const w=()=>{x(String(t)),y(!0),setTimeout(()=>b.current?.select(),0)},O=()=>{const D=parseFloat(g);isNaN(D)||u(S(D)),y(!1)},_=D=>{m||(D.key==="Enter"||D.key===" "?(D.preventDefault(),x(String(t)),y(!0),setTimeout(()=>b.current?.select(),0)):D.key==="ArrowRight"||D.key==="ArrowUp"?(D.preventDefault(),u(S(parseFloat((t+a).toFixed(6))))):(D.key==="ArrowLeft"||D.key==="ArrowDown")&&(D.preventDefault(),u(S(parseFloat((t-a).toFixed(6))))))},C=Number.isInteger(t)?t.toFixed(1):t.toFixed(3).replace(/0+$/,"");return T.jsxs("div",{className:"flex items-center w-20 relative nodrag",children:[s&&T.jsx("span",{className:"absolute left-1 z-10 bg-neutral-200 h-4 w-4 grid place-items-center pointer-events-none rounded-sm",children:T.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 height-3 leading-0 -translate-y-0.5 translate-x-0.5 ",children:s})}),T.jsx("div",{ref:E,tabIndex:0,onMouseDown:N,onDoubleClick:w,onKeyDown:_,className:["flex items-center justify-center","rounded overflow-hidden select-none w-full h-6","focus:outline-2 focus:outline-neutral-400 focus:outline-offset-1",m?"cursor-text":"cursor-ew-resize"].join(" "),children:m?T.jsx("input",{ref:b,value:g,onChange:D=>x(D.target.value),onBlur:O,onKeyDown:D=>{D.key==="Enter"&&O(),D.key==="Escape"&&y(!1)},className:"outline-none text-neutral-500 text-xs font-mono border-neutral-200 pl-5 rounded-sm text-right w-full h-full bg-white"}):T.jsx("span",{className:"text-xs font-mono text-neutral-500 pl-5 pointer-events-none border-neutral-200 bg-white rounded-sm w-full h-full flex items-center justify-end px-1",children:T.jsx("p",{children:C})})})]})},El=j.createContext({currentTime:{current:0},mousePosition:{current:[0,0]},shaders:[],patches:{},showStats:!1,openExportNodeId:null,setOpenExportNodeId:()=>{},openPreviewNodeId:null,setOpenPreviewNodeId:()=>{},uniforms:{current:{}},handleUpdateUniforms:()=>{},handleUpdateNode:t=>t,handleInsertShader:()=>{}}),ih=t=>Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0"),oh=t=>parseInt(t,16)/255,CS=([t,r,i])=>`#${ih(t)}${ih(r)}${ih(i)}`,RS=t=>[oh(t.slice(1,3)),oh(t.slice(3,5)),oh(t.slice(5,7))],V0=({color:t,onChange:r})=>{const i=j.useRef(null);return T.jsxs("div",{className:"relative",children:[T.jsx("button",{onClick:()=>i.current?.click(),className:"w-8 h-5.5 rounded border-2 border-neutral-200 cursor-pointer",style:{backgroundColor:t},title:t}),T.jsx("input",{ref:i,type:"color",value:t,onChange:a=>r(a.target.value),className:"absolute opacity-0 w-0 h-0 pointer-events-none"})]})},Ui=({onClick:t})=>T.jsx("button",{onClick:t,className:"w-6 h-6 flex items-center justify-center text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-sm select-none shrink-0",title:"Reset to default",children:"↺"}),H6=({name:t,type:r})=>{const{showStats:i}=j.useContext(El);return T.jsxs("div",{className:" min-w-40 flex flex-col gap-0.5 items-end",children:[T.jsx("span",{className:"font-mono text-xs text-neutral-900",children:t.replace("u_","").replaceAll("_"," ").replace(/\b\w/g,a=>a.toUpperCase())}),i&&T.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:r})]})},L6=({field:t,initialValue:r,handleUpdateUniformField:i})=>{const[a,s]=j.useState(r??t.default??0),u=f=>{s(f),i(f)};return T.jsxs("div",{className:"flex items-center ",children:[T.jsx(Bn,{value:a,min:t.min,max:t.max,step:.01,onChange:u}),t.default!==void 0&&T.jsx(Ui,{onClick:()=>u(t.default)})]})},j6=({field:t,initialValue:r,handleUpdateUniformField:i})=>{const[a,s]=j.useState(r??t.default??[0,0]),u=(f,h)=>{const p=[...a];p[f]=h,s(p),i(p)};return T.jsxs("div",{className:"flex items-center ",children:[T.jsx("div",{className:"flex gap-2 flex-wrap flex-col",children:["x","y"].map((f,h)=>T.jsx(Bn,{label:f,value:a[h],onChange:p=>u(h,p)},f))}),t.default!==void 0&&T.jsx(Ui,{onClick:()=>{s(t.default),i(t.default)}})]})},F6=({field:t,initialValue:r,handleUpdateUniformField:i})=>{const[a,s]=j.useState(r??t.default??[1,1,1]),u=f=>{s(f),i(f)};return T.jsxs("div",{className:"flex items-center ",children:[T.jsx(V0,{color:CS(a),onChange:f=>u(RS(f))}),t.default!==void 0&&T.jsx(Ui,{onClick:()=>u(t.default)})]})},V6=({field:t,initialValue:r,handleUpdateUniformField:i})=>{const[a,s]=j.useState(r??t.default??[1,1,1,1]),[u,f,h,p]=a,m=y=>{s(y),i(y)};return T.jsxs("div",{className:"flex items-center ",children:[T.jsx(V0,{color:CS([u,f,h]),onChange:y=>{const[g,x,b]=RS(y);m([g,x,b,p])}}),T.jsx(Bn,{label:"a",value:p,min:0,max:1,step:.01,onChange:y=>m([u,f,h,y])}),t.default!==void 0&&T.jsx(Ui,{onClick:()=>m(t.default)})]})},k6=({field:t,initialValue:r,handleUpdateUniformField:i})=>{const[a,s]=j.useState(r??t.default??[0,0,0]),u=(f,h)=>{const p=[...a];p[f]=h,s(p),i(p)};return T.jsxs("div",{className:"flex items-center ",children:[T.jsx("div",{className:"flex flex-col gap-2",children:["x","y","z"].map((f,h)=>T.jsx(Bn,{label:f,value:a[h],onChange:p=>u(h,p)},f))}),t.default!==void 0&&T.jsx(Ui,{onClick:()=>{s(t.default),i(t.default)}})]})},G6=({field:t,initialValue:r,handleUpdateUniformField:i})=>{const[a,s]=j.useState(r??t.default??[0,0,0,0]),u=(f,h)=>{const p=[...a];p[f]=h,s(p),i(p)};return T.jsxs("div",{className:"flex items-center gap-2 px-2",children:[T.jsx("div",{className:"flex flex-col gap-2",children:["x","y","z","w"].map((f,h)=>T.jsx(Bn,{label:f,value:a[h],onChange:p=>u(h,p)},f))}),t.default!==void 0&&T.jsx(Ui,{onClick:()=>{s(t.default),i(t.default)}})]})},q6=({handleUpdateUniformField:t})=>{const[r,i]=j.useState(!1),[a,s]=j.useState(0),u=j.useRef(0),f=j.useRef(0),h=j.useRef(0),p=j.useRef(t);p.current=t,j.useEffect(()=>{if(!r)return;f.current=Date.now();const g=()=>{const x=u.current+(Date.now()-f.current)/1e3;s(x),p.current(x),h.current=requestAnimationFrame(g)};return h.current=requestAnimationFrame(g),()=>{cancelAnimationFrame(h.current),u.current+=(Date.now()-f.current)/1e3}},[r]);const m=()=>i(g=>!g),y=()=>{i(!1),u.current=0,s(0),p.current(0)};return T.jsxs("div",{className:"flex items-center ",children:[T.jsx("button",{onClick:m,className:"text-xs font-mono text-neutral-500 bg-neutral-100 hover:bg-neutral-200 rounded-sm w-6 h-6 flex items-center justify-center select-none",title:r?"Pause":"Play",children:r?"⏸":"▶"}),T.jsxs("span",{className:"font-mono text-xs text-neutral-500 px-2 w-16 text-right tabular-nums",children:[a.toFixed(2),"s"]}),T.jsx(Ui,{onClick:y})]})},Y6=({handleUpdateUniformField:t})=>{const{mousePosition:r}=j.useContext(El),[i,a]=j.useState([0,0]),s=j.useRef(t);return s.current=t,j.useEffect(()=>{let u;const f=()=>{const h=[r.current[0],r.current[1]];a(h),s.current(h),u=requestAnimationFrame(f)};return u=requestAnimationFrame(f),()=>cancelAnimationFrame(u)},[]),T.jsx("div",{className:"flex items-center ",children:T.jsx("div",{className:"flex gap-2 flex-col",children:["x","y"].map((u,f)=>T.jsxs("div",{className:"flex items-center w-20 relative",children:[T.jsx("span",{className:"absolute left-1 z-10 bg-neutral-200 h-4 w-4 grid place-items-center pointer-events-none rounded-sm",children:T.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 leading-0 -translate-y-0.5 translate-x-0.5",children:u})}),T.jsx("span",{className:"text-xs font-mono text-neutral-500 pl-5 pointer-events-none bg-neutral-100 rounded-sm w-full h-6 flex items-center justify-end px-1 tabular-nums",children:i[f].toFixed(3)})]},u))})})},X6=({initialValue:t,handleUpdateUniformField:r})=>{const[i,a]=j.useState(!1),s=t?.src instanceof HTMLVideoElement?t.src:null,u=typeof t?.src=="string"?t.src:s?.src??null,f=s!==null,[h,p]=j.useState(u),[m,y]=j.useState(f),[g,x]=j.useState(u?u.split("/").pop()??null:null),[b,E]=j.useState(()=>s&&s.readyState>=1?[s.videoWidth,s.videoHeight]:null);j.useEffect(()=>{if(b===null){if(s){const w=()=>E([s.videoWidth,s.videoHeight]);s.readyState>=1?w():s.addEventListener("loadedmetadata",w,{once:!0})}else if(u&&!f){const w=new Image;w.onload=()=>E([w.naturalWidth,w.naturalHeight]),w.src=u}}},[]);const S=j.useRef(null),N=w=>{if(!w)return;const O=URL.createObjectURL(w),_=w.type.startsWith("video/");if(p(O),y(_),x(w.name),E(null),_){const C=document.createElement("video");C.autoplay=!0,C.muted=!0,C.loop=!0,C.playsInline=!0,C.onloadedmetadata=()=>E([C.videoWidth,C.videoHeight]),C.src=O,C.play(),r({type:"texture",src:C})}else{const C=new Image;C.onload=()=>E([C.naturalWidth,C.naturalHeight]),C.src=O,r({type:"texture",src:O})}};return j.useEffect(()=>{if(!i)return;const w=O=>{if(O.clipboardData){for(const _ of O.clipboardData.items)if(_.type.startsWith("image/")||_.type.startsWith("video/")){N(_.getAsFile());break}}};return window.addEventListener("paste",w),()=>window.removeEventListener("paste",w)},[i]),T.jsx("div",{className:"flex items-center ",children:T.jsxs("div",{className:"flex flex-col items-start gap-2",children:[T.jsx("div",{tabIndex:0,onFocus:()=>a(!0),onBlur:()=>a(!1),className:`w-32 h-32 rounded overflow-hidden flex flex-col items-center justify-center cursor-pointer select-none transition border-4 text-neutral-500 text-xs font-mono p-2 ${i?"bg-neutral-50 border-neutral-300":"bg-neutral-100 border-neutral-50"}`,children:h?m?T.jsx("video",{src:h,className:"w-full h-full object-contain",autoPlay:!0,muted:!0,loop:!0,playsInline:!0}):T.jsx("img",{src:h,className:"w-full h-full object-contain"}):i?"cmd+V":T.jsxs(T.Fragment,{children:[T.jsx("p",{children:"Paste"}),T.jsx("p",{children:"Here"})]})}),T.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[T.jsx("button",{className:"button-base",onClick:()=>S.current?.click(),children:h?"Replace":"Upload"}),g&&T.jsx("span",{className:"text-[10px] text-neutral-400 font-mono truncate max-w-32",title:g,children:g}),b&&T.jsxs("span",{className:"text-[10px] text-neutral-400 font-mono",children:[b[0],"×",b[1]]})]}),T.jsx("input",{ref:S,type:"file",accept:"image/*,video/*",className:"hidden",onChange:w=>N(w.target.files?.[0]??null)})]})})},I6=[{position:0,color:"#000000"},{position:1,color:"#ffffff"}],$6=({width:t,height:r,handleUpdateUniformField:i})=>{const a=j.useRef(i);return a.current=i,j.useEffect(()=>{a.current([t,r])},[t,r]),T.jsx("div",{className:"flex items-center ",children:T.jsx("div",{className:"flex gap-2 flex-col",children:["w","h"].map((s,u)=>T.jsxs("div",{className:"flex items-center w-20 relative",children:[T.jsx("span",{className:"absolute left-1 z-10 bg-neutral-200 h-4 w-4 grid place-items-center pointer-events-none rounded-sm",children:T.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 leading-0 -translate-y-0.5 translate-x-0.5",children:s})}),T.jsx("span",{className:"text-xs font-mono text-neutral-500 pl-5 pointer-events-none bg-neutral-100 rounded-sm w-full h-6 flex items-center justify-end px-1 tabular-nums",children:u===0?t:r})]},s))})})},P6=({initialValue:t,handleUpdateUniformField:r})=>{const[i,a]=j.useState(t?.stops??I6),s=j.useRef(null),u=j.useRef(null);j.useEffect(()=>{const g=s.current;if(!g)return;const x=g.getContext("2d");if(x){for(let b=0;b<g.width;b++)x.fillStyle=Vb(i,b/(g.width-1)),x.fillRect(b,0,1,g.height);r({type:"gradient",stops:i})}},[i]);const f=g=>x=>{x.preventDefault();const b=u.current;if(!b)return;const E=N=>{const w=b.getBoundingClientRect(),_=Math.max(0,Math.min(N.clientX-w.left,w.width))/w.width;a(C=>C.map((D,z)=>z===g?{...D,position:_}:D))},S=()=>{window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",S)};window.addEventListener("mousemove",E),window.addEventListener("mouseup",S)},h=()=>a(g=>[...g,{position:1,color:"#ffffff"}]),p=g=>{i.length<=1||a(x=>x.filter((b,E)=>E!==g))},m=(g,x)=>a(b=>b.map((E,S)=>S===g?{...E,position:x}:E)),y=(g,x)=>a(b=>b.map((E,S)=>S===g?{...E,color:x}:E));return T.jsxs("div",{className:"flex flex-col gap-3 p-2",children:[T.jsxs("div",{ref:u,className:"relative w-32 h-4 nodrag nopan",children:[T.jsx("canvas",{ref:s,width:128,height:16,className:"w-32 h-4 rounded-sm border-2 border-neutral-200"}),i.map((g,x)=>T.jsx("button",{"aria-label":`gradient stop ${x}`,className:"absolute w-4 h-4 -translate-x-1/2 -bottom-2 rounded-sm border-2 border-neutral-200 cursor-ew-resize",style:{left:`${g.position*100}%`,backgroundColor:g.color},onMouseDown:f(x)},x))]}),T.jsxs("div",{className:"flex items-center justify-between w-32",children:[T.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"STOPS"}),T.jsx("button",{onClick:h,className:"font-mono text-[10px] text-neutral-500 hover:text-neutral-800 leading-none",children:"ADD +"})]}),T.jsx("div",{className:"flex flex-col gap-1.5",children:i.map((g,x)=>T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Bn,{value:g.position,min:0,max:1,step:.01,onChange:b=>m(x,b)}),T.jsx(V0,{color:g.color,onChange:b=>y(x,b)}),i.length>1&&T.jsx("button",{onClick:()=>p(x),className:"text-xs text-neutral-400 hover:text-neutral-700 leading-none px-1","aria-label":`remove stop ${x}`,children:"×"})]},x))})]})},Z6=(t,r)=>{const i={};for(const a of t)switch(a.type){case"float":i[a.name]=a.default??0;break;case"vec2":i[a.name]=a.default??[0,0];break;case"vec3":i[a.name]=a.default??[0,0,0];break;case"vec4":i[a.name]=a.default??[0,0,0,0];break}if(r)for(const a of t)a.name in r&&(i[a.name]=r[a.name]);return i};function Q6(t){switch(t.type){case"float":return t.special==="time"?"float time":"float";case"vec2":return t.special==="mouse"?"vec2 mouse":t.special==="resolution"?"vec2 resolution":"vec2";case"vec3":return t.color?"vec3 color":"vec3";case"vec4":return t.color?"vec4 color":"vec4";case"sampler2D":return t.source==="gradient"?"sampler2D gradient":"sampler2D texture"}}const MS=({shader:t,initialUniforms:r,handleUpdateUniform:i})=>{const a=j.useMemo(()=>Bo(t),[t.source]),s=j.useMemo(()=>Z6(a,r),[a]),u=j.useRef(s);return j.useEffect(()=>{u.current={...s},i(u.current)},[s]),a.length===0?T.jsxs("p",{className:"px-2 py-3 font-mono text-xs",children:["No uniforms found."," ",T.jsxs("span",{children:["Add ",T.jsx("code",{className:"",children:"// [min, max, default]"})," comments to float uniforms."]})]}):T.jsx("div",{className:"rounded flex flex-col gap-1",children:a.map(f=>{const h=`${f.name}-${f.type}`,p=g=>{u.current[f.name]=g,i(u.current)},m=g=>{g===null?delete u.current[f.name]:u.current[f.name]=g,i(u.current)};let y=null;switch(f.type){case"float":y=f.special==="time"?T.jsx(q6,{field:f,handleUpdateUniformField:p}):T.jsx(L6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p});break;case"vec2":y=f.special==="mouse"?T.jsx(Y6,{field:f,handleUpdateUniformField:p}):f.special==="resolution"?T.jsx($6,{field:f,width:t.resolution.width,height:t.resolution.height,handleUpdateUniformField:p}):T.jsx(j6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p});break;case"vec3":y=f.color?T.jsx(F6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p}):T.jsx(k6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p});break;case"vec4":y=f.color?T.jsx(V6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p}):T.jsx(G6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p});break;case"sampler2D":f.source==="texture"?y=T.jsx(X6,{field:f,initialValue:s[f.name],handleUpdateUniformField:m}):f.source==="gradient"&&(y=T.jsx(P6,{field:f,initialValue:s[f.name],handleUpdateUniformField:p}));break}return y===null?null:T.jsxs("div",{className:"flex items-center gap-4 rounded-sm mb-1",children:[T.jsx(H6,{name:f.name,type:Q6(f)}),T.jsx("div",{className:"bg-neutral-100 p-1 rounded-md",children:y})]},h)})})},fc=({children:t,open:r,className:i,handleOpenChange:a})=>{const s=j.useRef(null),[u,f]=j.useState(r);return j.useEffect(()=>{f(!!r)},[r]),j.useEffect(()=>{s.current!==null&&(u?s.current.showModal():s.current.close()),a(u)},[u]),T.jsx("dialog",{ref:s,className:`top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-3xl h-5/6 border border-neutral-300 rounded-lg starting:opacity-0 opacity-100 transition-all transition-discrete ${u?"visible":"hidden"} ${i} nopan nodrag nowheel`,children:t})},mv="pnpm i @sequenza/lib",DS=({uniforms:t,patch:r,open:i,onOpenChange:a})=>{const s=DC(t,r),[u,f]=j.useState("idle"),[h,p]=j.useState("idle"),m=()=>{navigator.clipboard.writeText(mv),f("done"),setTimeout(()=>f("idle"),1800)},y=()=>{navigator.clipboard.writeText(s),p("done"),setTimeout(()=>p("idle"),1800)};return T.jsxs(fc,{open:i,handleOpenChange:a,className:"flex flex-col gap-4 p-6 overflow-y-auto",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("h2",{className:"text-sm font-medium text-neutral-800",children:"Integrate shader"}),T.jsx("button",{className:"button-base",onClick:()=>a(!1),children:"Close"})]}),T.jsxs("div",{className:"flex flex-col gap-1",children:[T.jsx("p",{className:"text-xs text-neutral-500",children:"Install"}),T.jsxs("div",{className:"flex items-center gap-2 bg-neutral-50 rounded py-4 px-4",children:[T.jsx("code",{className:"text-xs text-neutral-700 w-full select-all",children:mv}),T.jsx("button",{className:"button-base",onClick:m,children:u==="done"?"Copied!":"Copy"})]})]}),T.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-h-0",children:[T.jsx("p",{className:"text-xs text-neutral-500",children:"Component"}),T.jsxs("div",{className:"relative flex-1 min-h-0 bg-neutral-50 rounded",children:[T.jsx("button",{className:"absolute top-4 right-4 button-base",onClick:y,children:h==="done"?"Copied!":"Copy"}),T.jsx("textarea",{readOnly:!0,value:s,className:"w-full h-full resize-none bg-transparent text-xs text-neutral-700 font-mono p-4 pr-12 outline-none"})]})]})]})},K6=({open:t,onOpenChange:r,shader:i,patch:a,uniforms:s,nodeId:u,handleUpdateUniforms:f,handleUpdateNode:h})=>{const p=j.useRef(null),m=j.useRef(null),[y,g]=j.useState(!1),[x,b]=j.useState(null),E=(D,z)=>{const U=D.split(/\n(?=\d+: )/),V={};for(const P of U){const re=P.match(/^(\d+): ([\s\S]*)/);re&&(V[parseInt(re[1],10)]=re[2].trimEnd())}const Y=Math.max(1,z-3),ae=z+3,X=[];for(let P=Y;P<=ae;P++)V[P]!==void 0&&X.push(`${P}: ${V[P]}`);return X.join(`
66
- `)},[S,N]=j.useState({w:1,h:1}),{width:w,height:O}=i.resolution;j.useEffect(()=>{const D=m.current;if(!D)return;const z=new ResizeObserver(([U])=>{const{width:V,height:Y}=U.contentRect;N({w:V,h:Y})});return z.observe(D),()=>z.disconnect()},[]);const _=()=>{p.current?.toBlob(D=>{D&&navigator.clipboard.write([new ClipboardItem({"image/png":D})])})},C=()=>{const D=p.current?.toDataURL("image/png");if(!D)return;const z=document.createElement("a");z.href=D,z.download=`${i.name}.png`,z.click()};return T.jsxs(fc,{open:t,handleOpenChange:r,className:"flex flex-col w-full h-full",children:[T.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0",children:[T.jsx("h2",{className:"text-sm font-medium text-neutral-800",children:i.name}),T.jsx("button",{className:"button-base",onClick:()=>r(!1),children:"Close"})]}),T.jsxs("div",{className:"flex gap-16 px-6 pb-6 flex-1 min-h-0 items-center",children:[T.jsx("div",{className:"flex flex-col gap-8",children:T.jsx("div",{className:"flex flex-col gap-2",children:T.jsx(MS,{shader:i,initialUniforms:s.current[i.id],handleUpdateUniform:D=>f(i.id,D)})})}),T.jsxs("div",{className:"h-full w-full flex flex-col gap-4 ",children:[T.jsx("div",{ref:m,className:"flex bg-neutral-50 rounded w-4/5 items-center justify-center h-full",children:T.jsx(kb,{ref:p,animate:!0,width:w,height:O,patch:a,uniforms:s,className:w/O>S.w/S.h?"w-full":"h-full",onError:D=>b(D)})}),T.jsxs("div",{className:"flex flex-col gap-2 ",children:[T.jsxs("div",{className:"flex gap-1 bg-neutral-100 p-1 rounded-md w-min",children:[T.jsx(Bn,{label:"w",value:w,min:1,step:1,onChange:D=>h(u,z=>({...z,shader:{...z.shader,resolution:{width:D,height:O}}}))}),T.jsx(Bn,{label:"h",value:O,min:1,step:1,onChange:D=>h(u,z=>({...z,shader:{...z.shader,resolution:{width:w,height:D}}}))})]}),T.jsxs("div",{className:"flex gap-1 h-min w-min",children:[T.jsx("button",{className:"button-base",onClick:()=>g(!0),children:"Export"}),T.jsx(DS,{uniforms:s.current,patch:a,open:y,onOpenChange:g}),T.jsx("button",{className:"button-base",onClick:_,children:"Copy"}),T.jsx("button",{className:"button-base",onClick:C,children:"Save"})]})]})]})]}),x&&T.jsxs("div",{className:"flex flex-col gap-2 mx-6 mb-6 p-2 bg-white border-2 border-red-100 rounded-md",children:[T.jsx("p",{className:"text-white w-min text-nowrap bg-red-700 px-2 py-1 rounded text-xs",children:x.shaderName}),T.jsx("pre",{className:"text-xs text-red-600 font-mono whitespace-pre-wrap break-all",children:E(x.message,x.line)}),T.jsx("button",{className:"self-start text-xs px-2 py-1 rounded border border-red-200 bg-white text-red-600 hover:bg-red-50 cursor-pointer",onClick:()=>navigator.clipboard.writeText(x.message),children:"Copy error"})]})]})},J6=({data:t,selected:r,id:i})=>{const{patches:a,uniforms:s,handleUpdateUniforms:u,handleUpdateNode:f,showStats:h,setOpenExportNodeId:p,openPreviewNodeId:m,setOpenPreviewNodeId:y}=j.useContext(El);if(!a||a[t.shader.id]===void 0)return null;const{width:g,height:x}=t.shader.resolution,[b,E]=j.useState(null),S=j.useRef(null),[N,w]=j.useState("idle"),[O,_]=j.useState("idle"),C=()=>{S.current?.toBlob(V=>{V&&navigator.clipboard.write([new ClipboardItem({"image/png":V})])}),w("done"),setTimeout(()=>w("idle"),1800)},D=()=>{const V=S.current?.toDataURL("image/png");if(!V)return;const Y=document.createElement("a");Y.href=V,Y.download=`${t.shader.name}.png`,Y.click()},z=j.useMemo(()=>Bo(t.shader).filter(V=>V.type==="sampler2D"&&V.source==="input").map(V=>V.name),[t.shader]),U=(V,Y)=>{const ae=V.split(/\n(?=\d+: )/),X={};for(const q of ae){const R=q.match(/^(\d+): ([\s\S]*)/);R&&(X[parseInt(R[1],10)]=R[2].trimEnd())}const P=Math.max(1,Y-3),re=Y+3,B=[];for(let q=P;q<=re;q++)X[q]!==void 0&&B.push(`${q}: ${X[q]}`);return B.join(`
67
- `)};return T.jsxs("div",{className:`
68
- flex flex-col gap-4 bg-white rounded-lg p-6 relative transition-[outline] outline-neutral-200 duration-75
69
- ${r?"outline-4":"outline-0"}
70
- `,children:[T.jsx("p",{className:"text-sm w-min py-1 px-2 bg-neutral-100 rounded-lg text-neutral-500 text-nowrap",children:t.shader.name}),h&&T.jsxs(T.Fragment,{children:[T.jsxs("p",{className:"text-xs text-neutral-500 absolute -top-6",children:["ID: ",t.shader.id]}),T.jsx("p",{className:"text-xs text-neutral-500 absolute -top-10",children:t.shader.name})]}),z.map(V=>T.jsx(hv,{id:V,type:"target",position:ve.Top},V)),T.jsxs("div",{className:"flex gap-8",children:[T.jsx("div",{className:"flex flex-col gap-2",children:T.jsx(MS,{shader:t.shader,initialUniforms:s.current[t.shader.id],handleUpdateUniform:V=>{u(t.shader.id,V)}})}),T.jsxs("div",{className:"flex flex-col justify-center items-start gap-4 ",children:[T.jsxs("div",{className:"flex flex-col gap-2",children:[T.jsxs("div",{className:"relative max-w-96 group",children:[T.jsxs("div",{className:"flex absolute top-2 right-2 gap-2",children:[T.jsx("button",{className:"button-base group-hover:opacity-100 opacity-0",onClick:()=>y(i),children:"Expand"}),T.jsx(K6,{open:m===i,onOpenChange:V=>{y(V?i:null)},shader:t.shader,patch:a[t.shader.id],uniforms:s,nodeId:i,handleUpdateUniforms:u,handleUpdateNode:f}),T.jsx("button",{className:`button-base ${t.paused?"opacity-100":"group-hover:opacity-100 opacity-0"}`,onClick:()=>{f(i,V=>({...V,paused:!V.paused}))},children:t.paused?"Resume":"Pause"})]}),T.jsx(kb,{ref:S,animate:!t.paused,width:g,height:x,patch:a[t.shader.id],uniforms:s,className:"w-full h-auto",style:{maxWidth:`${g/x*24}rem`},onError:V=>{E(V)}})]}),T.jsxs("div",{className:"flex gap-1 bg-neutral-100 rounded-md p-1 w-min",children:[T.jsx(Bn,{label:"w",value:g,min:1,step:1,onChange:V=>f(i,Y=>({...Y,shader:{...Y.shader,resolution:{width:V,height:x}}}))}),T.jsx(Bn,{label:"h",value:x,min:1,step:1,onChange:V=>f(i,Y=>({...Y,shader:{...Y.shader,resolution:{width:g,height:V}}}))})]})]}),T.jsxs("div",{className:"flex gap-1",children:[T.jsx("button",{className:"button-base",onClick:()=>p(i),children:"Export"}),T.jsx("button",{className:"button-base",onClick:C,children:N==="done"?"Copied!":"Copy"}),T.jsx("button",{className:"button-base",onClick:D,children:"Save"})]})]})]}),b&&T.jsxs("div",{className:"flex flex-col gap-2 p-2 bg-white border-2 border-red-100 rounded-md relative",children:[T.jsx("p",{className:"text-white w-min text-nowrap bg-red-700 px-2 py-1 rounded text-xs",children:b.shaderName}),T.jsx("pre",{className:"text-xs text-red-600 font-mono whitespace-pre-wrap break-all",children:U(b.message,b.line)}),T.jsx("button",{className:"self-start text-xs px-2 py-1 rounded border border-red-200 bg-white text-red-600 hover:bg-red-50 cursor-pointer",onClick:()=>{navigator.clipboard.writeText(b.message),_("done"),setTimeout(()=>_("idle"),1800)},children:O==="done"?"Copied!":"Copy error"})]}),T.jsx(hv,{id:"out",type:"source",position:ve.Bottom})]})};function W6({sourceX:t,sourceY:r,targetX:i,targetY:a,sourcePosition:s,targetPosition:u,style:f={},markerEnd:h,id:p}){const[m,y,g]=ac({sourceX:t,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:u}),{shaders:x,handleInsertShader:b}=j.useContext(El),[E,S]=j.useState(!1),N=()=>{console.log("d"),S(!0)};return T.jsxs(T.Fragment,{children:[T.jsx(bl,{path:m,markerEnd:h,style:f}),T.jsx(u6,{children:T.jsxs("div",{className:"absolute -translate-1/2 origin-center pointer-events-auto",style:{transform:`translate(${y}px,${g}px)`},children:[T.jsx("button",{className:"w-6 h-6 bg-neutral-200 rounded-full active:bg-neutral-200 z-10 flex items-center justify-center",onClick:()=>N(),children:"+"}),T.jsx(fc,{open:E,handleOpenChange:w=>{S(w)},children:T.jsxs("div",{className:"w-full h-full flex flex-col p-4",children:[T.jsxs("div",{className:"w-full flex justify-between",children:[T.jsx("p",{children:"Add a Shader"}),T.jsx("button",{className:"button-base",onClick:()=>{S(!1)},children:"Close"})]}),T.jsx("div",{className:"w-full flex flex-col",children:x.map(w=>T.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>{b(w,p)},children:w.id},w.id))})]})})]})})]})}function ez({fromX:t,fromY:r,toX:i,toY:a,fromPosition:s,toPosition:u,toHandle:f}){const[h]=ac({sourceX:t,sourceY:r,sourcePosition:s,targetX:i,targetY:a,targetPosition:u}),p=f?"connect":"new",m=a-26,y=6,g=16,x=p.length*6+y*2;return T.jsxs("g",{children:[T.jsx("path",{fill:"none",stroke:"#b1b1b7",strokeWidth:1.5,d:h}),T.jsx("rect",{x:i-x/2,y:m-g/2,width:x,height:g,rx:4,fill:f?"#404040":"#e5e5e5",style:{pointerEvents:"none"}}),T.jsx("text",{x:i,y:m,textAnchor:"middle",dominantBaseline:"central",fontSize:10,fontFamily:"monospace",fill:f?"#ffffff":"#525252",style:{userSelect:"none",pointerEvents:"none"},children:p}),T.jsx("foreignObject",{x:i-8,y:a-8,width:16,height:16,style:{overflow:"visible"},children:T.jsx("div",{className:"w-4 h-4 rounded-full bg-neutral-400"})})]})}function ah(t,r,i){const a=new Map(t.map(u=>[u.id,u])),s=[i];for(;s.length>0;){const u=s.shift(),f=a.get(u);if(!f||f.type!=="shader")continue;const h=f,{width:p,height:m}=h.data.shader.resolution,y=_E(f,[...a.values()],r);for(const g of y){const x={...g,data:{...g.data,shader:{...g.data.shader,resolution:{width:p,height:m}}}};a.set(g.id,x),s.push(g.id)}}return[...a.values()]}const tz=({shaders:t,initialState:r,handleSave:i,className:a,initialShowStats:s,initialShaderPanelOpen:u,initialOpenPreviewNodeId:f,onEditorStateChange:h,onOpenPreviewNodeIdChange:p})=>{const[m,y]=j.useState(r?.edges??[]),[g,x]=j.useState(()=>{const ne=r?.nodes??[],ce=r?.edges??[],de=new Set(ce.map(Se=>Se.target)),ge=ne.filter(Se=>!de.has(Se.id)).map(Se=>Se.id);let xe=ne;for(const Se of ge)xe=ah(xe,ce,Se);return xe}),b=j.useCallback(ne=>x(ce=>WE(ne,ce)),[x]),E=j.useCallback(ne=>y(ce=>eS(ne,ce)),[y]),S=j.useCallback(ne=>{const ce=new Set,de=ge=>ce.has(ge)?!1:ge===ne.source?!0:(ce.add(ge),_E({id:ge},g,m).some(xe=>de(xe.id)));return!de(ne.target)},[g,m]),N=j.useCallback(ne=>{const ce=Mh({...ne,type:"insert"},m),de=ah(g,ce,ne.source);y(ce),x(de)},[m,g]),{screenToFlowPosition:w}=uc(),[O,_]=j.useState(null),C=j.useCallback((ne,ce)=>{if(!ce.isValid&&ce.fromNode){const{clientX:de,clientY:ge}="changedTouches"in ne?ne.changedTouches[0]:ne;_({position:w({x:de,y:ge}),sourceId:ce.fromNode.id})}},[w]),D=j.useRef(r?.uniforms??{});j.useEffect(()=>{r?.uniforms&&(D.current=r.uniforms)},[r]);const[z,U]=j.useState(null);j.useEffect(()=>{const ne=ce=>{(ce.metaKey||ce.ctrlKey)&&ce.key==="s"&&(ce.preventDefault(),i({nodes:g,edges:m,uniforms:D.current}),U(new Date))};return window.addEventListener("keydown",ne),()=>window.removeEventListener("keydown",ne)},[g,m]);const V=ne=>{const ce=`${Math.random()*1e5}`,de={...ne,id:ce};return{id:ce,position:{x:0,y:0},data:{shader:de,uniforms:D,paused:!1},type:"shader"}},Y=ne=>{x(ce=>[...ce,V(ne)])},ae=(ne,ce)=>{const de=m.find(Ie=>Ie.id===ce);if(!de)return;const ge=de.source,xe=de.target,Se=g.find(Ie=>Ie.id===ge),Ae=g.find(Ie=>Ie.id===xe),je=de.targetHandle;if(Se&&Ae&&je){const Ie=V(ne),wt=Bo(Ie.data.shader);let Tt;for(const $e of wt)if($e.type==="sampler2D"&&$e.source==="input"){Tt=$e.name;break}if(Tt===void 0)return;const[vn,jn,Fn]=F0({sourceX:Se.position.x,sourceY:Se.position.y,sourcePosition:ve.Bottom,targetX:Ae.position.x,targetY:Ae.position.y,targetPosition:ve.Top});Ie.position.x=jn,Ie.position.y=Fn,x($e=>[...$e,Ie]),y($e=>{const bn=$e.filter(Vn=>Vn.id!==ce),an={id:""+Math.random()*1e4,source:Se.id,target:Ie.id,targetHandle:Tt,type:"insert"},En={id:""+Math.random()*1e4,source:Ie.id,target:Ae.id,targetHandle:je,type:"insert"};return bn.push(an),bn.push(En),bn})}},[X,P]=j.useMemo(()=>{const ne={};for(const de of g)ne[de.id]=[];for(const de of m)ne[de.target].push({from:de.source,to:de.target,input:de.targetHandle??""});return[JSON.stringify(ne),ne]},[m,g]),[re,B]=j.useMemo(()=>{const ne={};for(const ce of g)if(ce.type==="shader"){const de=ce;ne[de.id]=de.data.shader}return[JSON.stringify(ne),ne]},[g]),q=j.useMemo(()=>{const ne={};for(const[ce,de]of Object.entries(B)){ne[ce]={shaders:[de],connections:[]};const ge=[ce];for(;ge.length!==0;){const xe=ge.shift();for(const Se of P[xe]){const Ae=Se.from;ge.push(Ae);const je=B[Ae];ne[ce].shaders.push(je),ne[ce].connections.push(Se)}}}return ne},[re,X]),R=j.useCallback((ne,ce)=>{D.current[ne]=ce},[]),L=j.useCallback((ne,ce)=>{x(de=>{const ge=de.map(xe=>{if(xe.id===ne&&xe.type==="shader"){const Se=xe;return{...Se,data:ce(Se.data)}}return xe});return ah(ge,m,ne)})},[m]),k=j.useRef(0),$=j.useRef([0,0]);j.useEffect(()=>{const ne=setInterval(()=>{k.current=Date.now()},10),ce=de=>{$.current=[Math.min(1,de.clientX/window.innerWidth),Math.min(de.clientY/innerHeight,1)]};return window.addEventListener("mousemove",ce),()=>{clearInterval(ne),window.removeEventListener("mousemove",ce)}},[]);const ee=(ne,ce,de)=>{if(g.find(xe=>xe.id===ce)){const xe=V(ne);xe.position=de;const Se=Bo(xe.data.shader);let Ae;for(const je of Se)if(je.type==="sampler2D"&&je.source==="input"){Ae=je.name;break}if(x(je=>[...je,xe]),Ae!==void 0){const je={id:""+Math.random(),source:ce,target:xe.id,targetHandle:Ae,type:"insert"};y(Ie=>Mh(je,Ie))}}},[M,F]=j.useState(s??!1),[J,te]=j.useState(u??!0),[se,he]=j.useState(null),[fe,ue]=j.useState(f??null),me=ne=>{ue(ne),p?.(ne)};return j.useEffect(()=>{h?.({showStats:M,shaderPanelOpen:J})},[M,J]),T.jsxs("div",{className:`w-full h-full ${a}`,children:[T.jsx(El.Provider,{value:{currentTime:k,mousePosition:$,shaders:t,patches:q,showStats:M,openExportNodeId:se,setOpenExportNodeId:he,openPreviewNodeId:fe,setOpenPreviewNodeId:me,uniforms:D,handleUpdateUniforms:R,handleUpdateNode:L,handleInsertShader:ae},children:T.jsxs(l6,{panOnScroll:!0,proOptions:{hideAttribution:!0},nodes:g,nodeTypes:{shader:J6},edges:m,edgeTypes:{insert:W6},onNodesChange:b,onEdgesChange:E,onConnect:N,onConnectEnd:C,connectionLineComponent:ez,isValidConnection:S,style:{background:"#F9F9F9"},fitView:!0,children:[T.jsx(b6,{style:{"--xy-controls-button-background-color-default":"transparent","--xy-controls-box-shadow-default":"none"}}),T.jsxs(Ci,{position:"top-left",className:"flex flex-col gap-4",children:[T.jsx("button",{className:"button-base",onClick:()=>F(!M),children:M?"Hide Stats":"Show Stats"}),M&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"flex flex-col gap-2",children:g.map(ne=>T.jsx("p",{className:"text-xs text-neutral-400",children:ne.id},ne.id))}),T.jsx("div",{className:"flex flex-col gap-2",children:m.map(ne=>T.jsxs("p",{className:"text-xs text-neutral-400",children:[ne.source," ",">"," ",ne.target," ",ne.targetHandle]},ne.id))})]})]}),t.length>0&&T.jsx(Ci,{position:"bottom-right",children:T.jsxs("div",{className:"w-56 flex flex-col rounded-sm bg-white overflow-hidden",children:[T.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[T.jsx("p",{className:"text-sm",children:"Add Shader"}),T.jsx("button",{className:"button-base",onClick:()=>te(!J),children:J?"Hide":"Show"})]}),J&&T.jsx("div",{className:"flex flex-col gap-1 px-2 pb-2",children:t.sort((ne,ce)=>ne.name.localeCompare(ce.name)).map(ne=>T.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>Y(ne),children:ne.id},ne.id))})]})}),z&&T.jsx(Ci,{position:"bottom-center",children:T.jsxs("p",{className:"text-xs text-neutral-400",children:["Last saved at ",z.toLocaleTimeString()]})})]})}),se!==null&&q[se]&&T.jsx(DS,{uniforms:D.current,patch:q[se],open:!0,onOpenChange:ne=>{ne||he(null)}}),T.jsx(fc,{open:O!==null,handleOpenChange:ne=>{ne===!1&&_(null)},children:T.jsxs("div",{className:"w-full h-full flex flex-col p-4",children:[T.jsxs("div",{className:"w-full flex justify-between",children:[T.jsx("p",{children:"Add a Shader"}),T.jsx("button",{className:"button-base",onClick:()=>{_(null)},children:"Close"})]}),T.jsx("div",{className:"w-full flex flex-col",children:t.map(ne=>T.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>{O&&ee(ne,O.sourceId,O.position),_(null)},children:ne.id},ne.id))})]})})]})},nz=t=>T.jsx(wS,{children:T.jsx(tz,{...t})});function rz(){const[t,r]=j.useState({}),i=j.useRef({});j.useEffect(()=>{console.log("[CONNECT]");const u=fu("http://localhost:3001");return u.on("shaders-found",f=>{const h={};for(const[p,m]of Object.entries(f))h[p]={id:p,source:m,name:p,resolution:{width:100,height:100}},i.current[p]={};r(h)}),()=>{console.log("[DISCONNECT]"),u.disconnect()}},[]);const a=j.useMemo(()=>{try{const u=JSON.parse(localStorage.getItem("sequenza-nodes")??"[]");let f=JSON.parse(localStorage.getItem("sequenza-edges")??"[]");const h=JSON.parse(localStorage.getItem("sequenza-uniforms")??"{}");for(const m of u)if(m.type==="shader"){const y=m,g=t[y.data.shader.name];if(g&&y.data.shader.source!==g?.source){const x={...g,id:y.data.shader.id};y.data.shader=x,console.log(y.data.shader.id)}}const p=new Set(u.map(m=>m.id));for(const m of Object.keys(h))p.has(m)||delete h[m];for(const m of u){if(m.type!=="shader")continue;const y=m,g=h[y.id];if(!g)continue;const x=Bo(y.data.shader),b={};for(const E of x){if(E.type==="sampler2D"&&E.source==="input")continue;const S=g[E.name];if(S!==void 0&&CC(S,E))b[E.name]=S;else{const N=RC(E);N!==void 0&&(b[E.name]=N)}}h[y.id]=b}if(f=f.filter(m=>{const y=u.find(S=>S.id===m.source),g=u.find(S=>S.id===m.target),x=m.targetHandle;if(!g||g&&g.type!=="shader")return!1;const E=Bo(g.data.shader);return!(!y||x===null||x===void 0||E.find(S=>S.name===x&&S.type==="sampler2D")===void 0)}),u!==null&&f!==null&&h!==null)return{nodes:u,edges:f,uniforms:h}}catch(u){console.error(u)}},[t]),s=Object.keys(t).length>0;return T.jsx("main",{className:"",children:T.jsx("div",{className:"w-full min-h-screen h-screen ",children:s&&T.jsx(nz,{shaders:[...Object.values(t)],initialState:a,initialShowStats:localStorage.getItem("sequenza-show-stats")==="true",initialShaderPanelOpen:localStorage.getItem("sequenza-shader-panel-open")!=="false",initialOpenPreviewNodeId:localStorage.getItem("sequenza-open-preview-node")||null,onEditorStateChange:({showStats:u,shaderPanelOpen:f})=>{localStorage.setItem("sequenza-show-stats",String(u)),localStorage.setItem("sequenza-shader-panel-open",String(f))},onOpenPreviewNodeIdChange:u=>{u?localStorage.setItem("sequenza-open-preview-node",u):localStorage.removeItem("sequenza-open-preview-node")},handleSave:({nodes:u,edges:f,uniforms:h})=>{localStorage.setItem("sequenza-nodes",JSON.stringify(u)),localStorage.setItem("sequenza-edges",JSON.stringify(f)),localStorage.setItem("sequenza-uniforms",JSON.stringify(h))}})})})}I2.createRoot(document.getElementById("root")).render(T.jsx(j.StrictMode,{children:T.jsx(rz,{})}));