@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.
- package/app/assets/index-h68uMvSO.js +757 -0
- package/app/index.html +1 -1
- package/package.json +1 -1
- package/app/assets/index-CdVswdI1.js +0 -70
|
@@ -0,0 +1,757 @@
|
|
|
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 c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function o(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=o(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 Sy;function L2(){if(Sy)return La;Sy=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(a,s,u){var c=null;if(u!==void 0&&(c=""+u),s.key!==void 0&&(c=""+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:c,ref:s!==void 0?s:null,props:u}}return La.Fragment=r,La.jsx=o,La.jsxs=o,La}var wy;function j2(){return wy||(wy=1,Md.exports=L2()),Md.exports}var A=j2(),Dd={exports:{}},Se={};var Ay;function F2(){if(Ay)return Se;Ay=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=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 _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function w(M,F,J){this.props=M,this.context=F,this.refs=C,this.updater=J||_}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 S(M,F,J){this.props=M,this.context=F,this.refs=C,this.updater=J||_}var N=S.prototype=new O;N.constructor=S,E(N,w.prototype),N.isPureReactComponent=!0;var D=Array.isArray;function z(){}var U={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function Y(M,F,J){var ne=J.ref;return{$$typeof:t,type:M,key:F,ref:ne!==void 0?ne: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 $(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?$(""+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,ne,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,ne,se)}}if(fe)return se=se(M),fe=ne===""?"."+B(M,0):ne,D(se)?(J="",fe!=null&&(J=fe.replace(re,"$&/")+"/"),R(se,F,J,"",function(ee){return ee})):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=ne===""?".":ne+":";if(D(M))for(var me=0;me<M.length;me++)ne=M[me],he=ue+B(ne,me),fe+=R(ne,F,J,he,se);else if(me=b(M),typeof me=="function")for(M=me.call(M),me=0;!(ne=M.next()).done;)ne=ne.value,he=ue+B(ne,me++),fe+=R(ne,F,J,he,se);else if(he==="object"){if(typeof M.then=="function")return R(q(M),F,J,ne,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 ne=[],se=0;return R(M,ne,"","",function(he){return F.call(J,he,se++)}),ne}function V(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 P=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)},te={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 Se.Activity=g,Se.Children=te,Se.Component=w,Se.Fragment=o,Se.Profiler=s,Se.PureComponent=S,Se.StrictMode=a,Se.Suspense=p,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Se.__COMPILER_RUNTIME={__proto__:null,c:function(M){return U.H.useMemoCache(M)}},Se.cache=function(M){return function(){return M.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(M,F,J){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ne=E({},M.props),se=M.key;if(F!=null)for(he in F.key!==void 0&&(se=""+F.key),F)!k.call(F,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&F.ref===void 0||(ne[he]=F[he]);var he=arguments.length-2;if(he===1)ne.children=J;else if(1<he){for(var fe=Array(he),ue=0;ue<he;ue++)fe[ue]=arguments[ue+2];ne.children=fe}return Y(M.type,se,ne)},Se.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:u,_context:M},M},Se.createElement=function(M,F,J){var ne,se={},he=null;if(F!=null)for(ne in F.key!==void 0&&(he=""+F.key),F)k.call(F,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(se[ne]=F[ne]);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(ne in fe=M.defaultProps,fe)se[ne]===void 0&&(se[ne]=fe[ne]);return Y(M,he,se)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(M){return{$$typeof:h,render:M}},Se.isValidElement=X,Se.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:V}},Se.memo=function(M,F){return{$$typeof:m,type:M,compare:F===void 0?null:F}},Se.startTransition=function(M){var F=U.T,J={};U.T=J;try{var ne=M(),se=U.S;se!==null&&se(J,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(z,P)}catch(he){P(he)}finally{F!==null&&J.types!==null&&(F.types=J.types),U.T=F}},Se.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Se.use=function(M){return U.H.use(M)},Se.useActionState=function(M,F,J){return U.H.useActionState(M,F,J)},Se.useCallback=function(M,F){return U.H.useCallback(M,F)},Se.useContext=function(M){return U.H.useContext(M)},Se.useDebugValue=function(){},Se.useDeferredValue=function(M,F){return U.H.useDeferredValue(M,F)},Se.useEffect=function(M,F){return U.H.useEffect(M,F)},Se.useEffectEvent=function(M){return U.H.useEffectEvent(M)},Se.useId=function(){return U.H.useId()},Se.useImperativeHandle=function(M,F,J){return U.H.useImperativeHandle(M,F,J)},Se.useInsertionEffect=function(M,F){return U.H.useInsertionEffect(M,F)},Se.useLayoutEffect=function(M,F){return U.H.useLayoutEffect(M,F)},Se.useMemo=function(M,F){return U.H.useMemo(M,F)},Se.useOptimistic=function(M,F){return U.H.useOptimistic(M,F)},Se.useReducer=function(M,F,J){return U.H.useReducer(M,F,J)},Se.useRef=function(M){return U.H.useRef(M)},Se.useState=function(M){return U.H.useState(M)},Se.useSyncExternalStore=function(M,F,J){return U.H.useSyncExternalStore(M,F,J)},Se.useTransition=function(){return U.H.useTransition()},Se.version="19.2.4",Se}var Ty;function cl(){return Ty||(Ty=1,Dd.exports=F2()),Dd.exports}var j=cl();const k2=pv(j);var Od={exports:{}},ja={},zd={exports:{}},Bd={};var Cy;function V2(){return Cy||(Cy=1,(function(t){function r(R,L){var V=R.length;R.push(L);e:for(;0<V;){var P=V-1>>>1,te=R[P];if(0<s(te,L))R[P]=L,R[V]=te,V=P;else break e}}function o(R){return R.length===0?null:R[0]}function a(R){if(R.length===0)return null;var L=R[0],V=R.pop();if(V!==L){R[0]=V;e:for(var P=0,te=R.length,M=te>>>1;P<M;){var F=2*(P+1)-1,J=R[F],ne=F+1,se=R[ne];if(0>s(J,V))ne<te&&0>s(se,J)?(R[P]=se,R[ne]=V,P=ne):(R[P]=J,R[F]=V,P=F);else if(ne<te&&0>s(se,V))R[P]=se,R[ne]=V,P=ne;else break e}}return L}function s(R,L){var V=R.sortIndex-L.sortIndex;return V!==0?V: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 c=Date,h=c.now();t.unstable_now=function(){return c.now()-h}}var p=[],m=[],y=1,g=null,x=3,b=!1,_=!1,E=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function N(R){for(var L=o(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=o(m)}}function D(R){if(E=!1,N(R),!_)if(o(p)!==null)_=!0,z||(z=!0,$());else{var L=o(m);L!==null&&q(D,L.startTime-R)}}var z=!1,U=-1,k=5,Y=-1;function ae(){return C?!0:!(t.unstable_now()-Y<k)}function X(){if(C=!1,z){var R=t.unstable_now();Y=R;var L=!0;try{e:{_=!1,E&&(E=!1,O(U),U=-1),b=!0;var V=x;try{t:{for(N(R),g=o(p);g!==null&&!(g.expirationTime>R&&ae());){var P=g.callback;if(typeof P=="function"){g.callback=null,x=g.priorityLevel;var te=P(g.expirationTime<=R);if(R=t.unstable_now(),typeof te=="function"){g.callback=te,N(R),L=!0;break t}g===o(p)&&a(p),N(R)}else a(p);g=o(p)}if(g!==null)L=!0;else{var M=o(m);M!==null&&q(D,M.startTime-R),L=!1}}break e}finally{g=null,x=V,b=!1}L=void 0}}finally{L?$():z=!1}}}var $;if(typeof S=="function")$=function(){S(X)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,B=re.port2;re.port1.onmessage=X,$=function(){B.postMessage(null)}}else $=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"):k=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 V=x;x=L;try{return R()}finally{x=V}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var V=x;x=R;try{return L()}finally{x=V}},t.unstable_scheduleCallback=function(R,L,V){var P=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?P+V:P):V=P,R){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=V+te,R={id:y++,callback:L,priorityLevel:R,startTime:V,expirationTime:te,sortIndex:-1},V>P?(R.sortIndex=V,r(m,R),o(p)===null&&R===o(m)&&(E?(O(U),U=-1):E=!0,q(D,V-P))):(R.sortIndex=te,r(p,R),_||b||(_=!0,z||(z=!0,$()))),R},t.unstable_shouldYield=ae,t.unstable_wrapCallback=function(R){var L=x;return function(){var V=x;x=L;try{return R.apply(this,arguments)}finally{x=V}}}})(Bd)),Bd}var Ny;function G2(){return Ny||(Ny=1,zd.exports=V2()),zd.exports}var Ud={exports:{}},Et={};var Ry;function q2(){if(Ry)return Et;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 o(){}var a={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},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 c=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 Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Et.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)},Et.flushSync=function(p){var m=c.T,y=a.p;try{if(c.T=null,a.p=2,p)return p()}finally{c.T=m,a.p=y,a.d.f()}},Et.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))},Et.prefetchDNS=function(p){typeof p=="string"&&a.d.D(p)},Et.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})}},Et.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)},Et.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})}},Et.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)},Et.requestFormReset=function(p){a.d.r(p)},Et.unstable_batchedUpdates=function(p,m){return p(m)},Et.useFormState=function(p,m,y){return c.H.useFormState(p,m,y)},Et.useFormStatus=function(){return c.H.useHostTransitionStatus()},Et.version="19.2.4",Et}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(),o=gv();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}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,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function c(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 i=e,l=n;;){var f=i.return;if(f===null)break;var d=f.alternate;if(d===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===i)return p(f),e;if(d===l)return p(f),n;d=d.sibling}throw Error(a(188))}if(i.return!==l.return)i=f,l=d;else{for(var v=!1,T=f.child;T;){if(T===i){v=!0,i=f,l=d;break}if(T===l){v=!0,l=f,i=d;break}T=T.sibling}if(!v){for(T=d.child;T;){if(T===i){v=!0,i=d,l=f;break}if(T===l){v=!0,l=d,i=f;break}T=T.sibling}if(!v)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?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"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),S=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function $(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 E:return"Fragment";case w:return"Profiler";case C:return"StrictMode";case D:return"Suspense";case z:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case S:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case N: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 k: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=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},P=[],te=-1;function M(e){return{current:e}}function F(e){0>te||(e.current=P[te],P[te]=null,te--)}function J(e,n){te++,P[te]=e.current,e.current=n}var ne=M(null),se=M(null),he=M(null),fe=M(null);function ue(e,n){switch(J(he,n),J(se,e),J(ne,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=Pg(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(ne),J(ne,e)}function me(){F(ne),F(se),F(he)}function ee(e){e.memoizedState!==null&&J(fe,e);var n=ne.current,i=Pg(n,e.type);n!==i&&(J(se,e),J(ne,i))}function ce(e){se.current===e&&(F(ne),F(se)),fe.current===e&&(F(fe),za._currentValue=V)}var de,ge;function xe(e){if(de===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);de=n&&n[1]||"",ge=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+de+e+ge}var Ee=!1;function Te(e,n){if(!e||Ee)return"";Ee=!0;var i=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 f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),v=d[0],T=d[1];if(v&&T){var H=v.split(`
|
|
4
|
+
`),Q=T.split(`
|
|
5
|
+
`);for(f=l=0;l<H.length&&!H[l].includes("DetermineComponentFrameRoot");)l++;for(;f<Q.length&&!Q[f].includes("DetermineComponentFrameRoot");)f++;if(l===H.length||f===Q.length)for(l=H.length-1,f=Q.length-1;1<=l&&0<=f&&H[l]!==Q[f];)f--;for(;1<=l&&0<=f;l--,f--)if(H[l]!==Q[f]){if(l!==1||f!==1)do if(l--,f--,0>f||H[l]!==Q[f]){var oe=`
|
|
6
|
+
`+H[l].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=l&&0<=f);break}}}finally{Ee=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?xe(i):""}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 Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return xe("Activity");default:return""}}function Ie(e){try{var n="",i=null;do n+=je(e,i),i=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,At=t.unstable_scheduleCallback,vn=t.unstable_cancelCallback,jn=t.unstable_shouldYield,Fn=t.unstable_requestPaint,Pe=t.unstable_now,bn=t.unstable_getCurrentPriorityLevel,an=t.unstable_ImmediatePriority,_n=t.unstable_UserBlockingPriority,kn=t.unstable_NormalPriority,dc=t.unstable_LowPriority,Lo=t.unstable_IdlePriority,hc=t.log,mc=t.unstable_setDisableYieldValue,Wr=null,Tt=null;function En(e){if(typeof hc=="function"&&mc(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Wr,e)}catch{}}var Ct=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 jo=256,Fo=262144,ko=4194304;function Vn(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 Vo(e,n,i){var l=e.pendingLanes;if(l===0)return 0;var f=0,d=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var T=l&134217727;return T!==0?(l=T&~d,l!==0?f=Vn(l):(v&=T,v!==0?f=Vn(v):i||(i=T&~e,i!==0&&(f=Vn(i))))):(T=l&~d,T!==0?f=Vn(T):v!==0?f=Vn(v):i||(i=l&~e,i!==0&&(f=Vn(i)))),f===0?0:n!==0&&n!==f&&(n&d)===0&&(d=f&-f,i=n&-n,d>=i||d===32&&(i&4194048)!==0)?n:f}function eo(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 El(){var e=ko;return ko<<=1,(ko&62914560)===0&&(ko=4194304),e}function Yi(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function to(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vc(e,n,i,l,f,d){var v=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var T=e.entanglements,H=e.expirationTimes,Q=e.hiddenUpdates;for(i=v&~i;0<i;){var oe=31-Ct(i),le=1<<oe;T[oe]=0,H[oe]=-1;var K=Q[oe];if(K!==null)for(Q[oe]=null,oe=0;oe<K.length;oe++){var W=K[oe];W!==null&&(W.lane&=-536870913)}i&=~le}l!==0&&Sl(e,l,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(v&~n))}function Sl(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var l=31-Ct(n);e.entangledLanes|=n,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function wl(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var l=31-Ct(i),f=1<<l;f&n|e[l]&n&&(e[l]|=n),i&=~f}}function Al(e,n){var i=n&-n;return i=(i&42)!==0?1:Xi(i),(i&(e.suspendedLanes|n))!==0?0:i}function Xi(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 Ii(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Tl(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:gy(e.type))}function Cl(e,n){var i=L.p;try{return L.p=e,n()}finally{L.p=i}}var Sn=Math.random().toString(36).slice(2),ht="__reactFiber$"+Sn,_t="__reactProps$"+Sn,Gn="__reactContainer$"+Sn,Go="__reactEvents$"+Sn,Nl="__reactListeners$"+Sn,bc="__reactHandles$"+Sn,Rl="__reactResources$"+Sn,no="__reactMarker$"+Sn;function Pi(e){delete e[ht],delete e[_t],delete e[Go],delete e[Nl],delete e[bc]}function mr(e){var n=e[ht];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Gn]||i[ht]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=ey(e);e!==null;){if(i=e[ht])return i;e=ey(e)}return n}e=i,i=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 it(e){e[no]=!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 _c=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]*$"),$i={},Ol={};function Ec(e){return wt.call(Ol,e)?!0:wt.call($i,e)?!1:_c.test(e)?Ol[e]=!0:($i[e]=!0,!1)}function qo(e,n,i){if(Ec(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){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,""+i)}}function Yo(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function ln(e,n,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(n,i,""+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 Sc(e,n,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,d=l.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){i=""+v,d.call(this,v)}}),Object.defineProperty(e,n,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Xo(e){if(!e._valueTracker){var n=zl(e)?"checked":"value";e._valueTracker=Sc(e,n,""+e[n])}}function Bl(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=zl(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function ro(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 oo(e,n,i,l,f,d,v,T){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?Zi(e,v,Dt(n)):i!=null?Zi(e,v,Dt(i)):l!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+Dt(T):e.removeAttribute("name")}function Ul(e,n,i,l,f,d,v,T){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||i!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){Xo(e);return}i=i!=null?""+Dt(i):"",n=n!=null?""+Dt(n):i,T||n===e.value||(e.value=n),e.defaultValue=n}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=T?e.checked:!!l,e.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),Xo(e)}function Zi(e,n,i){n==="number"&&ro(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Yn(e,n,i,l){if(e=e.options,n){n={};for(var f=0;f<i.length;f++)n["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=n.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Dt(i),n=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function V0(e,n,i){if(n!=null&&(n=""+Dt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Dt(i):""}function G0(e,n,i,l){if(n==null){if(l!=null){if(i!=null)throw Error(a(92));if(q(l)){if(1<l.length)throw Error(a(93));l=l[0]}i=l}i==null&&(i=""),n=i}i=Dt(n),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Xo(e)}function Io(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var OE=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,i){var l=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":l?e.setProperty(n,i):typeof i!="number"||i===0||OE.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function Y0(e,n,i){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var f in n)l=n[f],n.hasOwnProperty(f)&&i[f]!==l&&q0(e,f,l)}else for(var d in n)n.hasOwnProperty(d)&&q0(e,d,n[d])}function Ac(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 zE=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"]]),BE=/^[\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 BE.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Tc=null;function Cc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Po=null,$o=null;function X0(e){var n=pr(e);if(n&&(e=n.stateNode)){var i=e[_t]||null;e:switch(e=n.stateNode,n.type){case"input":if(oo(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Ot(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==e&&l.form===e.form){var f=l[_t]||null;if(!f)throw Error(a(90));oo(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<i.length;n++)l=i[n],l.form===e.form&&Bl(l)}break e;case"textarea":V0(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&Yn(e,!!i.multiple,n,!1)}}}var Nc=!1;function I0(e,n,i){if(Nc)return e(n,i);Nc=!0;try{var l=e(n);return l}finally{if(Nc=!1,(Po!==null||$o!==null)&&(Ss(),Po&&(n=Po,e=$o,$o=Po=null,X0(n),e)))for(n=0;n<e.length;n++)X0(e[n])}}function Qi(e,n){var i=e.stateNode;if(i===null)return null;var l=i[_t]||null;if(l===null)return null;i=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(i&&typeof i!="function")throw Error(a(231,n,typeof i));return i}var In=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=!1;if(In)try{var Ki={};Object.defineProperty(Ki,"passive",{get:function(){Rc=!0}}),window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{Rc=!1}var vr=null,Mc=null,Ll=null;function P0(){if(Ll)return Ll;var e,n=Mc,i=n.length,l,f="value"in vr?vr.value:vr.textContent,d=f.length;for(e=0;e<i&&n[e]===f[e];e++);var v=i-e;for(l=1;l<=v&&n[i-l]===f[d-l];l++);return Ll=f.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 $0(){return!1}function zt(e){function n(i,l,f,d,v){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(i=e[T],this[T]=i?i(d):d[T]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Fl:$0,this.isPropagationStopped=$0,this}return g(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Fl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Fl)},persist:function(){},isPersistent:Fl}),n}var io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=zt(io),Ji=g({},io,{view:0,detail:0}),UE=zt(Ji),Dc,Oc,Wi,Vl=g({},Ji,{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!==Wi&&(Wi&&e.type==="mousemove"?(Dc=e.screenX-Wi.screenX,Oc=e.screenY-Wi.screenY):Oc=Dc=0,Wi=e),Dc)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),Z0=zt(Vl),HE=g({},Vl,{dataTransfer:0}),LE=zt(HE),jE=g({},Ji,{relatedTarget:0}),zc=zt(jE),FE=g({},io,{animationName:0,elapsedTime:0,pseudoElement:0}),kE=zt(FE),VE=g({},io,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),GE=zt(VE),qE=g({},io,{data:0}),Q0=zt(qE),YE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XE={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"},IE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PE(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=IE[e])?!!n[e]:!1}function Bc(){return PE}var $E=g({},Ji,{key:function(e){if(e.key){var n=YE[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"?XE[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}}),ZE=zt($E),QE=g({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),K0=zt(QE),KE=g({},Ji,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bc}),JE=zt(KE),WE=g({},io,{propertyName:0,elapsedTime:0,pseudoElement:0}),eS=zt(WE),tS=g({},Vl,{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}),nS=zt(tS),rS=g({},io,{newState:0,oldState:0}),oS=zt(rS),iS=[9,13,27,32],Uc=In&&"CompositionEvent"in window,ea=null;In&&"documentMode"in document&&(ea=document.documentMode);var aS=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 iS.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 Zo=!1;function lS(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 sS(e,n){if(Zo)return e==="compositionend"||!Uc&&tm(e,n)?(e=P0(),Ll=Mc=vr=null,Zo=!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 uS={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"?!!uS[e.type]:n==="textarea"}function om(e,n,i,l){Po?$o?$o.push(l):$o=[l]:Po=l,n=Ms(n,"onChange"),0<n.length&&(i=new kl("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var ta=null,na=null;function cS(e){kg(e,0)}function Gl(e){var n=gr(e);if(Bl(n))return e}function im(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=[];om(n,na,e,Cc(e)),I0(cS,n)}}function fS(e,n,i){e==="focusin"?(sm(),ta=n,na=i,ta.attachEvent("onpropertychange",um)):e==="focusout"&&sm()}function dS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gl(na)}function hS(e,n){if(e==="click")return Gl(n)}function mS(e,n){if(e==="input"||e==="change")return Gl(n)}function pS(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var kt=typeof Object.is=="function"?Object.is:pS;function ra(e,n){if(kt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!wt.call(n,f)||!kt(e[f],n[f]))return!1}return!0}function cm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fm(e,n){var i=cm(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=n&&l>=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=cm(i)}}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=ro(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=ro(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 gS=In&&"documentMode"in document&&11>=document.documentMode,Qo=null,Fc=null,oa=null,kc=!1;function mm(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;kc||Qo==null||Qo!==ro(l)||(l=Qo,"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}),oa&&ra(oa,l)||(oa=l,l=Ms(Fc,"onSelect"),0<l.length&&(n=new kl("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=Qo)))}function ao(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Ko={animationend:ao("Animation","AnimationEnd"),animationiteration:ao("Animation","AnimationIteration"),animationstart:ao("Animation","AnimationStart"),transitionrun:ao("Transition","TransitionRun"),transitionstart:ao("Transition","TransitionStart"),transitioncancel:ao("Transition","TransitionCancel"),transitionend:ao("Transition","TransitionEnd")},Vc={},pm={};In&&(pm=document.createElement("div").style,"AnimationEvent"in window||(delete Ko.animationend.animation,delete Ko.animationiteration.animation,delete Ko.animationstart.animation),"TransitionEvent"in window||delete Ko.transitionend.transition);function lo(e){if(Vc[e])return Vc[e];if(!Ko[e])return e;var n=Ko[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in pm)return Vc[e]=n[i];return e}var gm=lo("animationend"),ym=lo("animationiteration"),xm=lo("animationstart"),yS=lo("transitionrun"),xS=lo("transitionstart"),vS=lo("transitioncancel"),vm=lo("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=[],Jo=0,qc=0;function Yl(){for(var e=Jo,n=qc=Jo=0;n<e;){var i=Qt[n];Qt[n++]=null;var l=Qt[n];Qt[n++]=null;var f=Qt[n];Qt[n++]=null;var d=Qt[n];if(Qt[n++]=null,l!==null&&f!==null){var v=l.pending;v===null?f.next=f:(f.next=v.next,v.next=f),l.pending=f}d!==0&&_m(i,f,d)}}function Xl(e,n,i,l){Qt[Jo++]=e,Qt[Jo++]=n,Qt[Jo++]=i,Qt[Jo++]=l,qc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Yc(e,n,i,l){return Xl(e,n,i,l),Il(e)}function so(e,n){return Xl(e,null,null,n),Il(e)}function _m(e,n,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var f=!1,d=e.return;d!==null;)d.childLanes|=i,l=d.alternate,l!==null&&(l.childLanes|=i),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&n!==null&&(f=31-Ct(i),e=d.hiddenUpdates,l=e[f],l===null?e[f]=[n]:l.push(n),n.lane=i|536870912),d):null}function Il(e){if(50<Ta)throw Ta=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 Wo={};function bS(e,n,i,l){this.tag=e,this.key=i,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 Vt(e,n,i,l){return new bS(e,n,i,l)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pn(e,n){var i=e.alternate;return i===null?(i=Vt(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Em(e,n){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Pl(e,n,i,l,f,d){var v=0;if(l=e,typeof e=="function")Xc(e)&&(v=1);else if(typeof e=="string")v=A2(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=Vt(31,i,n,f),e.elementType=Y,e.lanes=d,e;case E:return uo(i.children,f,d,n);case C:v=8,f|=24;break;case w:return e=Vt(12,i,n,f|2),e.elementType=w,e.lanes=d,e;case D:return e=Vt(13,i,n,f),e.elementType=D,e.lanes=d,e;case z:return e=Vt(19,i,n,f),e.elementType=z,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:v=10;break e;case O:v=9;break e;case N:v=11;break e;case U:v=14;break e;case k:v=16,l=null;break e}v=29,i=Error(a(130,e===null?"null":typeof e,"")),l=null}return n=Vt(v,i,n,f),n.elementType=e,n.type=l,n.lanes=d,n}function uo(e,n,i,l){return e=Vt(7,e,l,n),e.lanes=i,e}function Ic(e,n,i){return e=Vt(6,e,null,n),e.lanes=i,e}function Sm(e){var n=Vt(18,null,null,0);return n.stateNode=e,n}function Pc(e,n,i){return n=Vt(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,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 i=wm.get(e);return i!==void 0?i:(n={value:e,source:n,stack:Ie(n)},wm.set(e,n),n)}return{value:e,source:n,stack:Ie(n)}}var ei=[],ti=0,$l=null,ia=0,Jt=[],Wt=0,br=null,wn=1,An="";function $n(e,n){ei[ti++]=ia,ei[ti++]=$l,$l=e,ia=n}function Am(e,n,i){Jt[Wt++]=wn,Jt[Wt++]=An,Jt[Wt++]=br,br=e;var l=wn;e=An;var f=32-Ct(l)-1;l&=~(1<<f),i+=1;var d=32-Ct(n)+f;if(30<d){var v=f-f%5;d=(l&(1<<v)-1).toString(32),l>>=v,f-=v,wn=1<<32-Ct(n)+f|i<<f|l,An=d+e}else wn=1<<d|i<<f|l,An=e}function $c(e){e.return!==null&&($n(e,1),Am(e,1,0))}function Zc(e){for(;e===$l;)$l=ei[--ti],ei[ti]=null,ia=ei[--ti],ei[ti]=null;for(;e===br;)br=Jt[--Wt],Jt[Wt]=null,An=Jt[--Wt],Jt[Wt]=null,wn=Jt[--Wt],Jt[Wt]=null}function Tm(e,n){Jt[Wt++]=wn,Jt[Wt++]=An,Jt[Wt++]=br,wn=n.id,An=n.overflow,br=e}var yt=null,$e=null,ze=!1,_r=null,en=!1,Qc=Error(a(519));function Er(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw aa(Kt(n,e)),Qc}function Cm(e){var n=e.stateNode,i=e.type,l=e.memoizedProps;switch(n[ht]=e,n[_t]=l,i){case"dialog":Re("cancel",n),Re("close",n);break;case"iframe":case"object":case"embed":Re("load",n);break;case"video":case"audio":for(i=0;i<Na.length;i++)Re(Na[i],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)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||l.suppressHydrationWarning===!0||Yg(n.textContent,i)?(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||Er(e,!0)}function Nm(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 ni(e){if(e!==yt)return!1;if(!ze)return Nm(e),ze=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||pd(e.type,e.memoizedProps)),i=!i),i&&$e&&Er(e),Nm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));$e=Wg(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));$e=Wg(e)}else n===27?(n=$e,Hr(e.type)?(e=bd,bd=null,$e=e):$e=n):$e=yt?nn(e.stateNode.nextSibling):null;return!0}function co(){$e=yt=null,ze=!1}function Kc(){var e=_r;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),_r=null),e}function aa(e){_r===null?_r=[e]:_r.push(e)}var Jc=M(null),fo=null,Zn=null;function Sr(e,n,i){J(Jc,n._currentValue),n._currentValue=i}function Qn(e){e._currentValue=Jc.current,F(Jc)}function Wc(e,n,i){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===i)break;e=e.return}}function ef(e,n,i,l){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var v=f.child;d=d.firstContext;e:for(;d!==null;){var T=d;d=f;for(var H=0;H<n.length;H++)if(T.context===n[H]){d.lanes|=i,T=d.alternate,T!==null&&(T.lanes|=i),Wc(d.return,i,e),l||(v=null);break e}d=T.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(a(341));v.lanes|=i,d=v.alternate,d!==null&&(d.lanes|=i),Wc(v,i,e),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===e){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function ri(e,n,i,l){e=null;for(var f=n,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(a(387));if(v=v.memoizedProps,v!==null){var T=f.type;kt(f.pendingProps.value,v.value)||(e!==null?e.push(T):e=[T])}}else if(f===fe.current){if(v=f.alternate,v===null)throw Error(a(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(za):e=[za])}f=f.return}e!==null&&ef(n,e,i,l),n.flags|=262144}function Zl(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ho(e){fo=e,Zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xt(e){return Rm(fo,e)}function Ql(e,n){return fo===null&&ho(e),Rm(e,n)}function Rm(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,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 i}var _S=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},ES=t.unstable_scheduleCallback,SS=t.unstable_NormalPriority,at={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new _S,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&ES(SS,function(){e.controller.abort()})}var sa=null,nf=0,oi=0,ii=null;function wS(e,n){if(sa===null){var i=sa=[];nf=0,oi=ad(),ii={status:"pending",value:void 0,then:function(l){i.push(l)}}}return nf++,n.then(Mm,Mm),n}function Mm(){if(--nf===0&&sa!==null){ii!==null&&(ii.status="fulfilled");var e=sa;sa=null,oi=0,ii=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function AS(e,n){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){l.status="fulfilled",l.value=n;for(var f=0;f<i.length;f++)(0,i[f])(n)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var Dm=R.S;R.S=function(e,n){mg=Pe(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&wS(e,n),Dm!==null&&Dm(e,n)};var mo=M(null);function rf(){var e=mo.current;return e!==null?e:Xe.pooledCache}function Kl(e,n){n===null?J(mo,mo.current):J(mo,n.pool)}function Om(){var e=rf();return e===null?null:{parent:at._currentValue,pool:e}}var ai=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,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Xn,Xn),n=i),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 f=n;f.status="fulfilled",f.value=l}},function(l){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Hm(e),e}throw go=n,ai}}function po(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(go=i,ai):i}}var go=null;function Um(){if(go===null)throw Error(a(459));var e=go;return go=null,e}function Hm(e){if(e===ai||e===Jl)throw Error(a(483))}var li=null,ua=0;function es(e){var n=ua;return ua+=1,li===null&&(li=[]),Bm(li,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 i(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 f(I,G){return I=Pn(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 T(I,G,Z,ie){return G===null||G.tag!==6?(G=Ic(Z,I.mode,ie),G.return=I,G):(G=f(G,Z),G.return=I,G)}function H(I,G,Z,ie){var be=Z.type;return be===E?oe(I,G,Z.props.children,ie,Z.key):G!==null&&(G.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===k&&po(be)===G.type)?(G=f(G,Z.props),ca(G,Z),G.return=I,G):(G=Pl(Z.type,Z.key,Z.props,null,I.mode,ie),ca(G,Z),G.return=I,G)}function Q(I,G,Z,ie){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=Pc(Z,I.mode,ie),G.return=I,G):(G=f(G,Z.children||[]),G.return=I,G)}function oe(I,G,Z,ie,be){return G===null||G.tag!==7?(G=uo(Z,I.mode,ie,be),G.return=I,G):(G=f(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=Pl(G.type,G.key,G.props,null,I.mode,Z),ca(Z,G),Z.return=I,Z;case _:return G=Pc(G,I.mode,Z),G.return=I,G;case k:return G=po(G),le(I,G,Z)}if(q(G)||$(G))return G=uo(G,I.mode,Z,null),G.return=I,G;if(typeof G.then=="function")return le(I,es(G),Z);if(G.$$typeof===S)return le(I,Ql(I,G),Z);ts(I,G)}return null}function K(I,G,Z,ie){var be=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return be!==null?null:T(I,G,""+Z,ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===be?H(I,G,Z,ie):null;case _:return Z.key===be?Q(I,G,Z,ie):null;case k:return Z=po(Z),K(I,G,Z,ie)}if(q(Z)||$(Z))return be!==null?null:oe(I,G,Z,ie,null);if(typeof Z.then=="function")return K(I,G,es(Z),ie);if(Z.$$typeof===S)return K(I,G,Ql(I,Z),ie);ts(I,Z)}return null}function W(I,G,Z,ie,be){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return I=I.get(Z)||null,T(G,I,""+ie,be);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return I=I.get(ie.key===null?Z:ie.key)||null,H(G,I,ie,be);case _:return I=I.get(ie.key===null?Z:ie.key)||null,Q(G,I,ie,be);case k:return ie=po(ie),W(I,G,Z,ie,be)}if(q(ie)||$(ie))return I=I.get(Z)||null,oe(G,I,ie,be,null);if(typeof ie.then=="function")return W(I,G,Z,es(ie),be);if(ie.$$typeof===S)return W(I,G,Z,Ql(G,ie),be);ts(G,ie)}return null}function pe(I,G,Z,ie){for(var be=null,He=null,ye=G,Ce=G=0,De=null;ye!==null&&Ce<Z.length;Ce++){ye.index>Ce?(De=ye,ye=null):De=ye.sibling;var Le=K(I,ye,Z[Ce],ie);if(Le===null){ye===null&&(ye=De);break}e&&ye&&Le.alternate===null&&n(I,ye),G=d(Le,G,Ce),He===null?be=Le:He.sibling=Le,He=Le,ye=De}if(Ce===Z.length)return i(I,ye),ze&&$n(I,Ce),be;if(ye===null){for(;Ce<Z.length;Ce++)ye=le(I,Z[Ce],ie),ye!==null&&(G=d(ye,G,Ce),He===null?be=ye:He.sibling=ye,He=ye);return ze&&$n(I,Ce),be}for(ye=l(ye);Ce<Z.length;Ce++)De=W(ye,I,Ce,Z[Ce],ie),De!==null&&(e&&De.alternate!==null&&ye.delete(De.key===null?Ce:De.key),G=d(De,G,Ce),He===null?be=De:He.sibling=De,He=De);return e&&ye.forEach(function(Vr){return n(I,Vr)}),ze&&$n(I,Ce),be}function _e(I,G,Z,ie){if(Z==null)throw Error(a(151));for(var be=null,He=null,ye=G,Ce=G=0,De=null,Le=Z.next();ye!==null&&!Le.done;Ce++,Le=Z.next()){ye.index>Ce?(De=ye,ye=null):De=ye.sibling;var Vr=K(I,ye,Le.value,ie);if(Vr===null){ye===null&&(ye=De);break}e&&ye&&Vr.alternate===null&&n(I,ye),G=d(Vr,G,Ce),He===null?be=Vr:He.sibling=Vr,He=Vr,ye=De}if(Le.done)return i(I,ye),ze&&$n(I,Ce),be;if(ye===null){for(;!Le.done;Ce++,Le=Z.next())Le=le(I,Le.value,ie),Le!==null&&(G=d(Le,G,Ce),He===null?be=Le:He.sibling=Le,He=Le);return ze&&$n(I,Ce),be}for(ye=l(ye);!Le.done;Ce++,Le=Z.next())Le=W(ye,I,Ce,Le.value,ie),Le!==null&&(e&&Le.alternate!==null&&ye.delete(Le.key===null?Ce:Le.key),G=d(Le,G,Ce),He===null?be=Le:He.sibling=Le,He=Le);return e&&ye.forEach(function(H2){return n(I,H2)}),ze&&$n(I,Ce),be}function Ye(I,G,Z,ie){if(typeof Z=="object"&&Z!==null&&Z.type===E&&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===E){if(G.tag===7){i(I,G.sibling),ie=f(G,Z.props.children),ie.return=I,I=ie;break e}}else if(G.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===k&&po(be)===G.type){i(I,G.sibling),ie=f(G,Z.props),ca(ie,Z),ie.return=I,I=ie;break e}i(I,G);break}else n(I,G);G=G.sibling}Z.type===E?(ie=uo(Z.props.children,I.mode,ie,Z.key),ie.return=I,I=ie):(ie=Pl(Z.type,Z.key,Z.props,null,I.mode,ie),ca(ie,Z),ie.return=I,I=ie)}return v(I);case _: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){i(I,G.sibling),ie=f(G,Z.children||[]),ie.return=I,I=ie;break e}else{i(I,G);break}else n(I,G);G=G.sibling}ie=Pc(Z,I.mode,ie),ie.return=I,I=ie}return v(I);case k:return Z=po(Z),Ye(I,G,Z,ie)}if(q(Z))return pe(I,G,Z,ie);if($(Z)){if(be=$(Z),typeof be!="function")throw Error(a(150));return Z=be.call(Z),_e(I,G,Z,ie)}if(typeof Z.then=="function")return Ye(I,G,es(Z),ie);if(Z.$$typeof===S)return Ye(I,G,Ql(I,Z),ie);ts(I,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(i(I,G.sibling),ie=f(G,Z),ie.return=I,I=ie):(i(I,G),ie=Ic(Z,I.mode,ie),ie.return=I,I=ie),v(I)):i(I,G)}return function(I,G,Z,ie){try{ua=0;var be=Ye(I,G,Z,ie);return li=null,be}catch(ye){if(ye===ai||ye===Jl)throw ye;var He=Vt(29,ye,null,I.mode);return He.lanes=ie,He.return=I,He}}}var yo=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 Ar(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tr(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Fe&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,n=Il(e),_m(e,null,i),n}return Xl(e,l,n,i),Il(e)}function fa(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,wl(e,i)}}function sf(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var v={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?f=d=v:d=d.next=v,i=i.next}while(i!==null);d===null?f=d=n:d=d.next=n}else f=d=n;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var uf=!1;function da(){if(uf){var e=ii;if(e!==null)throw e}}function ha(e,n,i,l){uf=!1;var f=e.updateQueue;wr=!1;var d=f.firstBaseUpdate,v=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var H=T,Q=H.next;H.next=null,v===null?d=Q:v.next=Q,v=H;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,T=oe.lastBaseUpdate,T!==v&&(T===null?oe.firstBaseUpdate=Q:T.next=Q,oe.lastBaseUpdate=H))}if(d!==null){var le=f.baseState;v=0,oe=Q=H=null,T=d;do{var K=T.lane&-536870913,W=K!==T.lane;if(W?(Me&K)===K:(l&K)===K){K!==0&&K===oi&&(uf=!0),oe!==null&&(oe=oe.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var pe=e,_e=T;K=n;var Ye=i;switch(_e.tag){case 1:if(pe=_e.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=_e.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=T.callback,K!==null&&(e.flags|=64,W&&(e.flags|=8192),W=f.callbacks,W===null?f.callbacks=[K]:W.push(K))}else W={lane:K,tag:T.tag,payload:T.payload,callback:T.callback,next:null},oe===null?(Q=oe=W,H=le):oe=oe.next=W,v|=K;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;W=T,T=W.next,W.next=null,f.lastBaseUpdate=W,f.shared.pending=null}}while(!0);oe===null&&(H=le),f.baseState=H,f.firstBaseUpdate=Q,f.lastBaseUpdate=oe,d===null&&(f.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 km(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Fm(i[e],n)}var si=M(null),ns=M(0);function Vm(e,n){e=ir,J(ns,e),J(si,n),ir=e|n.baseLanes}function cf(){J(ns,ir),J(si,si.current)}function ff(){ir=ns.current,F(si),F(ns)}var Gt=M(null),tn=null;function Cr(e){var n=e.alternate;J(rt,rt.current&1),J(Gt,e),tn===null&&(n===null||si.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)):Nr()}function Nr(){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 i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||xd(i)||vd(i)))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,Ae=null,Ge=null,lt=null,os=!1,ui=!1,xo=!1,is=0,ma=0,ci=null,TS=0;function tt(){throw Error(a(321))}function hf(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!kt(e[i],n[i]))return!1;return!0}function mf(e,n,i,l,f,d){return Kn=d,Ae=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,R.H=e===null||e.memoizedState===null?Ap:Rf,xo=!1,d=i(l,f),xo=!1,ui&&(d=Ym(n,i,l,f)),qm(e),d}function qm(e){R.H=ya;var n=Ge!==null&&Ge.next!==null;if(Kn=0,lt=Ge=Ae=null,os=!1,ma=0,ci=null,n)throw Error(a(300));e===null||st||(e=e.dependencies,e!==null&&Zl(e)&&(st=!0))}function Ym(e,n,i,l){Ae=e;var f=0;do{if(ui&&(ci=null),ma=0,ui=!1,25<=f)throw Error(a(301));if(f+=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=Tp,d=n(i,l)}while(ui);return d}function CS(){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&&(Ae.flags|=1024),n}function pf(){var e=is!==0;return is=0,e}function gf(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function yf(e){if(os){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}os=!1}Kn=0,lt=Ge=Ae=null,ui=!1,ma=is=0,ci=null}function Nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Ae.memoizedState=lt=e:lt=lt.next=e,lt}function ot(){if(Ge===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var n=lt===null?Ae.memoizedState:lt.next;if(n!==null)lt=n,Ge=e;else{if(e===null)throw Ae.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?Ae.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,ci===null&&(ci=[]),e=Bm(ci,e,n),n=Ae,(lt===null?n.memoizedState:lt.next)===null&&(n=n.alternate,R.H=n===null||n.memoizedState===null?Ap:Rf),e}function ls(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pa(e);if(e.$$typeof===S)return xt(e)}throw Error(a(438,String(e)))}function xf(e){var n=null,i=Ae.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var l=Ae.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=as(),Ae.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),l=0;l<e;l++)i[l]=ae;return n.index++,i}function Jn(e,n){return typeof n=="function"?n(e):n}function ss(e){var n=ot();return vf(n,Ge,e)}function vf(e,n,i){var l=e.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var f=e.baseQueue,d=l.pending;if(d!==null){if(f!==null){var v=f.next;f.next=d.next,d.next=v}n.baseQueue=f=d,l.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{n=f.next;var T=v=null,H=null,Q=n,oe=!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===oi&&(oe=!0);else if((Kn&K)===K){Q=Q.next,K===oi&&(oe=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},H===null?(T=H=le,v=d):H=H.next=le,Ae.lanes|=K,Dr|=K;le=Q.action,xo&&i(d,le),d=Q.hasEagerState?Q.eagerState:i(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?(T=H=K,v=d):H=H.next=K,Ae.lanes|=le,Dr|=le;Q=Q.next}while(Q!==null&&Q!==n);if(H===null?v=d:H.next=T,!kt(d,e.memoizedState)&&(st=!0,oe&&(i=ii,i!==null)))throw i;e.memoizedState=d,e.baseState=v,e.baseQueue=H,l.lastRenderedState=d}return f===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function bf(e){var n=ot(),i=n.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=e;var l=i.dispatch,f=i.pending,d=n.memoizedState;if(f!==null){i.pending=null;var v=f=f.next;do d=e(d,v.action),v=v.next;while(v!==f);kt(d,n.memoizedState)||(st=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),i.lastRenderedState=d}return[d,l]}function Xm(e,n,i){var l=Ae,f=ot(),d=ze;if(d){if(i===void 0)throw Error(a(407));i=i()}else i=n();var v=!kt((Ge||f).memoizedState,i);if(v&&(f.memoizedState=i,st=!0),f=f.queue,Sf($m.bind(null,l,f,e),[e]),f.getSnapshot!==n||v||lt!==null&<.memoizedState.tag&1){if(l.flags|=2048,fi(9,{destroy:void 0},Pm.bind(null,l,f,i,n),null),Xe===null)throw Error(a(349));d||(Kn&127)!==0||Im(l,n,i)}return i}function Im(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Ae.updateQueue,n===null?(n=as(),Ae.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Pm(e,n,i,l){n.value=i,n.getSnapshot=l,Zm(n)&&Qm(e)}function $m(e,n,i){return i(function(){Zm(n)&&Qm(e)})}function Zm(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!kt(e,i)}catch{return!0}}function Qm(e){var n=so(e,2);n!==null&&jt(n,e,2)}function _f(e){var n=Nt();if(typeof e=="function"){var i=e;if(e=i(),xo){En(!0);try{i()}finally{En(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jn,lastRenderedState:e},n}function Km(e,n,i,l){return e.baseState=i,vf(e,Ge,typeof l=="function"?l:Jn)}function NS(e,n,i,l,f){if(fs(e))throw Error(a(485));if(e=n.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};R.T!==null?i(!0):d.isTransition=!1,l(d),i=n.pending,i===null?(d.next=n.pending=d,Jm(n,d)):(d.next=i.next,n.pending=i.next=d)}}function Jm(e,n){var i=n.action,l=n.payload,f=e.state;if(n.isTransition){var d=R.T,v={};R.T=v;try{var T=i(f,l),H=R.S;H!==null&&H(v,T),Wm(e,n,T)}catch(Q){Ef(e,n,Q)}finally{d!==null&&v.types!==null&&(d.types=v.types),R.T=d}}else try{d=i(f,l),Wm(e,n,d)}catch(Q){Ef(e,n,Q)}}function Wm(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){ep(e,n,l)},function(l){return Ef(e,n,l)}):ep(e,n,i)}function ep(e,n,i){n.status="fulfilled",n.value=i,tp(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,Jm(e,i)))}function Ef(e,n,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=i,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 i=Xe.formState;if(i!==null){e:{var l=Ae;if(ze){if($e){t:{for(var f=$e,d=en;f.nodeType!==8;){if(!d){f=null;break t}if(f=nn(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){$e=nn(f.nextSibling),l=f.data==="F!";break e}}Er(l)}l=!1}l&&(n=i[0])}}return i=Nt(),i.memoizedState=i.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:np,lastRenderedState:n},i.queue=l,i=Ep.bind(null,Ae,l),l.dispatch=i,l=_f(!1),d=Nf.bind(null,Ae,!1,l.queue),l=Nt(),f={state:n,dispatch:null,action:e,pending:null},l.queue=f,i=NS.bind(null,Ae,f,d,i),f.dispatch=i,l.memoizedState=e,[n,i,!1]}function op(e){var n=ot();return ip(n,Ge,e)}function ip(e,n,i){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===ai?Jl:v}else l=n;n=ot();var f=n.queue,d=f.dispatch;return i!==n.memoizedState&&(Ae.flags|=2048,fi(9,{destroy:void 0},RS.bind(null,f,i),null)),[l,d,e]}function RS(e,n){e.action=n}function ap(e){var n=ot(),i=Ge;if(i!==null)return ip(n,i,e);ot(),n=n.memoizedState,i=ot();var l=i.queue.dispatch;return i.memoizedState=e,[n,l,!1]}function fi(e,n,i,l){return e={tag:e,create:i,deps:l,inst:n,next:null},n=Ae.updateQueue,n===null&&(n=as(),Ae.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,n.lastEffect=e),e}function lp(){return ot().memoizedState}function us(e,n,i,l){var f=Nt();Ae.flags|=e,f.memoizedState=fi(1|n,{destroy:void 0},i,l===void 0?null:l)}function cs(e,n,i,l){var f=ot();l=l===void 0?null:l;var d=f.memoizedState.inst;Ge!==null&&l!==null&&hf(l,Ge.memoizedState.deps)?f.memoizedState=fi(n,d,i,l):(Ae.flags|=e,f.memoizedState=fi(1|n,d,i,l))}function sp(e,n){us(8390656,8,e,n)}function Sf(e,n){cs(2048,8,e,n)}function MS(e){Ae.flags|=4;var n=Ae.updateQueue;if(n===null)n=as(),Ae.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function up(e){var n=ot().memoizedState;return MS({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 i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function hp(e,n,i){i=i!=null?i.concat([e]):null,cs(4,4,dp.bind(null,n,e),i)}function wf(){}function mp(e,n){var i=ot();n=n===void 0?null:n;var l=i.memoizedState;return n!==null&&hf(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function pp(e,n){var i=ot();n=n===void 0?null:n;var l=i.memoizedState;if(n!==null&&hf(n,l[1]))return l[0];if(l=e(),xo){En(!0);try{e()}finally{En(!1)}}return i.memoizedState=[l,n],l}function Af(e,n,i){return i===void 0||(Kn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=gg(),Ae.lanes|=e,Dr|=e,i)}function gp(e,n,i,l){return kt(i,n)?i:si.current!==null?(e=Af(e,i,l),kt(e,n)||(st=!0),e):(Kn&42)===0||(Kn&1073741824)!==0&&(Me&261930)===0?(st=!0,e.memoizedState=i):(e=gg(),Ae.lanes|=e,Dr|=e,n)}function yp(e,n,i,l,f){var d=L.p;L.p=d!==0&&8>d?d:8;var v=R.T,T={};R.T=T,Nf(e,!1,n,i);try{var H=f(),Q=R.S;if(Q!==null&&Q(T,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var oe=AS(H,l);ga(e,n,oe,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&&T.types!==null&&(v.types=T.types),R.T=v}}function DS(){}function Tf(e,n,i,l){if(e.tag!==5)throw Error(a(476));var f=xp(e).queue;yp(e,f,n,V,i===null?DS:function(){return vp(e),i(l)})}function xp(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jn,lastRenderedState:V},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jn,lastRenderedState:i},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 Cf(){return xt(za)}function bp(){return ot().memoizedState}function _p(){return ot().memoizedState}function OS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=It();e=Ar(i);var l=Tr(n,e,i);l!==null&&(jt(l,n,i),fa(l,n,i)),n={cache:tf()},e.payload=n;return}n=n.return}}function zS(e,n,i){var l=It();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fs(e)?Sp(n,i):(i=Yc(e,n,i,l),i!==null&&(jt(i,e,l),wp(i,n,l)))}function Ep(e,n,i){var l=It();ga(e,n,i,l)}function ga(e,n,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(fs(e))Sp(n,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var v=n.lastRenderedState,T=d(v,i);if(f.hasEagerState=!0,f.eagerState=T,kt(T,v))return Xl(e,n,f,0),Xe===null&&Yl(),!1}catch{}if(i=Yc(e,n,f,l),i!==null)return jt(i,e,l),wp(i,n,l),!0}return!1}function Nf(e,n,i,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,i,l,2),n!==null&&jt(n,e,2)}function fs(e){var n=e.alternate;return e===Ae||n!==null&&n===Ae}function Sp(e,n){ui=os=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function wp(e,n,i){if((i&4194048)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,wl(e,i)}}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 Ap={readContext:xt,use:ls,useCallback:function(e,n){return Nt().memoizedState=[e,n===void 0?null:n],e},useContext:xt,useEffect:sp,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,us(4194308,4,dp.bind(null,n,e),i)},useLayoutEffect:function(e,n){return us(4194308,4,e,n)},useInsertionEffect:function(e,n){us(4,2,e,n)},useMemo:function(e,n){var i=Nt();n=n===void 0?null:n;var l=e();if(xo){En(!0);try{e()}finally{En(!1)}}return i.memoizedState=[l,n],l},useReducer:function(e,n,i){var l=Nt();if(i!==void 0){var f=i(n);if(xo){En(!0);try{i(n)}finally{En(!1)}}}else f=n;return l.memoizedState=l.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},l.queue=e,e=e.dispatch=zS.bind(null,Ae,e),[l.memoizedState,e]},useRef:function(e){var n=Nt();return e={current:e},n.memoizedState=e},useState:function(e){e=_f(e);var n=e.queue,i=Ep.bind(null,Ae,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:wf,useDeferredValue:function(e,n){var i=Nt();return Af(i,e,n)},useTransition:function(){var e=_f(!1);return e=yp.bind(null,Ae,e.queue,!0,!1),Nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var l=Ae,f=Nt();if(ze){if(i===void 0)throw Error(a(407));i=i()}else{if(i=n(),Xe===null)throw Error(a(349));(Me&127)!==0||Im(l,n,i)}f.memoizedState=i;var d={value:i,getSnapshot:n};return f.queue=d,sp($m.bind(null,l,d,e),[e]),l.flags|=2048,fi(9,{destroy:void 0},Pm.bind(null,l,d,i,n),null),i},useId:function(){var e=Nt(),n=Xe.identifierPrefix;if(ze){var i=An,l=wn;i=(l&~(1<<32-Ct(l)-1)).toString(32)+i,n="_"+n+"R_"+i,i=is++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=TS++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Cf,useFormState:rp,useActionState:rp,useOptimistic:function(e){var n=Nt();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Nf.bind(null,Ae,!0,i),i.dispatch=n,[e,n]},useMemoCache:xf,useCacheRefresh:function(){return Nt().memoizedState=OS.bind(null,Ae)},useEffectEvent:function(e){var n=Nt(),i={impl:e};return n.memoizedState=i,function(){if((Fe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},Rf={readContext:xt,use:ls,useCallback:mp,useContext:xt,useEffect:Sf,useImperativeHandle:hp,useInsertionEffect:cp,useLayoutEffect:fp,useMemo:pp,useReducer:ss,useRef:lp,useState:function(){return ss(Jn)},useDebugValue:wf,useDeferredValue:function(e,n){var i=ot();return gp(i,Ge.memoizedState,e,n)},useTransition:function(){var e=ss(Jn)[0],n=ot().memoizedState;return[typeof e=="boolean"?e:pa(e),n]},useSyncExternalStore:Xm,useId:bp,useHostTransitionStatus:Cf,useFormState:op,useActionState:op,useOptimistic:function(e,n){var i=ot();return Km(i,Ge,e,n)},useMemoCache:xf,useCacheRefresh:_p};Rf.useEffectEvent=up;var Tp={readContext:xt,use:ls,useCallback:mp,useContext:xt,useEffect:Sf,useImperativeHandle:hp,useInsertionEffect:cp,useLayoutEffect:fp,useMemo:pp,useReducer:bf,useRef:lp,useState:function(){return bf(Jn)},useDebugValue:wf,useDeferredValue:function(e,n){var i=ot();return Ge===null?Af(i,e,n):gp(i,Ge.memoizedState,e,n)},useTransition:function(){var e=bf(Jn)[0],n=ot().memoizedState;return[typeof e=="boolean"?e:pa(e),n]},useSyncExternalStore:Xm,useId:bp,useHostTransitionStatus:Cf,useFormState:ap,useActionState:ap,useOptimistic:function(e,n){var i=ot();return Ge!==null?Km(i,Ge,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:xf,useCacheRefresh:_p};Tp.useEffectEvent=up;function Mf(e,n,i,l){n=e.memoizedState,i=i(l,n),i=i==null?n:g({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Df={enqueueSetState:function(e,n,i){e=e._reactInternals;var l=It(),f=Ar(l);f.payload=n,i!=null&&(f.callback=i),n=Tr(e,f,l),n!==null&&(jt(n,e,l),fa(n,e,l))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=It(),f=Ar(l);f.tag=1,f.payload=n,i!=null&&(f.callback=i),n=Tr(e,f,l),n!==null&&(jt(n,e,l),fa(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=It(),l=Ar(i);l.tag=2,n!=null&&(l.callback=n),n=Tr(e,l,i),n!==null&&(jt(n,e,i),fa(n,e,i))}};function Cp(e,n,i,l,f,d,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,d,v):n.prototype&&n.prototype.isPureReactComponent?!ra(i,l)||!ra(f,d):!0}function Np(e,n,i,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==e&&Df.enqueueReplaceState(n,n.state,null)}function vo(e,n){var i=n;if("ref"in n){i={};for(var l in n)l!=="ref"&&(i[l]=n[l])}if(e=e.defaultProps){i===n&&(i=g({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function Rp(e){ql(e)}function Mp(e){console.error(e)}function Dp(e){ql(e)}function ds(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function Op(e,n,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Of(e,n,i){return i=Ar(i),i.tag=3,i.payload={element:null},i.callback=function(){ds(e,n)},i}function zp(e){return e=Ar(e),e.tag=3,e}function Bp(e,n,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var d=l.value;e.payload=function(){return f(d)},e.callback=function(){Op(n,i,l)}}var v=i.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){Op(n,i,l),typeof f!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var T=l.stack;this.componentDidCatch(l.value,{componentStack:T!==null?T:""})})}function BS(e,n,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=i.alternate,n!==null&&ri(n,i,f,!0),i=Gt.current,i!==null){switch(i.tag){case 31:case 13:return tn===null?ws():i.alternate===null&&nt===0&&(nt=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===Wl?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([l]):n.add(l),rd(e,l,f)),!1;case 22:return i.flags|=65536,l===Wl?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([l]):i.add(l)),rd(e,l,f)),!1}throw Error(a(435,i.tag))}return rd(e,l,f),ws(),!1}if(ze)return n=Gt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,l!==Qc&&(e=Error(a(422),{cause:l}),aa(Kt(e,i)))):(l!==Qc&&(n=Error(a(423),{cause:l}),aa(Kt(n,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,l=Kt(l,i),f=Of(e.stateNode,l,f),sf(e,f),nt!==4&&(nt=2)),!1;var d=Error(a(520),{cause:l});if(d=Kt(d,i),Aa===null?Aa=[d]:Aa.push(d),nt!==4&&(nt=2),n===null)return!0;l=Kt(l,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Of(i.stateNode,l,e),sf(i,e),!1;case 1:if(n=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Or===null||!Or.has(d))))return i.flags|=65536,f&=-f,i.lanes|=f,f=zp(f),Bp(f,e,i,l),sf(i,f),!1}i=i.return}while(i!==null);return!1}var zf=Error(a(461)),st=!1;function vt(e,n,i,l){n.child=e===null?jm(n,null,i,l):yo(n,e.child,i,l)}function Up(e,n,i,l,f){i=i.render;var d=n.ref;if("ref"in l){var v={};for(var T in l)T!=="ref"&&(v[T]=l[T])}else v=l;return ho(n),l=mf(e,n,i,v,d,f),T=pf(),e!==null&&!st?(gf(e,n,f),Wn(e,n,f)):(ze&&T&&$c(n),n.flags|=1,vt(e,n,l,f),n.child)}function Hp(e,n,i,l,f){if(e===null){var d=i.type;return typeof d=="function"&&!Xc(d)&&d.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=d,Lp(e,n,d,l,f)):(e=Pl(i.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!Vf(e,f)){var v=d.memoizedProps;if(i=i.compare,i=i!==null?i:ra,i(v,l)&&e.ref===n.ref)return Wn(e,n,f)}return n.flags|=1,e=Pn(d,l),e.ref=n.ref,e.return=n,n.child=e}function Lp(e,n,i,l,f){if(e!==null){var d=e.memoizedProps;if(ra(d,l)&&e.ref===n.ref)if(st=!1,n.pendingProps=l=d,Vf(e,f))(e.flags&131072)!==0&&(st=!0);else return n.lanes=e.lanes,Wn(e,n,f)}return Bf(e,n,i,l,f)}function jp(e,n,i,l){var f=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|i:i,e!==null){for(l=n.child=e.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~d}else l=0,n.child=null;return Fp(e,n,d,i,l)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Kl(n,d!==null?d.cachePool:null),d!==null?Vm(n,d):cf(),Gm(n);else return l=n.lanes=536870912,Fp(e,n,d!==null?d.baseLanes|i:i,i,l)}else d!==null?(Kl(n,d.cachePool),Vm(n,d),Nr(),n.memoizedState=null):(e!==null&&Kl(n,null),cf(),Nr());return vt(e,n,f,i),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,i,l,f){var d=rf();return d=d===null?null:{parent:at._currentValue,pool:d},n.memoizedState={baseLanes:i,cachePool:d},e!==null&&Kl(n,null),cf(),Gm(n),e!==null&&ri(e,n,l,!0),n.childLanes=f,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 kp(e,n,i){return yo(n,e.child,null,i),e=hs(n,n.pendingProps),e.flags|=2,qt(n),n.memoizedState=null,e}function US(e,n,i){var l=n.pendingProps,f=(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=$e)?(e=Jg(e,en),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:br!==null?{id:wn,overflow:An}:null,retryLane:536870912,hydrationErrors:null},i=Sm(e),i.return=n,n.child=i,yt=n,$e=null)):e=null,e===null)throw Er(n);return n.lanes=536870912,null}return hs(n,l)}var d=e.memoizedState;if(d!==null){var v=d.dehydrated;if(df(n),f)if(n.flags&256)n.flags&=-257,n=kp(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(st||ri(e,n,i,!1),f=(i&e.childLanes)!==0,st||f){if(l=Xe,l!==null&&(v=Al(l,i),v!==0&&v!==d.retryLane))throw d.retryLane=v,so(e,v),jt(l,e,v),zf;ws(),n=kp(e,n,i)}else e=d.treeContext,$e=nn(v.nextSibling),yt=n,ze=!0,_r=null,en=!1,e!==null&&Tm(n,e),n=hs(n,l),n.flags|=4096;return n}return e=Pn(e.child,{mode:l.mode,children:l.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ms(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function Bf(e,n,i,l,f){return ho(n),i=mf(e,n,i,l,void 0,f),l=pf(),e!==null&&!st?(gf(e,n,f),Wn(e,n,f)):(ze&&l&&$c(n),n.flags|=1,vt(e,n,i,f),n.child)}function Vp(e,n,i,l,f,d){return ho(n),n.updateQueue=null,i=Ym(n,l,i,f),qm(e),l=pf(),e!==null&&!st?(gf(e,n,d),Wn(e,n,d)):(ze&&l&&$c(n),n.flags|=1,vt(e,n,i,d),n.child)}function Gp(e,n,i,l,f){if(ho(n),n.stateNode===null){var d=Wo,v=i.contextType;typeof v=="object"&&v!==null&&(d=xt(v)),d=new i(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=i.contextType,d.context=typeof v=="object"&&v!==null?xt(v):Wo,d.state=n.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Mf(n,i,v,l),d.state=n.memoizedState),typeof i.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,f),da(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(e===null){d=n.stateNode;var T=n.memoizedProps,H=vo(i,T);d.props=H;var Q=d.context,oe=i.contextType;v=Wo,typeof oe=="object"&&oe!==null&&(v=xt(oe));var le=i.getDerivedStateFromProps;oe=typeof le=="function"||typeof d.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,oe||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(T||Q!==v)&&Np(n,d,l,v),wr=!1;var K=n.memoizedState;d.state=K,ha(n,l,d,f),da(),Q=n.memoizedState,T||K!==Q||wr?(typeof le=="function"&&(Mf(n,i,le,l),Q=n.memoizedState),(H=wr||Cp(n,i,H,l,K,Q,v))?(oe||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,oe=vo(i,v),d.props=oe,le=n.pendingProps,K=d.context,Q=i.contextType,H=Wo,typeof Q=="object"&&Q!==null&&(H=xt(Q)),T=i.getDerivedStateFromProps,(Q=typeof T=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==le||K!==H)&&Np(n,d,l,H),wr=!1,K=n.memoizedState,d.state=K,ha(n,l,d,f),da();var W=n.memoizedState;v!==le||K!==W||wr||e!==null&&e.dependencies!==null&&Zl(e.dependencies)?(typeof T=="function"&&(Mf(n,i,T,l),W=n.memoizedState),(oe=wr||Cp(n,i,oe,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=oe):(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,i=l&&typeof i.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&l?(n.child=yo(n,e.child,null,f),n.child=yo(n,null,i,f)):vt(e,n,i,f),n.memoizedState=d.state,e=n.child):e=Wn(e,n,f),e}function qp(e,n,i,l){return co(),n.flags|=256,vt(e,n,i,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,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=Xt),e}function Yp(e,n,i){var l=n.pendingProps,f=!1,d=(n.flags&128)!==0,v;if((v=d)||(v=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,e===null){if(ze){if(f?Cr(n):Nr(),(e=$e)?(e=Jg(e,en),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:br!==null?{id:wn,overflow:An}:null,retryLane:536870912,hydrationErrors:null},i=Sm(e),i.return=n,n.child=i,yt=n,$e=null)):e=null,e===null)throw Er(n);return vd(e)?n.lanes=32:n.lanes=536870912,null}var T=l.children;return l=l.fallback,f?(Nr(),f=n.mode,T=ps({mode:"hidden",children:T},f),l=uo(l,f,i,null),T.return=n,l.return=n,T.sibling=l,n.child=T,l=n.child,l.memoizedState=Hf(i),l.childLanes=Lf(e,v,i),n.memoizedState=Uf,xa(null,l)):(Cr(n),jf(n,T))}var H=e.memoizedState;if(H!==null&&(T=H.dehydrated,T!==null)){if(d)n.flags&256?(Cr(n),n.flags&=-257,n=Ff(e,n,i)):n.memoizedState!==null?(Nr(),n.child=e.child,n.flags|=128,n=null):(Nr(),T=l.fallback,f=n.mode,l=ps({mode:"visible",children:l.children},f),T=uo(T,f,i,null),T.flags|=2,l.return=n,T.return=n,l.sibling=T,n.child=l,yo(n,e.child,null,i),l=n.child,l.memoizedState=Hf(i),l.childLanes=Lf(e,v,i),n.memoizedState=Uf,n=xa(null,l));else if(Cr(n),vd(T)){if(v=T.nextSibling&&T.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,i)}else if(st||ri(e,n,i,!1),v=(i&e.childLanes)!==0,st||v){if(v=Xe,v!==null&&(l=Al(v,i),l!==0&&l!==H.retryLane))throw H.retryLane=l,so(e,l),jt(v,e,l),zf;xd(T)||ws(),n=Ff(e,n,i)}else xd(T)?(n.flags|=192,n.child=e.child,n=null):(e=H.treeContext,$e=nn(T.nextSibling),yt=n,ze=!0,_r=null,en=!1,e!==null&&Tm(n,e),n=jf(n,l.children),n.flags|=4096);return n}return f?(Nr(),T=l.fallback,f=n.mode,H=e.child,Q=H.sibling,l=Pn(H,{mode:"hidden",children:l.children}),l.subtreeFlags=H.subtreeFlags&65011712,Q!==null?T=Pn(Q,T):(T=uo(T,f,i,null),T.flags|=2),T.return=n,l.return=n,l.sibling=T,n.child=l,xa(null,l),l=n.child,T=e.child.memoizedState,T===null?T=Hf(i):(f=T.cachePool,f!==null?(H=at._currentValue,f=f.parent!==H?{parent:H,pool:H}:f):f=Om(),T={baseLanes:T.baseLanes|i,cachePool:f}),l.memoizedState=T,l.childLanes=Lf(e,v,i),n.memoizedState=Uf,xa(e.child,l)):(Cr(n),i=e.child,e=i.sibling,i=Pn(i,{mode:"visible",children:l.children}),i.return=n,i.sibling=null,e!==null&&(v=n.deletions,v===null?(n.deletions=[e],n.flags|=16):v.push(e)),n.child=i,n.memoizedState=null,i)}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=Vt(22,e,null,n),e.lanes=0,e}function Ff(e,n,i){return yo(n,e.child,null,i),e=jf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Xp(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Wc(e.return,n,i)}function kf(e,n,i,l,f,d){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f,treeForkCount:d}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=i,v.tailMode=f,v.treeForkCount=d)}function Ip(e,n,i){var l=n.pendingProps,f=l.revealOrder,d=l.tail;l=l.children;var v=rt.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,J(rt,v),vt(e,n,l,i),l=ze?ia:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xp(e,i,n);else if(e.tag===19)Xp(e,i,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(f){case"forwards":for(i=n.child,f=null;i!==null;)e=i.alternate,e!==null&&rs(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=n.child,n.child=null):(f=i.sibling,i.sibling=null),kf(n,!1,f,i,d,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&rs(e)===null){n.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}kf(n,!0,i,null,d,l);break;case"together":kf(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function Wn(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Dr|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(ri(e,n,i,!1),(i&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,i=Pn(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=Pn(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function Vf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Zl(e)))}function HS(e,n,i){switch(n.tag){case 3:ue(n,n.stateNode.containerInfo),Sr(n,at,e.memoizedState.cache),co();break;case 27:case 5:ee(n);break;case 4:ue(n,n.stateNode.containerInfo);break;case 10:Sr(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?(Cr(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Yp(e,n,i):(Cr(n),e=Wn(e,n,i),e!==null?e.sibling:null);Cr(n);break;case 19:var f=(e.flags&128)!==0;if(l=(i&n.childLanes)!==0,l||(ri(e,n,i,!1),l=(i&n.childLanes)!==0),f){if(l)return Ip(e,n,i);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),J(rt,rt.current),l)break;return null;case 22:return n.lanes=0,jp(e,n,i,n.pendingProps);case 24:Sr(n,at,e.memoizedState.cache)}return Wn(e,n,i)}function Pp(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)st=!0;else{if(!Vf(e,i)&&(n.flags&128)===0)return st=!1,HS(e,n,i);st=(e.flags&131072)!==0}else st=!1,ze&&(n.flags&1048576)!==0&&Am(n,ia,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(e=po(n.elementType),n.type=e,typeof e=="function")Xc(e)?(l=vo(e,l),n.tag=1,n=Gp(null,n,e,l,i)):(n.tag=0,n=Bf(null,n,e,l,i));else{if(e!=null){var f=e.$$typeof;if(f===N){n.tag=11,n=Up(null,n,e,l,i);break e}else if(f===U){n.tag=14,n=Hp(null,n,e,l,i);break e}}throw n=B(e)||e,Error(a(306,n,""))}}return n;case 0:return Bf(e,n,n.type,n.pendingProps,i);case 1:return l=n.type,f=vo(l,n.pendingProps),Gp(e,n,l,f,i);case 3:e:{if(ue(n,n.stateNode.containerInfo),e===null)throw Error(a(387));l=n.pendingProps;var d=n.memoizedState;f=d.element,lf(e,n),ha(n,l,null,i);var v=n.memoizedState;if(l=v.cache,Sr(n,at,l),l!==d.cache&&ef(n,[at],i,!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,i);break e}else if(l!==f){f=Kt(Error(a(424)),n),aa(f),n=qp(e,n,l,i);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,$e=nn(e.firstChild),yt=n,ze=!0,_r=null,en=!0,i=jm(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(co(),l===f){n=Wn(e,n,i);break e}vt(e,n,l,i)}n=n.child}return n;case 26:return ms(e,n),e===null?(i=oy(n.type,null,n.pendingProps,null))?n.memoizedState=i:ze||(i=n.type,e=n.pendingProps,l=Ds(he.current).createElement(i),l[ht]=n,l[_t]=e,bt(l,i,e),it(l),n.stateNode=l):n.memoizedState=oy(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ee(n),e===null&&ze&&(l=n.stateNode=ty(n.type,n.pendingProps,he.current),yt=n,en=!0,f=$e,Hr(n.type)?(bd=f,$e=nn(l.firstChild)):$e=f),vt(e,n,n.pendingProps.children,i),ms(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&ze&&((f=l=$e)&&(l=d2(l,n.type,n.pendingProps,en),l!==null?(n.stateNode=l,yt=n,$e=nn(l.firstChild),en=!1,f=!0):f=!1),f||Er(n)),ee(n),f=n.type,d=n.pendingProps,v=e!==null?e.memoizedProps:null,l=d.children,pd(f,d)?l=null:v!==null&&pd(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=mf(e,n,CS,null,null,i),za._currentValue=f),ms(e,n),vt(e,n,l,i),n.child;case 6:return e===null&&ze&&((e=i=$e)&&(i=h2(i,n.pendingProps,en),i!==null?(n.stateNode=i,yt=n,$e=null,e=!0):e=!1),e||Er(n)),null;case 13:return Yp(e,n,i);case 4:return ue(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=yo(n,null,l,i):vt(e,n,l,i),n.child;case 11:return Up(e,n,n.type,n.pendingProps,i);case 7:return vt(e,n,n.pendingProps,i),n.child;case 8:return vt(e,n,n.pendingProps.children,i),n.child;case 12:return vt(e,n,n.pendingProps.children,i),n.child;case 10:return l=n.pendingProps,Sr(n,n.type,l.value),vt(e,n,l.children,i),n.child;case 9:return f=n.type._context,l=n.pendingProps.children,ho(n),f=xt(f),l=l(f),n.flags|=1,vt(e,n,l,i),n.child;case 14:return Hp(e,n,n.type,n.pendingProps,i);case 15:return Lp(e,n,n.type,n.pendingProps,i);case 19:return Ip(e,n,i);case 31:return US(e,n,i);case 22:return jp(e,n,i,n.pendingProps);case 24:return ho(n),l=xt(at),e===null?(f=rf(),f===null&&(f=Xe,d=tf(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=i),f=d),n.memoizedState={parent:l,cache:f},af(n),Sr(n,at,f)):((e.lanes&i)!==0&&(lf(e,n),ha(n,null,null,i),da()),f=e.memoizedState,d=n.memoizedState,f.parent!==l?(f={parent:l,cache:l},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),Sr(n,at,l)):(l=d.cache,Sr(n,at,l),l!==f.cache&&ef(n,[at],i,!0))),vt(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function er(e){e.flags|=4}function Gf(e,n,i,l,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(bg())e.flags|=8192;else throw go=Wl,of}else e.flags&=-16777217}function $p(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 go=Wl,of}function gs(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?El():536870912,e.lanes|=n,pi|=n)}function va(e,n){if(!ze)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.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,i=0,l=0;if(n)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=i,n}function LS(e,n,i){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 i=n.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Qn(at),me(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ni(n)?er(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Kc())),Ze(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(er(n),d!==null?(Ze(n),$p(n,d)):(Ze(n),Gf(n,f,null,l,i))):d?d!==e.memoizedState?(er(n),Ze(n),$p(n,d)):(Ze(n),n.flags&=-16777217):(e=e.memoizedProps,e!==l&&er(n),Ze(n),Gf(n,f,e,l,i)),null;case 27:if(ce(n),i=he.current,f=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=ne.current,ni(n)?Cm(n):(e=ty(f,l,i),n.stateNode=e,er(n))}return Ze(n),null;case 5:if(ce(n),f=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=ne.current,ni(n))Cm(n);else{var v=Ds(he.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);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(f,{is:l.is}):v.createElement(f)}}d[ht]=n,d[_t]=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,f,l),f){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,i),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,ni(n)){if(e=n.stateNode,i=n.memoizedProps,l=null,f=yt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}e[ht]=n,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Yg(e.nodeValue,i)),e||Er(n,!0)}else e=Ds(e).createTextNode(l),e[ht]=n,n.stateNode=e}return Ze(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(l=ni(n),i!==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 co(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ze(n),e=!1}else i=Kc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),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(f=ni(n),l!==null&&l.dehydrated!==null){if(e===null){if(!f)throw Error(a(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[ht]=n}else co(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ze(n),f=!1}else f=Kc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(qt(n),n):(qt(n),null)}return qt(n),(n.flags&128)!==0?(n.lanes=i,n):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=n.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==f&&(l.flags|=2048)),i!==e&&i&&(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(f=(n.flags&128)!==0,d=l.rendering,d===null)if(f)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=i,i=n.child;i!==null;)Em(i,e),i=i.sibling;return J(rt,rt.current&1|2),ze&&$n(n,l.treeForkCount),n.child}e=e.sibling}l.tail!==null&&Pe()>_s&&(n.flags|=128,f=!0,va(l,!1),n.lanes=4194304)}else{if(!f)if(e=rs(d),e!==null){if(n.flags|=128,f=!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*Pe()-l.renderingStartTime>_s&&i!==536870912&&(n.flags|=128,f=!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=Pe(),e.sibling=null,i=rt.current,J(rt,f?i&1|2:i&1),ze&&$n(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?(i&536870912)!==0&&(n.flags&128)===0&&(Ze(n),n.subtreeFlags&6&&(n.flags|=8192)):Ze(n),i=n.updateQueue,i!==null&&gs(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==i&&(n.flags|=2048),e!==null&&F(mo),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Qn(at),Ze(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function jS(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));co()}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));co()}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(mo),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(mo);break;case 24:Qn(at)}}function ba(e,n){try{var i=n.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&e)===e){l=void 0;var d=i.create,v=i.inst;l=d(),v.destroy=l}i=i.next}while(i!==f)}}catch(T){Ve(n,n.return,T)}}function Rr(e,n,i){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var d=f.next;l=d;do{if((l.tag&e)===e){var v=l.inst,T=v.destroy;if(T!==void 0){v.destroy=void 0,f=n;var H=i,Q=T;try{Q()}catch(oe){Ve(f,H,oe)}}}l=l.next}while(l!==d)}}catch(oe){Ve(n,n.return,oe)}}function Qp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{km(n,i)}catch(l){Ve(e,e.return,l)}}}function Kp(e,n,i){i.props=vo(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){Ve(e,n,l)}}function _a(e,n){try{var i=e.ref;if(i!==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 i=="function"?e.refCleanup=i(l):i.current=l}}catch(f){Ve(e,n,f)}}function Tn(e,n){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){Ve(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Ve(e,n,f)}else i.current=null}function Jp(e){var n=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){Ve(e,e.return,f)}}function qf(e,n,i){try{var l=e.stateNode;a2(l,e.type,i,n),l[_t]=n}catch(f){Ve(e,e.return,f)}}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,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Xn));else if(l!==4&&(l===27&&Hr(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(Xf(e,n,i),e=e.sibling;e!==null;)Xf(e,n,i),e=e.sibling}function ys(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(l===27&&Hr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(ys(e,n,i),e=e.sibling;e!==null;)ys(e,n,i),e=e.sibling}function eg(e){var n=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);bt(n,l,i),n[ht]=e,n[_t]=i}catch(d){Ve(e,e.return,d)}}var tr=!1,ut=!1,If=!1,tg=typeof WeakSet=="function"?WeakSet:Set,gt=null;function FS(e,n){if(e=e.containerInfo,hd=js,e=hm(e),jc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var v=0,T=-1,H=-1,Q=0,oe=0,le=e,K=null;t:for(;;){for(var W;le!==i||f!==0&&le.nodeType!==3||(T=v+f),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===i&&++Q===f&&(T=v),K===d&&++oe===l&&(H=v),(W=le.nextSibling)!==null)break;le=K,K=le.parentNode}le=W}i=T===-1||H===-1?null:{start:T,end:H}}else i=null}i=i||{start:0,end:0}}else i=null;for(md={focusedElem:e,selectionRange:i},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(i=0;i<e.length;i++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,i=n,f=d.memoizedProps,d=d.memoizedState,l=i.stateNode;try{var pe=vo(i.type,f);e=l.getSnapshotBeforeUpdate(pe,d),l.__reactInternalSnapshotBeforeUpdate=e}catch(_e){Ve(i,i.return,_e)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)yd(e);else if(i===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,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:rr(e,i),l&4&&ba(5,i);break;case 1:if(rr(e,i),l&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(v){Ve(i,i.return,v)}else{var f=vo(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(v){Ve(i,i.return,v)}}l&64&&Qp(i),l&512&&_a(i,i.return);break;case 3:if(rr(e,i),l&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{km(e,n)}catch(v){Ve(i,i.return,v)}}break;case 27:n===null&&l&4&&eg(i);case 26:case 5:rr(e,i),n===null&&l&4&&Jp(i),l&512&&_a(i,i.return);break;case 12:rr(e,i);break;case 31:rr(e,i),l&4&&ig(e,i);break;case 13:rr(e,i),l&4&&ag(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$S.bind(null,i),m2(e,i))));break;case 22:if(l=i.memoizedState!==null||tr,!l){n=n!==null&&n.memoizedState!==null||ut,f=tr;var d=ut;tr=l,(ut=n)&&!d?or(e,i,(i.subtreeFlags&8772)!==0):rr(e,i),tr=f,ut=d}break;case 30:break;default:rr(e,i)}}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&&Pi(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,i){for(i=i.child;i!==null;)og(e,n,i),i=i.sibling}function og(e,n,i){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Wr,i)}catch{}switch(i.tag){case 26:ut||Tn(i,n),nr(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ut||Tn(i,n);var l=Ke,f=Bt;Hr(i.type)&&(Ke=i.stateNode,Bt=!1),nr(e,n,i),Ma(i.stateNode),Ke=l,Bt=f;break;case 5:ut||Tn(i,n);case 6:if(l=Ke,f=Bt,Ke=null,nr(e,n,i),Ke=l,Bt=f,Ke!==null)if(Bt)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(i.stateNode)}catch(d){Ve(i,n,d)}else try{Ke.removeChild(i.stateNode)}catch(d){Ve(i,n,d)}break;case 18:Ke!==null&&(Bt?(e=Ke,Qg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Si(e)):Qg(Ke,i.stateNode));break;case 4:l=Ke,f=Bt,Ke=i.stateNode.containerInfo,Bt=!0,nr(e,n,i),Ke=l,Bt=f;break;case 0:case 11:case 14:case 15:Rr(2,i,n),ut||Rr(4,i,n),nr(e,n,i);break;case 1:ut||(Tn(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Kp(i,n,l)),nr(e,n,i);break;case 21:nr(e,n,i);break;case 22:ut=(l=ut)||i.memoizedState!==null,nr(e,n,i),ut=l;break;default:nr(e,n,i)}}function ig(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Si(e)}catch(i){Ve(n,n.return,i)}}}function ag(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Si(e)}catch(i){Ve(n,n.return,i)}}function kS(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 i=kS(e);n.forEach(function(l){if(!i.has(l)){i.add(l);var f=ZS.bind(null,e,l);l.then(f,f)}})}function Ut(e,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l],d=e,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(Hr(T.type)){Ke=T.stateNode,Bt=!1;break e}break;case 5:Ke=T.stateNode,Bt=!1;break e;case 3:case 4:Ke=T.stateNode.containerInfo,Bt=!0;break e}T=T.return}if(Ke===null)throw Error(a(160));og(d,v,f),Ke=null,Bt=!1,d=f.alternate,d!==null&&(d.return=null),f.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 i=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||i===null||Tn(i,i.return)),l&64&&tr&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var f=un;if(Ut(n,e),Ht(e),l&512&&(ut||i===null||Tn(i,i.return)),l&4){var d=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":d=f.getElementsByTagName("title")[0],(!d||d[no]||d[ht]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(l),f.head.insertBefore(d,f.querySelector("head > title"))),bt(d,l,i),d[ht]=e,it(d),l=d;break e;case"link":var v=ly("link","href",f).get(l+(i.href||""));if(v){for(var T=0;T<v.length;T++)if(d=v[T],d.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&d.getAttribute("rel")===(i.rel==null?null:i.rel)&&d.getAttribute("title")===(i.title==null?null:i.title)&&d.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){v.splice(T,1);break t}}d=f.createElement(l),bt(d,l,i),f.head.appendChild(d);break;case"meta":if(v=ly("meta","content",f).get(l+(i.content||""))){for(T=0;T<v.length;T++)if(d=v[T],d.getAttribute("content")===(i.content==null?null:""+i.content)&&d.getAttribute("name")===(i.name==null?null:i.name)&&d.getAttribute("property")===(i.property==null?null:i.property)&&d.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&d.getAttribute("charset")===(i.charSet==null?null:i.charSet)){v.splice(T,1);break t}}d=f.createElement(l),bt(d,l,i),f.head.appendChild(d);break;default:throw Error(a(468,l))}d[ht]=e,it(d),l=d}e.stateNode=l}else sy(f,e.type,e.stateNode);else e.stateNode=ay(f,l,e.memoizedProps);else d!==l?(d===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):d.count--,l===null?sy(f,e.type,e.stateNode):ay(f,l,e.memoizedProps)):l===null&&e.stateNode!==null&&qf(e,e.memoizedProps,i.memoizedProps)}break;case 27:Ut(n,e),Ht(e),l&512&&(ut||i===null||Tn(i,i.return)),i!==null&&l&4&&qf(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Ut(n,e),Ht(e),l&512&&(ut||i===null||Tn(i,i.return)),e.flags&32){f=e.stateNode;try{Io(f,"")}catch(pe){Ve(e,e.return,pe)}}l&4&&e.stateNode!=null&&(f=e.memoizedProps,qf(e,f,i!==null?i.memoizedProps:f)),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,i=e.stateNode;try{i.nodeValue=l}catch(pe){Ve(e,e.return,pe)}}break;case 3:if(Bs=null,f=un,un=Os(n.containerInfo),Ut(n,e),un=f,Ht(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Si(n.containerInfo)}catch(pe){Ve(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!=(i!==null&&i.memoizedState!==null)&&(bs=Pe()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,xs(e,l)));break;case 22:f=e.memoizedState!==null;var H=i!==null&&i.memoizedState!==null,Q=tr,oe=ut;if(tr=Q||f,ut=oe||H,Ut(n,e),ut=oe,tr=Q,Ht(e),l&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(i===null||H||tr||ut||bo(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){H=i=n;try{if(d=H.stateNode,f)v=d.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=H.stateNode;var le=H.memoizedProps.style,K=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(pe){Ve(H,H.return,pe)}}}else if(n.tag===6){if(i===null){H=n;try{H.stateNode.nodeValue=f?"":H.memoizedProps}catch(pe){Ve(H,H.return,pe)}}}else if(n.tag===18){if(i===null){H=n;try{var W=H.stateNode;f?Kg(W,!0):Kg(H.stateNode,!1)}catch(pe){Ve(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;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,xs(e,i))));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 i,l=e.return;l!==null;){if(Wp(l)){i=l;break}l=l.return}if(i==null)throw Error(a(160));switch(i.tag){case 27:var f=i.stateNode,d=Yf(e);ys(e,d,f);break;case 5:var v=i.stateNode;i.flags&32&&(Io(v,""),i.flags&=-33);var T=Yf(e);ys(e,T,v);break;case 3:case 4:var H=i.stateNode.containerInfo,Q=Yf(e);Xf(e,Q,H);break;default:throw Error(a(161))}}catch(oe){Ve(e,e.return,oe)}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 bo(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),bo(n);break;case 1:Tn(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&Kp(n,n.return,i),bo(n);break;case 27:Ma(n.stateNode);case 26:case 5:Tn(n,n.return),bo(n);break;case 22:n.memoizedState===null&&bo(n);break;case 30:bo(n);break;default:bo(n)}e=e.sibling}}function or(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,f=e,d=n,v=d.flags;switch(d.tag){case 0:case 11:case 15:or(f,d,i),ba(4,d);break;case 1:if(or(f,d,i),l=d,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Q){Ve(l,l.return,Q)}if(l=d,f=l.updateQueue,f!==null){var T=l.stateNode;try{var H=f.shared.hiddenCallbacks;if(H!==null)for(f.shared.hiddenCallbacks=null,f=0;f<H.length;f++)Fm(H[f],T)}catch(Q){Ve(l,l.return,Q)}}i&&v&64&&Qp(d),_a(d,d.return);break;case 27:eg(d);case 26:case 5:or(f,d,i),i&&l===null&&v&4&&Jp(d),_a(d,d.return);break;case 12:or(f,d,i);break;case 31:or(f,d,i),i&&v&4&&ig(f,d);break;case 13:or(f,d,i),i&&v&4&&ag(f,d);break;case 22:d.memoizedState===null&&or(f,d,i),_a(d,d.return);break;case 30:break;default:or(f,d,i)}n=n.sibling}}function Pf(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&la(i))}function $f(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,i,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)ug(e,n,i,l),n=n.sibling}function ug(e,n,i,l){var f=n.flags;switch(n.tag){case 0:case 11:case 15:cn(e,n,i,l),f&2048&&ba(9,n);break;case 1:cn(e,n,i,l);break;case 3:cn(e,n,i,l),f&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(f&2048){cn(e,n,i,l),e=n.stateNode;try{var d=n.memoizedProps,v=d.id,T=d.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(H){Ve(n,n.return,H)}}else cn(e,n,i,l);break;case 31:cn(e,n,i,l);break;case 13:cn(e,n,i,l);break;case 23:break;case 22:d=n.stateNode,v=n.alternate,n.memoizedState!==null?d._visibility&2?cn(e,n,i,l):Ea(e,n):d._visibility&2?cn(e,n,i,l):(d._visibility|=2,di(e,n,i,l,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Pf(v,n);break;case 24:cn(e,n,i,l),f&2048&&$f(n.alternate,n);break;default:cn(e,n,i,l)}}function di(e,n,i,l,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,v=n,T=i,H=l,Q=v.flags;switch(v.tag){case 0:case 11:case 15:di(d,v,T,H,f),ba(8,v);break;case 23:break;case 22:var oe=v.stateNode;v.memoizedState!==null?oe._visibility&2?di(d,v,T,H,f):Ea(d,v):(oe._visibility|=2,di(d,v,T,H,f)),f&&Q&2048&&Pf(v.alternate,v);break;case 24:di(d,v,T,H,f),f&&Q&2048&&$f(v.alternate,v);break;default:di(d,v,T,H,f)}n=n.sibling}}function Ea(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,l=n,f=l.flags;switch(l.tag){case 22:Ea(i,l),f&2048&&Pf(l.alternate,l);break;case 24:Ea(i,l),f&2048&&$f(l.alternate,l);break;default:Ea(i,l)}n=n.sibling}}var Sa=8192;function hi(e,n,i){if(e.subtreeFlags&Sa)for(e=e.child;e!==null;)cg(e,n,i),e=e.sibling}function cg(e,n,i){switch(e.tag){case 26:hi(e,n,i),e.flags&Sa&&e.memoizedState!==null&&T2(i,un,e.memoizedState,e.memoizedProps);break;case 5:hi(e,n,i);break;case 3:case 4:var l=un;un=Os(e.stateNode.containerInfo),hi(e,n,i),un=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Sa,Sa=16777216,hi(e,n,i),Sa=l):hi(e,n,i));break;default:hi(e,n,i)}}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 i=0;i<n.length;i++){var l=n[i];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 i=0;i<n.length;i++){var l=n[i];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:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,vs(n));break;default:vs(n)}e=e.sibling}}function hg(e,n){for(;gt!==null;){var i=gt;switch(i.tag){case 0:case 11:case 15:Rr(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:la(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,gt=l;else e:for(i=e;gt!==null;){l=gt;var f=l.sibling,d=l.return;if(rg(l),l===i){gt=null;break e}if(f!==null){f.return=d,gt=f;break e}gt=d}}}var VS={getCacheForType:function(e){var n=xt(at),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return xt(at).controller.signal}},GS=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Xe=null,Ne=null,Me=0,ke=0,Yt=null,Mr=!1,mi=!1,Zf=!1,ir=0,nt=0,Dr=0,_o=0,Qf=0,Xt=0,pi=0,Aa=null,Lt=null,Kf=!1,bs=0,mg=0,_s=1/0,Es=null,Or=null,mt=0,zr=null,gi=null,ar=0,Jf=0,Wf=null,pg=null,Ta=0,ed=null;function It(){return(Fe&2)!==0&&Me!==0?Me&-Me:R.T!==null?ad():Tl()}function gg(){if(Xt===0)if((Me&536870912)===0||ze){var e=Fo;Fo<<=1,(Fo&3932160)===0&&(Fo=262144),Xt=e}else Xt=536870912;return e=Gt.current,e!==null&&(e.flags|=32),Xt}function jt(e,n,i){(e===Xe&&(ke===2||ke===9)||e.cancelPendingCommit!==null)&&(yi(e,0),Br(e,Me,Xt,!1)),to(e,i),((Fe&2)===0||e!==Xe)&&(e===Xe&&((Fe&2)===0&&(_o|=i),nt===4&&Br(e,Me,Xt,!1)),Cn(e))}function yg(e,n,i){if((Fe&6)!==0)throw Error(a(327));var l=!i&&(n&127)===0&&(n&e.expiredLanes)===0||eo(e,n),f=l?XS(e,n):nd(e,n,!0),d=l;do{if(f===0){mi&&!l&&Br(e,n,0,!1);break}else{if(i=e.current.alternate,d&&!qS(i)){f=nd(e,n,!1),d=!1;continue}if(f===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 T=e;f=Aa;var H=T.current.memoizedState.isDehydrated;if(H&&(yi(T,v).flags|=256),v=nd(T,v,!1),v!==2){if(Zf&&!H){T.errorRecoveryDisabledLanes|=d,_o|=d,f=4;break e}d=Lt,Lt=f,d!==null&&(Lt===null?Lt=d:Lt.push.apply(Lt,d))}f=v}if(d=!1,f!==2)continue}}if(f===1){yi(e,0),Br(e,n,0,!0);break}e:{switch(l=e,d=f,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&&(f=bs+300-Pe(),10<f)){if(Br(l,n,Xt,!Mr),Vo(l,0,!0)!==0)break e;ar=n,l.timeoutHandle=$g(xg.bind(null,l,i,Lt,Es,Kf,n,Xt,_o,pi,Mr,d,"Throttled",-0,0),f);break e}xg(l,i,Lt,Es,Kf,n,Xt,_o,pi,Mr,d,null,-0,0)}}break}while(!0);Cn(e)}function xg(e,n,i,l,f,d,v,T,H,Q,oe,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-Pe():(d&4194048)===d?mg-Pe():0;if(pe=C2(le,pe),pe!==null){ar=d,e.cancelPendingCommit=pe(Tg.bind(null,e,n,d,i,l,f,v,T,H,oe,le,null,K,W)),Br(e,d,v,!Q);return}}Tg(e,n,d,i,l,f,v,T,H)}function qS(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],d=f.getSnapshot;f=f.value;try{if(!kt(d(),f))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;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,i,l){n&=~Qf,n&=~_o,e.suspendedLanes|=n,e.pingedLanes&=~n,l&&(e.warmLanes|=n),l=e.expirationTimes;for(var f=n;0<f;){var d=31-Ct(f),v=1<<d;l[d]=-1,f&=~v}i!==0&&Sl(e,i,n)}function Ss(){return(Fe&6)===0?(Ca(0),!1):!0}function td(){if(Ne!==null){if(ke===0)var e=Ne.return;else e=Ne,Zn=fo=null,yf(e),li=null,ua=0,e=Ne;for(;e!==null;)Zp(e.alternate,e),e=e.return;Ne=null}}function yi(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,u2(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ar=0,td(),Xe=e,Ne=i=Pn(e.current,null),Me=n,ke=0,Yt=null,Mr=!1,mi=eo(e,n),Zf=!1,pi=Xt=Qf=_o=Dr=nt=0,Lt=Aa=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 f=31-Ct(l),d=1<<f;n|=e[f],l&=~d}return ir=n,Yl(),i}function vg(e,n){Ae=null,R.H=ya,n===ai||n===Jl?(n=Um(),ke=3):n===of?(n=Um(),ke=4):ke=n===zf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Ne===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 _g(){var e=R.H;return R.H=ya,e===null?ya:e}function Eg(){var e=R.A;return R.A=VS,e}function ws(){nt=4,Mr||(Me&4194048)!==Me&&Gt.current!==null||(mi=!0),(Dr&134217727)===0&&(_o&134217727)===0||Xe===null||Br(Xe,Me,Xt,!1)}function nd(e,n,i){var l=Fe;Fe|=2;var f=_g(),d=Eg();(Xe!==e||Me!==n)&&(Es=null,yi(e,n)),n=!1;var v=nt;e:do try{if(ke!==0&&Ne!==null){var T=Ne,H=Yt;switch(ke){case 8:td(),v=6;break e;case 3:case 2:case 9:case 6:Gt.current===null&&(n=!0);var Q=ke;if(ke=0,Yt=null,xi(e,T,H,Q),i&&mi){v=0;break e}break;default:Q=ke,ke=0,Yt=null,xi(e,T,H,Q)}}YS(),v=nt;break}catch(oe){vg(e,oe)}while(!0);return n&&e.shellSuspendCounter++,Zn=fo=null,Fe=l,R.H=f,R.A=d,Ne===null&&(Xe=null,Me=0,Yl()),v}function YS(){for(;Ne!==null;)Sg(Ne)}function XS(e,n){var i=Fe;Fe|=2;var l=_g(),f=Eg();Xe!==e||Me!==n?(Es=null,_s=Pe()+500,yi(e,n)):mi=eo(e,n);e:do try{if(ke!==0&&Ne!==null){n=Ne;var d=Yt;t:switch(ke){case 1:ke=0,Yt=null,xi(e,n,d,1);break;case 2:case 9:if(zm(d)){ke=0,Yt=null,wg(n);break}n=function(){ke!==2&&ke!==9||Xe!==e||(ke=7),Cn(e)},d.then(n,n);break e;case 3:ke=7;break e;case 4:ke=5;break e;case 7:zm(d)?(ke=0,Yt=null,wg(n)):(ke=0,Yt=null,xi(e,n,d,7));break;case 5:var v=null;switch(Ne.tag){case 26:v=Ne.memoizedState;case 5:case 27:var T=Ne;if(v?uy(v):T.stateNode.complete){ke=0,Yt=null;var H=T.sibling;if(H!==null)Ne=H;else{var Q=T.return;Q!==null?(Ne=Q,As(Q)):Ne=null}break t}}ke=0,Yt=null,xi(e,n,d,5);break;case 6:ke=0,Yt=null,xi(e,n,d,6);break;case 8:td(),nt=6;break e;default:throw Error(a(462))}}IS();break}catch(oe){vg(e,oe)}while(!0);return Zn=fo=null,R.H=l,R.A=f,Fe=i,Ne!==null?0:(Xe=null,Me=0,Yl(),nt)}function IS(){for(;Ne!==null&&!jn();)Sg(Ne)}function Sg(e){var n=Pp(e.alternate,e,ir);e.memoizedProps=e.pendingProps,n===null?As(e):Ne=n}function wg(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Vp(i,n,n.pendingProps,n.type,void 0,Me);break;case 11:n=Vp(i,n,n.pendingProps,n.type.render,n.ref,Me);break;case 5:yf(n);default:Zp(i,n),n=Ne=Em(n,ir),n=Pp(i,n,ir)}e.memoizedProps=e.pendingProps,n===null?As(e):Ne=n}function xi(e,n,i,l){Zn=fo=null,yf(n),li=null,ua=0;var f=n.return;try{if(BS(e,f,n,i,Me)){nt=1,ds(e,Kt(i,e.current)),Ne=null;return}}catch(d){if(f!==null)throw Ne=f,d;nt=1,ds(e,Kt(i,e.current)),Ne=null;return}n.flags&32768?(ze||l===1?e=!0:mi||(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))),Ag(n,e)):As(n)}function As(e){var n=e;do{if((n.flags&32768)!==0){Ag(n,Mr);return}e=n.return;var i=LS(n.alternate,n,ir);if(i!==null){Ne=i;return}if(n=n.sibling,n!==null){Ne=n;return}Ne=n=e}while(n!==null);nt===0&&(nt=5)}function Ag(e,n){do{var i=jS(e.alternate,e);if(i!==null){i.flags&=32767,Ne=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=i}while(e!==null);nt=6,Ne=null}function Tg(e,n,i,l,f,d,v,T,H){e.cancelPendingCommit=null;do Ts();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,i,d,v,T,H),e===Xe&&(Ne=Xe=null,Me=0),gi=n,zr=e,ar=i,Jf=d,Wf=f,pg=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,QS(kn,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,f=L.p,L.p=2,v=Fe,Fe|=4;try{FS(e,n,i)}finally{Fe=v,L.p=f,R.T=l}}mt=1,Cg(),Ng(),Rg()}}function Cg(){if(mt===1){mt=0;var e=zr,n=gi,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=R.T,R.T=null;var l=L.p;L.p=2;var f=Fe;Fe|=4;try{lg(n,e);var d=md,v=hm(e.containerInfo),T=d.focusedElem,H=d.selectionRange;if(v!==T&&T&&T.ownerDocument&&dm(T.ownerDocument.documentElement,T)){if(H!==null&&jc(T)){var Q=H.start,oe=H.end;if(oe===void 0&&(oe=Q),"selectionStart"in T)T.selectionStart=Q,T.selectionEnd=Math.min(oe,T.value.length);else{var le=T.ownerDocument||document,K=le&&le.defaultView||window;if(K.getSelection){var W=K.getSelection(),pe=T.textContent.length,_e=Math.min(H.start,pe),Ye=H.end===void 0?_e:Math.min(H.end,pe);!W.extend&&_e>Ye&&(v=Ye,Ye=_e,_e=v);var I=fm(T,_e),G=fm(T,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(),_e>Ye?(W.addRange(Z),W.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),W.addRange(Z))}}}}for(le=[],W=T;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var ie=le[T];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}js=!!hd,md=hd=null}finally{Fe=f,L.p=l,R.T=i}}e.current=n,mt=2}}function Ng(){if(mt===2){mt=0;var e=zr,n=gi,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=R.T,R.T=null;var l=L.p;L.p=2;var f=Fe;Fe|=4;try{ng(e,n.alternate,n)}finally{Fe=f,L.p=l,R.T=i}}mt=3}}function Rg(){if(mt===4||mt===3){mt=0,Fn();var e=zr,n=gi,i=ar,l=pg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?mt=5:(mt=0,gi=zr=null,Mg(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Or=null),Ii(i),n=n.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Wr,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=R.T,f=L.p,L.p=2,R.T=null;try{for(var d=e.onRecoverableError,v=0;v<l.length;v++){var T=l[v];d(T.value,{componentStack:T.stack})}}finally{R.T=n,L.p=f}}(ar&3)!==0&&Ts(),Cn(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===ed?Ta++:(Ta=0,ed=e):Ta=0,Ca(0)}}function Mg(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,la(n)))}function Ts(){return Cg(),Ng(),Rg(),Dg()}function Dg(){if(mt!==5)return!1;var e=zr,n=Jf;Jf=0;var i=Ii(ar),l=R.T,f=L.p;try{L.p=32>i?32:i,R.T=null,i=Wf,Wf=null;var d=zr,v=ar;if(mt=0,gi=zr=null,ar=0,(Fe&6)!==0)throw Error(a(331));var T=Fe;if(Fe|=4,dg(d.current),ug(d,d.current,v,i),Fe=T,Ca(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Wr,d)}catch{}return!0}finally{L.p=f,R.T=l,Mg(e,n)}}function Og(e,n,i){n=Kt(i,n),n=Of(e.stateNode,n,2),e=Tr(e,n,2),e!==null&&(to(e,2),Cn(e))}function Ve(e,n,i){if(e.tag===3)Og(e,e,i);else for(;n!==null;){if(n.tag===3){Og(n,e,i);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(i,e),i=zp(2),l=Tr(n,i,2),l!==null&&(Bp(i,l,n,e),to(l,2),Cn(l));break}}n=n.return}}function rd(e,n,i){var l=e.pingCache;if(l===null){l=e.pingCache=new GS;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(i)||(Zf=!0,f.add(i),e=PS.bind(null,e,n,i),n.then(e,e))}function PS(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Xe===e&&(Me&i)===i&&(nt===4||nt===3&&(Me&62914560)===Me&&300>Pe()-bs?(Fe&2)===0&&yi(e,0):Qf|=i,pi===Me&&(pi=0)),Cn(e)}function zg(e,n){n===0&&(n=El()),e=so(e,n),e!==null&&(to(e,n),Cn(e))}function $S(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),zg(e,i)}function ZS(e,n){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(i=f.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,i)}function QS(e,n){return At(e,n)}var Cs=null,vi=null,od=!1,Ns=!1,id=!1,Ur=0;function Cn(e){e!==vi&&e.next===null&&(vi===null?Cs=vi=e:vi=vi.next=e),Ns=!0,od||(od=!0,JS())}function Ca(e,n){if(!id&&Ns){id=!0;do for(var i=!1,l=Cs;l!==null;){if(e!==0){var f=l.pendingLanes;if(f===0)var d=0;else{var v=l.suspendedLanes,T=l.pingedLanes;d=(1<<31-Ct(42|e)+1)-1,d&=f&~(v&~T),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,Lg(l,d))}else d=Me,d=Vo(l,l===Xe?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||eo(l,d)||(i=!0,Lg(l,d));l=l.next}while(i);id=!1}}function KS(){Bg()}function Bg(){Ns=od=!1;var e=0;Ur!==0&&s2()&&(e=Ur);for(var n=Pe(),i=null,l=Cs;l!==null;){var f=l.next,d=Ug(l,n);d===0?(l.next=null,i===null?Cs=f:i.next=f,f===null&&(vi=i)):(i=l,(e!==0||(d&3)!==0)&&(Ns=!0)),l=f}mt!==0&&mt!==5||Ca(e),Ur!==0&&(Ur=0)}function Ug(e,n){for(var i=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var v=31-Ct(d),T=1<<v,H=f[v];H===-1?((T&i)===0||(T&l)!==0)&&(f[v]=xc(T,n)):H<=n&&(e.expiredLanes|=T),d&=~T}if(n=Xe,i=Me,i=Vo(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===n&&(ke===2||ke===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&vn(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||eo(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(l!==null&&vn(l),Ii(i)){case 2:case 8:i=_n;break;case 32:i=kn;break;case 268435456:i=Lo;break;default:i=kn}return l=Hg.bind(null,e),i=At(i,l),e.callbackPriority=n,e.callbackNode=i,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 i=e.callbackNode;if(Ts()&&e.callbackNode!==i)return null;var l=Me;return l=Vo(e,e===Xe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(yg(e,l,n),Ug(e,Pe()),e.callbackNode!=null&&e.callbackNode===i?Hg.bind(null,e):null)}function Lg(e,n){if(Ts())return null;yg(e,n,!0)}function JS(){c2(function(){(Fe&6)!==0?At(an,KS):Bg()})}function ad(){if(Ur===0){var e=oi;e===0&&(e=jo,jo<<=1,(jo&261888)===0&&(jo=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 i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function WS(e,n,i,l,f){if(n==="submit"&&i&&i.stateNode===f){var d=jg((f[_t]||null).action),v=l.submitter;v&&(n=(n=v[_t]||null)?jg(n.formAction):v.getAttribute("formAction"),n!==null&&(d=n,v=null));var T=new kl("action","action",null,l,f);e.push({event:T,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ur!==0){var H=v?Fg(f,v):new FormData(f);Tf(i,{pending:!0,data:H,method:f.method,action:d},null,H)}}else typeof d=="function"&&(T.preventDefault(),H=v?Fg(f,v):new FormData(f),Tf(i,{pending:!0,data:H,method:f.method,action:d},d,H))},currentTarget:f}]})}}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(yS,"onTransitionRun"),sn(xS,"onTransitionStart"),sn(vS,"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 Na="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(Na));function kg(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],f=l.event;l=l.listeners;e:{var d=void 0;if(n)for(var v=l.length-1;0<=v;v--){var T=l[v],H=T.instance,Q=T.currentTarget;if(T=T.listener,H!==d&&f.isPropagationStopped())break e;d=T,f.currentTarget=Q;try{d(f)}catch(oe){ql(oe)}f.currentTarget=null,d=H}else for(v=0;v<l.length;v++){if(T=l[v],H=T.instance,Q=T.currentTarget,T=T.listener,H!==d&&f.isPropagationStopped())break e;d=T,f.currentTarget=Q;try{d(f)}catch(oe){ql(oe)}f.currentTarget=null,d=H}}}}function Re(e,n){var i=n[Go];i===void 0&&(i=n[Go]=new Set);var l=e+"__bubble";i.has(l)||(Vg(n,e,2,!1),i.add(l))}function ud(e,n,i){var l=0;n&&(l|=4),Vg(i,e,l,n)}var Rs="_reactListening"+Math.random().toString(36).slice(2);function cd(e){if(!e[Rs]){e[Rs]=!0,Ml.forEach(function(i){i!=="selectionchange"&&(n2.has(i)||ud(i,!1,e),ud(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Rs]||(n[Rs]=!0,ud("selectionchange",!1,n))}}function Vg(e,n,i,l){switch(gy(n)){case 2:var f=M2;break;case 8:f=D2;break;default:f=Ad}i=f.bind(null,n,i,e),f=void 0,!Rc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,i,{capture:!0,passive:f}):e.addEventListener(n,i,!0):f!==void 0?e.addEventListener(n,i,{passive:f}):e.addEventListener(n,i,!1)}function fd(e,n,i,l,f){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 T=l.stateNode.containerInfo;if(T===f)break;if(v===4)for(v=l.return;v!==null;){var H=v.tag;if((H===3||H===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;T!==null;){if(v=mr(T),v===null)return;if(H=v.tag,H===5||H===6||H===26||H===27){l=d=v;continue e}T=T.parentNode}}l=l.return}I0(function(){var Q=d,oe=Cc(i),le=[];e:{var K=bm.get(e);if(K!==void 0){var W=kl,pe=e;switch(e){case"keypress":if(jl(i)===0)break e;case"keydown":case"keyup":W=ZE;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(i.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=LE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=JE;break;case gm:case ym:case xm:W=kE;break;case vm:W=eS;break;case"scroll":case"scrollend":W=UE;break;case"wheel":W=nS;break;case"copy":case"cut":case"paste":W=GE;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=oS}var _e=(n&4)!==0,Ye=!_e&&(e==="scroll"||e==="scrollend"),I=_e?K!==null?K+"Capture":null:K;_e=[];for(var G=Q,Z;G!==null;){var ie=G;if(Z=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Z===null||I===null||(ie=Qi(G,I),ie!=null&&_e.push(Ra(G,ie,Z))),Ye)break;G=G.return}0<_e.length&&(K=new W(K,pe,null,i,oe),le.push({event:K,listeners:_e}))}}if((n&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",K&&i!==Tc&&(pe=i.relatedTarget||i.fromElement)&&(mr(pe)||pe[Gn]))break e;if((W||K)&&(K=oe.window===oe?oe:(K=oe.ownerDocument)?K.defaultView||K.parentWindow:window,W?(pe=i.relatedTarget||i.toElement,W=Q,pe=pe?mr(pe):null,pe!==null&&(Ye=u(pe),_e=pe.tag,pe!==Ye||_e!==5&&_e!==27&&_e!==6)&&(pe=null)):(W=null,pe=Q),W!==pe)){if(_e=Z0,ie="onMouseLeave",I="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(_e=K0,ie="onPointerLeave",I="onPointerEnter",G="pointer"),Ye=W==null?K:gr(W),Z=pe==null?K:gr(pe),K=new _e(ie,G+"leave",W,i,oe),K.target=Ye,K.relatedTarget=Z,ie=null,mr(oe)===Q&&(_e=new _e(I,G+"enter",pe,i,oe),_e.target=Z,_e.relatedTarget=Ye,ie=_e),Ye=ie,W&&pe)t:{for(_e=r2,I=W,G=pe,Z=0,ie=I;ie;ie=_e(ie))Z++;ie=0;for(var be=G;be;be=_e(be))ie++;for(;0<Z-ie;)I=_e(I),Z--;for(;0<ie-Z;)G=_e(G),ie--;for(;Z--;){if(I===G||G!==null&&I===G.alternate){_e=I;break t}I=_e(I),G=_e(G)}_e=null}else _e=null;W!==null&&Gg(le,K,W,_e,!1),pe!==null&&Ye!==null&&Gg(le,Ye,pe,_e,!0)}}e:{if(K=Q?gr(Q):window,W=K.nodeName&&K.nodeName.toLowerCase(),W==="select"||W==="input"&&K.type==="file")var He=im;else if(rm(K))if(am)He=mS;else{He=dS;var ye=fS}else W=K.nodeName,!W||W.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Q&&Ac(Q.elementType)&&(He=im):He=hS;if(He&&(He=He(e,Q))){om(le,He,i,oe);break e}ye&&ye(e,K,Q),e==="focusout"&&Q&&K.type==="number"&&Q.memoizedProps.value!=null&&Zi(K,"number",K.value)}switch(ye=Q?gr(Q):window,e){case"focusin":(rm(ye)||ye.contentEditable==="true")&&(Qo=ye,Fc=Q,oa=null);break;case"focusout":oa=Fc=Qo=null;break;case"mousedown":kc=!0;break;case"contextmenu":case"mouseup":case"dragend":kc=!1,mm(le,i,oe);break;case"selectionchange":if(gS)break;case"keydown":case"keyup":mm(le,i,oe)}var Ce;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 Zo?tm(e,i)&&(De="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(De="onCompositionStart");De&&(J0&&i.locale!=="ko"&&(Zo||De!=="onCompositionStart"?De==="onCompositionEnd"&&Zo&&(Ce=P0()):(vr=oe,Mc="value"in vr?vr.value:vr.textContent,Zo=!0)),ye=Ms(Q,De),0<ye.length&&(De=new Q0(De,e,null,i,oe),le.push({event:De,listeners:ye}),Ce?De.data=Ce:(Ce=nm(i),Ce!==null&&(De.data=Ce)))),(Ce=aS?lS(e,i):sS(e,i))&&(De=Ms(Q,"onBeforeInput"),0<De.length&&(ye=new Q0("onBeforeInput","beforeinput",null,i,oe),le.push({event:ye,listeners:De}),ye.data=Ce)),WS(le,e,Q,i,oe)}kg(le,n)})}function Ra(e,n,i){return{instance:e,listener:n,currentTarget:i}}function Ms(e,n){for(var i=n+"Capture",l=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=Qi(e,i),f!=null&&l.unshift(Ra(e,f,d)),f=Qi(e,n),f!=null&&l.push(Ra(e,f,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,i,l,f){for(var d=n._reactName,v=[];i!==null&&i!==l;){var T=i,H=T.alternate,Q=T.stateNode;if(T=T.tag,H!==null&&H===l)break;T!==5&&T!==26&&T!==27||Q===null||(H=Q,f?(Q=Qi(i,d),Q!=null&&v.unshift(Ra(i,Q,H))):f||(Q=Qi(i,d),Q!=null&&v.push(Ra(i,Q,H)))),i=i.return}v.length!==0&&e.push({event:n,listeners:v})}var o2=/\r\n?/g,i2=/\u0000|\uFFFD/g;function qg(e){return(typeof e=="string"?e:""+e).replace(o2,`
|
|
9
|
+
`).replace(i2,"")}function Yg(e,n){return n=qg(n),qg(e)===n}function qe(e,n,i,l,f,d){switch(i){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Io(e,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Io(e,""+l);break;case"className":Yo(e,"class",l);break;case"tabIndex":Yo(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yo(e,i,l);break;case"style":Y0(e,l,d);break;case"data":if(n!=="object"){Yo(e,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Hl(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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"&&(i==="formAction"?(n!=="input"&&qe(e,n,"name",f.name,f,null),qe(e,n,"formEncType",f.formEncType,f,null),qe(e,n,"formMethod",f.formMethod,f,null),qe(e,n,"formTarget",f.formTarget,f,null)):(qe(e,n,"encType",f.encType,f,null),qe(e,n,"method",f.method,f,null),qe(e,n,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Hl(""+l),e.setAttribute(i,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(i=l.__html,i!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=i}}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}i=Hl(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);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(i,""+l):e.removeAttribute(i);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(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Re("beforetoggle",e),Re("toggle",e),qo(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":qo(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=zE.get(i)||i,qo(e,i,l))}}function dd(e,n,i,l,f,d){switch(i){case"style":Y0(e,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Io(e,l):(typeof l=="number"||typeof l=="bigint")&&Io(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(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),n=i.slice(2,f?i.length-7:void 0),d=e[_t]||null,d=d!=null?d[i]:null,typeof d=="function"&&e.removeEventListener(n,d,f),typeof l=="function")){typeof d!="function"&&d!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,l,f);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):qo(e,i,l)}}}function bt(e,n,i){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,f=!1,d;for(d in i)if(i.hasOwnProperty(d)){var v=i[d];if(v!=null)switch(d){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:qe(e,n,d,v,i,null)}}f&&qe(e,n,"srcSet",i.srcSet,i,null),l&&qe(e,n,"src",i.src,i,null);return;case"input":Re("invalid",e);var T=d=v=f=null,H=null,Q=null;for(l in i)if(i.hasOwnProperty(l)){var oe=i[l];if(oe!=null)switch(l){case"name":f=oe;break;case"type":v=oe;break;case"checked":H=oe;break;case"defaultChecked":Q=oe;break;case"value":d=oe;break;case"defaultValue":T=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,n));break;default:qe(e,n,l,oe,i,null)}}Ul(e,d,T,H,Q,v,f,!1);return;case"select":Re("invalid",e),l=v=d=null;for(f in i)if(i.hasOwnProperty(f)&&(T=i[f],T!=null))switch(f){case"value":d=T;break;case"defaultValue":v=T;break;case"multiple":l=T;default:qe(e,n,f,T,i,null)}n=d,i=v,e.multiple=!!l,n!=null?Yn(e,!!l,n,!1):i!=null&&Yn(e,!!l,i,!0);return;case"textarea":Re("invalid",e),d=f=l=null;for(v in i)if(i.hasOwnProperty(v)&&(T=i[v],T!=null))switch(v){case"value":l=T;break;case"defaultValue":f=T;break;case"children":d=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(a(91));break;default:qe(e,n,v,T,i,null)}G0(e,l,f,d);return;case"option":for(H in i)i.hasOwnProperty(H)&&(l=i[H],l!=null)&&(H==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":qe(e,n,H,l,i,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<Na.length;l++)Re(Na[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 i)if(i.hasOwnProperty(Q)&&(l=i[Q],l!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:qe(e,n,Q,l,i,null)}return;default:if(Ac(n)){for(oe in i)i.hasOwnProperty(oe)&&(l=i[oe],l!==void 0&&dd(e,n,oe,l,i,void 0));return}}for(T in i)i.hasOwnProperty(T)&&(l=i[T],l!=null&&qe(e,n,T,l,i,null))}function a2(e,n,i,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,v=null,T=null,H=null,Q=null,oe=null;for(W in i){var le=i[W];if(i.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=i[K],l.hasOwnProperty(K)&&(W!=null||le!=null))switch(K){case"type":d=W;break;case"name":f=W;break;case"checked":Q=W;break;case"defaultChecked":oe=W;break;case"value":v=W;break;case"defaultValue":T=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)}}oo(e,v,T,H,Q,oe,d,f);return;case"select":W=v=T=K=null;for(d in i)if(H=i[d],i.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(f in l)if(d=l[f],H=i[f],l.hasOwnProperty(f)&&(d!=null||H!=null))switch(f){case"value":K=d;break;case"defaultValue":T=d;break;case"multiple":v=d;default:d!==H&&qe(e,n,f,d,l,H)}n=T,i=v,l=W,K!=null?Yn(e,!!i,K,!1):!!l!=!!i&&(n!=null?Yn(e,!!i,n,!0):Yn(e,!!i,i?[]:"",!1));return;case"textarea":W=K=null;for(T in i)if(f=i[T],i.hasOwnProperty(T)&&f!=null&&!l.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:qe(e,n,T,null,l,f)}for(v in l)if(f=l[v],d=i[v],l.hasOwnProperty(v)&&(f!=null||d!=null))switch(v){case"value":K=f;break;case"defaultValue":W=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&qe(e,n,v,f,l,d)}V0(e,K,W);return;case"option":for(var pe in i)K=i[pe],i.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=i[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 _e in i)K=i[_e],i.hasOwnProperty(_e)&&K!=null&&!l.hasOwnProperty(_e)&&qe(e,n,_e,null,l,K);for(Q in l)if(K=l[Q],W=i[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(Ac(n)){for(var Ye in i)K=i[Ye],i.hasOwnProperty(Ye)&&K!==void 0&&!l.hasOwnProperty(Ye)&&dd(e,n,Ye,void 0,l,K);for(oe in l)K=l[oe],W=i[oe],!l.hasOwnProperty(oe)||K===W||K===void 0&&W===void 0||dd(e,n,oe,K,l,W);return}}for(var I in i)K=i[I],i.hasOwnProperty(I)&&K!=null&&!l.hasOwnProperty(I)&&qe(e,n,I,null,l,K);for(le in l)K=l[le],W=i[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,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var f=i[l],d=f.transferSize,v=f.initiatorType,T=f.duration;if(d&&T&&Xg(v)){for(v=0,T=f.responseEnd,l+=1;l<i.length;l++){var H=i[l],Q=H.startTime;if(Q>T)break;var oe=H.transferSize,le=H.initiatorType;oe&&Xg(le)&&(H=H.responseEnd,v+=oe*(H<T?1:(T-Q)/(H-Q)))}if(--l,n+=8*(d+v)/(f.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 Pg(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 $g=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)}:$g;function f2(e){setTimeout(function(){throw e})}function Hr(e){return e==="head"}function Qg(e,n){var i=n,l=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(f),Si(n);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Ma(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Ma(i);for(var d=i.firstChild;d;){var v=d.nextSibling,T=d.nodeName;d[no]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&d.rel.toLowerCase()==="stylesheet"||i.removeChild(d),d=v}}else i==="body"&&Ma(e.ownerDocument.body);i=f}while(i);Si(n)}function Kg(e,n){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function yd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":yd(i),Pi(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function d2(e,n,i,l){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[no])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!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.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,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(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 i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var l=function(){n(),i.removeEventListener("DOMContentLoaded",l)};i.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 i=e.data;if(i==="/$"||i==="/&"){if(n===0)return nn(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function ey(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function ty(e,n,i){switch(n=Ds(i),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]);Pi(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:E2,S:_2,M:S2};function p2(){var e=lr.f(),n=Ss();return e||n}function g2(e){var n=pr(e);n!==null&&n.tag===5&&n.type==="form"?vp(n):lr.r(e)}var bi=typeof document>"u"?null:document;function ry(e,n,i){var l=bi;if(l&&typeof n=="string"&&n){var f=Ot(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),ny.has(f)||(ny.add(f),e={rel:e,crossOrigin:i,href:n},l.querySelector(f)===null&&(n=l.createElement("link"),bt(n,"link",e),it(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,i){lr.L(e,n,i);var l=bi;if(l&&e&&n){var f='link[rel="preload"][as="'+Ot(n)+'"]';n==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+Ot(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+Ot(i.imageSizes)+'"]')):f+='[href="'+Ot(e)+'"]';var d=f;switch(n){case"style":d=_i(e);break;case"script":d=Ei(e)}rn.has(d)||(e=g({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),rn.set(d,e),l.querySelector(f)!==null||n==="style"&&l.querySelector(Da(d))||n==="script"&&l.querySelector(Oa(d))||(n=l.createElement("link"),bt(n,"link",e),it(n),l.head.appendChild(n)))}}function b2(e,n){lr.m(e,n);var i=bi;if(i&&e){var l=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Ot(l)+'"][href="'+Ot(e)+'"]',d=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Ei(e)}if(!rn.has(d)&&(e=g({rel:"modulepreload",href:e},n),rn.set(d,e),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Oa(d)))return}l=i.createElement("link"),bt(l,"link",e),it(l),i.head.appendChild(l)}}}function _2(e,n,i){lr.S(e,n,i);var l=bi;if(l&&e){var f=yr(l).hoistableStyles,d=_i(e);n=n||"default";var v=f.get(d);if(!v){var T={loading:0,preload:null};if(v=l.querySelector(Da(d)))T.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":n},i),(i=rn.get(d))&&_d(e,i);var H=v=l.createElement("link");it(H),bt(H,"link",e),H._p=new Promise(function(Q,oe){H.onload=Q,H.onerror=oe}),H.addEventListener("load",function(){T.loading|=1}),H.addEventListener("error",function(){T.loading|=2}),T.loading|=4,zs(v,n,l)}v={type:"stylesheet",instance:v,count:1,state:T},f.set(d,v)}}}function E2(e,n){lr.X(e,n);var i=bi;if(i&&e){var l=yr(i).hoistableScripts,f=Ei(e),d=l.get(f);d||(d=i.querySelector(Oa(f)),d||(e=g({src:e,async:!0},n),(n=rn.get(f))&&Ed(e,n),d=i.createElement("script"),it(d),bt(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(f,d))}}function S2(e,n){lr.M(e,n);var i=bi;if(i&&e){var l=yr(i).hoistableScripts,f=Ei(e),d=l.get(f);d||(d=i.querySelector(Oa(f)),d||(e=g({src:e,async:!0,type:"module"},n),(n=rn.get(f))&&Ed(e,n),d=i.createElement("script"),it(d),bt(d,"link",e),i.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(f,d))}}function oy(e,n,i,l){var f=(f=he.current)?Os(f):null;if(!f)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=_i(i.href),i=yr(f).hoistableStyles,l=i.get(n),l||(l={type:"style",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=_i(i.href);var d=yr(f).hoistableStyles,v=d.get(e);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,v),(d=f.querySelector(Da(e)))&&!d._p&&(v.instance=d,v.state.loading=5),rn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},rn.set(e,i),d||w2(f,e,i,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=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ei(i),i=yr(f).hoistableScripts,l=i.get(n),l||(l={type:"script",instance:null,count:0,state:null},i.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function _i(e){return'href="'+Ot(e)+'"'}function Da(e){return'link[rel="stylesheet"]['+e+"]"}function iy(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function w2(e,n,i,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",i),it(n),e.head.appendChild(n))}function Ei(e){return'[src="'+Ot(e)+'"]'}function Oa(e){return"script[async]"+e}function ay(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var l=e.querySelector('style[data-href~="'+Ot(i.href)+'"]');if(l)return n.instance=l,it(l),l;var f=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),it(l),bt(l,"style",f),zs(l,i.precedence,e),n.instance=l;case"stylesheet":f=_i(i.href);var d=e.querySelector(Da(f));if(d)return n.state.loading|=4,n.instance=d,it(d),d;l=iy(i),(f=rn.get(f))&&_d(l,f),d=(e.ownerDocument||e).createElement("link"),it(d);var v=d;return v._p=new Promise(function(T,H){v.onload=T,v.onerror=H}),bt(d,"link",l),n.state.loading|=4,zs(d,i.precedence,e),n.instance=d;case"script":return d=Ei(i.src),(f=e.querySelector(Oa(d)))?(n.instance=f,it(f),f):(l=i,(f=rn.get(d))&&(l=g({},i),Ed(l,f)),e=e.ownerDocument||e,f=e.createElement("script"),it(f),bt(f,"link",l),e.head.appendChild(f),n.instance=f);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,i.precedence,e));return n.instance}function zs(e,n,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,d=f,v=0;v<l.length;v++){var T=l[v];if(T.dataset.precedence===n)d=T;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function _d(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Ed(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,i){if(Bs===null){var l=new Map,f=Bs=new Map;f.set(i,l)}else f=Bs,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var d=i[f];if(!(d[no]||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 T=l.get(v);T?T.push(d):l.set(v,[d])}}return l}function sy(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function A2(e,n,i){if(i===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 T2(e,n,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=_i(l.href),d=n.querySelector(Da(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Us.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=d,it(d);return}d=n.ownerDocument||n,l=iy(l),(f=rn.get(f))&&_d(l,f),d=d.createElement("link"),it(d);var v=d;v._p=new Promise(function(T,H){v.onload=T,v.onerror=H}),bt(d,"link",l),i.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Us.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var Sd=0;function C2(e,n){return e.stylesheets&&e.count===0&&Ls(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){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&&Sd===0&&(Sd=62500*l2());var f=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>Sd?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(f)}}: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(N2,e),Hs=null,Us.call(e))}function N2(e,n){if(!(n.state.loading&4)){var i=Hs.get(e);if(i)var l=i.get(null);else{i=new Map,Hs.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var v=f[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(i.set(v.dataset.precedence,v),l=v)}l&&i.set(null,l)}f=n.instance,v=f.getAttribute("data-precedence"),d=i.get(v)||l,d===l&&i.set(null,f),i.set(v,f),this.count++,l=Us.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var za={$$typeof:S,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function R2(e,n,i,l,f,d,v,T,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=Yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yi(0),this.hiddenUpdates=Yi(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function cy(e,n,i,l,f,d,v,T,H,Q,oe,le){return e=new R2(e,n,i,v,H,Q,oe,le,T),n=1,d===!0&&(n|=24),d=Vt(3,null,null,n),e.current=d,d.stateNode=e,n=tf(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:l,isDehydrated:i,cache:n},af(d),e}function fy(e){return e?(e=Wo,e):Wo}function dy(e,n,i,l,f,d){f=fy(f),l.context===null?l.context=f:l.pendingContext=f,l=Ar(n),l.payload={element:i},d=d===void 0?null:d,d!==null&&(l.callback=d),i=Tr(e,l,n),i!==null&&(jt(i,e,n),fa(i,e,n))}function hy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i: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=so(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=Xi(n);var i=so(e,n);i!==null&&jt(i,e,n),wd(e,n)}}var js=!0;function M2(e,n,i,l){var f=R.T;R.T=null;var d=L.p;try{L.p=2,Ad(e,n,i,l)}finally{L.p=d,R.T=f}}function D2(e,n,i,l){var f=R.T;R.T=null;var d=L.p;try{L.p=8,Ad(e,n,i,l)}finally{L.p=d,R.T=f}}function Ad(e,n,i,l){if(js){var f=Td(l);if(f===null)fd(e,n,l,Fs,i),yy(e,l);else if(z2(f,e,n,i,l))l.stopPropagation();else if(yy(e,l),n&4&&-1<O2.indexOf(e)){for(;f!==null;){var d=pr(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=Vn(d.pendingLanes);if(v!==0){var T=d;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var H=1<<31-Ct(v);T.entanglements[1]|=H,v&=~H}Cn(d),(Fe&6)===0&&(_s=Pe()+500,Ca(0))}}break;case 31:case 13:T=so(d,2),T!==null&&jt(T,d,2),Ss(),wd(d,2)}if(d=Td(l),d===null&&fd(e,n,l,Fs,i),d===f)break;f=d}f!==null&&l.stopPropagation()}else fd(e,n,l,null,i)}}function Td(e){return e=Cc(e),Cd(e)}var Fs=null;function Cd(e){if(Fs=null,e=mr(e),e!==null){var n=u(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=c(n),e!==null)return e;e=null}else if(i===31){if(e=h(n),e!==null)return e;e=null}else if(i===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 _n:return 8;case kn:case dc:return 32;case Lo:return 268435456;default:return 32}default:return 32}}var Nd=!1,Lr=null,jr=null,Fr=null,Ba=new Map,Ua=new Map,kr=[],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,i,l,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:d,targetContainers:[f]},n!==null&&(n=pr(n),n!==null&&my(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function z2(e,n,i,l,f){switch(n){case"focusin":return Lr=Ha(Lr,e,n,i,l,f),!0;case"dragenter":return jr=Ha(jr,e,n,i,l,f),!0;case"mouseover":return Fr=Ha(Fr,e,n,i,l,f),!0;case"pointerover":var d=f.pointerId;return Ba.set(d,Ha(Ba.get(d)||null,e,n,i,l,f)),!0;case"gotpointercapture":return d=f.pointerId,Ua.set(d,Ha(Ua.get(d)||null,e,n,i,l,f)),!0}return!1}function xy(e){var n=mr(e.target);if(n!==null){var i=u(n);if(i!==null){if(n=i.tag,n===13){if(n=c(i),n!==null){e.blockedOn=n,Cl(e.priority,function(){py(i)});return}}else if(n===31){if(n=h(i),n!==null){e.blockedOn=n,Cl(e.priority,function(){py(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ks(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Td(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Tc=l,i.target.dispatchEvent(l),Tc=null}else return n=pr(i),n!==null&&my(n),e.blockedOn=i,!1;n.shift()}return!0}function vy(e,n,i){ks(e)&&i.delete(n)}function B2(){Nd=!1,Lr!==null&&ks(Lr)&&(Lr=null),jr!==null&&ks(jr)&&(jr=null),Fr!==null&&ks(Fr)&&(Fr=null),Ba.forEach(vy),Ua.forEach(vy)}function Vs(e,n){e.blockedOn===n&&(e.blockedOn=null,Nd||(Nd=!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 i=e[n],l=e[n+1],f=e[n+2];if(typeof l!="function"){if(Cd(l||i)===null)continue;break}var d=pr(i);d!==null&&(e.splice(n,3),n-=3,Tf(d,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function Si(e){function n(H){return Vs(H,e)}Lr!==null&&Vs(Lr,e),jr!==null&&Vs(jr,e),Fr!==null&&Vs(Fr,e),Ba.forEach(n),Ua.forEach(n);for(var i=0;i<kr.length;i++){var l=kr[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<kr.length&&(i=kr[0],i.blockedOn===null);)xy(i),i.blockedOn===null&&kr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],d=i[l+1],v=f[_t]||null;if(typeof d=="function")v||by(i);else if(v){var T=null;if(d&&d.hasAttribute("formAction")){if(f=d,v=d[_t]||null)T=v.formAction;else if(Cd(f)!==null)continue}else T=v.action;typeof T=="function"?i[l+1]=T:(i.splice(l,3),l-=3),by(i)}}}function _y(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),l||setTimeout(i,20)}function i(){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,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=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 i=n.current,l=It();dy(i,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),Ss(),n[Gn]=null}};function qs(e){this._internalRoot=e}qs.prototype.unstable_scheduleHydration=function(e){if(e){var n=Tl();e={blockedOn:null,target:e,priority:n};for(var i=0;i<kr.length&&n!==0&&n<kr[i].priority;i++);kr.splice(i,0,e),i===0&&xy(e)}};var Ey=r.version;if(Ey!=="19.2.4")throw Error(a(527,Ey,"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),Tt=Ys}catch{}}return ja.createRoot=function(e,n){if(!s(e))throw Error(a(299));var i=!1,l="",f=Rp,d=Mp,v=Dp;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=cy(e,1,!1,null,null,i,l,null,f,d,v,_y),e[Gn]=n.current,cd(e),new Rd(n)},ja.hydrateRoot=function(e,n,i){if(!s(e))throw Error(a(299));var l=!1,f="",d=Rp,v=Mp,T=Dp,H=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(d=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError),i.formState!==void 0&&(H=i.formState)),n=cy(e,1,!0,n,i??null,l,f,H,d,v,T,_y),n.context=fy(null),i=n.current,l=It(),l=Xi(l),f=Ar(l),f.callback=null,Tr(i,f,l),i=l,n.current.lanes=i,to(n,i),Cn(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},o,a)=>yv&&r instanceof Blob?o?a(r):zy(r,a):xv&&(r instanceof ArrayBuffer||vv(r))?o?a(r):zy(new Blob([r]),a):a(On[t]+(r||"")),zy=(t,r)=>{const o=new FileReader;return o.onload=function(){const a=o.result.split(",")[1];r("b"+(a||""))},o.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 P2(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,o=>{Hd||(Hd=new TextEncoder),r(Hd.encode(o))})}const Uy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<Uy.length;t++)Xa[Uy.charCodeAt(t)]=t;const $2=t=>{let r=t.length*.75,o=t.length,a,s=0,u,c,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<o;a+=4)u=Xa[t.charCodeAt(a)],c=Xa[t.charCodeAt(a+1)],h=Xa[t.charCodeAt(a+2)],p=Xa[t.charCodeAt(a+3)],y[s++]=u<<2|c>>4,y[s++]=(c&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 o=t.charAt(0);return o==="b"?{type:"message",data:Q2(t.substring(1),r)}:su[o]?t.length>1?{type:su[o],data:t.substring(1)}:{type:su[o]}:lh},Q2=(t,r)=>{if(Z2){const o=$2(t);return bv(o,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,_v="",K2=(t,r)=>{const o=t.length,a=new Array(o);let s=0;t.forEach((u,c)=>{Hh(u,!1,h=>{a[c]=h,++s===o&&r(a.join(_v))})})},J2=(t,r)=>{const o=t.split(_v),a=[];for(let s=0;s<o.length;s++){const u=Lh(o[s],r);if(a.push(u),u.type==="error")break}return a};function W2(){return new TransformStream({transform(t,r){P2(t,o=>{const a=o.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(o)})}})}let Ld;function Xs(t){return t.reduce((r,o)=>r+o.length,0)}function Is(t,r){if(t[0].length===r)return t.shift();const o=new Uint8Array(r);let a=0;for(let s=0;s<r;s++)o[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)),o}function ew(t,r){Ld||(Ld=new TextDecoder);const o=[];let a=0,s=-1,u=!1;return new TransformStream({transform(c,h){for(o.push(c);;){if(a===0){if(Xs(o)<1)break;const p=Is(o,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(o)<2)break;const p=Is(o,2);s=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),a=3}else if(a===2){if(Xs(o)<8)break;const p=Is(o,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(o)<s)break;const p=Is(o,s);h.enqueue(Lh(u?p:Ld.decode(p),r)),a=0}if(s===0||s>t){h.enqueue(lh);break}}}})}const Ev=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 o(){this.off(t,o),r.apply(this,arguments)}return o.fn=r,this.on(t,o),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 o=this._callbacks["$"+t];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var a,s=0;s<o.length;s++)if(a=o[s],a===r||a.fn===r){o.splice(s,1);break}return o.length===0&&delete this._callbacks["$"+t],this};ct.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),o=this._callbacks["$"+t],a=1;a<arguments.length;a++)r[a-1]=arguments[a];if(o){o=o.slice(0);for(var a=0,s=o.length;a<s;++a)o[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,o)=>o(r,0),on=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),nw="arraybuffer";function Sv(t,...r){return r.reduce((o,a)=>(t.hasOwnProperty(a)&&(o[a]=t[a]),o),{})}const rw=on.setTimeout,ow=on.clearTimeout;function Fu(t,r){r.useNativeTimers?(t.setTimeoutFn=rw.bind(on),t.clearTimeoutFn=ow.bind(on)):(t.setTimeoutFn=on.setTimeout.bind(on),t.clearTimeoutFn=on.clearTimeout.bind(on))}const iw=1.33;function aw(t){return typeof t=="string"?lw(t):Math.ceil((t.byteLength||t.size)*iw)}function lw(t){let r=0,o=0;for(let a=0,s=t.length;a<s;a++)r=t.charCodeAt(a),r<128?o+=1:r<2048?o+=2:r<55296||r>=57344?o+=3:(a++,o+=4);return o}function wv(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function sw(t){let r="";for(let o in t)t.hasOwnProperty(o)&&(r.length&&(r+="&"),r+=encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return r}function uw(t){let r={},o=t.split("&");for(let a=0,s=o.length;a<s;a++){let u=o[a].split("=");r[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return r}class cw extends Error{constructor(r,o,a){super(r),this.description=o,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,o,a){return super.emitReserved("error",new cw(r,o,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 o=Lh(r,this.socket.binaryType);this.onPacket(o)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,o={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(o)}_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 o=sw(r);return o.length?"?"+o:""}}class fw extends jh{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const o=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||o()})),this.writable||(a++,this.once("drain",function(){--a||o()}))}else o()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const o=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(o),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,o=>{this.doWrite(o,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",o=this.query||{};return this.opts.timestampRequests!==!1&&(o[this.opts.timestampParam]=wv()),!this.supportsBinary&&!o.sid&&(o.b64=1),this.createUri(r,o)}}let Av=!1;try{Av=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const dw=Av;function hw(){}class mw extends fw{constructor(r){if(super(r),typeof location<"u"){const o=location.protocol==="https:";let a=location.port;a||(a=o?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||a!==r.port}}doWrite(r,o){const a=this.request({method:"POST",data:r});a.on("success",o),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",(o,a)=>{this.onError("xhr poll error",o,a)}),this.pollXhr=r}}class Mn extends ct{constructor(r,o,a){super(),this.createRequest=r,Fu(this,a),this._opts=a,this._method=a.method||"GET",this._uri=o,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var r;const o=Sv(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");o.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(o);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=Tv({xdomain:!1});return t&&t.responseType!==null})();class gw extends mw{constructor(r){super(r);const o=r&&r.forceBase64;this.supportsBinary=pw&&!o}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Mn(Tv,this.uri(),r)}}function Tv(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 Cv=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yw extends jh{get name(){return"websocket"}doOpen(){const r=this.uri(),o=this.opts.protocols,a=Cv?{}:Sv(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,o,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 o=0;o<r.length;o++){const a=r[o],s=o===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",o=this.query||{};return this.opts.timestampRequests&&(o[this.opts.timestampParam]=wv()),this.supportsBinary||(o.b64=1),this.createUri(r,o)}}const jd=on.WebSocket||on.MozWebSocket;class xw extends yw{createSocket(r,o,a){return Cv?new jd(r,o,a):o?new jd(r,o):new jd(r)}doWrite(r,o){this.ws.send(o)}}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 o=ew(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=r.readable.pipeThrough(o).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 c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let o=0;o<r.length;o++){const a=r[o],s=o===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},_w=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ew=["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,o=t.indexOf("["),a=t.indexOf("]");o!=-1&&a!=-1&&(t=t.substring(0,o)+t.substring(o,a).replace(/:/g,";")+t.substring(a,t.length));let s=_w.exec(t||""),u={},c=14;for(;c--;)u[Ew[c]]=s[c]||"";return o!=-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=Sw(u,u.path),u.queryKey=ww(u,u.query),u}function Sw(t,r){const o=/\/{2,9}/g,a=r.replace(o,"/").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 o={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,u){s&&(o[s]=u)}),o}const uh=typeof addEventListener=="function"&&typeof removeEventListener=="function",uu=[];uh&&addEventListener("offline",()=>{uu.forEach(t=>t())},!1);class Pr extends ct{constructor(r,o){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"&&(o=r,r=null),r){const a=sh(r);o.hostname=a.host,o.secure=a.protocol==="https"||a.protocol==="wss",o.port=a.port,a.query&&(o.query=a.query)}else o.host&&(o.hostname=sh(o.host).host);Fu(this,o),this.secure=o.secure!=null?o.secure:typeof location<"u"&&location.protocol==="https:",o.hostname&&!o.port&&(o.port=this.secure?"443":"80"),this.hostname=o.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=o.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},o.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},o),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 o=Object.assign({},this.opts.query);o.EIO=Ev,o.transport=r,this.id&&(o.sid=this.id);const a=Object.assign({},this.opts,{query:o,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&&Pr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const o=this.createTransport(r);o.open(),this.setTransport(o)}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",o=>this._onClose("transport close",o))}onOpen(){this.readyState="open",Pr.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 o=new Error("server error");o.code=r.data,this._onError(o);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 o=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(o+=aw(s)),a>0&&o>this._maxPayload)return this.writeBuffer.slice(0,a);o+=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,o,a){return this._sendPacket("message",r,o,a),this}send(r,o,a){return this._sendPacket("message",r,o,a),this}_sendPacket(r,o,a,s){if(typeof o=="function"&&(s=o,o=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:o,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()},o=()=>{this.off("upgrade",o),this.off("upgradeError",o),r()},a=()=>{this.once("upgrade",o),this.once("upgradeError",o)};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(Pr.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,o){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,o),this.writeBuffer=[],this._prevBufferLen=0}}}Pr.protocol=Ev;class Aw extends Pr{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 o=this.createTransport(r),a=!1;Pr.priorWebsocketSuccess=!1;const s=()=>{a||(o.send([{type:"ping",data:"probe"}]),o.once("packet",g=>{if(!a)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",o),!o)return;Pr.priorWebsocketSuccess=o.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(y(),this.setTransport(o),o.send([{type:"upgrade"}]),this.emitReserved("upgrade",o),o=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=o.name,this.emitReserved("upgradeError",x)}}))};function u(){a||(a=!0,y(),o.close(),o=null)}const c=g=>{const x=new Error("probe error: "+g);x.transport=o.name,u(),this.emitReserved("upgradeError",x)};function h(){c("transport closed")}function p(){c("socket closed")}function m(g){o&&g.name!==o.name&&u()}const y=()=>{o.removeListener("open",s),o.removeListener("error",c),o.removeListener("close",h),this.off("close",p),this.off("upgrading",m)};o.once("open",s),o.once("error",c),o.once("close",h),this.once("close",p),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{a||o.open()},200):o.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const o=[];for(let a=0;a<r.length;a++)~this.transports.indexOf(r[a])&&o.push(r[a]);return o}}let Tw=class extends Aw{constructor(r,o={}){const a=typeof r=="object"?r:o;(!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 Cw(t,r="",o){let a=t;o=o||typeof location<"u"&&location,t==null&&(t=o.protocol+"//"+o.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=o.protocol+t:t=o.host+t),/^(https?|wss?):\/\//.test(t)||(typeof o<"u"?t=o.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+(o&&o.port===a.port?"":":"+a.port),a}const Nw=typeof ArrayBuffer=="function",Rw=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Nv=Object.prototype.toString,Mw=typeof Blob=="function"||typeof Blob<"u"&&Nv.call(Blob)==="[object BlobConstructor]",Dw=typeof File=="function"||typeof File<"u"&&Nv.call(File)==="[object FileConstructor]";function Fh(t){return Nw&&(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 o=0,a=t.length;o<a;o++)if(cu(t[o]))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 o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&cu(t[o]))return!0;return!1}function Ow(t){const r=[],o=t.data,a=t;return a.data=ch(o,r),a.attachments=r.length,{packet:a,buffers:r}}function ch(t,r){if(!t)return t;if(Fh(t)){const o={_placeholder:!0,num:r.length};return r.push(t),o}else if(Array.isArray(t)){const o=new Array(t.length);for(let a=0;a<t.length;a++)o[a]=ch(t[a],r);return o}else if(typeof t=="object"&&!(t instanceof Date)){const o={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(o[a]=ch(t[a],r));return o}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 o=0;o<t.length;o++)t[o]=fh(t[o],r);else if(typeof t=="object")for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(t[o]=fh(t[o],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 o=""+r.type;return(r.type===Be.BINARY_EVENT||r.type===Be.BINARY_ACK)&&(o+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(o+=r.nsp+","),r.id!=null&&(o+=r.id),r.data!=null&&(o+=JSON.stringify(r.data,this.replacer)),o}encodeAsBinary(r){const o=Ow(r),a=this.encodeAsString(o.packet),s=o.buffers;return s.unshift(a),s}}class kh extends ct{constructor(r){super(),this.reviver=r}add(r){let o;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");o=this.decodeString(r);const a=o.type===Be.BINARY_EVENT;a||o.type===Be.BINARY_ACK?(o.type=a?Be.EVENT:Be.ACK,this.reconstructor=new Hw(o),o.attachments===0&&super.emitReserved("decoded",o)):super.emitReserved("decoded",o)}else if(Fh(r)||r.base64)if(this.reconstructor)o=this.reconstructor.takeBinaryData(r),o&&(this.reconstructor=null,super.emitReserved("decoded",o));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let o=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=o+1;for(;r.charAt(++o)!=="-"&&o!=r.length;);const c=r.substring(u,o);if(c!=Number(c)||r.charAt(o)!=="-")throw new Error("Illegal attachments");a.attachments=Number(c)}if(r.charAt(o+1)==="/"){const u=o+1;for(;++o&&!(r.charAt(o)===","||o===r.length););a.nsp=r.substring(u,o)}else a.nsp="/";const s=r.charAt(o+1);if(s!==""&&Number(s)==s){const u=o+1;for(;++o;){const c=r.charAt(o);if(c==null||Number(c)!=c){--o;break}if(o===r.length)break}a.id=Number(r.substring(u,o+1))}if(r.charAt(++o)){const u=this.tryParse(r.substr(o));if(kh.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,o){switch(r){case Be.CONNECT:return Ly(o);case Be.DISCONNECT:return o===void 0;case Be.CONNECT_ERROR:return typeof o=="string"||Ly(o);case Be.EVENT:case Be.BINARY_EVENT:return Array.isArray(o)&&(typeof o[0]=="number"||typeof o[0]=="string"&&Bw.indexOf(o[0])===-1);case Be.ACK:case Be.BINARY_ACK:return Array.isArray(o)}}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 o=zw(this.reconPack,this.buffers);return this.finishedReconstruction(),o}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:kh,Encoder:Uw,get PacketType(){return Be}},Symbol.toStringTag,{value:"Module"}));function dn(t,r,o){return t.on(r,o),function(){t.off(r,o)}}const jw=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Rv extends ct{constructor(r,o,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=o,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,...o){var a,s,u;if(jw.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(o.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(o),this;const c={type:Be.EVENT,data:o};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof o[o.length-1]=="function"){const y=this.ids++,g=o.pop();this._registerAckCallback(y,g),c.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(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(r,o){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[r]=o;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);o.call(this,new Error("operation has timed out"))},s),c=(...h)=>{this.io.clearTimeoutFn(u),o.apply(this,h)};c.withError=!0,this.acks[r]=c}emitWithAck(r,...o){return new Promise((a,s)=>{const u=(c,h)=>c?s(c):a(h);u.withError=!0,o.push(u),this.emit(r,...o)})}_addToQueue(r){let o;typeof r[r.length-1]=="function"&&(o=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(),o&&o(s)):(this._queue.shift(),o&&o(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 o=this._queue[0];o.pending&&!r||(o.pending=!0,o.tryCount++,this.flags=o.flags,this.emit.apply(this,o.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,o){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,o),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 o=r.data||[];r.id!=null&&o.push(this.ack(r.id)),this.connected?this.emitEvent(o):this.receiveBuffer.push(Object.freeze(o))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const o=this._anyListeners.slice();for(const a of o)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 o=this;let a=!1;return function(...s){a||(a=!0,o.packet({type:Be.ACK,id:r,data:s}))}}onack(r){const o=this.acks[r.id];typeof o=="function"&&(delete this.acks[r.id],o.withError&&r.data.unshift(null),o.apply(this,r.data))}onconnect(r,o){this.id=r,this.recovered=o&&this._pid===o,this._pid=o,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 o=this._anyListeners;for(let a=0;a<o.length;a++)if(r===o[a])return o.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 o=this._anyOutgoingListeners;for(let a=0;a<o.length;a++)if(r===o[a])return o.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const o=this._anyOutgoingListeners.slice();for(const a of o)a.apply(this,r.data)}}}function Gi(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}Gi.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),o=Math.floor(r*this.jitter*t);t=(Math.floor(r*10)&1)==0?t-o:t+o}return Math.min(t,this.max)|0};Gi.prototype.reset=function(){this.attempts=0};Gi.prototype.setMin=function(t){this.ms=t};Gi.prototype.setMax=function(t){this.max=t};Gi.prototype.setJitter=function(t){this.jitter=t};class dh extends ct{constructor(r,o){var a;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(o=r,r=void 0),o=o||{},o.path=o.path||"/socket.io",this.opts=o,Fu(this,o),this.reconnection(o.reconnection!==!1),this.reconnectionAttempts(o.reconnectionAttempts||1/0),this.reconnectionDelay(o.reconnectionDelay||1e3),this.reconnectionDelayMax(o.reconnectionDelayMax||5e3),this.randomizationFactor((a=o.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new Gi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(o.timeout==null?2e4:o.timeout),this._readyState="closed",this.uri=r;const s=o.parser||Lw;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=o.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 o;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(o=this.backoff)===null||o===void 0||o.setMin(r),this)}randomizationFactor(r){var o;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(o=this.backoff)===null||o===void 0||o.setJitter(r),this)}reconnectionDelayMax(r){var o;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(o=this.backoff)===null||o===void 0||o.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 Tw(this.uri,this.opts);const o=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=dn(o,"open",function(){a.onopen(),r&&r()}),u=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),r?r(h):this.maybeReconnectOnOpen()},c=dn(o,"error",u);if(this._timeout!==!1){const h=this._timeout,p=this.setTimeoutFn(()=>{s(),u(new Error("timeout")),o.close()},h);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(s),this.subs.push(c),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(o){this.onclose("parse error",o)}}ondecoded(r){ju(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,o){let a=this.nsps[r];return a?this._autoConnect&&!a.active&&a.connect():(a=new Rv(this,r,o),this.nsps[r]=a),a}_destroy(r){const o=Object.keys(this.nsps);for(const a of o)if(this.nsps[a].active)return;this._close()}_packet(r){const o=this.encoder.encode(r);for(let a=0;a<o.length;a++)this.engine.write(o[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,o){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,o),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 o=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()}))},o);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 o=Cw(t,r.path||"/socket.io"),a=o.source,s=o.id,u=o.path,c=Fa[s]&&u in Fa[s].nsps,h=r.forceNew||r["force new connection"]||r.multiplex===!1||c;let p;return h?p=new dh(a,r):(Fa[s]||(Fa[s]=new dh(a,r)),p=Fa[s]),o.query&&!r.query&&(r.query=o.queryKey),p.socket(o.path,r)}Object.assign(fu,{Manager:dh,Socket:Rv,io:fu,connect:fu});const Fw=`#version 300 es
|
|
10
|
+
precision mediump float;
|
|
11
|
+
|
|
12
|
+
uniform sampler2D u_texture; // input
|
|
13
|
+
uniform vec3 u_sourceColor; // color
|
|
14
|
+
uniform vec4 u_targetColor; // color [0, 0, 0, 0]
|
|
15
|
+
uniform float u_threshold; // [0, 1, 0.1]
|
|
16
|
+
|
|
17
|
+
in vec2 vUv;
|
|
18
|
+
out vec4 fragColor;
|
|
19
|
+
|
|
20
|
+
void main() {
|
|
21
|
+
vec4 texColor = texture(u_texture, vUv);
|
|
22
|
+
|
|
23
|
+
float colorDiff = distance(texColor.rgb, u_sourceColor) / 2.0;
|
|
24
|
+
|
|
25
|
+
if (colorDiff < u_threshold) {
|
|
26
|
+
fragColor = u_targetColor;
|
|
27
|
+
} else {
|
|
28
|
+
fragColor = texColor;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`,kw=`#version 300 es
|
|
32
|
+
|
|
33
|
+
precision highp float;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
uniform float u_time; // time
|
|
37
|
+
uniform vec2 u_resolution; // resolution
|
|
38
|
+
uniform vec3 u_notes;
|
|
39
|
+
uniform vec2 u_mouse; //mouse
|
|
40
|
+
|
|
41
|
+
uniform float u_flower_count; // [1, 10, 5]
|
|
42
|
+
uniform float u_flower_rotation; // [-6, 10, 5]
|
|
43
|
+
|
|
44
|
+
uniform float u_ring_radius; // [-1, 10, 2]
|
|
45
|
+
uniform float u_rotation_offset; // [1, 10, 5]
|
|
46
|
+
uniform float u_mouse_rotation; // [0, 2, 0.1]
|
|
47
|
+
uniform float u_mouse_scale_factor; // [0, 1, 0.1]
|
|
48
|
+
uniform vec3 u_origin; // [0, 0.5, -20]
|
|
49
|
+
|
|
50
|
+
in vec2 vUv;
|
|
51
|
+
out vec4 fragColor;
|
|
52
|
+
|
|
53
|
+
float sdSphere(vec3 p, float r)
|
|
54
|
+
{
|
|
55
|
+
return length(p) - r;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
float sdCappedCylinder(vec3 p, float h, float r)
|
|
59
|
+
{
|
|
60
|
+
vec2 d = abs(vec2(length(p.xz), p.y)) - vec2(r, h);
|
|
61
|
+
return min(max(d.x,d.y),0.0) + length(max(d,0.0));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
float sdCappedCone( vec3 p, float h, float r1, float r2 )
|
|
65
|
+
{
|
|
66
|
+
vec2 q = vec2( length(p.xz), p.y );
|
|
67
|
+
vec2 k1 = vec2(r2,h);
|
|
68
|
+
vec2 k2 = vec2(r2-r1,2.0*h);
|
|
69
|
+
vec2 ca = vec2(q.x-min(q.x,(q.y<0.0)?r1:r2), abs(q.y)-h);
|
|
70
|
+
vec2 cb = q - k1 + k2*clamp( dot(k1-q,k2)/dot(k2, k2), 0.0, 1.0 );
|
|
71
|
+
float s = (cb.x<0.0 && ca.y<0.0) ? -1.0 : 1.0;
|
|
72
|
+
return s*sqrt( min(dot(ca, ca),dot(cb, cb)) );
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
float sdEllipsoid(vec3 p, vec3 r)
|
|
76
|
+
{
|
|
77
|
+
return (length(p/r) - 1.0) * min(min(r.x,r.y),r.z);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
float smin(float a, float b, float k)
|
|
81
|
+
{
|
|
82
|
+
if (k <= 0.00001) return min(a, b);
|
|
83
|
+
float h = clamp(0.5 + 0.5*(b-a)/k, 0.0, 1.0);
|
|
84
|
+
return mix(b, a, h) - k*h*(1.0-h);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
float gain( float x, float k )
|
|
89
|
+
{
|
|
90
|
+
float a = 0.5*pow(2.0*((x<0.5)?x:1.0-x), k);
|
|
91
|
+
return (x<0.5)?a:1.0-a;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
vec3 rotateAroundAxis(vec3 v, vec3 axis, float angle) {
|
|
95
|
+
axis = normalize(axis);
|
|
96
|
+
float s = sin(angle);
|
|
97
|
+
float c = cos(angle);
|
|
98
|
+
float oc = 1.0 - c;
|
|
99
|
+
|
|
100
|
+
return v * c +
|
|
101
|
+
cross(axis, v) * s +
|
|
102
|
+
axis * dot(axis, v) * oc;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
float petals(vec3 p)
|
|
106
|
+
{
|
|
107
|
+
float petals = 1000.0;
|
|
108
|
+
const int PETAL_COUNT = 6;
|
|
109
|
+
for(int i = 0; i < PETAL_COUNT; i++)
|
|
110
|
+
{
|
|
111
|
+
float angle = float(i) / float(PETAL_COUNT) * 6.28318;
|
|
112
|
+
vec3 rp = p;
|
|
113
|
+
|
|
114
|
+
float c = cos(angle);
|
|
115
|
+
float s = sin(angle);
|
|
116
|
+
rp.xz = mat2(c, -s, s, c) * rp.xz;
|
|
117
|
+
|
|
118
|
+
float dist_from_center = length(rp.xz) * 7.0;
|
|
119
|
+
|
|
120
|
+
// adds dip near stem
|
|
121
|
+
rp.y -= 2.0 / pow(1.3 - (1.0-u_mouse.y * u_mouse_scale_factor) / 10.0, dist_from_center + abs(rp.x) * 5.0);
|
|
122
|
+
|
|
123
|
+
// adds tilt between leaves
|
|
124
|
+
rp.y += smoothstep(-0.9, 0.9, rp.x / 4.0) + 1.0;
|
|
125
|
+
|
|
126
|
+
// pushes petal tip out
|
|
127
|
+
rp.z += 1.0/(abs(rp.x) + 1.5) + 0.5 + (1.0-u_mouse.y * u_mouse_scale_factor) / 2.0;
|
|
128
|
+
|
|
129
|
+
float petal = sdEllipsoid(rp, vec3(0.1 + (1.0-u_mouse.y * u_mouse_scale_factor) / 10.0, 0.02, 0.2 + (1.0-u_mouse.y * u_mouse_scale_factor) / 10.0));
|
|
130
|
+
petals = smin(petals, petal, 0.1);
|
|
131
|
+
}
|
|
132
|
+
return petals;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
float trumpet(vec3 p)
|
|
136
|
+
{
|
|
137
|
+
float dist_from_center = length(p.xz);
|
|
138
|
+
vec3 p_base = p;
|
|
139
|
+
p_base.y +=1.0;
|
|
140
|
+
float trumpetbase = sdCappedCone(p_base, 0.6 + (1.0-u_mouse.y * u_mouse_scale_factor), 0.3, 0.1);
|
|
141
|
+
|
|
142
|
+
vec3 p_flare = p;
|
|
143
|
+
p_flare.y -= 1.0 / (dist_from_center + 0.4) - 3.2 - (1.0-u_mouse.y * u_mouse_scale_factor);
|
|
144
|
+
|
|
145
|
+
float r = length(p_flare.xz);
|
|
146
|
+
float angle = atan(p_flare.z, p_flare.x);
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
float hyper = 1.0 / (r + 10.0);
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
p_flare.y += hyper * sin(angle * (angle - 1.6) * 2.0);
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
float flare = sdEllipsoid(p_flare, vec3(0.09 + (1.0-u_mouse.y * u_mouse_scale_factor) / 20.0, 0.01, 0.09 + (1.0-u_mouse.y * u_mouse_scale_factor) / 20.0));
|
|
156
|
+
float trumpet = smin(trumpetbase, flare, 0.6 + (1.0-u_mouse.y * u_mouse_scale_factor) / 2.0);
|
|
157
|
+
|
|
158
|
+
return trumpet;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
float leaves(vec3 p) {
|
|
162
|
+
float leaves = 1000.0;
|
|
163
|
+
const int LEAF_COUNT = 5;
|
|
164
|
+
for(int i = 0; i < LEAF_COUNT; i++)
|
|
165
|
+
{
|
|
166
|
+
float angle = float(i) / float(LEAF_COUNT) * 6.28318;
|
|
167
|
+
vec3 rp = p;
|
|
168
|
+
|
|
169
|
+
float c = cos(angle);
|
|
170
|
+
float s = sin(angle);
|
|
171
|
+
rp.xz = mat2(c, -s, s, c) * rp.xz;
|
|
172
|
+
|
|
173
|
+
float dist_from_center = length(rp.xz);
|
|
174
|
+
|
|
175
|
+
rp.y += smoothstep(0.0,4.0, dist_from_center) * 20.0 - 15.0;
|
|
176
|
+
rp.z += angle / 4.0;
|
|
177
|
+
|
|
178
|
+
float leaf = sdEllipsoid(rp, vec3(0.5, 2.0, 0.5 + (1.0-u_mouse.y * u_mouse_scale_factor) / 2.0));
|
|
179
|
+
leaves = smin(leaves, leaf, (1.0-u_mouse.y * u_mouse_scale_factor));
|
|
180
|
+
}
|
|
181
|
+
return leaves;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
float single_flower(vec3 p)
|
|
185
|
+
{
|
|
186
|
+
float scaledTime = u_time / 2.0;
|
|
187
|
+
|
|
188
|
+
float bendStart = 7.0;
|
|
189
|
+
float bendEnd = 0.0;
|
|
190
|
+
|
|
191
|
+
float h = clamp((p.y - bendStart) / (bendEnd - bendStart), 0.0, 1.0);
|
|
192
|
+
|
|
193
|
+
h = h * h;
|
|
194
|
+
|
|
195
|
+
float maxBend = sin(u_time / 2.0) / 10.0 + 0.6 - (gain(u_notes.x - u_notes.z / 2.0, 2.0)-0.5) / 5.0;
|
|
196
|
+
|
|
197
|
+
float bendAngle = h * maxBend;
|
|
198
|
+
|
|
199
|
+
//p = rotateAroundAxis(p, vec3(1.0, 0.0, 0.0), 0.2);
|
|
200
|
+
p = rotateAroundAxis(p, vec3(0.0, 1.0, 0.0), u_flower_rotation);
|
|
201
|
+
|
|
202
|
+
p = rotateAroundAxis(p, vec3(1.0, 0.0, 0.0), -bendAngle);
|
|
203
|
+
|
|
204
|
+
//p.xz += vec2(sin(p.y * 0.2+ scaledTime), cos(p.y * 0.20 + scaledTime)) * smoothstep(-1.0, 0.0, p.y) / 2.0;
|
|
205
|
+
|
|
206
|
+
vec3 stemP = p;
|
|
207
|
+
stemP.y -= 6.0;
|
|
208
|
+
float stem = sdCappedCylinder(stemP, 7.0, 0.01);
|
|
209
|
+
|
|
210
|
+
float flower = smin(smin(petals(p), trumpet(p), 0.0), leaves(p), 0.0);
|
|
211
|
+
|
|
212
|
+
float scene = smin(flower, stem, 1.0);
|
|
213
|
+
|
|
214
|
+
return scene;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
float sceneSDF(vec3 p)
|
|
218
|
+
{
|
|
219
|
+
float radius = u_ring_radius + (1.0-u_mouse.y * u_mouse_scale_factor) * 3.0;
|
|
220
|
+
|
|
221
|
+
p = rotateAroundAxis(p, vec3(1.0, 0.0, 0.0), -0.5);
|
|
222
|
+
float angle = atan(p.z, p.x) +.4 + (sin(u_time / 4.0) ) / 10.0 - (gain(u_mouse.x, 1.2) - 0.5) * u_mouse_rotation + u_rotation_offset;
|
|
223
|
+
float r = length(p.xz);
|
|
224
|
+
|
|
225
|
+
float sectorAngle = 6.28318 / u_flower_count;
|
|
226
|
+
|
|
227
|
+
float id = floor((angle + 3.14159) / sectorAngle);
|
|
228
|
+
|
|
229
|
+
float centerAngle = id * sectorAngle + sectorAngle * 0.5 - 3.14159;
|
|
230
|
+
|
|
231
|
+
float localAngle = angle - centerAngle;
|
|
232
|
+
|
|
233
|
+
vec3 localP;
|
|
234
|
+
|
|
235
|
+
localP.x = r * cos(localAngle) - radius;
|
|
236
|
+
localP.z = r * sin(localAngle);
|
|
237
|
+
localP.y = p.y;
|
|
238
|
+
|
|
239
|
+
float variation = sin(id * 12.37);
|
|
240
|
+
|
|
241
|
+
localP = rotateAroundAxis(localP, vec3(0.0,1.0,0.0), centerAngle);
|
|
242
|
+
|
|
243
|
+
localP.y += sin(id * 5.17) * 0.35;
|
|
244
|
+
|
|
245
|
+
return single_flower(localP);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
void main()
|
|
251
|
+
{
|
|
252
|
+
vec2 uv = vec2(vUv.x * 2.0 - 1.0, (1.0 -vUv.y) * 2.0 - 1.0);
|
|
253
|
+
float aspect = u_resolution.x / u_resolution.y;
|
|
254
|
+
vec2 resolution = vec2(uv.x * aspect, uv.y) * 0.5;
|
|
255
|
+
|
|
256
|
+
vec3 ray_origin = vec3(0, (1.0-u_mouse.y * u_mouse_scale_factor) * 1.0, (1.0-u_mouse.y * u_mouse_scale_factor) * 7.0) + u_origin;
|
|
257
|
+
vec3 ray_direction = normalize(vec3(resolution, 1.0));
|
|
258
|
+
|
|
259
|
+
float MAX_DIST = 20.0 + 10.0 * (1.0-u_mouse.y * u_mouse_scale_factor);
|
|
260
|
+
const int MAX_STEPS = 100;
|
|
261
|
+
float dist_traveled = 0.0;
|
|
262
|
+
int steps = 0;
|
|
263
|
+
int intersected = 0;
|
|
264
|
+
float min_dist = 100.0;
|
|
265
|
+
|
|
266
|
+
for(int i = 0; i < MAX_STEPS; i++)
|
|
267
|
+
{
|
|
268
|
+
vec3 current_pos = ray_origin + ray_direction * dist_traveled;
|
|
269
|
+
|
|
270
|
+
float distance = sceneSDF(current_pos);
|
|
271
|
+
|
|
272
|
+
min_dist = min(distance, min_dist);
|
|
273
|
+
|
|
274
|
+
if(distance < 0.1)
|
|
275
|
+
{
|
|
276
|
+
intersected = 1;
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if(dist_traveled > MAX_DIST)
|
|
281
|
+
break;
|
|
282
|
+
|
|
283
|
+
dist_traveled += distance * 0.5;
|
|
284
|
+
steps += 1;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
fragColor = vec4(
|
|
288
|
+
mix(
|
|
289
|
+
vec3(
|
|
290
|
+
//0.0,
|
|
291
|
+
//pow(max(0.0,1.0 - float(min_dist)), 2.0 * u_notes.x + 1.0),
|
|
292
|
+
pow(max(0.0,1.0 - float(min_dist)), 0.5 * u_notes.x + 1.0) * 1.2
|
|
293
|
+
//pow(1.0 - float(steps) / float(MAX_STEPS), 2.0),
|
|
294
|
+
//1.0
|
|
295
|
+
),
|
|
296
|
+
vec3(
|
|
297
|
+
pow(max(0.0,1.0 - dist_traveled / MAX_DIST), 1.0)
|
|
298
|
+
//pow(1.0 - float(steps) / float(MAX_STEPS), 2.0)
|
|
299
|
+
//1.0
|
|
300
|
+
),
|
|
301
|
+
pow(min(1.0,(1.0 - u_notes.x - u_notes.z + u_notes.y) + 0.4), 2.0)
|
|
302
|
+
//float(intersected)
|
|
303
|
+
),
|
|
304
|
+
1.0
|
|
305
|
+
);
|
|
306
|
+
}`,Vw=`#version 300 es
|
|
307
|
+
precision mediump float;
|
|
308
|
+
|
|
309
|
+
uniform sampler2D u_texture; // input
|
|
310
|
+
uniform float u_resolution; // [1, 100, 20]
|
|
311
|
+
uniform float u_numColors; // [2, 16, 2]
|
|
312
|
+
|
|
313
|
+
in vec2 vUv;
|
|
314
|
+
out vec4 fragColor;
|
|
315
|
+
|
|
316
|
+
int bayer(int x, int y) {
|
|
317
|
+
int bayer64[64] = int[64](
|
|
318
|
+
0, 32, 8, 40, 2, 34, 10, 42,
|
|
319
|
+
48, 16, 56, 24, 50, 18, 58, 26,
|
|
320
|
+
12, 44, 4, 36, 14, 46, 6, 38,
|
|
321
|
+
60, 28, 52, 20, 62, 30, 54, 22,
|
|
322
|
+
3, 35, 11, 43, 1, 33, 9, 41,
|
|
323
|
+
51, 19, 59, 27, 49, 17, 57, 25,
|
|
324
|
+
15, 47, 7, 39, 13, 45, 5, 37,
|
|
325
|
+
63, 31, 55, 23, 61, 29, 53, 21
|
|
326
|
+
);
|
|
327
|
+
return bayer64[(y % 8) * 8 + (x % 8)];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
void main() {
|
|
331
|
+
vec2 cell = floor(vUv * u_resolution);
|
|
332
|
+
vec2 cellUv = cell / u_resolution;
|
|
333
|
+
|
|
334
|
+
vec4 color = texture(u_texture, cellUv);
|
|
335
|
+
|
|
336
|
+
float threshold = (float(bayer(int(cell.x), int(cell.y))) + 0.5) / 64.0 - 0.5;
|
|
337
|
+
|
|
338
|
+
float n = max(2.0, u_numColors);
|
|
339
|
+
float step = 1.0 / (n - 1.0);
|
|
340
|
+
vec3 dithered = clamp(round((color.rgb + threshold * step) / step) * step, 0.0, 1.0);
|
|
341
|
+
|
|
342
|
+
fragColor = vec4(dithered, color.a);
|
|
343
|
+
}
|
|
344
|
+
`,Gw=`#version 300 es
|
|
345
|
+
precision mediump float;
|
|
346
|
+
|
|
347
|
+
uniform sampler2D u_texture; // input
|
|
348
|
+
uniform float u_frequency; // [1, 100, 20]
|
|
349
|
+
uniform float u_radius; // [0, 1, 0.5]
|
|
350
|
+
uniform float u_rotation; // [0, 6.28, 0]
|
|
351
|
+
uniform float u_constantSize; // [0, 1, 0]
|
|
352
|
+
uniform vec4 u_background; // color [1, 1, 1, 1]
|
|
353
|
+
|
|
354
|
+
in vec2 vUv;
|
|
355
|
+
out vec4 fragColor;
|
|
356
|
+
|
|
357
|
+
vec2 rot(vec2 v, float a) {
|
|
358
|
+
float c = cos(a), s = sin(a);
|
|
359
|
+
return mat2(c, -s, s, c) * v;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
void main() {
|
|
363
|
+
// rotate UV space around center
|
|
364
|
+
vec2 rotUv = rot(vUv - 0.5, u_rotation) + 0.5;
|
|
365
|
+
|
|
366
|
+
// find nearest grid cell center in rotated space
|
|
367
|
+
vec2 cellUv = rotUv * u_frequency;
|
|
368
|
+
vec2 cellId = round(cellUv);
|
|
369
|
+
|
|
370
|
+
// unrotate cell center to sample from original texture
|
|
371
|
+
vec2 sampleUv = rot(cellId / u_frequency - 0.5, -u_rotation) + 0.5;
|
|
372
|
+
vec4 cellColor = texture(u_texture, clamp(sampleUv, 0.0, 1.0));
|
|
373
|
+
|
|
374
|
+
// luminance drives dot radius unless constant size is toggled
|
|
375
|
+
float lum = dot(cellColor.rgb, vec3(0.299, 0.587, 0.114));
|
|
376
|
+
float dotRadius = u_radius * mix(lum, 1.0, step(0.5, u_constantSize));
|
|
377
|
+
|
|
378
|
+
// distance from current pixel to nearest cell center (in cell-space units)
|
|
379
|
+
float dist = length(cellUv - cellId) / u_frequency * u_frequency;
|
|
380
|
+
|
|
381
|
+
fragColor = dist < dotRadius ? cellColor : u_background;
|
|
382
|
+
}
|
|
383
|
+
`,qw=`#version 300 es
|
|
384
|
+
precision highp float;
|
|
385
|
+
|
|
386
|
+
in vec2 vUv;
|
|
387
|
+
out vec4 fragColor;
|
|
388
|
+
|
|
389
|
+
uniform vec2 u_resolution; // [100, 100]
|
|
390
|
+
uniform float u_time; // time
|
|
391
|
+
uniform float u_mod_size; // [0, 2, 1]
|
|
392
|
+
uniform float u_tile_factor; // [1, 100, 10]
|
|
393
|
+
uniform vec2 u_translation; // [0,0]
|
|
394
|
+
|
|
395
|
+
float modSigned(float x, float y) {
|
|
396
|
+
return x - y * sign(x) * floor(abs(x/y));
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
void main() {
|
|
400
|
+
// Map UV coordinates to RGB
|
|
401
|
+
float aspect = u_resolution.x / u_resolution.y;
|
|
402
|
+
vec2 uv = vec2(
|
|
403
|
+
(vUv.x + sin((u_translation.x +vUv.x) * 10.0) * sin(vUv.y + u_translation.y + u_time / 100.0) * .01 ) * aspect,
|
|
404
|
+
vUv.y + sin((u_translation.y+vUv.y) * 7.0) * 0.05 * sin(vUv.x + u_translation.x + u_time / 100.)) * u_tile_factor + u_translation;
|
|
405
|
+
|
|
406
|
+
vec2 localUv = vec2(
|
|
407
|
+
mod(uv.x, u_mod_size),
|
|
408
|
+
mod(uv.y,u_mod_size)
|
|
409
|
+
);
|
|
410
|
+
|
|
411
|
+
float dist = length(
|
|
412
|
+
localUv - (u_mod_size / 2.0)
|
|
413
|
+
);
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
fragColor = mix(
|
|
417
|
+
vec4(1.0 - localUv.x, localUv.y,1., 1.0),
|
|
418
|
+
vec4(vec3(1.0), 1.0),
|
|
419
|
+
smoothstep(0.6, 0.5, dist)
|
|
420
|
+
);
|
|
421
|
+
}`,Yw=`#version 300 es
|
|
422
|
+
precision mediump float;
|
|
423
|
+
|
|
424
|
+
uniform sampler2D u_texture;
|
|
425
|
+
uniform float u_size; // [1, 100, 5]
|
|
426
|
+
uniform vec2 u_resolution; // resolution
|
|
427
|
+
|
|
428
|
+
in vec2 vUv;
|
|
429
|
+
out vec4 fragColor;
|
|
430
|
+
|
|
431
|
+
const float PI = 3.1415926535897932384626433832795;
|
|
432
|
+
|
|
433
|
+
// Gaussian function
|
|
434
|
+
float gaussian(float x, float sigma) {
|
|
435
|
+
return exp(-(x * x) / (2.0 * sigma * sigma)) / (sqrt(2.0 * PI) * sigma);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
void main() {
|
|
439
|
+
vec2 texelSize = 1.0 / u_resolution;
|
|
440
|
+
float sigma = u_size / 3.0; // Standard deviation based on size
|
|
441
|
+
|
|
442
|
+
vec4 result = vec4(0.0);
|
|
443
|
+
float totalWeight = 0.0;
|
|
444
|
+
|
|
445
|
+
int kernelRadius = int(ceil(u_size));
|
|
446
|
+
|
|
447
|
+
// Two-pass separable Gaussian blur (horizontal + vertical in one pass for simplicity)
|
|
448
|
+
// For better performance, this should be split into two passes, but for this implementation
|
|
449
|
+
// we'll do a 2D kernel
|
|
450
|
+
for (int x = -25; x <= 25; x++) {
|
|
451
|
+
if (abs(float(x)) > float(kernelRadius)) continue;
|
|
452
|
+
|
|
453
|
+
for (int y = -25; y <= 25; y++) {
|
|
454
|
+
if (abs(float(y)) > float(kernelRadius)) continue;
|
|
455
|
+
|
|
456
|
+
vec2 offset = vec2(float(x), float(y)) * texelSize;
|
|
457
|
+
vec2 sampleCoord = vUv + offset;
|
|
458
|
+
|
|
459
|
+
// Clamp to edges
|
|
460
|
+
sampleCoord = clamp(sampleCoord, vec2(0.0), vec2(1.0));
|
|
461
|
+
|
|
462
|
+
float distance = length(vec2(float(x), float(y)));
|
|
463
|
+
float weight = gaussian(distance, sigma);
|
|
464
|
+
|
|
465
|
+
result += texture(u_texture, sampleCoord) * weight;
|
|
466
|
+
totalWeight += weight;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
fragColor = result / totalWeight;
|
|
471
|
+
}
|
|
472
|
+
`,Xw=`#version 300 es
|
|
473
|
+
precision mediump float;
|
|
474
|
+
|
|
475
|
+
uniform sampler2D u_texture;
|
|
476
|
+
uniform sampler2D u_gradientTexture; // gradient
|
|
477
|
+
in vec2 vUv;
|
|
478
|
+
out vec4 fragColor;
|
|
479
|
+
|
|
480
|
+
void main() {
|
|
481
|
+
vec4 color = texture(u_texture, vUv);
|
|
482
|
+
|
|
483
|
+
float brightness = dot(color.rgb, vec3(0.299, 0.587, 0.114));
|
|
484
|
+
|
|
485
|
+
vec4 gradientColor = texture(u_gradientTexture, vec2(brightness, 0.5));
|
|
486
|
+
|
|
487
|
+
fragColor = vec4(gradientColor.rgb, 1.0);
|
|
488
|
+
}
|
|
489
|
+
`,Iw=`#version 300 es
|
|
490
|
+
precision mediump float;
|
|
491
|
+
|
|
492
|
+
uniform sampler2D u_texture; // input
|
|
493
|
+
uniform vec3 u_hslAdjust; // H (degrees), S (0-1), L (0-1) — [0, 0, 0]
|
|
494
|
+
|
|
495
|
+
in vec2 vUv;
|
|
496
|
+
out vec4 fragColor;
|
|
497
|
+
|
|
498
|
+
vec3 rgb2hsl(vec3 color) {
|
|
499
|
+
float maxC = max(max(color.r, color.g), color.b);
|
|
500
|
+
float minC = min(min(color.r, color.g), color.b);
|
|
501
|
+
float delta = maxC - minC;
|
|
502
|
+
|
|
503
|
+
float h = 0.0;
|
|
504
|
+
float s = 0.0;
|
|
505
|
+
float l = (maxC + minC) / 2.0;
|
|
506
|
+
|
|
507
|
+
if (delta != 0.0) {
|
|
508
|
+
s = l > 0.5 ? delta / (2.0 - maxC - minC) : delta / (maxC + minC);
|
|
509
|
+
|
|
510
|
+
if (color.r == maxC) {
|
|
511
|
+
h = (color.g - color.b) / delta + (color.g < color.b ? 6.0 : 0.0);
|
|
512
|
+
} else if (color.g == maxC) {
|
|
513
|
+
h = (color.b - color.r) / delta + 2.0;
|
|
514
|
+
} else {
|
|
515
|
+
h = (color.r - color.g) / delta + 4.0;
|
|
516
|
+
}
|
|
517
|
+
h /= 6.0;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
return vec3(h, s, l);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
float hue2rgb(float p, float q, float t) {
|
|
524
|
+
if (t < 0.0) t += 1.0;
|
|
525
|
+
if (t > 1.0) t -= 1.0;
|
|
526
|
+
if (t < 1.0/6.0) return p + (q - p) * 6.0 * t;
|
|
527
|
+
if (t < 1.0/2.0) return q;
|
|
528
|
+
if (t < 2.0/3.0) return p + (q - p) * (2.0/3.0 - t) * 6.0;
|
|
529
|
+
return p;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
vec3 hsl2rgb(vec3 hsl) {
|
|
533
|
+
float h = hsl.x;
|
|
534
|
+
float s = hsl.y;
|
|
535
|
+
float l = hsl.z;
|
|
536
|
+
|
|
537
|
+
if (s == 0.0) {
|
|
538
|
+
return vec3(l);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
float q = l < 0.5 ? l * (1.0 + s) : l + s - l * s;
|
|
542
|
+
float p = 2.0 * l - q;
|
|
543
|
+
return vec3(
|
|
544
|
+
hue2rgb(p, q, h + 1.0/3.0),
|
|
545
|
+
hue2rgb(p, q, h),
|
|
546
|
+
hue2rgb(p, q, h - 1.0/3.0)
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
void main() {
|
|
551
|
+
vec4 color = texture(u_texture, vUv);
|
|
552
|
+
|
|
553
|
+
vec3 hsl = rgb2hsl(color.rgb);
|
|
554
|
+
|
|
555
|
+
hsl.x = mod(hsl.x + u_hslAdjust.x / 360.0, 1.0);
|
|
556
|
+
hsl.y = clamp(hsl.y + u_hslAdjust.y, 0.0, 1.0);
|
|
557
|
+
hsl.z = clamp(hsl.z + u_hslAdjust.z, 0.0, 1.0);
|
|
558
|
+
|
|
559
|
+
fragColor = vec4(hsl2rgb(hsl), color.a);
|
|
560
|
+
}
|
|
561
|
+
`,Pw=`#version 300 es
|
|
562
|
+
precision highp float;
|
|
563
|
+
|
|
564
|
+
in vec2 vUv;
|
|
565
|
+
out vec4 fragColor;
|
|
566
|
+
|
|
567
|
+
uniform sampler2D u_image_source; // texture
|
|
568
|
+
|
|
569
|
+
void main() {
|
|
570
|
+
fragColor = texture(u_image_source, vec2(vUv.x, 1.0-vUv.y));
|
|
571
|
+
}`,$w=`#version 300 es
|
|
572
|
+
precision mediump float;
|
|
573
|
+
|
|
574
|
+
uniform sampler2D u_texture;
|
|
575
|
+
uniform float u_size; // [1, 100, 5]
|
|
576
|
+
uniform vec2 u_resolution; // resolution
|
|
577
|
+
|
|
578
|
+
in vec2 vUv;
|
|
579
|
+
out vec4 fragColor;
|
|
580
|
+
|
|
581
|
+
void main() {
|
|
582
|
+
vec2 texelSize = 1.0 / u_resolution;
|
|
583
|
+
|
|
584
|
+
vec4 result = vec4(0.0);
|
|
585
|
+
int kernelRadius = int(ceil(u_size));
|
|
586
|
+
int sampleCount = 0;
|
|
587
|
+
|
|
588
|
+
// Box blur - simple average of all pixels in the kernel
|
|
589
|
+
for (int x = -25; x <= 25; x++) {
|
|
590
|
+
if (abs(float(x)) > float(kernelRadius)) continue;
|
|
591
|
+
|
|
592
|
+
for (int y = -25; y <= 25; y++) {
|
|
593
|
+
if (abs(float(y)) > float(kernelRadius)) continue;
|
|
594
|
+
|
|
595
|
+
vec2 offset = vec2(float(x), float(y)) * texelSize;
|
|
596
|
+
vec2 sampleCoord = vUv + offset;
|
|
597
|
+
|
|
598
|
+
// Clamp to edges
|
|
599
|
+
sampleCoord = clamp(sampleCoord, vec2(0.0), vec2(1.0));
|
|
600
|
+
|
|
601
|
+
result += texture(u_texture, sampleCoord);
|
|
602
|
+
sampleCount++;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
fragColor = result / float(sampleCount);
|
|
607
|
+
}
|
|
608
|
+
`,Zw=`#version 300 es
|
|
609
|
+
precision highp float;
|
|
610
|
+
|
|
611
|
+
uniform float u_time; // time
|
|
612
|
+
uniform vec2 u_resolution; // resolution
|
|
613
|
+
uniform vec2 u_mouse;
|
|
614
|
+
uniform float u_amplitude;
|
|
615
|
+
|
|
616
|
+
uniform float u_rotation; // [0, 6.28, 0]
|
|
617
|
+
uniform float u_density; // [10, 200, 30]
|
|
618
|
+
uniform float u_threshold;
|
|
619
|
+
uniform vec4 u_line_color; // color [0,0,0,0]
|
|
620
|
+
|
|
621
|
+
uniform sampler2D u_input_tex;
|
|
622
|
+
uniform float u_mode; // [0, 1, 1]
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
in vec2 vUv;
|
|
626
|
+
out vec4 fragColor;
|
|
627
|
+
|
|
628
|
+
const float PI = 3.1415926535897932384626433832795;
|
|
629
|
+
|
|
630
|
+
/*
|
|
631
|
+
angle is in radians
|
|
632
|
+
*/
|
|
633
|
+
vec2 rotate(vec2 uv, float angle) {
|
|
634
|
+
float c = cos(angle);
|
|
635
|
+
float s = sin(angle);
|
|
636
|
+
return mat2(c, -s, s, c) * uv;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
vec2 invRotate(vec2 uv, float angle) {
|
|
640
|
+
float c = cos(angle);
|
|
641
|
+
float s = sin(angle);
|
|
642
|
+
return mat2(c, s, -s, c) * uv;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
vec2 rotateCenter(vec2 uv, float angle) {
|
|
646
|
+
return rotate(uv - vec2(.5), u_rotation) + vec2(.5);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
void main() {
|
|
650
|
+
vec2 uv = vec2(vUv.x, vUv.y);
|
|
651
|
+
vec2 uvInRotatedSpace = invRotate(uv, u_rotation);
|
|
652
|
+
vec2 targetPixInRot = vec2(floor(uvInRotatedSpace.x * u_density + 0.5)/u_density, uvInRotatedSpace.y);
|
|
653
|
+
vec2 targetPixInRot2 = vec2(floor((uvInRotatedSpace.x) * u_density + 0.5)/u_density, uvInRotatedSpace.y + sin(u_mouse) / 20.0);
|
|
654
|
+
|
|
655
|
+
float distanceFromTargetInRot = smoothstep(0.0, 1.0, abs(targetPixInRot.x - uvInRotatedSpace.x) * 1.2) * 15.0 / (1.0 + u_amplitude * 5.0);
|
|
656
|
+
float maxDist = 1.0 / u_density;
|
|
657
|
+
|
|
658
|
+
vec2 targetInCart = invRotate(targetPixInRot, -u_rotation);
|
|
659
|
+
vec2 targetInCart2 = invRotate(targetPixInRot2, -u_rotation);
|
|
660
|
+
vec4 targetColor = (texture(u_input_tex, targetInCart) + texture(u_input_tex, targetInCart2)) * 0.5;
|
|
661
|
+
|
|
662
|
+
float targetLum = pow(dot(targetColor.rgb, vec3(0.299, 0.587, 0.114)), 2.0);
|
|
663
|
+
|
|
664
|
+
// 1.0 is solid; should be shaded. 0.0 should be white space
|
|
665
|
+
float solidMask = clamp(targetLum, 0.0, 1.0) < distanceFromTargetInRot * u_density ? 1.0 : 0.0;
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
if (u_mode > 0.5) {
|
|
669
|
+
if (solidMask < 0.5) {
|
|
670
|
+
fragColor = vec4(vec3(u_line_color), 1.0);
|
|
671
|
+
} else {
|
|
672
|
+
fragColor = vec4(1.0);
|
|
673
|
+
}
|
|
674
|
+
} else {
|
|
675
|
+
if (solidMask > 0.5) {
|
|
676
|
+
fragColor = vec4(vec3(u_line_color), 1.0);
|
|
677
|
+
} else {
|
|
678
|
+
fragColor = vec4(1.0);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
}`,Qw=`#version 300 es
|
|
683
|
+
precision mediump float;
|
|
684
|
+
|
|
685
|
+
uniform sampler2D u_texture; // input
|
|
686
|
+
uniform vec3 u_rgbAdjust; // RGB offset in [−255, 255] — [0, 0, 0]
|
|
687
|
+
|
|
688
|
+
in vec2 vUv;
|
|
689
|
+
out vec4 fragColor;
|
|
690
|
+
|
|
691
|
+
void main() {
|
|
692
|
+
vec4 color = texture(u_texture, vUv);
|
|
693
|
+
vec3 adjusted = clamp(color.rgb + u_rgbAdjust / 255.0, 0.0, 1.0);
|
|
694
|
+
fragColor = vec4(adjusted, color.a);
|
|
695
|
+
}
|
|
696
|
+
`,Kw={"chromakey.frag":Fw,"dither_bayer.frag":Vw,"dots.frag":Gw,"daffodil.frag":kw,"diamonds.frag":qw,"gaussian.frag":Yw,"gradientmap.frag":Xw,"hsl.frag":Iw,"imageViewer.frag":Pw,"linear.frag":$w,"lines.frag":Zw,"rgb.frag":Qw};let Vh=Float32Array;function Gh(t,r,o){const a=new Vh(3);return t&&(a[0]=t),r&&(a[1]=r),o&&(a[2]=o),a}function Jw(t,r,o){return o=o||new Vh(3),o[0]=t[0]+r[0],o[1]=t[1]+r[1],o[2]=t[2]+r[2],o}function Ww(t,r,o){return o=o||new Vh(3),o[0]=t[0]*r[0],o[1]=t[1]*r[1],o[2]=t[2]*r[2],o}let Mv=Float32Array;function e3(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 t3(t,r){r=r||new Mv(16);const o=t[0],a=t[1],s=t[2],u=t[3],c=t[4],h=t[5],p=t[6],m=t[7],y=t[8],g=t[9],x=t[10],b=t[11],_=t[12],E=t[13],C=t[14],w=t[15],O=x*w,S=C*b,N=p*w,D=C*m,z=p*b,U=x*m,k=s*w,Y=C*u,ae=s*b,X=x*u,$=s*m,re=p*u,B=y*E,q=_*g,R=c*E,L=_*h,V=c*g,P=y*h,te=o*E,M=_*a,F=o*g,J=y*a,ne=o*h,se=c*a,he=O*h+D*g+z*E-(S*h+N*g+U*E),fe=S*a+k*g+X*E-(O*a+Y*g+ae*E),ue=N*a+Y*h+$*E-(D*a+k*h+re*E),me=U*a+ae*h+re*g-(z*a+X*h+$*g),ee=1/(o*he+c*fe+y*ue+_*me);return r[0]=ee*he,r[1]=ee*fe,r[2]=ee*ue,r[3]=ee*me,r[4]=ee*(S*c+N*y+U*_-(O*c+D*y+z*_)),r[5]=ee*(O*o+Y*y+ae*_-(S*o+k*y+X*_)),r[6]=ee*(D*o+k*c+re*_-(N*o+Y*c+$*_)),r[7]=ee*(z*o+X*c+$*y-(U*o+ae*c+re*y)),r[8]=ee*(B*m+L*b+V*w-(q*m+R*b+P*w)),r[9]=ee*(q*u+te*b+J*w-(B*u+M*b+F*w)),r[10]=ee*(R*u+M*m+ne*w-(L*u+te*m+se*w)),r[11]=ee*(P*u+F*m+se*b-(V*u+J*m+ne*b)),r[12]=ee*(R*x+P*C+q*p-(V*C+B*p+L*x)),r[13]=ee*(F*C+B*s+M*x-(te*x+J*C+q*s)),r[14]=ee*(te*p+se*C+L*s-(ne*C+R*s+M*p)),r[15]=ee*(ne*x+V*s+J*p-(F*p+se*x+P*s)),r}function n3(t,r,o){o=o||Gh();const a=r[0],s=r[1],u=r[2],c=a*t[3]+s*t[7]+u*t[11]+t[15];return o[0]=(a*t[0]+s*t[4]+u*t[8]+t[12])/c,o[1]=(a*t[1]+s*t[5]+u*t[9]+t[13])/c,o[2]=(a*t[2]+s*t[6]+u*t[10]+t[14])/c,o}function r3(t,r,o){o=o||Gh();const a=r[0],s=r[1],u=r[2];return o[0]=a*t[0]+s*t[4]+u*t[8],o[1]=a*t[1]+s*t[5]+u*t[9],o[2]=a*t[2]+s*t[6]+u*t[10],o}const qh=5120,Qa=5121,Yh=5122,Xh=5123,Ih=5124,Ph=5125,$h=5126,o3=32819,i3=32820,a3=33635,l3=5131,s3=33640,u3=35899,c3=35902,f3=36269,d3=34042,Dv={};{const t=Dv;t[qh]=Int8Array,t[Qa]=Uint8Array,t[Yh]=Int16Array,t[Xh]=Uint16Array,t[Ih]=Int32Array,t[Ph]=Uint32Array,t[$h]=Float32Array,t[o3]=Uint16Array,t[i3]=Uint16Array,t[a3]=Uint16Array,t[l3]=Uint16Array,t[s3]=Uint32Array,t[u3]=Uint32Array,t[c3]=Uint32Array,t[f3]=Uint32Array,t[d3]=Uint32Array}function ku(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 Ph;if(t instanceof Float32Array)return $h;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 Ph;if(t===Float32Array)return $h;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 h3(t,r,o){t.forEach(function(a){const s=r[a];s!==void 0&&(o[a]=s)})}function Bv(...t){console.error(...t)}const jy=new Map;function Vu(t,r){if(!t||typeof t!="object")return!1;let o=jy.get(r);o||(o=new WeakMap,jy.set(r,o));let a=o.get(t);if(a===void 0){const s=Object.prototype.toString.call(t);a=s.substring(8,s.length-1)===r,o.set(t,a)}return a}function m3(t,r){return typeof WebGLBuffer<"u"&&Vu(r,"WebGLBuffer")}function p3(t,r){return typeof WebGLRenderbuffer<"u"&&Vu(r,"WebGLRenderbuffer")}function Zh(t,r){return typeof WebGLTexture<"u"&&Vu(r,"WebGLTexture")}function g3(t,r){return typeof WebGLSampler<"u"&&Vu(r,"WebGLSampler")}const Uv=35044,$r=34962,Hv=34963,y3=34660,x3=5120,v3=5121,b3=5122,_3=5123,E3=5124,S3=5125,Lv=5126,jv={attribPrefix:""};function w3(t,r,o,a,s){t.bindBuffer(r,o),t.bufferData(r,a,s||Uv)}function Qh(t,r,o,a){if(m3(t,r))return r;o=o||$r;const s=t.createBuffer();return w3(t,o,s,r,a),s}function Fv(t){return t==="indices"}function A3(t){return t===Int8Array||t===Uint8Array}function Kh(t){return t.length?t:t.data}const T3=/coord|texture/i,C3=/color|colour/i;function N3(t,r){let o;if(T3.test(t)?o=2:C3.test(t)?o=4:o=3,r%o>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${o} but ${r} values is not evenly divisible by ${o}. You should specify it.`);return o}function Jh(t,r,o){return t.numComponents||t.size||N3(r,o||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 o=t.type?Wh(t.type):void 0;return o||(Fv(r)?o=Uint16Array:o=Float32Array),new o(t.data)}function R3(t){return typeof t=="number"?t:t?Ov(t):Lv}function Wh(t){return typeof t=="number"?zv(t):t||Float32Array}function M3(t,r){return{buffer:r.buffer,numValues:24,type:R3(r.type),arrayType:Wh(r.type)}}function D3(t,r){const o=r.data||r,a=Wh(r.type),s=o*a.BYTES_PER_ELEMENT,u=t.createBuffer();return t.bindBuffer($r,u),t.bufferData($r,s,r.drawType||Uv),{buffer:u,numValues:o,type:Ov(a),arrayType:a}}function O3(t,r,o){const a=Gu(r,o);return{arrayType:a.constructor,buffer:Qh(t,a,void 0,r.drawType),type:ku(a),numValues:0}}function z3(t,r){const o={};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");o[u]={value:s.value}}else{let c;s.buffer&&s.buffer instanceof WebGLBuffer?c=M3:typeof s=="number"||typeof s.data=="number"?c=D3:c=O3;const{buffer:h,type:p,numValues:m,arrayType:y}=c(t,s,a),g=s.normalize!==void 0?s.normalize:A3(y),x=Jh(s,a,m);o[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($r,null),o}function B3(t,r){return r===x3||r===v3?1:r===b3||r===_3?2:r===E3||r===S3||r===Lv?4:0}const Di=["position","positions","a_position"];function U3(t){let r,o;for(o=0;o<Di.length&&(r=Di[o],!(r in t));++o);o===Di.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),c=s/u;if(s%u>0)throw new Error(`numComponents ${u} not correct for length ${s}`);return c}function H3(t,r){let o,a;for(a=0;a<Di.length&&(o=Di[a],!(o in r||(o=jv.attribPrefix+o,o in r)));++a);a===Di.length&&(o=Object.keys(r)[0]);const s=r[o];if(!s.buffer)return 1;t.bindBuffer($r,s.buffer);const u=t.getBufferParameter($r,y3);t.bindBuffer($r,null);const c=B3(t,s.type),h=u/c,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 L3(t,r,o){const a=z3(t,r),s=Object.assign({},o||{});s.attribs=Object.assign({},o?o.attribs:{},a);const u=r.indices;if(u){const c=Gu(u,"indices");s.indices=Qh(t,c,Hv),s.numElements=c.length,s.elementType=ku(c)}else s.numElements||(s.numElements=H3(t,s.attribs));return s}function j3(t,r,o){const a=o==="indices"?Hv:$r,s=Gu(r,o);return Qh(t,s,a)}function F3(t,r){const o={};return Object.keys(r).forEach(function(a){o[a]=j3(t,r[a],a)}),r.indices?(o.numElements=r.indices.length,o.elementType=ku(Gu(r.indices))):o.numElements=U3(r),o}const Ao=Kh,k3=Jh;function kv(t,r){let o=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[o++]=s[u];else t[o++]=s}},t.reset=function(a){o=a||0},t.numComponents=r,Object.defineProperty(t,"numElements",{get:function(){return this.length/this.numComponents|0}}),t}function Oe(t,r,o){const a=o||Float32Array;return kv(new a(t*r),t)}function V3(t){return t!=="indices"}function G3(t){const r=t.indices,o={},a=r.length;function s(u){const c=t[u],h=c.numComponents,p=Oe(h,a,c.constructor);for(let m=0;m<a;++m){const g=r[m]*h;for(let x=0;x<h;++x)p.push(c[g+x])}o[u]=p}return Object.keys(t).filter(V3).forEach(s),o}function q3(t){if(t.indices)throw new Error("can not flatten normals of indexed vertices. deindex them first");const r=t.normal,o=r.length;for(let a=0;a<o;a+=9){const s=r[a+0],u=r[a+1],c=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,_=u+p+g,E=c+m+x;const C=Math.sqrt(b*b+_*_+E*E);b/=C,_/=C,E/=C,r[a+0]=b,r[a+1]=_,r[a+2]=E,r[a+3]=b,r[a+4]=_,r[a+5]=E,r[a+6]=b,r[a+7]=_,r[a+8]=E}return t}function e0(t,r,o){const a=t.length,s=new Float32Array(3);for(let u=0;u<a;u+=3)o(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 Y3(t,r,o){o=o||Gh();const a=r[0],s=r[1],u=r[2];return o[0]=a*t[0]+s*t[1]+u*t[2],o[1]=a*t[4]+s*t[5]+u*t[6],o[2]=a*t[8]+s*t[9]+u*t[10],o}function Vv(t,r){return e0(t,r,r3),t}function Gv(t,r){return e0(t,t3(r),Y3),t}function qv(t,r){return e0(t,r,n3),t}function Yv(t,r){return Object.keys(t).forEach(function(o){const a=t[o];o.indexOf("pos")>=0?qv(a,r):o.indexOf("tan")>=0||o.indexOf("binorm")>=0?Vv(a,r):o.indexOf("norm")>=0&&Gv(a,r)}),t}function t0(t,r,o){return t=t||2,r=r||0,o=o||0,t*=.5,{position:{numComponents:2,data:[r+-1*t,o+-1*t,r+1*t,o+-1*t,r+-1*t,o+1*t,r+1*t,o+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,o,a,s){t=t||1,r=r||1,o=o||1,a=a||1,s=s||e3();const u=(o+1)*(a+1),c=Oe(3,u),h=Oe(3,u),p=Oe(2,u);for(let x=0;x<=a;x++)for(let b=0;b<=o;b++){const _=b/o,E=x/a;c.push(t*_-t*.5,0,r*E-r*.5),h.push(0,1,0),p.push(_,E)}const m=o+1,y=Oe(3,o*a*2,Uint16Array);for(let x=0;x<a;x++)for(let b=0;b<o;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:c,normal:h,texcoord:p,indices:y},s)}function r0(t,r,o,a,s,u,c){if(r<=0||o<=0)throw new Error("subdivisionAxis and subdivisionHeight must be > 0");a=a||0,s=s||Math.PI,u=u||0,c=c||Math.PI*2;const h=s-a,p=c-u,m=(r+1)*(o+1),y=Oe(3,m),g=Oe(3,m),x=Oe(2,m);for(let E=0;E<=o;E++)for(let C=0;C<=r;C++){const w=C/r,O=E/o,S=p*w+u,N=h*O+a,D=Math.sin(S),z=Math.cos(S),U=Math.sin(N),k=Math.cos(N),Y=z*U,ae=k,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,_=Oe(3,r*o*2,Uint16Array);for(let E=0;E<r;E++)for(let C=0;C<o;C++)_.push((C+0)*b+E,(C+0)*b+E+1,(C+1)*b+E),_.push((C+1)*b+E,(C+0)*b+E+1,(C+1)*b+E+1);return{position:y,normal:g,texcoord:x,indices:_}}const X3=[[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 o0(t){t=t||1;const r=t/2,o=[[-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,c=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=X3[y];for(let b=0;b<4;++b){const _=o[g[b]],E=a[y],C=s[b];c.push(_),h.push(E),p.push(C)}const x=4*y;m.push(x+0,x+1,x+2),m.push(x+0,x+2,x+3)}return{position:c,normal:h,texcoord:p,indices:m}}function qu(t,r,o,a,s,u,c){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=c===void 0?!0:c,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),_=Oe(3,a*(s+m/2)*2,Uint16Array),E=a+1,C=Math.atan2(t-r,o),w=Math.cos(C),O=Math.sin(C),S=h?-2:0,N=s+(p?2:0);for(let D=S;D<=N;++D){let z=D/s,U=o*z,k;D<0?(U=0,z=1,k=t):D>s?(U=o,z=1,k=r):k=t+(r-t)*(D/s),(D===-2||D===s+2)&&(k=0,z=0),U-=o/2;for(let Y=0;Y<E;++Y){const ae=Math.sin(Y*Math.PI*2/a),X=Math.cos(Y*Math.PI*2/a);g.push(ae*k,U,X*k),D<0?x.push(0,-1,0):D>s?x.push(0,1,0):k===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)_.push(E*(D+0)+0+z,E*(D+0)+1+z,E*(D+1)+1+z),_.push(E*(D+0)+0+z,E*(D+1)+1+z,E*(D+1)+0+z);return{position:g,normal:x,texcoord:b,indices:_}}function Fy(t,r){r=r||[];const o=[];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 c=0;c<s;++c)o.push.apply(o,u)}return o}function i0(){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],o=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(o),u.color.push(a);for(let c=0;c<s;++c)u.indices.push(c);return u}function Yu(t,r,o,a,s,u,c){if(s<=0)throw new Error("subdivisionDown must be > 0");u=u||0,c=c||1;const h=2,p=c-u,m=(s+1)*2*(2+h),y=Oe(3,m),g=Oe(3,m),x=Oe(2,m);function b(O,S,N){return O+(S-O)*N}function _(O,S,N,D,z,U){for(let k=0;k<=s;k++){const Y=S/(h-1),ae=k/s,X=(Y-.5)*2,$=(u+ae*p)*Math.PI,re=Math.sin($),B=Math.cos($),q=b(t,O,re),R=X*a,L=B*t,V=re*q;y.push(R,L,V);const P=Jw(Ww([0,re,B],N),D);g.push(P),x.push(Y*z+U,ae)}}for(let O=0;O<h;O++){const S=(O/(h-1)-.5)*2;_(r,O,[1,1,1],[0,0,0],1,0),_(r,O,[0,0,0],[S,0,0],0,0),_(o,O,[1,1,1],[0,0,0],1,0),_(o,O,[0,0,0],[S,0,0],0,1)}const E=Oe(3,s*2*(2+h),Uint16Array);function C(O,S){for(let N=0;N<s;++N)E.push(O+N+0,O+N+1,S+N+0),E.push(O+N+1,S+N+1,S+N+0)}const w=s+1;return C(w*0,w*4),C(w*5,w*7),C(w*6,w*2),C(w*3,w*1),{position:y,normal:g,texcoord:x,indices:E}}function a0(t,r,o,a,s,u){return qu(t,t,r,o,a,s,u)}function l0(t,r,o,a,s,u){if(o<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 c=u-s,h=o+1,p=a+1,m=h*p,y=Oe(3,m),g=Oe(3,m),x=Oe(2,m),b=Oe(3,o*a*2,Uint16Array);for(let _=0;_<p;++_){const E=_/a,C=E*Math.PI*2,w=Math.sin(C),O=t+w*r,S=Math.cos(C),N=S*r;for(let D=0;D<h;++D){const z=D/o,U=s+z*c,k=Math.sin(U),Y=Math.cos(U),ae=k*O,X=Y*O,$=k*w,re=Y*w;y.push(ae,N,X),g.push($,S,re),x.push(z,1-E)}}for(let _=0;_<a;++_)for(let E=0;E<o;++E){const C=1+E,w=1+_;b.push(h*_+E,h*w+E,h*_+C),b.push(h*w+E,h*w+C,h*_+C)}return{position:y,normal:g,texcoord:x,indices:b}}function s0(t,r,o,a,s){if(r<3)throw new Error("divisions must be at least 3");o=o||1,s=s||1,a=a||0;const u=(r+1)*(o+1),c=Oe(3,u),h=Oe(3,u),p=Oe(2,u),m=Oe(3,o*r*2,Uint16Array);let y=0;const g=t-a,x=r+1;for(let b=0;b<=o;++b){const _=a+g*Math.pow(b/o,s);for(let E=0;E<=r;++E){const C=2*Math.PI*E/r,w=_*Math.cos(C),O=_*Math.sin(C);if(c.push(w,0,O),h.push(0,1,0),p.push(1-E/r,b/o),b>0&&E!==r){const S=y+(E+1),N=y+E,D=y+E-x,z=y+(E+1)-x;m.push(S,N,D),m.push(S,D,z)}}y+=r+1}return{position:c,normal:h,texcoord:p,indices:m}}function I3(t){return Math.random()*t|0}function P3(t,r){r=r||{};const o=t.position.numElements,a=Oe(4,o,Uint8Array),s=r.rand||function(u,c){return c<3?I3(256):255};if(t.color=a,t.indices)for(let u=0;u<o;++u)a.push(s(u,0),s(u,1),s(u,2),s(u,3));else{const u=r.vertsPerColor||3,c=o/u;for(let h=0;h<c;++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 o=t.apply(this,Array.prototype.slice.call(arguments,1));return F3(r,o)}}function Hn(t){return function(r){const o=t.apply(null,Array.prototype.slice.call(arguments,1));return L3(r,o)}}const $3=["numComponents","size","type","normalize","stride","offset","attrib","name","attribName"];function hh(t,r,o,a){a=a||0;const s=t.length;for(let u=0;u<s;++u)r[o+u]=t[u]+a}function Xv(t,r){const o=Ao(t),a=new o.constructor(r);let s=a;return o.numComponents&&o.numElements&&kv(a,o.numComponents),t.data&&(s={data:a},h3($3,t,s)),s}function Z3(t){const r={};let o;for(let h=0;h<t.length;++h){const p=t[h];Object.keys(p).forEach(function(m){r[m]||(r[m]=[]),!o&&m!=="indices"&&(o=m);const y=p[m],g=k3(y,m),b=Ao(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=Ao(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 _=t[x][h],E=Ao(_);h==="indices"?(hh(E,m,g,y),y+=p[x]):hh(E,m,g),g+=E.length}}const u=r[o],c={};return Object.keys(r).forEach(function(h){const p=a(h),m=Xv(p.spec,p.length);s(h,u,Ao(m)),c[h]=m}),c}function Q3(t){const r={};return Object.keys(t).forEach(function(o){const a=t[o],s=Ao(a),u=Xv(a,s.length);hh(s,Ao(u),0),r[o]=u}),r}const K3=Hn(i0),J3=Un(i0),W3=Hn(o0),eA=Un(o0),tA=Hn(n0),nA=Un(n0),rA=Hn(r0),oA=Un(r0),iA=Hn(qu),aA=Un(qu),lA=Hn(t0),sA=Un(t0),Iv=Hn(Yu),Pv=Un(Yu),uA=Hn(a0),cA=Un(a0),fA=Hn(l0),dA=Un(l0),hA=Hn(s0),mA=Un(s0),pA=Iv,gA=Pv,yA=Yu;var xA=Object.freeze({__proto__:null,create3DFBufferInfo:K3,create3DFBuffers:J3,create3DFVertices:i0,createAugmentedTypedArray:Oe,createCubeBufferInfo:W3,createCubeBuffers:eA,createCubeVertices:o0,createPlaneBufferInfo:tA,createPlaneBuffers:nA,createPlaneVertices:n0,createSphereBufferInfo:rA,createSphereBuffers:oA,createSphereVertices:r0,createTruncatedConeBufferInfo:iA,createTruncatedConeBuffers:aA,createTruncatedConeVertices:qu,createXYQuadBufferInfo:lA,createXYQuadBuffers:sA,createXYQuadVertices:t0,createCresentBufferInfo:pA,createCresentBuffers:gA,createCresentVertices:yA,createCrescentBufferInfo:Iv,createCrescentBuffers:Pv,createCrescentVertices:Yu,createCylinderBufferInfo:uA,createCylinderBuffers:cA,createCylinderVertices:a0,createTorusBufferInfo:fA,createTorusBuffers:dA,createTorusVertices:l0,createDiscBufferInfo:hA,createDiscBuffers:mA,createDiscVertices:s0,deindexVertices:G3,flattenNormals:q3,makeRandomVertexColors:P3,reorientDirections:Vv,reorientNormals:Gv,reorientPositions:qv,reorientVertices:Yv,concatVertices:Z3,duplicateVertices:Q3});function fl(t){return!!t.texStorage2D}const $v=(function(){const t={},r={};function o(a){const s=a.constructor.name;if(!t[s]){for(const u in a)if(typeof a[u]=="number"){const c=r[a[u]];r[a[u]]=c?`${c} | ${u}`:u}t[s]=!0}}return function(s,u){return o(s),r[u]||(typeof u=="number"?`0x${u.toString(16)}`:u)}})(),ka=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}})(),ky=6406,Nn=6407,et=6408,Vy=6409,Gy=6410,Va=6402,qy=34041,bu=33071,Fd=9728,kd=9729,vA=9986,cr=3553,fr=34067,Uo=32879,Mo=35866,u0=34069,bA=34070,_A=34071,EA=34072,SA=34073,wA=34074,_u=10241,Eu=10240,Su=10242,wu=10243,Yy=32882,AA=33082,TA=33083,CA=33084,NA=33085,RA=34892,MA=34893,c0=3317,Qv=3314,Kv=32878,Jv=3316,Wv=3315,eb=32877,du=37443,hu=37441,mu=37440,DA=33321,OA=36756,zA=33325,BA=33326,UA=33330,HA=33329,LA=33338,jA=33337,FA=33340,kA=33339,VA=33323,GA=36757,qA=33327,YA=33328,XA=33336,IA=33335,PA=33332,$A=33331,ZA=33334,QA=33333,KA=32849,JA=35905,WA=36194,eT=36758,tT=35898,nT=35901,rT=34843,oT=34837,iT=36221,aT=36239,lT=36215,sT=36233,uT=36209,cT=36227,fT=32856,dT=35907,hT=36759,mT=32855,pT=32854,gT=32857,yT=34842,xT=34836,vT=36220,bT=36238,_T=36975,ET=36214,ST=36232,wT=36226,AT=36208,TT=33189,CT=33190,NT=36012,RT=36013,MT=35056,Gr=5120,Qe=5121,Ps=5122,wi=5123,$s=5124,Eo=5125,St=5126,Xy=32819,Iy=32820,Py=33635,fn=5131,Ga=36193,Vd=33640,DT=35899,OT=35902,zT=36269,BT=34042,Zs=33319,Ai=33320,Qs=6403,Ti=36244,Ci=36248,So=36249,$y=33776,Zy=33777,Qy=33778,Ky=33779,Jy=35916,Wy=35917,ex=35918,tx=35919,nx=36196,rx=37488,ox=37489,ix=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,_x=37812,Ex=37813,Sx=37814,wx=37815,Ax=37816,Tx=37817,Cx=37818,Nx=37819,Rx=37820,Mx=37821,Dx=37840,Ox=37841,zx=37842,Bx=37843,Ux=37844,Hx=37845,Lx=37846,jx=37847,Fx=37848,kx=37849,Vx=37850,Gx=37851,qx=37852,Yx=37853,Xx=36492,Ix=36493,Px=36494,$x=36495,Zx=36283,Qx=36284,Kx=36285,Jx=36286;let Gd;function qi(t){if(!Gd){const o={};o[ky]={textureFormat:ky,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Qe,fn,Ga,St]},o[Vy]={textureFormat:Vy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Qe,fn,Ga,St]},o[Gy]={textureFormat:Gy,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[Qe,fn,Ga,St]},o[Nn]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[Qe,fn,Ga,St,Py]},o[et]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[Qe,fn,Ga,St,Xy,Iy]},o[Va]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Eo,wi]},o[DA]={textureFormat:Qs,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[Qe]},o[OA]={textureFormat:Qs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[Gr]},o[zA]={textureFormat:Qs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[St,fn]},o[BA]={textureFormat:Qs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[St]},o[UA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Qe]},o[HA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Gr]},o[PA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[wi]},o[$A]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Ps]},o[ZA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Eo]},o[QA]={textureFormat:Ti,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[$s]},o[VA]={textureFormat:Zs,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[Qe]},o[GA]={textureFormat:Zs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[Gr]},o[qA]={textureFormat:Zs,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[St,fn]},o[YA]={textureFormat:Zs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[St]},o[XA]={textureFormat:Ai,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Qe]},o[IA]={textureFormat:Ai,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Gr]},o[LA]={textureFormat:Ai,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[wi]},o[jA]={textureFormat:Ai,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ps]},o[FA]={textureFormat:Ai,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Eo]},o[kA]={textureFormat:Ai,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[$s]},o[KA]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[Qe]},o[JA]={textureFormat:Nn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Qe]},o[WA]={textureFormat:Nn,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[Qe,Py]},o[eT]={textureFormat:Nn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Gr]},o[tT]={textureFormat:Nn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[St,fn,DT]},o[nT]={textureFormat:Nn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[St,fn,OT]},o[rT]={textureFormat:Nn,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[St,fn]},o[oT]={textureFormat:Nn,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[St]},o[iT]={textureFormat:Ci,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Qe]},o[aT]={textureFormat:Ci,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Gr]},o[lT]={textureFormat:Ci,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[wi]},o[sT]={textureFormat:Ci,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Ps]},o[uT]={textureFormat:Ci,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Eo]},o[cT]={textureFormat:Ci,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[$s]},o[fT]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Qe]},o[dT]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Qe]},o[hT]={textureFormat:et,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[Gr]},o[mT]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[Qe,Iy,Vd]},o[pT]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[Qe,Xy]},o[gT]={textureFormat:et,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Vd]},o[yT]={textureFormat:et,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[St,fn]},o[xT]={textureFormat:et,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[St]},o[vT]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Qe]},o[bT]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Gr]},o[_T]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Vd]},o[ET]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[wi]},o[ST]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ps]},o[wT]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[$s]},o[AT]={textureFormat:So,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Eo]},o[TT]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[wi,Eo]},o[CT]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Eo]},o[NT]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[St]},o[MT]={textureFormat:qy,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[BT]},o[RT]={textureFormat:qy,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[zT]},Object.keys(o).forEach(function(u){const c=o[u];c.bytesPerElementMap={},c.bytesPerElement.forEach(function(h,p){const m=c.type[p];c.bytesPerElementMap[m]=h})});const a={bytes:8,width:4,height:4},s={bytes:16,width:4,height:4};o[$y]={textureFormat:$y,colorRenderable:!1,textureFilterable:!0,block:a},o[Zy]={textureFormat:Zy,colorRenderable:!1,textureFilterable:!0,block:a},o[Qy]={textureFormat:Qy,colorRenderable:!1,textureFilterable:!0,block:s},o[Ky]={textureFormat:Ky,colorRenderable:!1,textureFilterable:!0,block:s},o[Jy]={textureFormat:Jy,colorRenderable:!1,textureFilterable:!0,block:a},o[Wy]={textureFormat:Wy,colorRenderable:!1,textureFilterable:!0,block:a},o[ex]={textureFormat:ex,colorRenderable:!1,textureFilterable:!0,block:s},o[tx]={textureFormat:tx,colorRenderable:!1,textureFilterable:!0,block:s},o[nx]={textureFormat:nx,colorRenderable:!1,textureFilterable:!0,block:a},o[rx]={textureFormat:rx,colorRenderable:!1,textureFilterable:!0,block:a},o[ox]={textureFormat:ox,colorRenderable:!1,textureFilterable:!0,block:a},o[ix]={textureFormat:ix,colorRenderable:!1,textureFilterable:!0,block:s},o[ax]={textureFormat:ax,colorRenderable:!1,textureFilterable:!0,block:s},o[lx]={textureFormat:lx,colorRenderable:!1,textureFilterable:!0,block:a},o[sx]={textureFormat:sx,colorRenderable:!1,textureFilterable:!0,block:a},o[ux]={textureFormat:ux,colorRenderable:!1,textureFilterable:!0,block:a},o[cx]={textureFormat:cx,colorRenderable:!1,textureFilterable:!0,block:a},o[fx]={textureFormat:fx,colorRenderable:!1,textureFilterable:!0,block:s},o[dx]={textureFormat:dx,colorRenderable:!1,textureFilterable:!0,block:s},o[hx]={textureFormat:hx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:8,height:8}},o[mx]={textureFormat:mx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:16,height:8}},o[px]={textureFormat:px,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:8,height:8}},o[gx]={textureFormat:gx,colorRenderable:!1,textureFilterable:!0,block:{bytes:32,width:16,height:8}},o[yx]={textureFormat:yx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:4,height:4}},o[xx]={textureFormat:xx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:4}},o[vx]={textureFormat:vx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:5}},o[bx]={textureFormat:bx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:5}},o[_x]={textureFormat:_x,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:6}},o[Ex]={textureFormat:Ex,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:5}},o[Sx]={textureFormat:Sx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:6}},o[wx]={textureFormat:wx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:8}},o[Ax]={textureFormat:Ax,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:5}},o[Tx]={textureFormat:Tx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:6}},o[Cx]={textureFormat:Cx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:8}},o[Nx]={textureFormat:Nx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:10}},o[Rx]={textureFormat:Rx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:10}},o[Mx]={textureFormat:Mx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:12}},o[Dx]={textureFormat:Dx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:4,height:4}},o[Ox]={textureFormat:Ox,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:4}},o[zx]={textureFormat:zx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:5,height:5}},o[Bx]={textureFormat:Bx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:5}},o[Ux]={textureFormat:Ux,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:6,height:6}},o[Hx]={textureFormat:Hx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:5}},o[Lx]={textureFormat:Lx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:6}},o[jx]={textureFormat:jx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:8,height:8}},o[Fx]={textureFormat:Fx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:5}},o[kx]={textureFormat:kx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:6}},o[Vx]={textureFormat:Vx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:8}},o[Gx]={textureFormat:Gx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:10,height:10}},o[qx]={textureFormat:qx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:10}},o[Yx]={textureFormat:Yx,colorRenderable:!1,textureFilterable:!0,block:{bytes:16,width:12,height:12}},o[Xx]={textureFormat:Xx,colorRenderable:!1,textureFilterable:!0,block:s},o[Ix]={textureFormat:Ix,colorRenderable:!1,textureFilterable:!0,block:s},o[Px]={textureFormat:Px,colorRenderable:!1,textureFilterable:!0,block:s},o[$x]={textureFormat:$x,colorRenderable:!1,textureFilterable:!0,block:s},o[Zx]={textureFormat:Zx,colorRenderable:!1,textureFilterable:!0,block:a},o[Qx]={textureFormat:Qx,colorRenderable:!1,textureFilterable:!0,block:a},o[Kx]={textureFormat:Kx,colorRenderable:!1,textureFilterable:!0,block:a},o[Jx]={textureFormat:Jx,colorRenderable:!1,textureFilterable:!0,block:a},Gd=o}const r=Gd[t];if(!r)throw new Error("unknown internal format");return r}function tb(t,r){const a=qi(t).bytesPerElementMap[r];if(a===void 0)throw new Error("type not supported for internal format");return a}function dl(t){const r=qi(t);if(!r)throw new Error("unknown internal format");return{format:r.textureFormat,type:r.type?.[0]??Qe}}function nb(t){return!!qi(t).block}function UT(t,r){const o=qi(t);return o.block?{blockWidth:o.block.width,blockHeight:o.block.height,bytesPerBlock:o.block.bytes}:{blockWidth:1,blockHeight:1,bytesPerBlock:tb(t,r)}}function Wx(t){return(t&t-1)===0}function HT(t,r,o,a){if(!fl(t))return Wx(r)&&Wx(o);const s=qi(a);return s.colorRenderable&&s.textureFilterable}function qd(t){return qi(t).textureFilterable}function LT(t,r,o){return Ja(r)?ku(r):o||Qe}function Ks(t,r,o,a,s){if(s%1!==0)throw new Error("can't guess dimensions");if(!o&&!a){const u=Math.sqrt(s/(r===fr?6:1));u%1===0?(o=u,a=u):(o=s,a=1)}else if(a){if(!o&&(o=s/a,o%1))throw new Error("can't guess dimensions")}else if(a=s/o,a%1)throw new Error("can't guess dimensions");return{width:o,height:a}}function Ir(t,r,o){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)),o(),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,o,a){const s=r[o];return{[o]: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 jT(t,r,o,a){a.minMag&&(o.call(t,r,_u,a.minMag),o.call(t,r,Eu,a.minMag)),a.min&&o.call(t,r,_u,a.min),a.mag&&o.call(t,r,Eu,a.mag),a.wrap&&(o.call(t,r,Su,a.wrap),o.call(t,r,wu,a.wrap),(r===Uo||g3(t,r))&&o.call(t,r,Yy,a.wrap)),a.wrapR&&o.call(t,r,Yy,a.wrapR),a.wrapS&&o.call(t,r,Su,a.wrapS),a.wrapT&&o.call(t,r,wu,a.wrapT),a.minLod!==void 0&&o.call(t,r,AA,a.minLod),a.maxLod!==void 0&&o.call(t,r,TA,a.maxLod),a.baseLevel!==void 0&&o.call(t,r,CA,a.baseLevel),a.maxLevel!==void 0&&o.call(t,r,NA,a.maxLevel),a.compareFunc!==void 0&&o.call(t,r,MA,a.compareFunc),a.compareMode!==void 0&&o.call(t,r,RA,a.compareMode)}function ob(t,r,o){const a=o.target||cr;t.bindTexture(a,r),jT(t,a,t.texParameteri,o)}function FT(t){return t=t||Qr.textureColor,Ja(t)?t:new Uint8Array([t[0]*255,t[1]*255,t[2]*255,t[3]*255])}function ib(t,r,{options:o,width:a,height:s,internalFormat:u,lastMipLevelUploaded:c}){o=o||Qr.textureOptions,u=u||et;const h=o.target||cr;if(a=a||o.width,s=s||o.height,t.bindTexture(h,r),c>1){const p=Math.max(1,a>>c),m=Math.max(1,s>>c),y=p===1&&m===1,g=qd(u)?kd:Fd,x=qd(u)?y?vA:kd:Fd;t.texParameteri(h,Eu,g),t.texParameteri(h,_u,x)}else if(HT(t,a,s,u))t.generateMipmap(h);else{const p=qd(u)?kd:Fd;t.texParameteri(h,_u,p),t.texParameteri(h,Eu,p),t.texParameteri(h,Su,bu),t.texParameteri(h,wu,bu)}}function e1(t,r,o,a,s,u){ib(t,r,{options:o,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,bA,_A,EA,SA,wA]}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 Au(t,r,o,a){a=a||Qr.textureOptions;const s=a.target||cr,u=a.level||0;let c=o.width,h=o.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=o.width,b=o.height;let _,E;if(x/6===b)_=b,E=[0,0,1,0,2,0,3,0,4,0,5,0];else if(b/6===x)_=x,E=[0,0,0,1,0,2,0,3,0,4,0,5];else if(x/3===b/2)_=x/3,E=[0,0,1,0,2,0,0,1,1,1,2,1];else if(x/2===b/3)_=x/2,E=[0,0,1,0,0,1,1,1,0,2,1,2];else throw new Error(`can't figure out cube map from element: ${o.src?o.src:o.nodeName}`);const C=Zv();C?(C.canvas.width=_,C.canvas.height=_,c=_,h=_,Ir(t,a,()=>{ph(t,a).forEach(function(w){const O=E[w.ndx*2+0]*_,S=E[w.ndx*2+1]*_;C.drawImage(o,O,S,_,_,0,0,_,_),t.texImage2D(w.face,u,p,y,g,C.canvas)}),C.canvas.width=1,C.canvas.height=1})):typeof createImageBitmap<"u"&&(c=_,h=_,ph(t,a).forEach(function(w){const O=E[w.ndx*2+0]*_,S=E[w.ndx*2+1]*_;t.texImage2D(w.face,u,p,_,_,0,y,g,null),createImageBitmap(o,O,S,_,_,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(N){Ir(t,a,()=>{t.bindTexture(s,r),t.texImage2D(w.face,u,p,y,g,N),Wa(a)&&e1(t,r,a,c,h,p)})})}))}else s===Uo||s===Mo?Ir(t,a,()=>{const x=Math.min(o.width,o.height),b=Math.max(o.width,o.height),_=b/x;if(_%1!==0)throw new Error("can not compute 3D dimensions of element");const E=o.width===b?1:0,C=o.height===b?1:0;t.pixelStorei(c0,1),t.pixelStorei(Qv,o.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<_;++w){const O=w*x*E,S=w*x*C;t.pixelStorei(Jv,O),t.pixelStorei(Wv,S),t.texSubImage3D(s,u,0,0,w,x,x,1,y,g,o)}rb(t)}):Ir(t,a,()=>{t.texImage2D(s,u,p,y,g,o)});Wa(a)&&e1(t,r,a,c,h,p),ob(t,r,a)}function hl(){}function kT(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 VT(t,r){return r===void 0&&!kT(t)?"anonymous":r}function GT(t,r,o){o=o||hl;let a;if(r=r!==void 0?r:Qr.crossOrigin,r=VT(t,r),typeof Image<"u"){a=new Image,r!==void 0&&(a.crossOrigin=r);const s=function(){a.removeEventListener("error",u),a.removeEventListener("load",c),a=null},u=function(){const p="couldn't load image: "+t;Bv(p),o(p,a),s()},c=function(){o(null,a),s()};return a.addEventListener("error",u),a.addEventListener("load",c),a.src=t,a}else if(typeof ImageBitmap<"u"){let s,u;const c=function(){o(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(c)}).catch(function(p){s=p,setTimeout(c)}),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,o){return ab(t)?(setTimeout(function(){o(null,t)}),t):GT(t,r,o)}function h0(t,r,o){o=o||Qr.textureOptions;const a=o.target||cr;if(t.bindTexture(a,r),o.color===!1)return;const s=FT(o.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===Uo||a===Mo?t.texImage3D(a,0,et,1,1,1,0,et,Qe,s):t.texImage2D(a,0,et,1,1,0,et,Qe,s)}function qT(t,r,o,a){return a=a||hl,o=o||Qr.textureOptions,h0(t,r,o),o=f0(t,o),d0(o.src,o.crossOrigin,function(u,c){u?a(u,r,c):(Au(t,r,c,o),a(null,r,c))})}function YT(t,r,o,a){a=a||hl;const s=o.src;if(s.length!==6)throw new Error("there must be 6 urls for a cubemap");const u=o.level||0,c=o.internalFormat||o.format||et,h=dl(c),p=o.format||h.format,m=o.type||Qe,y=o.target||cr;if(y!==fr)throw new Error("target must be TEXTURE_CUBE_MAP");h0(t,r,o),o=f0(t,o);let g=6;const x=[],b=mh(t,o);let _;function E(C){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,o,()=>{t.bindTexture(y,r),g===5?mh().forEach(function(S){t.texImage2D(S,u,c,p,m,O)}):t.texImage2D(C,u,c,p,m,O),Wa(o)&&t.generateMipmap(y)}),g===0&&a(x.length?x:void 0,r,_)}}_=s.map(function(C,w){return d0(C,o.crossOrigin,E(b[w]))})}function XT(t,r,o,a){a=a||hl;const s=o.src,u=o.internalFormat||o.format||et,c=dl(u),h=o.format||c.format,p=o.type||Qe,m=o.target||Mo;if(m!==Uo&&m!==Mo)throw new Error("target must be TEXTURE_3D or TEXTURE_2D_ARRAY");h0(t,r,o),o=f0(t,o);let y=s.length;const g=[];let x;const b=o.level||0;let _=o.width,E=o.height;const C=s.length;let w=!0;function O(S){return function(N,D){--y,N?g.push(N):Ir(t,o,()=>{if(t.bindTexture(m,r),w){w=!1,_=o.width||D.width,E=o.height||D.height,t.texImage3D(m,b,u,_,E,C,0,h,p,null);for(let z=0;z<C;++z)t.texSubImage3D(m,b,0,0,z,_,E,1,h,p,D)}else{let z=D,U;(D.width!==_||D.height!==E)&&(U=Zv(),z=U.canvas,U.canvas.width=_,U.canvas.height=E,U.drawImage(D,0,0,_,E)),t.texSubImage3D(m,b,0,0,S,_,E,1,h,p,z),U&&z===U.canvas&&(U.canvas.width=0,U.canvas.height=0)}Wa(o)&&t.generateMipmap(m)}),y===0&&a(g.length?g:void 0,r,x)}}x=s.map(function(S,N){return d0(S,o.crossOrigin,O(N))})}function gh(t,r,o,a){a=a||Qr.textureOptions;const s=a.target||cr;t.bindTexture(s,r);const u=a.level||0,c=a.internalFormat||a.format||et,h=dl(c),p=a.format||h.format,m=a.type||LT(t,o,h.type);if(Ja(o))o instanceof Uint8ClampedArray&&(o=new Uint8Array(o.buffer));else{const E=zv(m);o=new E(o)}const{width:y,height:g,depth:x}=IT(s,o,a,c,p,m),b=nb(c);rb(t),t.pixelStorei(c0,a.unpackAlignment||1);let _=0;return Ir(t,a,()=>{let E=0;const{blockWidth:C,blockHeight:w,bytesPerBlock:O}=UT(c,m);for(;E<o.byteLength;){const S=Math.max(1,y>>_),N=Math.max(1,g>>_),D=s===cr?Math.max(1,x>>_):x,z=Math.ceil(S/C),U=Math.ceil(N/w),k=s===fr?6:1,Y=z*U*O*D*k;if(E+Y>o.byteLength)throw new Error("src size does not match number of mip levels");const ae=o.subarray(E/o.BYTES_PER_ELEMENT,(E+Y)/o.BYTES_PER_ELEMENT),X=u+_;if(s===fr){const $=ae.length/6;ph(t,a).forEach(re=>{const B=$*re.ndx,q=ae.subarray(B,B+$);b?t.compressedTexImage2D(re.face,X,c,S,N,0,q):t.texImage2D(re.face,X,c,S,N,0,p,m,q)})}else s===Uo||s===Mo?t.texImage3D(s,X,c,S,N,D,0,p,m,ae):b?t.compressedTexImage2D(s,X,c,S,N,0,ae):t.texImage2D(s,X,c,S,N,0,p,m,ae);if(++_,E+=Y,S===1&&N===1&&D===1&&E!==o.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+_-1}}function IT(t,r,o,a,s,u){let c=o.width,h=o.height,p=o.depth;const m=nb(a);if(m){if(!c||!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: ${$v(ka,s)}`);if(m&&(!c||!h))throw new Error("compressed texture needs to set width and height!");let x;if(t===Uo||t===Mo)if(!c&&!h&&!p){const b=Math.cbrt(g);if(b%1!==0)throw new Error(`can't guess cube size of array of numElements: ${g}`);c=b,h=b,p=b}else c&&(!h||!p)?(x=Ks(ka,t,h,p,g/c),h=x.width,p=x.height):h&&(!c||!p)?(x=Ks(ka,t,c,p,g/h),c=x.width,p=x.height):(x=Ks(ka,t,c,h,g/p),c=x.width,h=x.height);else x=Ks(ka,t,c,h,g),c=x.width,h=x.height}return{width:c,height:h,depth:p}}function PT(t,r,o){const a=o.target||cr;t.bindTexture(a,r);const s=o.level||0,u=o.internalFormat||o.format||et,c=dl(u),h=o.format||c.format,p=o.type||c.type;Ir(t,o,()=>{if(a===fr)for(let m=0;m<6;++m)t.texImage2D(u0+m,s,u,o.width,o.height,0,h,p,null);else a===Uo||a===Mo?t.texImage3D(a,s,u,o.width,o.height,o.depth,0,h,p,null):t.texImage2D(a,s,u,o.width,o.height,0,h,p,null)})}function yh(t,r,o){o=o||hl,r=r||Qr.textureOptions;const a=t.createTexture(),s=r.target||cr;let u=r.width||1,c=r.height||1,h=0;const p=r.internalFormat||et;t.bindTexture(s,a),s===fr&&(t.texParameteri(s,Su,bu),t.texParameteri(s,wu,bu));let m=r.src;if(m)if(typeof m=="function"&&(m=m(t,r)),typeof m=="string")qT(t,a,r,o);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,c=y.height,h=y.lastMipLevelUploaded}else Array.isArray(m)&&(typeof m[0]=="string"||ab(m[0]))?s===fr?YT(t,a,r,o):XT(t,a,r,o):(Au(t,a,m,r),u=m.width,c=m.height);else PT(t,a,r);return Wa(r)&&ib(t,a,{options:r,width:u,height:c,internalFormat:p,lastMipLevelUploaded:h}),ob(t,a,r),a}const m0=Bv;function lb(t){return typeof document<"u"&&document.getElementById?document.getElementById(t):null}const Tu=33984,Xu=34962,$T=34963,ZT=35713,QT=35714,KT=35632,JT=35633,WT=35981,sb=35718,eC=35721,tC=35971,nC=35382,rC=35396,oC=35398,iC=35392,aC=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,_b=35676,lC=35678,sC=35680,uC=35679,cC=35682,fC=35685,dC=35686,hC=35687,mC=35688,pC=35689,gC=35690,yC=36289,xC=36292,vC=36293,g0=5125,Eb=36294,Sb=36295,wb=36296,bC=36298,_C=36299,EC=36300,SC=36303,wC=36306,AC=36307,TC=36308,CC=36311,Pu=3553,$u=34067,y0=32879,Zu=35866,we={};function Ab(t,r){return we[r].bindPoint}function NC(t,r){return function(o){t.uniform1f(r,o)}}function RC(t,r){return function(o){t.uniform1fv(r,o)}}function MC(t,r){return function(o){t.uniform2fv(r,o)}}function DC(t,r){return function(o){t.uniform3fv(r,o)}}function OC(t,r){return function(o){t.uniform4fv(r,o)}}function Tb(t,r){return function(o){t.uniform1i(r,o)}}function Cb(t,r){return function(o){t.uniform1iv(r,o)}}function Nb(t,r){return function(o){t.uniform2iv(r,o)}}function Rb(t,r){return function(o){t.uniform3iv(r,o)}}function Mb(t,r){return function(o){t.uniform4iv(r,o)}}function zC(t,r){return function(o){t.uniform1ui(r,o)}}function BC(t,r){return function(o){t.uniform1uiv(r,o)}}function UC(t,r){return function(o){t.uniform2uiv(r,o)}}function HC(t,r){return function(o){t.uniform3uiv(r,o)}}function LC(t,r){return function(o){t.uniform4uiv(r,o)}}function jC(t,r){return function(o){t.uniformMatrix2fv(r,!1,o)}}function FC(t,r){return function(o){t.uniformMatrix3fv(r,!1,o)}}function kC(t,r){return function(o){t.uniformMatrix4fv(r,!1,o)}}function VC(t,r){return function(o){t.uniformMatrix2x3fv(r,!1,o)}}function GC(t,r){return function(o){t.uniformMatrix3x2fv(r,!1,o)}}function qC(t,r){return function(o){t.uniformMatrix2x4fv(r,!1,o)}}function YC(t,r){return function(o){t.uniformMatrix4x2fv(r,!1,o)}}function XC(t,r){return function(o){t.uniformMatrix3x4fv(r,!1,o)}}function IC(t,r){return function(o){t.uniformMatrix4x3fv(r,!1,o)}}function Rt(t,r,o,a){const s=Ab(t,r);return fl(t)?function(u){let c,h;!u||Zh(t,u)?(c=u,h=null):(c=u.texture,h=u.sampler),t.uniform1i(a,o),t.activeTexture(Tu+o),t.bindTexture(s,c),t.bindSampler(o,h)}:function(u){t.uniform1i(a,o),t.activeTexture(Tu+o),t.bindTexture(s,u)}}function Mt(t,r,o,a,s){const u=Ab(t,r),c=new Int32Array(s);for(let h=0;h<s;++h)c[h]=o+h;return fl(t)?function(h){t.uniform1iv(a,c),h.forEach(function(p,m){t.activeTexture(Tu+c[m]);let y,g;!p||Zh(t,p)?(y=p,g=null):(y=p.texture,g=p.sampler),t.bindSampler(o,g),t.bindTexture(u,y)})}:function(h){t.uniform1iv(a,c),h.forEach(function(p,m){t.activeTexture(Tu+c[m]),t.bindTexture(u,p)})}}we[Iu]={Type:Float32Array,size:4,setter:NC,arraySetter:RC};we[ub]={Type:Float32Array,size:8,setter:MC,cols:2};we[cb]={Type:Float32Array,size:12,setter:DC,cols:3};we[fb]={Type:Float32Array,size:16,setter:OC,cols:4};we[p0]={Type:Int32Array,size:4,setter:Tb,arraySetter:Cb};we[db]={Type:Int32Array,size:8,setter:Nb,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:zC,arraySetter:BC};we[Eb]={Type:Uint32Array,size:8,setter:UC,cols:2};we[Sb]={Type:Uint32Array,size:12,setter:HC,cols:3};we[wb]={Type:Uint32Array,size:16,setter:LC,cols:4};we[pb]={Type:Uint32Array,size:4,setter:Tb,arraySetter:Cb};we[gb]={Type:Uint32Array,size:8,setter:Nb,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:jC,rows:2,cols:2};we[bb]={Type:Float32Array,size:48,setter:FC,rows:3,cols:3};we[_b]={Type:Float32Array,size:64,setter:kC,rows:4,cols:4};we[fC]={Type:Float32Array,size:32,setter:VC,rows:2,cols:3};we[dC]={Type:Float32Array,size:32,setter:qC,rows:2,cols:4};we[hC]={Type:Float32Array,size:48,setter:GC,rows:3,cols:2};we[mC]={Type:Float32Array,size:48,setter:XC,rows:3,cols:4};we[pC]={Type:Float32Array,size:64,setter:YC,rows:4,cols:2};we[gC]={Type:Float32Array,size:64,setter:IC,rows:4,cols:3};we[lC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[sC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[uC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:y0};we[cC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[yC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};we[xC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};we[vC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[bC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[_C]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:y0};we[EC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[SC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};we[wC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Pu};we[AC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:y0};we[TC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:$u};we[CC]={Type:null,size:0,setter:Rt,arraySetter:Mt,bindPoint:Zu};function Qu(t,r){return function(o){if(o.value)switch(t.disableVertexAttribArray(r),o.value.length){case 4:t.vertexAttrib4fv(r,o.value);break;case 3:t.vertexAttrib3fv(r,o.value);break;case 2:t.vertexAttrib2fv(r,o.value);break;case 1:t.vertexAttrib1fv(r,o.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else t.bindBuffer(Xu,o.buffer),t.enableVertexAttribArray(r),t.vertexAttribPointer(r,o.numComponents||o.size,o.type||Iu,o.normalize||!1,o.stride||0,o.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,o.divisor||0)}}function Kr(t,r){return function(o){if(o.value)if(t.disableVertexAttribArray(r),o.value.length===4)t.vertexAttrib4iv(r,o.value);else throw new Error("The length of an integer constant value must be 4!");else t.bindBuffer(Xu,o.buffer),t.enableVertexAttribArray(r),t.vertexAttribIPointer(r,o.numComponents||o.size,o.type||p0,o.stride||0,o.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,o.divisor||0)}}function Ku(t,r){return function(o){if(o.value)if(t.disableVertexAttribArray(r),o.value.length===4)t.vertexAttrib4uiv(r,o.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else t.bindBuffer(Xu,o.buffer),t.enableVertexAttribArray(r),t.vertexAttribIPointer(r,o.numComponents||o.size,o.type||g0,o.stride||0,o.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(r,o.divisor||0)}}function x0(t,r,o){const a=o.size,s=o.count;return function(u){t.bindBuffer(Xu,u.buffer);const c=u.size||u.numComponents||a,h=c/s,p=u.type||Iu,y=we[p].size*c,g=u.normalize||!1,x=u.offset||0,b=y/s;for(let _=0;_<s;++_)t.enableVertexAttribArray(r+_),t.vertexAttribPointer(r+_,h,p,g,y,x+b*_),t.vertexAttribDivisor&&t.vertexAttribDivisor(r+_,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[Eb]={size:8,setter:Ku};ft[Sb]={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[_b]={size:16,setter:x0,count:4};const PC=/ERROR:\s*\d+:(\d+)/gi;function $C(t,r="",o=0){const a=[...r.matchAll(PC)],s=new Map(a.map((u,c)=>{const h=parseInt(u[1]),p=a[c+1],m=p?p.index:r.length,y=r.substring(u.index,m);return[h-1,y]}));return t.split(`
|
|
697
|
+
`).map((u,c)=>{const h=s.get(c);return`${c+1+o}: ${u}${h?`
|
|
698
|
+
|
|
699
|
+
^^^ ${h}`:""}`}).join(`
|
|
700
|
+
`)}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 ZC(t,r){return t.errorCallback(r),t.callback&&setTimeout(()=>{t.callback(`${r}
|
|
701
|
+
${t.errors.join(`
|
|
702
|
+
`)}`)}),null}function QC(t,r,o,a){if(a=a||m0,!t.getShaderParameter(o,ZT)){const u=t.getShaderInfoLog(o),{lineOffset:c,shaderSource:h}=Db(t.getShaderSource(o)),p=`${$C(h,u,c)}
|
|
703
|
+
Error compiling ${$v(t,r)}: ${u}`;return a(p),p}return""}function v0(t,r,o){let a,s,u;if(typeof r=="function"&&(o=r,r=void 0),typeof t=="function")o=t,t=void 0;else if(t&&!Array.isArray(t)){const m=t;o=m.errorCallback,t=m.attribLocations,a=m.transformFeedbackVaryings,s=m.transformFeedbackMode,u=m.callback}const c=o||m0,h=[],p={errorCallback(m,...y){h.push(m),c(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 KC=["VERTEX_SHADER","FRAGMENT_SHADER"];function JC(t,r){if(r.indexOf("frag")>=0)return KT;if(r.indexOf("vert")>=0)return JT}function WC(t,r,o){const a=t.getAttachedShaders(r);for(const s of a)o.has(s)||t.deleteShader(s);t.deleteProgram(r)}const eN=(t=0)=>new Promise(r=>setTimeout(r,t));function tN(t,r,o){const a=t.createProgram(),{attribLocations:s,transformFeedbackVaryings:u,transformFeedbackMode:c}=v0(o);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[KC[h]];m&&m.type&&(g=JC(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,c||WT))}return t.linkProgram(a),a}function nN(t,r,o,a,s){const u=v0(o,a,s),c=new Set(r),h=tN(t,r,u);function p(m,y){const g=oN(m,y,u.errorCallback);return g&&WC(m,y,c),g}if(u.callback){rN(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 rN(t,r){const o=t.getExtension("KHR_parallel_shader_compile"),a=o?(u,c)=>u.getProgramParameter(c,o.COMPLETION_STATUS_KHR):()=>!0;let s=0;do await eN(s),s=1e3/60;while(!a(t,r))}function oN(t,r,o){if(o=o||m0,!t.getProgramParameter(r,QT)){const s=t.getProgramInfoLog(r);o(`Error in program linking: ${s}`);const c=t.getAttachedShaders(r).map(h=>QC(t,t.getShaderParameter(h,t.SHADER_TYPE),h,o));return`${s}
|
|
704
|
+
${c.filter(h=>h).join(`
|
|
705
|
+
`)}`}}function iN(t,r,o,a,s){return nN(t,r,o,a,s)}function Ob(t){const r=t.name;return r.startsWith("gl_")||r.startsWith("webgl_")}const aN=/(\.|\[|]|\w+)/g,lN=t=>t>="0"&&t<="9";function sN(t,r,o,a){const s=t.split(aN).filter(h=>h!=="");let u=0,c="";for(;;){const h=s[u++];c+=h;const p=lN(h[0]),m=p?parseInt(h):h;if(p&&(c+=s[u++]),u===s.length){o[m]=r;break}else{const g=s[u++],x=g==="[",b=o[m]||(x?[]:{});o[m]=b,o=b,a[c]=a[c]||(function(_){return function(E){zb(_,E)}})(b),c+=g}}}function uN(t,r){let o=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 _=o;o+=p.size,y?b=x.arraySetter(t,g,_,m,p.size):b=x.setter(t,g,_,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={},c=t.getProgramParameter(r,sb);for(let h=0;h<c;++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,sN(m,g,u,s)}}return s}function cN(t,r){const o={},a=t.getProgramParameter(r,tC);for(let s=0;s<a;++s){const u=t.getTransformFeedbackVarying(r,s);o[u.name]={index:s,type:u.type,size:u.size}}return o}function fN(t,r){const o=t.getProgramParameter(r,sb),a=[],s=[];for(let h=0;h<o;++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={},c=t.getProgramParameter(r,nC);for(let h=0;h<c;++h){const p=t.getActiveUniformBlockName(r,h),m={index:t.getUniformBlockIndex(r,p),usedByVertexShader:t.getActiveUniformBlockParameter(r,h,rC),usedByFragmentShader:t.getActiveUniformBlockParameter(r,h,oC),size:t.getActiveUniformBlockParameter(r,h,iC),uniformIndices:t.getActiveUniformBlockParameter(r,h,aC)};m.used=m.usedByVertexShader||m.usedByFragmentShader,u[p]=m}return{blockSpecs:u,uniformData:a}}function zb(t,r){for(const o in r){const a=t[o];typeof a=="function"?a(r[o]):zb(t[o],r[o])}}function Bb(t,...r){const o=t.uniformSetters||t,a=r.length;for(let s=0;s<a;++s){const u=r[s];if(Array.isArray(u)){const c=u.length;for(let h=0;h<c;++h)Bb(o,u[h])}else for(const c in u){const h=o[c];h&&h(u[c])}}}function dN(t,r){const o={},a=t.getProgramParameter(r,eC);for(let s=0;s<a;++s){const u=t.getActiveAttrib(r,s);if(Ob(u))continue;const c=t.getAttribLocation(r,u.name),h=ft[u.type],p=h.setter(t,c,h);p.location=c,o[u.name]=p}return o}function hN(t,r){for(const o in r){const a=t[o];a&&a(r[o])}}function mN(t,r,o){o.vertexArrayObject?t.bindVertexArray(o.vertexArrayObject):(hN(r.attribSetters||r,o.attribs),o.indices&&t.bindBuffer($T,o.indices))}function n1(t,r){const o=uN(t,r),a=dN(t,r),s={program:r,uniformSetters:o,attribSetters:a,uniformLocations:Object.fromEntries(Object.entries(o).map(([u,c])=>[u,c.location])),attribLocations:Object.fromEntries(Object.entries(a).map(([u,c])=>[u,c.location]))};return fl(t)&&(s.uniformBlockSpec=fN(t,r),s.transformFeedbackInfo=cN(t,r)),s}const pN=/\s|{|}|;/;function gN(t,r,o,a,s){const u=v0(o,a,s),c=[];if(r=r.map(function(m){if(!pN.test(m)){const y=lb(m);if(y)m=y.text;else{const g=`no element with id: ${m}`;u.errorCallback(g),c.push(g)}}return m}),c.length)return ZC(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 yN=4,r1=5123;function xN(t,r,o,a,s,u){o=o===void 0?yN:o;const c=r.indices,h=r.elementType,p=a===void 0?r.numElements:a;s=s===void 0?0:s,h||c?u!==void 0?t.drawElementsInstanced(o,p,h===void 0?r1:r.elementType,s,u):t.drawElements(o,p,h===void 0?r1:r.elementType,s):u!==void 0?t.drawArraysInstanced(o,s,p,u):t.drawArrays(o,s,p)}const Ub=36160,Js=36161,vN=3553,bN=5121,_N=6402,EN=6408,SN=33190,wN=36012,AN=35056,TN=36013,CN=32854,NN=32855,RN=36194,Hb=33189,Lb=6401,jb=36168,b0=34041,xh=36064,Ju=36096,Fb=36128,_0=33306,vh=33071,bh=9729,MN=[{format:EN,type:bN,min:bh,wrap:vh},{format:b0}],yn={};yn[b0]=_0;yn[Lb]=Fb;yn[jb]=Fb;yn[_N]=Ju;yn[Hb]=Ju;yn[SN]=Ju;yn[wN]=Ju;yn[AN]=_0;yn[TN]=_0;function DN(t,r){return yn[t]||yn[r]}const Jr={};Jr[CN]=!0;Jr[NN]=!0;Jr[RN]=!0;Jr[b0]=!0;Jr[Hb]=!0;Jr[Lb]=!0;Jr[jb]=!0;function ON(t){return Jr[t]}const zN=32;function BN(t){return t>=xh&&t<xh+zN}function UN(t,r,o,a){const s=Ub,u=t.createFramebuffer();t.bindFramebuffer(s,u),o=o||t.drawingBufferWidth,a=a||t.drawingBufferHeight,r=r||MN;const c=[],h={framebuffer:u,attachments:[],width:o,height:a};return r.forEach(function(p,m){let y=p.attachment;const g=p.samples,x=p.format;let b=p.attachmentPoint||DN(x,p.internalFormat);if(b||(b=xh+m),BN(b)&&c.push(b),!y)if(g!==void 0||ON(x))y=t.createRenderbuffer(),t.bindRenderbuffer(Js,y),g>1?t.renderbufferStorageMultisample(Js,g,x,o,a):t.renderbufferStorage(Js,x,o,a);else{const _=Object.assign({},p);_.width=o,_.height=a,_.auto===void 0&&(_.auto=!1,_.min=_.min||_.minMag||bh,_.mag=_.mag||_.minMag||bh,_.wrapS=_.wrapS||_.wrap||vh,_.wrapT=_.wrapT||_.wrap||vh),y=yh(t,_)}if(p3(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||vN,y,p.level||0);else throw new Error("unknown attachment type");h.attachments.push(y)}),t.drawBuffers&&t.drawBuffers(c),h}function o1(t,r,o){o=o||Ub,r?(t.bindFramebuffer(o,r.framebuffer),t.viewport(0,0,r.width,r.height)):(t.bindFramebuffer(o,null),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight))}const i1=t=>{const r=t.replace("#","");return[parseInt(r.substring(0,2),16),parseInt(r.substring(2,4),16),parseInt(r.substring(4,6),16)]},HN=(t,r,o)=>{const[a,s,u]=i1(t),[c,h,p]=i1(r),m=Math.round(a+(c-a)*o).toString(16).padStart(2,"0"),y=Math.round(s+(h-s)*o).toString(16).padStart(2,"0"),g=Math.round(u+(p-u)*o).toString(16).padStart(2,"0");return`#${m}${y}${g}`},kb=(t,r)=>{const o=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||o<=a[0].position)return a[0].color;if(o>=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(o>=a[p].position&&o<=a[p+1].position){s=a[p],u=a[p+1];break}const c=u.position-s.position,h=c===0?0:(o-s.position)/c;return HN(s.color,u.color,h)},LN=t=>typeof t=="object"&&t!==null&&t.type==="texture"&&"src"in t,jN=t=>typeof t=="object"&&t!==null&&t.type==="gradient",FN=`#version 300 es
|
|
706
|
+
|
|
707
|
+
precision highp float;
|
|
708
|
+
|
|
709
|
+
in vec2 position;
|
|
710
|
+
in vec2 texcoord;
|
|
711
|
+
|
|
712
|
+
out vec2 vUv;
|
|
713
|
+
|
|
714
|
+
void main() {
|
|
715
|
+
vUv = vec2(texcoord.x, texcoord.y);
|
|
716
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
717
|
+
}
|
|
718
|
+
`;class kN{programs={};fbos={};renderOrder=[];dependencyMapping={};quad;textures={};textureSrcs={};gradientCanvases={};defaultTexture;patch;gl;uniforms;onTextureLoaded;error=null;constructor(r,o){this.patch=o,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<o.shaders.length&&!a;h++){const p=o.shaders[h];if(this.programs[p.id]=gN(this.gl,[FN,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]=UN(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=xA.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 c=[...Object.entries(u)].reduce((h,[p,m])=>m===0?[...h,p]:h,[]);for(;c.length>0;){const h=c.shift();this.renderOrder.push(h);for(const p of s[h]){const m=u[p]-1;u[p]=m,m===0&&c.push(p)}}if(this.renderOrder.length<this.patch.shaders.length)throw Error("Cycle detected in graph")}_getOrCreateTexture(r){if(!this.textures[r]){const o=yh(this.gl,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1});gh(this.gl,o,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]=o}return this.textures[r]}_updateGradientUniform(r,o){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=kb(o.stops,u/255),s.fillRect(u,0,1,1);return this._updateTextureUniform(r,{type:"texture",src:a})}_updateTextureUniform(r,o){const a=this._getOrCreateTexture(r),s=o.src;if(typeof s=="string"){if(this.textureSrcs[r]!==s){this.textureSrcs[r]=s;const u=new Image;u.onload=()=>{this.textures[r]===a&&(Au(this.gl,a,u,{minMag:this.gl.NEAREST,wrap:this.gl.CLAMP_TO_EDGE,auto:!1}),this.onTextureLoaded?.())},u.src=s}}else Au(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 o=this.renderOrder[r],a=this.programs[o],s={...this.uniforms[o]};for(const[u,c]of Object.entries(s))LN(c)?s[u]=this._updateTextureUniform(`${o}::${u}`,c):jN(c)&&(s[u]=this._updateGradientUniform(`${o}::${u}`,c));for(const u of this.dependencyMapping[o])s[u.input]=this.fbos[u.from].attachments[0];this.gl.useProgram(a.program),r!==this.renderOrder.length-1?o1(this.gl,this.fbos[o]):o1(this.gl,null),Bb(a,s),mN(this.gl,a,this.quad),xN(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 o of r.attachments)o instanceof WebGLTexture?this.gl.deleteTexture(o):o instanceof WebGLRenderbuffer&&this.gl.deleteRenderbuffer(o);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 Vb=j.forwardRef(({patch:t,uniforms:r,className:o,style:a,width:s=100,height:u=100,animate:c,onError:h},p)=>{const m=j.useRef(null);return j.useEffect(()=>{if(m.current){const y=m.current.getContext("webgl2",{preserveDrawingBuffer:!0}),g=new kN(y,t);h?.(g.error);let x=null;const b=()=>{g.uniforms=r.current,g.render()};return c?x=requestAnimationFrame(function _(){b(),x=requestAnimationFrame(_)}):(g.onTextureLoaded=b,b()),()=>{x!==null&&cancelAnimationFrame(x),g.dispose()}}},[t,s,u,c]),A.jsx("canvas",{className:`image-crisp ${o??""}`,style:a,width:s,height:u,ref:y=>{m.current=y,typeof p=="function"?p(y):p&&(p.current=y)}})}),pt="([-\\d.]+)",Pt="\\s*,\\s*",Bi=t=>{const r=[],o=t.source.split(`
|
|
719
|
+
`);for(const a of o){const s=a.trim(),u=s.match(new RegExp(`^uniform\\s+float\\s+(\\w+)\\s*;.*\\/\\/\\s*\\[\\s*${pt}${Pt}${pt}${Pt}${pt}\\s*\\]`));if(u?.[1]){const w=parseFloat(u[2]),O=parseFloat(u[3]),S=parseFloat(u[4]);r.push({name:u[1],type:"float",min:w,max:O,default:S});continue}const c=s.match(/^uniform\s+float\s+(\w+)\s*;.*\/\/\s*time\b/);if(c?.[1]){r.push({name:c[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}${Pt}${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}${Pt}${pt}${Pt}${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}${Pt}${pt}${Pt}${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}${Pt}${pt}${Pt}${pt}${Pt}${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}${Pt}${pt}${Pt}${pt}${Pt}${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 _=s.match(/^uniform\s+vec2\s+(\w+)\s*;.*\/\/\s*resolution\b/);if(_?.[1]){r.push({name:_[1],type:"vec2",special:"resolution"});continue}const E=s.match(/^uniform\s+(vec[234])\s+(\w+)\s*;/);if(E){const w=E[1],O=E[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 C=s.match(/^uniform\s+sampler2D\s+(\w+)\s*;(?:.*\/\/\s*(texture|gradient)\b)?/);if(C?.[1]){const w=C[2],O=w==="texture"?"texture":w==="gradient"?"gradient":"input";r.push({name:C[1],type:"sampler2D",source:O})}}return r};function VN(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 GN(t){if(t.type==="float"||t.type==="vec2"||t.type==="vec3"||t.type==="vec4")return t.default}const qN=`import { RendererComponent, type Uniforms, type Patch } from "@sequenza/lib";
|
|
720
|
+
import "@sequenza/lib/style.css";
|
|
721
|
+
import { useRef } from "react";
|
|
722
|
+
|
|
723
|
+
function SequenzaComponent() {
|
|
724
|
+
const uniformRef = useRef<Record<string, Uniforms>>(getInitialUniforms());
|
|
725
|
+
|
|
726
|
+
return (
|
|
727
|
+
<RendererComponent
|
|
728
|
+
patch={getPatch()}
|
|
729
|
+
uniforms={uniformRef}
|
|
730
|
+
animate={true}
|
|
731
|
+
width={100}
|
|
732
|
+
height={100}
|
|
733
|
+
></RendererComponent>
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
export default SequenzaComponent;
|
|
738
|
+
|
|
739
|
+
function getInitialUniforms(): Record<string, Uniforms> {
|
|
740
|
+
throw new Error("placeholder for initial uniforms");
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
function getPatch(): Patch {
|
|
744
|
+
throw new Error("placeholder for patch");
|
|
745
|
+
}
|
|
746
|
+
`;function YN(t,r){let o=qN;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 o=o.replace('throw new Error("placeholder for initial uniforms");',`return ${JSON.stringify(s,null,2)};`),o=o.replace('throw new Error("placeholder for patch");',`return ${JSON.stringify(r,null,2)};`),o}function dt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let o=0,a;o<t.length;o++)(a=dt(t[o]))!==""&&(r+=(r&&" ")+a);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var XN={value:()=>{}};function Wu(){for(var t=0,r=arguments.length,o={},a;t<r;++t){if(!(a=arguments[t]+"")||a in o||/[\s.]/.test(a))throw new Error("illegal type: "+a);o[a]=[]}return new pu(o)}function pu(t){this._=t}function IN(t,r){return t.trim().split(/^|\s+/).map(function(o){var a="",s=o.indexOf(".");if(s>=0&&(a=o.slice(s+1),o=o.slice(0,s)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:a}})}pu.prototype=Wu.prototype={constructor:pu,on:function(t,r){var o=this._,a=IN(t+"",o),s,u=-1,c=a.length;if(arguments.length<2){for(;++u<c;)if((s=(t=a[u]).type)&&(s=PN(o[s],t.name)))return s;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++u<c;)if(s=(t=a[u]).type)o[s]=a1(o[s],t.name,r);else if(r==null)for(s in o)o[s]=a1(o[s],t.name,null);return this},copy:function(){var t={},r=this._;for(var o in r)t[o]=r[o].slice();return new pu(t)},call:function(t,r){if((s=arguments.length-2)>0)for(var o=new Array(s),a=0,s,u;a<s;++a)o[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,o)},apply:function(t,r,o){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,o)}};function PN(t,r){for(var o=0,a=t.length,s;o<a;++o)if((s=t[o]).name===r)return s.value}function a1(t,r,o){for(var a=0,s=t.length;a<s;++a)if(t[a].name===r){t[a]=XN,t=t.slice(0,a).concat(t.slice(a+1));break}return o!=null&&t.push({name:r,value:o}),t}var _h="http://www.w3.org/1999/xhtml";const l1={svg:"http://www.w3.org/2000/svg",xhtml:_h,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+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),l1.hasOwnProperty(r)?{space:l1[r],local:t}:t}function $N(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===_h&&r.documentElement.namespaceURI===_h?r.createElement(t):r.createElementNS(o,t)}}function ZN(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Gb(t){var r=ec(t);return(r.local?ZN:$N)(r)}function QN(){}function E0(t){return t==null?QN:function(){return this.querySelector(t)}}function KN(t){typeof t!="function"&&(t=E0(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var u=r[s],c=u.length,h=a[s]=new Array(c),p,m,y=0;y<c;++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 JN(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function WN(){return[]}function qb(t){return t==null?WN:function(){return this.querySelectorAll(t)}}function eR(t){return function(){return JN(t.apply(this,arguments))}}function tR(t){typeof t=="function"?t=eR(t):t=qb(t);for(var r=this._groups,o=r.length,a=[],s=[],u=0;u<o;++u)for(var c=r[u],h=c.length,p,m=0;m<h;++m)(p=c[m])&&(a.push(t.call(p,p.__data__,m,c)),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 nR=Array.prototype.find;function rR(t){return function(){return nR.call(this.children,t)}}function oR(){return this.firstElementChild}function iR(t){return this.select(t==null?oR:rR(typeof t=="function"?t:Xb(t)))}var aR=Array.prototype.filter;function lR(){return Array.from(this.children)}function sR(t){return function(){return aR.call(this.children,t)}}function uR(t){return this.selectAll(t==null?lR:sR(typeof t=="function"?t:Xb(t)))}function cR(t){typeof t!="function"&&(t=Yb(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var u=r[s],c=u.length,h=a[s]=[],p,m=0;m<c;++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 fR(){return new Zt(this._enter||this._groups.map(Ib),this._parents)}function Cu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Cu.prototype={constructor:Cu,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 dR(t){return function(){return t}}function hR(t,r,o,a,s,u){for(var c=0,h,p=r.length,m=u.length;c<m;++c)(h=r[c])?(h.__data__=u[c],a[c]=h):o[c]=new Cu(t,u[c]);for(;c<p;++c)(h=r[c])&&(s[c]=h)}function mR(t,r,o,a,s,u,c){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=c.call(p,p.__data__,h,r)+"",m.has(b)?s[h]=p:m.set(b,p));for(h=0;h<g;++h)b=c.call(t,u[h],h,u)+"",(p=m.get(b))?(a[h]=p,p.__data__=u[h],m.delete(b)):o[h]=new Cu(t,u[h]);for(h=0;h<y;++h)(p=r[h])&&m.get(x[h])===p&&(s[h]=p)}function pR(t){return t.__data__}function gR(t,r){if(!arguments.length)return Array.from(this,pR);var o=r?mR:hR,a=this._parents,s=this._groups;typeof t!="function"&&(t=dR(t));for(var u=s.length,c=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=yR(t.call(y,y&&y.__data__,m,a)),_=b.length,E=h[m]=new Array(_),C=c[m]=new Array(_),w=p[m]=new Array(x);o(y,g,E,C,w,b,r);for(var O=0,S=0,N,D;O<_;++O)if(N=E[O]){for(O>=S&&(S=O+1);!(D=C[S])&&++S<_;);N._next=D||null}}return c=new Zt(c,a),c._enter=h,c._exit=p,c}function yR(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function xR(){return new Zt(this._exit||this._groups.map(Ib),this._parents)}function vR(t,r,o){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())),o==null?u.remove():o(u),a&&s?a.merge(s).order():s}function bR(t){for(var r=t.selection?t.selection():t,o=this._groups,a=r._groups,s=o.length,u=a.length,c=Math.min(s,u),h=new Array(s),p=0;p<c;++p)for(var m=o[p],y=a[p],g=m.length,x=h[p]=new Array(g),b,_=0;_<g;++_)(b=m[_]||y[_])&&(x[_]=b);for(;p<s;++p)h[p]=o[p];return new Zt(h,this._parents)}function _R(){for(var t=this._groups,r=-1,o=t.length;++r<o;)for(var a=t[r],s=a.length-1,u=a[s],c;--s>=0;)(c=a[s])&&(u&&c.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(c,u),u=c);return this}function ER(t){t||(t=SR);function r(g,x){return g&&x?t(g.__data__,x.__data__):!g-!x}for(var o=this._groups,a=o.length,s=new Array(a),u=0;u<a;++u){for(var c=o[u],h=c.length,p=s[u]=new Array(h),m,y=0;y<h;++y)(m=c[y])&&(p[y]=m);p.sort(r)}return new Zt(s,this._parents).order()}function SR(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function wR(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function AR(){return Array.from(this)}function TR(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var a=t[r],s=0,u=a.length;s<u;++s){var c=a[s];if(c)return c}return null}function CR(){let t=0;for(const r of this)++t;return t}function NR(){return!this.node()}function RR(t){for(var r=this._groups,o=0,a=r.length;o<a;++o)for(var s=r[o],u=0,c=s.length,h;u<c;++u)(h=s[u])&&t.call(h,h.__data__,u,s);return this}function MR(t){return function(){this.removeAttribute(t)}}function DR(t){return function(){this.removeAttributeNS(t.space,t.local)}}function OR(t,r){return function(){this.setAttribute(t,r)}}function zR(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function BR(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function UR(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,o)}}function HR(t,r){var o=ec(t);if(arguments.length<2){var a=this.node();return o.local?a.getAttributeNS(o.space,o.local):a.getAttribute(o)}return this.each((r==null?o.local?DR:MR:typeof r=="function"?o.local?UR:BR:o.local?zR:OR)(o,r))}function Pb(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function LR(t){return function(){this.style.removeProperty(t)}}function jR(t,r,o){return function(){this.style.setProperty(t,r,o)}}function FR(t,r,o){return function(){var a=r.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,o)}}function kR(t,r,o){return arguments.length>1?this.each((r==null?LR:typeof r=="function"?FR:jR)(t,r,o??"")):Ui(this.node(),t)}function Ui(t,r){return t.style.getPropertyValue(r)||Pb(t).getComputedStyle(t,null).getPropertyValue(r)}function VR(t){return function(){delete this[t]}}function GR(t,r){return function(){this[t]=r}}function qR(t,r){return function(){var o=r.apply(this,arguments);o==null?delete this[t]:this[t]=o}}function YR(t,r){return arguments.length>1?this.each((r==null?VR:typeof r=="function"?qR:GR)(t,r)):this.node()[t]}function $b(t){return t.trim().split(/^|\s+/)}function S0(t){return t.classList||new Zb(t)}function Zb(t){this._node=t,this._names=$b(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 o=S0(t),a=-1,s=r.length;++a<s;)o.add(r[a])}function Kb(t,r){for(var o=S0(t),a=-1,s=r.length;++a<s;)o.remove(r[a])}function XR(t){return function(){Qb(this,t)}}function IR(t){return function(){Kb(this,t)}}function PR(t,r){return function(){(r.apply(this,arguments)?Qb:Kb)(this,t)}}function $R(t,r){var o=$b(t+"");if(arguments.length<2){for(var a=S0(this.node()),s=-1,u=o.length;++s<u;)if(!a.contains(o[s]))return!1;return!0}return this.each((typeof r=="function"?PR:r?XR:IR)(o,r))}function ZR(){this.textContent=""}function QR(t){return function(){this.textContent=t}}function KR(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function JR(t){return arguments.length?this.each(t==null?ZR:(typeof t=="function"?KR:QR)(t)):this.node().textContent}function WR(){this.innerHTML=""}function e4(t){return function(){this.innerHTML=t}}function t4(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function n4(t){return arguments.length?this.each(t==null?WR:(typeof t=="function"?t4:e4)(t)):this.node().innerHTML}function r4(){this.nextSibling&&this.parentNode.appendChild(this)}function o4(){return this.each(r4)}function i4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function a4(){return this.each(i4)}function l4(t){var r=typeof t=="function"?t:Gb(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function s4(){return null}function u4(t,r){var o=typeof t=="function"?t:Gb(t),a=r==null?s4:typeof r=="function"?r:E0(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),a.apply(this,arguments)||null)})}function c4(){var t=this.parentNode;t&&t.removeChild(this)}function f4(){return this.each(c4)}function d4(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function h4(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function m4(t){return this.select(t?h4:d4)}function p4(t){return arguments.length?this.property("__data__",t):this.node().__data__}function g4(t){return function(r){t.call(this,r,this.__data__)}}function y4(t){return t.trim().split(/^|\s+/).map(function(r){var o="",a=r.indexOf(".");return a>=0&&(o=r.slice(a+1),r=r.slice(0,a)),{type:r,name:o}})}function x4(t){return function(){var r=this.__on;if(r){for(var o=0,a=-1,s=r.length,u;o<s;++o)u=r[o],(!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 v4(t,r,o){return function(){var a=this.__on,s,u=g4(r);if(a){for(var c=0,h=a.length;c<h;++c)if((s=a[c]).type===t.type&&s.name===t.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=u,s.options=o),s.value=r;return}}this.addEventListener(t.type,u,o),s={type:t.type,name:t.name,value:r,listener:u,options:o},a?a.push(s):this.__on=[s]}}function b4(t,r,o){var a=y4(t+""),s,u=a.length,c;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((c=a[s]).type===y.type&&c.name===y.name)return y.value}return}for(h=r?v4:x4,s=0;s<u;++s)this.each(h(a[s],r,o));return this}function Jb(t,r,o){var a=Pb(t),s=a.CustomEvent;typeof s=="function"?s=new s(r,o):(s=a.document.createEvent("Event"),o?(s.initEvent(r,o.bubbles,o.cancelable),s.detail=o.detail):s.initEvent(r,!1,!1)),t.dispatchEvent(s)}function _4(t,r){return function(){return Jb(this,t,r)}}function E4(t,r){return function(){return Jb(this,t,r.apply(this,arguments))}}function S4(t,r){return this.each((typeof r=="function"?E4:_4)(t,r))}function*w4(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var a=t[r],s=0,u=a.length,c;s<u;++s)(c=a[s])&&(yield c)}var Wb=[null];function Zt(t,r){this._groups=t,this._parents=r}function ml(){return new Zt([[document.documentElement]],Wb)}function A4(){return this}Zt.prototype=ml.prototype={constructor:Zt,select:KN,selectAll:tR,selectChild:iR,selectChildren:uR,filter:cR,data:gR,enter:fR,exit:xR,join:vR,merge:bR,selection:A4,order:_R,sort:ER,call:wR,nodes:AR,node:TR,size:CR,empty:NR,each:RR,attr:HR,style:kR,property:YR,classed:$R,text:JR,html:n4,raise:o4,lower:a4,append:l4,insert:u4,remove:f4,clone:m4,datum:p4,on:b4,dispatch:S4,[Symbol.iterator]:w4};function $t(t){return typeof t=="string"?new Zt([[document.querySelector(t)]],[document.documentElement]):new Zt([[t]],Wb)}function T4(t){let r;for(;r=t.sourceEvent;)t=r;return t}function hn(t,r){if(t=T4(t),r===void 0&&(r=t.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var a=o.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 C4={passive:!1},el={capture:!0,passive:!1};function Xd(t){t.stopImmediatePropagation()}function Oi(t){t.preventDefault(),t.stopImmediatePropagation()}function e_(t){var r=t.document.documentElement,o=$t(t).on("dragstart.drag",Oi,el);"onselectstart"in r?o.on("selectstart.drag",Oi,el):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function t_(t,r){var o=t.document.documentElement,a=$t(t).on("dragstart.drag",null);r&&(a.on("click.drag",Oi,el),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in o?a.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const Ws=t=>()=>t;function Eh(t,{sourceEvent:r,subject:o,target:a,identifier:s,active:u,x:c,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:o,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:c,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}})}Eh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function N4(t){return!t.ctrlKey&&!t.button}function R4(){return this.parentNode}function M4(t,r){return r??{x:t.x,y:t.y}}function D4(){return navigator.maxTouchPoints||"ontouchstart"in this}function n_(){var t=N4,r=R4,o=M4,a=D4,s={},u=Wu("start","drag","end"),c=0,h,p,m,y,g=0;function x(N){N.on("mousedown.drag",b).filter(a).on("touchstart.drag",C).on("touchmove.drag",w,C4).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(N,D){if(!(y||!t.call(this,N,D))){var z=S(this,r.call(this,N,D),N,D,"mouse");z&&($t(N.view).on("mousemove.drag",_,el).on("mouseup.drag",E,el),e_(N.view),Xd(N),m=!1,h=N.clientX,p=N.clientY,z("start",N))}}function _(N){if(Oi(N),!m){var D=N.clientX-h,z=N.clientY-p;m=D*D+z*z>g}s.mouse("drag",N)}function E(N){$t(N.view).on("mousemove.drag mouseup.drag",null),t_(N.view,m),Oi(N),s.mouse("end",N)}function C(N,D){if(t.call(this,N,D)){var z=N.changedTouches,U=r.call(this,N,D),k=z.length,Y,ae;for(Y=0;Y<k;++Y)(ae=S(this,U,N,D,z[Y].identifier,z[Y]))&&(Xd(N),ae("start",N,z[Y]))}}function w(N){var D=N.changedTouches,z=D.length,U,k;for(U=0;U<z;++U)(k=s[D[U].identifier])&&(Oi(N),k("drag",N,D[U]))}function O(N){var D=N.changedTouches,z=D.length,U,k;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),U=0;U<z;++U)(k=s[D[U].identifier])&&(Xd(N),k("end",N,D[U]))}function S(N,D,z,U,k,Y){var ae=u.copy(),X=hn(Y||z,D),$,re,B;if((B=o.call(N,new Eh("beforestart",{sourceEvent:z,target:x,identifier:k,active:c,x:X[0],y:X[1],dx:0,dy:0,dispatch:ae}),U))!=null)return $=B.x-X[0]||0,re=B.y-X[1]||0,function q(R,L,V){var P=X,te;switch(R){case"start":s[k]=q,te=c++;break;case"end":delete s[k],--c;case"drag":X=hn(V||L,D),te=c;break}ae.call(R,N,new Eh(R,{sourceEvent:L,subject:B,target:x,identifier:k,active:te,x:X[0]+$,y:X[1]+re,dx:X[0]-P[0],dy:X[1]-P[1],dispatch:ae}),U)}}return x.filter=function(N){return arguments.length?(t=typeof N=="function"?N:Ws(!!N),x):t},x.container=function(N){return arguments.length?(r=typeof N=="function"?N:Ws(N),x):r},x.subject=function(N){return arguments.length?(o=typeof N=="function"?N:Ws(N),x):o},x.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:Ws(!!N),x):a},x.on=function(){var N=u.on.apply(u,arguments);return N===u?x:N},x.clickDistance=function(N){return arguments.length?(g=(N=+N)*N,x):Math.sqrt(g)},x}function w0(t,r,o){t.prototype=r.prototype=o,o.constructor=t}function r_(t,r){var o=Object.create(t.prototype);for(var a in r)o[a]=r[a];return o}function pl(){}var tl=.7,Nu=1/tl,zi="\\s*([+-]?\\d+)\\s*",nl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",O4=/^#([0-9a-f]{3,8})$/,z4=new RegExp(`^rgb\\(${zi},${zi},${zi}\\)$`),B4=new RegExp(`^rgb\\(${Dn},${Dn},${Dn}\\)$`),U4=new RegExp(`^rgba\\(${zi},${zi},${zi},${nl}\\)$`),H4=new RegExp(`^rgba\\(${Dn},${Dn},${Dn},${nl}\\)$`),L4=new RegExp(`^hsl\\(${nl},${Dn},${Dn}\\)$`),j4=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,Do,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:u1,formatHex:u1,formatHex8:F4,formatHsl:k4,formatRgb:c1,toString:c1});function u1(){return this.rgb().formatHex()}function F4(){return this.rgb().formatHex8()}function k4(){return o_(this).formatHsl()}function c1(){return this.rgb().formatRgb()}function Do(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=O4.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?f1(r):o===3?new Ft(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?eu(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===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=z4.exec(t))?new Ft(r[1],r[2],r[3],1):(r=B4.exec(t))?new Ft(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=U4.exec(t))?eu(r[1],r[2],r[3],r[4]):(r=H4.exec(t))?eu(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=L4.exec(t))?m1(r[1],r[2]/100,r[3]/100,1):(r=j4.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,o,a){return a<=0&&(t=r=o=NaN),new Ft(t,r,o,a)}function V4(t){return t instanceof pl||(t=Do(t)),t?(t=t.rgb(),new Ft(t.r,t.g,t.b,t.opacity)):new Ft}function Sh(t,r,o,a){return arguments.length===1?V4(t):new Ft(t,r,o,a??1)}function Ft(t,r,o,a){this.r=+t,this.g=+r,this.b=+o,this.opacity=+a}w0(Ft,Sh,r_(pl,{brighter(t){return t=t==null?Nu:Math.pow(Nu,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(Co(this.r),Co(this.g),Co(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:G4,formatRgb:h1,toString:h1}));function d1(){return`#${To(this.r)}${To(this.g)}${To(this.b)}`}function G4(){return`#${To(this.r)}${To(this.g)}${To(this.b)}${To((isNaN(this.opacity)?1:this.opacity)*255)}`}function h1(){const t=Ru(this.opacity);return`${t===1?"rgb(":"rgba("}${Co(this.r)}, ${Co(this.g)}, ${Co(this.b)}${t===1?")":`, ${t})`}`}function Ru(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Co(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function To(t){return t=Co(t),(t<16?"0":"")+t.toString(16)}function m1(t,r,o,a){return a<=0?t=r=o=NaN:o<=0||o>=1?t=r=NaN:r<=0&&(t=NaN),new mn(t,r,o,a)}function o_(t){if(t instanceof mn)return new mn(t.h,t.s,t.l,t.opacity);if(t instanceof pl||(t=Do(t)),!t)return new mn;if(t instanceof mn)return t;t=t.rgb();var r=t.r/255,o=t.g/255,a=t.b/255,s=Math.min(r,o,a),u=Math.max(r,o,a),c=NaN,h=u-s,p=(u+s)/2;return h?(r===u?c=(o-a)/h+(o<a)*6:o===u?c=(a-r)/h+2:c=(r-o)/h+4,h/=p<.5?u+s:2-u-s,c*=60):h=p>0&&p<1?0:c,new mn(c,h,p,t.opacity)}function q4(t,r,o,a){return arguments.length===1?o_(t):new mn(t,r,o,a??1)}function mn(t,r,o,a){this.h=+t,this.s=+r,this.l=+o,this.opacity=+a}w0(mn,q4,r_(pl,{brighter(t){return t=t==null?Nu:Math.pow(Nu,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,o=this.l,a=o+(o<.5?o:1-o)*r,s=2*o-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,o){return(t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r)*255}const A0=t=>()=>t;function Y4(t,r){return function(o){return t+o*r}}function X4(t,r,o){return t=Math.pow(t,o),r=Math.pow(r,o)-t,o=1/o,function(a){return Math.pow(t+a*r,o)}}function I4(t){return(t=+t)==1?i_:function(r,o){return o-r?X4(r,o,t):A0(isNaN(r)?o:r)}}function i_(t,r){var o=r-t;return o?Y4(t,o):A0(isNaN(t)?r:t)}const Mu=(function t(r){var o=I4(r);function a(s,u){var c=o((s=Sh(s)).r,(u=Sh(u)).r),h=o(s.g,u.g),p=o(s.b,u.b),m=i_(s.opacity,u.opacity);return function(y){return s.r=c(y),s.g=h(y),s.b=p(y),s.opacity=m(y),s+""}}return a.gamma=t,a})(1);function P4(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,a=r.slice(),s;return function(u){for(s=0;s<o;++s)a[s]=t[s]*(1-u)+r[s]*u;return a}}function $4(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Z4(t,r){var o=r?r.length:0,a=t?Math.min(o,t.length):0,s=new Array(a),u=new Array(o),c;for(c=0;c<a;++c)s[c]=$a(t[c],r[c]);for(;c<o;++c)u[c]=r[c];return function(h){for(c=0;c<a;++c)u[c]=s[c](h);return u}}function Q4(t,r){var o=new Date;return t=+t,r=+r,function(a){return o.setTime(t*(1-a)+r*a),o}}function Rn(t,r){return t=+t,r=+r,function(o){return t*(1-o)+r*o}}function K4(t,r){var o={},a={},s;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(s in r)s in t?o[s]=$a(t[s],r[s]):a[s]=r[s];return function(u){for(s in o)a[s]=o[s](u);return a}}var wh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pd=new RegExp(wh.source,"g");function J4(t){return function(){return t}}function W4(t){return function(r){return t(r)+""}}function a_(t,r){var o=wh.lastIndex=Pd.lastIndex=0,a,s,u,c=-1,h=[],p=[];for(t=t+"",r=r+"";(a=wh.exec(t))&&(s=Pd.exec(r));)(u=s.index)>o&&(u=r.slice(o,u),h[c]?h[c]+=u:h[++c]=u),(a=a[0])===(s=s[0])?h[c]?h[c]+=s:h[++c]=s:(h[++c]=null,p.push({i:c,x:Rn(a,s)})),o=Pd.lastIndex;return o<r.length&&(u=r.slice(o),h[c]?h[c]+=u:h[++c]=u),h.length<2?p[0]?W4(p[0].x):J4(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 $a(t,r){var o=typeof r,a;return r==null||o==="boolean"?A0(r):(o==="number"?Rn:o==="string"?(a=Do(r))?(r=a,Mu):a_:r instanceof Do?Mu:r instanceof Date?Q4:$4(r)?P4:Array.isArray(r)?Z4:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?K4:Rn)(t,r)}var g1=180/Math.PI,Ah={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function l_(t,r,o,a,s,u){var c,h,p;return(c=Math.sqrt(t*t+r*r))&&(t/=c,r/=c),(p=t*o+r*a)&&(o-=t*p,a-=r*p),(h=Math.sqrt(o*o+a*a))&&(o/=h,a/=h,p/=h),t*a<r*o&&(t=-t,r=-r,p=-p,c=-c),{translateX:s,translateY:u,rotate:Math.atan2(r,t)*g1,skewX:Math.atan(p)*g1,scaleX:c,scaleY:h}}var nu;function eM(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Ah:l_(r.a,r.b,r.c,r.d,r.e,r.f)}function tM(t){return t==null||(nu||(nu=document.createElementNS("http://www.w3.org/2000/svg","g")),nu.setAttribute("transform",t),!(t=nu.transform.baseVal.consolidate()))?Ah:(t=t.matrix,l_(t.a,t.b,t.c,t.d,t.e,t.f))}function s_(t,r,o,a){function s(m){return m.length?m.pop()+" ":""}function u(m,y,g,x,b,_){if(m!==g||y!==x){var E=b.push("translate(",null,r,null,o);_.push({i:E-4,x:Rn(m,g)},{i:E-2,x:Rn(y,x)})}else(g||x)&&b.push("translate("+g+r+x+o)}function c(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,_){if(m!==g||y!==x){var E=b.push(s(b)+"scale(",null,",",null,")");_.push({i:E-4,x:Rn(m,g)},{i:E-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),c(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 _=-1,E=x.length,C;++_<E;)g[(C=x[_]).i]=C.x(b);return g.join("")}}}var nM=s_(eM,"px, ","px)","deg)"),rM=s_(tM,", ",")",")"),oM=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 aM(t){return((t=Math.exp(2*t))-1)/(t+1)}const gu=(function t(r,o,a){function s(u,c){var h=u[0],p=u[1],m=u[2],y=c[0],g=c[1],x=c[2],b=y-h,_=g-p,E=b*b+_*_,C,w;if(E<oM)w=Math.log(x/m)/r,C=function(U){return[h+U*b,p+U*_,m*Math.exp(r*U*w)]};else{var O=Math.sqrt(E),S=(x*x-m*m+a*E)/(2*m*o*O),N=(x*x-m*m-a*E)/(2*x*o*O),D=Math.log(Math.sqrt(S*S+1)-S),z=Math.log(Math.sqrt(N*N+1)-N);w=(z-D)/r,C=function(U){var k=U*w,Y=y1(D),ae=m/(o*O)*(Y*aM(r*k+D)-iM(D));return[h+ae*b,p+ae*_,m*Y/y1(r*k+D)]}}return C.duration=w*1e3*r/Math.SQRT2,C}return s.rho=function(u){var c=Math.max(.001,+u),h=c*c,p=h*h;return t(c,h,p)},s})(Math.SQRT2,2,4);var Hi=0,Ia=0,qa=0,u_=1e3,Du,Pa,Ou=0,Oo=0,tc=0,rl=typeof performance=="object"&&performance.now?performance:Date,c_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function T0(){return Oo||(c_(lM),Oo=rl.now()+tc)}function lM(){Oo=0}function zu(){this._call=this._time=this._next=null}zu.prototype=f_.prototype={constructor:zu,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?T0():+o)+(r==null?0:+r),!this._next&&Pa!==this&&(Pa?Pa._next=this:Du=this,Pa=this),this._call=t,this._time=o,Th()},stop:function(){this._call&&(this._call=null,this._time=1/0,Th())}};function f_(t,r,o){var a=new zu;return a.restart(t,r,o),a}function sM(){T0(),++Hi;for(var t=Du,r;t;)(r=Oo-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Hi}function x1(){Oo=(Ou=rl.now())+tc,Hi=Ia=0;try{sM()}finally{Hi=0,cM(),Oo=0}}function uM(){var t=rl.now(),r=t-Ou;r>u_&&(tc-=r,Ou=t)}function cM(){for(var t,r=Du,o,a=1/0;r;)r._call?(a>r._time&&(a=r._time),t=r,r=r._next):(o=r._next,r._next=null,r=t?t._next=o:Du=o);Pa=t,Th(a)}function Th(t){if(!Hi){Ia&&(Ia=clearTimeout(Ia));var r=t-Oo;r>24?(t<1/0&&(Ia=setTimeout(x1,t-rl.now()-tc)),qa&&(qa=clearInterval(qa))):(qa||(Ou=rl.now(),qa=setInterval(uM,u_)),Hi=1,c_(x1))}}function v1(t,r,o){var a=new zu;return r=r==null?0:+r,a.restart(s=>{a.stop(),t(s+r)},r,o),a}var fM=Wu("start","end","cancel","interrupt"),dM=[],d_=0,b1=1,Ch=2,yu=3,_1=4,Nh=5,xu=6;function nc(t,r,o,a,s,u){var c=t.__transition;if(!c)t.__transition={};else if(o in c)return;hM(t,o,{name:r,index:a,group:s,on:fM,tween:dM,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:d_})}function C0(t,r){var o=xn(t,r);if(o.state>d_)throw new Error("too late; already scheduled");return o}function Ln(t,r){var o=xn(t,r);if(o.state>yu)throw new Error("too late; already running");return o}function xn(t,r){var o=t.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function hM(t,r,o){var a=t.__transition,s;a[r]=o,o.timer=f_(u,0,o.time);function u(m){o.state=b1,o.timer.restart(c,o.delay,o.time),o.delay<=m&&c(m-o.delay)}function c(m){var y,g,x,b;if(o.state!==b1)return p();for(y in a)if(b=a[y],b.name===o.name){if(b.state===yu)return v1(c);b.state===_1?(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(){o.state===yu&&(o.state=_1,o.timer.restart(h,o.delay,o.time),h(m))}),o.state=Ch,o.on.call("start",t,t.__data__,o.index,o.group),o.state===Ch){for(o.state=yu,s=new Array(x=o.tween.length),y=0,g=-1;y<x;++y)(b=o.tween[y].value.call(t,t.__data__,o.index,o.group))&&(s[++g]=b);s.length=g+1}}function h(m){for(var y=m<o.duration?o.ease.call(null,m/o.duration):(o.timer.restart(p),o.state=Nh,1),g=-1,x=s.length;++g<x;)s[g].call(t,y);o.state===Nh&&(o.on.call("end",t,t.__data__,o.index,o.group),p())}function p(){o.state=xu,o.timer.stop(),delete a[r];for(var m in a)return;delete t.__transition}}function vu(t,r){var o=t.__transition,a,s,u=!0,c;if(o){r=r==null?null:r+"";for(c in o){if((a=o[c]).name!==r){u=!1;continue}s=a.state>Ch&&a.state<Nh,a.state=xu,a.timer.stop(),a.on.call(s?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete o[c]}u&&delete t.__transition}}function mM(t){return this.each(function(){vu(this,t)})}function pM(t,r){var o,a;return function(){var s=Ln(this,t),u=s.tween;if(u!==o){a=o=u;for(var c=0,h=a.length;c<h;++c)if(a[c].name===r){a=a.slice(),a.splice(c,1);break}}s.tween=a}}function gM(t,r,o){var a,s;if(typeof o!="function")throw new Error;return function(){var u=Ln(this,t),c=u.tween;if(c!==a){s=(a=c).slice();for(var h={name:r,value:o},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 yM(t,r){var o=this._id;if(t+="",arguments.length<2){for(var a=xn(this.node(),o).tween,s=0,u=a.length,c;s<u;++s)if((c=a[s]).name===t)return c.value;return null}return this.each((r==null?pM:gM)(o,t,r))}function N0(t,r,o){var a=t._id;return t.each(function(){var s=Ln(this,a);(s.value||(s.value={}))[r]=o.apply(this,arguments)}),function(s){return xn(s,a).value[r]}}function h_(t,r){var o;return(typeof r=="number"?Rn:r instanceof Do?Mu:(o=Do(r))?(r=o,Mu):a_)(t,r)}function xM(t){return function(){this.removeAttribute(t)}}function vM(t){return function(){this.removeAttributeNS(t.space,t.local)}}function bM(t,r,o){var a,s=o+"",u;return function(){var c=this.getAttribute(t);return c===s?null:c===a?u:u=r(a=c,o)}}function _M(t,r,o){var a,s=o+"",u;return function(){var c=this.getAttributeNS(t.space,t.local);return c===s?null:c===a?u:u=r(a=c,o)}}function EM(t,r,o){var a,s,u;return function(){var c,h=o(this),p;return h==null?void this.removeAttribute(t):(c=this.getAttribute(t),p=h+"",c===p?null:c===a&&p===s?u:(s=p,u=r(a=c,h)))}}function SM(t,r,o){var a,s,u;return function(){var c,h=o(this),p;return h==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),p=h+"",c===p?null:c===a&&p===s?u:(s=p,u=r(a=c,h)))}}function wM(t,r){var o=ec(t),a=o==="transform"?rM:h_;return this.attrTween(t,typeof r=="function"?(o.local?SM:EM)(o,a,N0(this,"attr."+t,r)):r==null?(o.local?vM:xM)(o):(o.local?_M:bM)(o,a,r))}function AM(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function TM(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function CM(t,r){var o,a;function s(){var u=r.apply(this,arguments);return u!==a&&(o=(a=u)&&TM(t,u)),o}return s._value=r,s}function NM(t,r){var o,a;function s(){var u=r.apply(this,arguments);return u!==a&&(o=(a=u)&&AM(t,u)),o}return s._value=r,s}function RM(t,r){var o="attr."+t;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var a=ec(t);return this.tween(o,(a.local?CM:NM)(a,r))}function MM(t,r){return function(){C0(this,t).delay=+r.apply(this,arguments)}}function DM(t,r){return r=+r,function(){C0(this,t).delay=r}}function OM(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?MM:DM)(r,t)):xn(this.node(),r).delay}function zM(t,r){return function(){Ln(this,t).duration=+r.apply(this,arguments)}}function BM(t,r){return r=+r,function(){Ln(this,t).duration=r}}function UM(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?zM:BM)(r,t)):xn(this.node(),r).duration}function HM(t,r){if(typeof r!="function")throw new Error;return function(){Ln(this,t).ease=r}}function LM(t){var r=this._id;return arguments.length?this.each(HM(r,t)):xn(this.node(),r).ease}function jM(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Ln(this,t).ease=o}}function FM(t){if(typeof t!="function")throw new Error;return this.each(jM(this._id,t))}function kM(t){typeof t!="function"&&(t=Yb(t));for(var r=this._groups,o=r.length,a=new Array(o),s=0;s<o;++s)for(var u=r[s],c=u.length,h=a[s]=[],p,m=0;m<c;++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 VM(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,o=t._groups,a=r.length,s=o.length,u=Math.min(a,s),c=new Array(a),h=0;h<u;++h)for(var p=r[h],m=o[h],y=p.length,g=c[h]=new Array(y),x,b=0;b<y;++b)(x=p[b]||m[b])&&(g[b]=x);for(;h<a;++h)c[h]=r[h];return new dr(c,this._parents,this._name,this._id)}function GM(t){return(t+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function qM(t,r,o){var a,s,u=GM(r)?C0:Ln;return function(){var c=u(this,t),h=c.on;h!==a&&(s=(a=h).copy()).on(r,o),c.on=s}}function YM(t,r){var o=this._id;return arguments.length<2?xn(this.node(),o).on.on(t):this.each(qM(o,t,r))}function XM(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function IM(){return this.on("end.remove",XM(this._id))}function PM(t){var r=this._name,o=this._id;typeof t!="function"&&(t=E0(t));for(var a=this._groups,s=a.length,u=new Array(s),c=0;c<s;++c)for(var h=a[c],p=h.length,m=u[c]=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,o,x,m,xn(y,o)));return new dr(u,this._parents,r,o)}function $M(t){var r=this._name,o=this._id;typeof t!="function"&&(t=qb(t));for(var a=this._groups,s=a.length,u=[],c=[],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,_=xn(y,o),E=0,C=x.length;E<C;++E)(b=x[E])&&nc(b,r,o,E,x,_);u.push(x),c.push(y)}return new dr(u,c,r,o)}var ZM=ml.prototype.constructor;function QM(){return new ZM(this._groups,this._parents)}function KM(t,r){var o,a,s;return function(){var u=Ui(this,t),c=(this.style.removeProperty(t),Ui(this,t));return u===c?null:u===o&&c===a?s:s=r(o=u,a=c)}}function m_(t){return function(){this.style.removeProperty(t)}}function JM(t,r,o){var a,s=o+"",u;return function(){var c=Ui(this,t);return c===s?null:c===a?u:u=r(a=c,o)}}function WM(t,r,o){var a,s,u;return function(){var c=Ui(this,t),h=o(this),p=h+"";return h==null&&(p=h=(this.style.removeProperty(t),Ui(this,t))),c===p?null:c===a&&p===s?u:(s=p,u=r(a=c,h))}}function e8(t,r){var o,a,s,u="style."+r,c="end."+u,h;return function(){var p=Ln(this,t),m=p.on,y=p.value[u]==null?h||(h=m_(r)):void 0;(m!==o||s!==y)&&(a=(o=m).copy()).on(c,s=y),p.on=a}}function t8(t,r,o){var a=(t+="")=="transform"?nM:h_;return r==null?this.styleTween(t,KM(t,a)).on("end.style."+t,m_(t)):typeof r=="function"?this.styleTween(t,WM(t,a,N0(this,"style."+t,r))).each(e8(this._id,t)):this.styleTween(t,JM(t,a,r),o).on("end.style."+t,null)}function n8(t,r,o){return function(a){this.style.setProperty(t,r.call(this,a),o)}}function r8(t,r,o){var a,s;function u(){var c=r.apply(this,arguments);return c!==s&&(a=(s=c)&&n8(t,c,o)),a}return u._value=r,u}function o8(t,r,o){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,r8(t,r,o??""))}function i8(t){return function(){this.textContent=t}}function a8(t){return function(){var r=t(this);this.textContent=r??""}}function l8(t){return this.tween("text",typeof t=="function"?a8(N0(this,"text",t)):i8(t==null?"":t+""))}function s8(t){return function(r){this.textContent=t.call(this,r)}}function u8(t){var r,o;function a(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&s8(s)),r}return a._value=t,a}function c8(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,u8(t))}function f8(){for(var t=this._name,r=this._id,o=p_(),a=this._groups,s=a.length,u=0;u<s;++u)for(var c=a[u],h=c.length,p,m=0;m<h;++m)if(p=c[m]){var y=xn(p,r);nc(p,t,o,m,c,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new dr(a,this._parents,t,o)}function d8(){var t,r,o=this,a=o._id,s=o.size();return new Promise(function(u,c){var h={value:c},p={value:function(){--s===0&&u()}};o.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 h8=0;function dr(t,r,o,a){this._groups=t,this._parents=r,this._name=o,this._id=a}function p_(){return++h8}var sr=ml.prototype;dr.prototype={constructor:dr,select:PM,selectAll:$M,selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:kM,merge:VM,selection:QM,transition:f8,call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.each,on:YM,attr:wM,attrTween:RM,style:t8,styleTween:o8,text:l8,textTween:c8,remove:IM,tween:yM,delay:OM,duration:UM,ease:LM,easeVarying:FM,end:d8,[Symbol.iterator]:sr[Symbol.iterator]};function m8(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var p8={time:null,delay:0,duration:250,ease:m8};function g8(t,r){for(var o;!(o=t.__transition)||!(o=o[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return o}function y8(t){var r,o;t instanceof dr?(r=t._id,t=t._name):(r=p_(),(o=p8).time=T0(),t=t==null?null:t+"");for(var a=this._groups,s=a.length,u=0;u<s;++u)for(var c=a[u],h=c.length,p,m=0;m<h;++m)(p=c[m])&&nc(p,t,r,m,c,o||g8(p,r));return new dr(a,this._parents,t,r)}ml.prototype.interrupt=mM;ml.prototype.transition=y8;const ru=t=>()=>t;function x8(t,{sourceEvent:r,target:o,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function ur(t,r,o){this.k=t,this.x=r,this.y=o}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);g_.prototype=ur.prototype;function g_(t){for(;!t.__zoom;)if(!(t=t.parentNode))return rc;return t.__zoom}function $d(t){t.stopImmediatePropagation()}function Ya(t){t.preventDefault(),t.stopImmediatePropagation()}function v8(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function b8(){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 E1(){return this.__zoom||rc}function _8(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function E8(){return navigator.maxTouchPoints||"ontouchstart"in this}function S8(t,r,o){var a=t.invertX(r[0][0])-o[0][0],s=t.invertX(r[1][0])-o[1][0],u=t.invertY(r[0][1])-o[0][1],c=t.invertY(r[1][1])-o[1][1];return t.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),c>u?(u+c)/2:Math.min(0,u)||Math.max(0,c))}function y_(){var t=v8,r=b8,o=S8,a=_8,s=E8,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],h=250,p=gu,m=Wu("start","zoom","end"),y,g,x,b=500,_=150,E=0,C=10;function w(B){B.property("__zoom",E1).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",Y).on("dblclick.zoom",ae).filter(s).on("touchstart.zoom",X).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(B,q,R,L){var V=B.selection?B.selection():B;V.property("__zoom",E1),B!==V?D(B,q,R,L):V.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 V=this.__zoom.k,P=typeof q=="function"?q.apply(this,arguments):q;return V*P},R,L)},w.scaleTo=function(B,q,R,L){w.transform(B,function(){var V=r.apply(this,arguments),P=this.__zoom,te=R==null?N(V):typeof R=="function"?R.apply(this,arguments):R,M=P.invert(te),F=typeof q=="function"?q.apply(this,arguments):q;return o(S(O(P,F),te,M),V,c)},R,L)},w.translateBy=function(B,q,R,L){w.transform(B,function(){return o(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof R=="function"?R.apply(this,arguments):R),r.apply(this,arguments),c)},null,L)},w.translateTo=function(B,q,R,L,V){w.transform(B,function(){var P=r.apply(this,arguments),te=this.__zoom,M=L==null?N(P):typeof L=="function"?L.apply(this,arguments):L;return o(rc.translate(M[0],M[1]).scale(te.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof R=="function"?-R.apply(this,arguments):-R),P,c)},L,V)};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 S(B,q,R){var L=q[0]-R[0]*B.k,V=q[1]-R[1]*B.k;return L===B.x&&V===B.y?B:new ur(B.k,L,V)}function N(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 V=this,P=arguments,te=z(V,P).event(L),M=r.apply(V,P),F=R==null?N(M):typeof R=="function"?R.apply(V,P):R,J=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),ne=V.__zoom,se=typeof q=="function"?q.apply(V,P):q,he=p(ne.invert(F).concat(J/ne.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)}te.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=$t(this.that).datum();m.call(B,this.that,new x8(B,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:m}),q)}};function k(B,...q){if(!t.apply(this,arguments))return;var R=z(this,q).event(B),L=this.__zoom,V=Math.max(u[0],Math.min(u[1],L.k*Math.pow(2,a.apply(this,arguments)))),P=hn(B);if(R.wheel)(R.mouse[0][0]!==P[0]||R.mouse[0][1]!==P[1])&&(R.mouse[1]=L.invert(R.mouse[0]=P)),clearTimeout(R.wheel);else{if(L.k===V)return;R.mouse=[P,L.invert(P)],vu(this),R.start()}Ya(B),R.wheel=setTimeout(te,_),R.zoom("mouse",o(S(O(L,V),R.mouse[0],R.mouse[1]),R.extent,c));function te(){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),V=$t(B.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",J,!0),P=hn(B,R),te=B.clientX,M=B.clientY;e_(B.view),$d(B),L.mouse=[P,this.__zoom.invert(P)],vu(this),L.start();function F(ne){if(Ya(ne),!L.moved){var se=ne.clientX-te,he=ne.clientY-M;L.moved=se*se+he*he>E}L.event(ne).zoom("mouse",o(S(L.that.__zoom,L.mouse[0]=hn(ne,R),L.mouse[1]),L.extent,c))}function J(ne){V.on("mousemove.zoom mouseup.zoom",null),t_(ne.view,L.moved),Ya(ne),L.event(ne).end()}}function ae(B,...q){if(t.apply(this,arguments)){var R=this.__zoom,L=hn(B.changedTouches?B.changedTouches[0]:B,this),V=R.invert(L),P=R.k*(B.shiftKey?.5:2),te=o(S(O(R,P),L,V),r.apply(this,q),c);Ya(B),h>0?$t(this).transition().duration(h).call(D,te,L,B):$t(this).call(w.transform,te,L,B)}}function X(B,...q){if(t.apply(this,arguments)){var R=B.touches,L=R.length,V=z(this,q,B.changedTouches.length===L).event(B),P,te,M,F;for($d(B),te=0;te<L;++te)M=R[te],F=hn(M,this),F=[F,this.__zoom.invert(F),M.identifier],V.touch0?!V.touch1&&V.touch0[2]!==F[2]&&(V.touch1=F,V.taps=0):(V.touch0=F,P=!0,V.taps=1+!!y);y&&(y=clearTimeout(y)),P&&(V.taps<2&&(g=F[0],y=setTimeout(function(){y=null},b)),vu(this),V.start())}}function $(B,...q){if(this.__zooming){var R=z(this,q).event(B),L=B.changedTouches,V=L.length,P,te,M,F;for(Ya(B),P=0;P<V;++P)te=L[P],M=hn(te,this),R.touch0&&R.touch0[2]===te.identifier?R.touch0[0]=M:R.touch1&&R.touch1[2]===te.identifier&&(R.touch1[0]=M);if(te=R.that.__zoom,R.touch1){var J=R.touch0[0],ne=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]-ne[0])*ue+(ue=he[1]-ne[1])*ue;te=O(te,Math.sqrt(fe/ue)),M=[(J[0]+se[0])/2,(J[1]+se[1])/2],F=[(ne[0]+he[0])/2,(ne[1]+he[1])/2]}else if(R.touch0)M=R.touch0[0],F=R.touch0[1];else return;R.zoom("touch",o(S(te,M,F),R.extent,c))}}function re(B,...q){if(this.__zooming){var R=z(this,q).event(B),L=B.changedTouches,V=L.length,P,te;for($d(B),x&&clearTimeout(x),x=setTimeout(function(){x=null},b),P=0;P<V;++P)te=L[P],R.touch0&&R.touch0[2]===te.identifier?delete R.touch0:R.touch1&&R.touch1[2]===te.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&&(te=hn(te,this),Math.hypot(g[0]-te[0],g[1]-te[1])<C)){var M=$t(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?(c[0][0]=+B[0][0],c[1][0]=+B[1][0],c[0][1]=+B[0][1],c[1][1]=+B[1][1],w):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},w.constrain=function(B){return arguments.length?(o=B,w):o},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?(E=(B=+B)*B,w):Math.sqrt(E)},w.tapDistance=function(B){return arguments.length?(C=+B,w):C},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:o,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?o: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."},ol=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],x_=["Enter"," ","Escape"],v_={"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:o})=>`Moved selected node ${t}. New position, x: ${r}, y: ${o}`,"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 Li;(function(t){t.Strict="strict",t.Loose="loose"})(Li||(Li={}));var No;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(No||(No={}));var il;(function(t){t.Partial="partial",t.Full="full"})(il||(il={}));const b_={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 S1={[ve.Left]:ve.Right,[ve.Right]:ve.Left,[ve.Top]:ve.Bottom,[ve.Bottom]:ve.Top};function __(t){return t===null?null:t?"valid":"invalid"}const E_=t=>"id"in t&&"source"in t&&"target"in t,w8=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),S_=(t,r,o)=>{if(!t.id)return[];const a=new Set;return o.forEach(s=>{s.source===t.id&&a.add(s.target)}),r.filter(s=>a.has(s.id))},gl=(t,r=[0,0])=>{const{width:o,height:a}=hr(t),s=t.origin??r,u=o*s[0],c=a*s[1];return{x:t.position.x-u,y:t.position.y-c}},A8=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const o=t.reduce((a,s)=>{const u=typeof s=="string";let c=!r.nodeLookup&&!u?s:void 0;r.nodeLookup&&(c=u?r.nodeLookup.get(s):R0(s)?s:r.nodeLookup.get(s.id));const h=c?Uu(c,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return oc(a,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ic(o)},yl=(t,r={})=>{let o={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))&&(o=oc(o,Uu(s)),a=!0)}),a?ic(o):{x:0,y:0,width:0,height:0}},M0=(t,r,[o,a,s]=[0,0,1],u=!1,c=!1)=>{const h={...vl(r,[o,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(c&&!g||x)continue;const b=y.width??m.width??m.initialWidth??null,_=y.height??m.height??m.initialHeight??null,E=al(h,Fi(m)),C=(b??0)*(_??0),w=u&&E>0;(!m.internals.handleBounds||w||E>=C||m.dragging)&&p.push(m)}return p},T8=(t,r)=>{const o=new Set;return t.forEach(a=>{o.add(a.id)}),r.filter(a=>o.has(a.source)||o.has(a.target))};function C8(t,r){const o=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))&&o.set(s.id,s)}),o}async function N8({nodes:t,width:r,height:o,panZoom:a,minZoom:s,maxZoom:u},c){if(t.size===0)return Promise.resolve(!0);const h=C8(t,c),p=yl(h),m=D0(p,r,o,c?.minZoom??s,c?.maxZoom??u,c?.padding??.1);return await a.setViewport(m,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),Promise.resolve(!0)}function w_({nodeId:t,nextPosition:r,nodeLookup:o,nodeOrigin:a=[0,0],nodeExtent:s,onError:u}){const c=o.get(t),h=c.parentId?o.get(c.parentId):void 0,{x:p,y:m}=h?h.internals.positionAbsolute:{x:0,y:0},y=c.origin??a;let g=c.extent||s;if(c.extent==="parent"&&!c.expandParent)if(!h)u?.("005",zn.error005());else{const b=h.measured.width,_=h.measured.height;b&&_&&(g=[[p,m],[p+b,m+_]])}else h&&ki(c.extent)&&(g=[[c.extent[0][0]+p,c.extent[0][1]+m],[c.extent[1][0]+p,c.extent[1][1]+m]]);const x=ki(g)?zo(r,g,c.measured):r;return(c.measured.width===void 0||c.measured.height===void 0)&&u?.("015",zn.error015()),{position:{x:x.x-p+(c.measured.width??0)*y[0],y:x.y-m+(c.measured.height??0)*y[1]},positionAbsolute:x}}async function R8({nodesToRemove:t=[],edgesToRemove:r=[],nodes:o,edges:a,onBeforeDelete:s}){const u=new Set(t.map(x=>x.id)),c=[];for(const x of o){if(x.deletable===!1)continue;const b=u.has(x.id),_=!b&&x.parentId&&c.find(E=>E.id===x.parentId);(b||_)&&c.push(x)}const h=new Set(r.map(x=>x.id)),p=a.filter(x=>x.deletable!==!1),y=T8(c,p);for(const x of p)h.has(x.id)&&!y.find(_=>_.id===x.id)&&y.push(x);if(!s)return{edges:y,nodes:c};const g=await s({nodes:c,edges:y});return typeof g=="boolean"?g?{edges:y,nodes:c}:{edges:[],nodes:[]}:g}const ji=(t,r=0,o=1)=>Math.min(Math.max(t,r),o),zo=(t={x:0,y:0},r,o)=>({x:ji(t.x,r[0][0],r[1][0]-(o?.width??0)),y:ji(t.y,r[0][1],r[1][1]-(o?.height??0))});function A_(t,r,o){const{width:a,height:s}=hr(o),{x:u,y:c}=o.internals.positionAbsolute;return zo(t,[[u,c],[u+a,c+s]],r)}const w1=(t,r,o)=>t<r?ji(Math.abs(t-r),1,r)/r:t>o?-ji(Math.abs(t-o),1,r)/r:0,T_=(t,r,o=15,a=40)=>{const s=w1(t.x,a,r.width-a)*o,u=w1(t.y,a,r.height-a)*o;return[s,u]},oc=(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:o,height:a})=>({x:t,y:r,x2:t+o,y2:r+a}),ic=({x:t,y:r,x2:o,y2:a})=>({x:t,y:r,width:o-t,height:a-r}),Fi=(t,r=[0,0])=>{const{x:o,y:a}=R0(t)?t.internals.positionAbsolute:gl(t,r);return{x:o,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:o,y:a}=R0(t)?t.internals.positionAbsolute:gl(t,r);return{x:o,y:a,x2:o+(t.measured?.width??t.width??t.initialWidth??0),y2:a+(t.measured?.height??t.height??t.initialHeight??0)}},C_=(t,r)=>ic(oc(Rh(t),Rh(r))),al=(t,r)=>{const o=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(o*a)},A1=t=>pn(t.width)&&pn(t.height)&&pn(t.x)&&pn(t.y),pn=t=>!isNaN(t)&&isFinite(t),M8=(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},[o,a,s],u=!1,c=[1,1])=>{const h={x:(t-o)/s,y:(r-a)/s};return u?xl(h,c):h},Hu=({x:t,y:r},[o,a,s])=>({x:t*s+o,y:r*s+a});function Ni(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(o)}if(typeof t=="string"&&t.endsWith("%")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(r*o*.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 D8(t,r,o){if(typeof t=="string"||typeof t=="number"){const a=Ni(t,o),s=Ni(t,r);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof t=="object"){const a=Ni(t.top??t.y??0,o),s=Ni(t.bottom??t.y??0,o),u=Ni(t.left??t.x??0,r),c=Ni(t.right??t.x??0,r);return{top:a,right:c,bottom:s,left:u,x:u+c,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function O8(t,r,o,a,s,u){const{x:c,y:h}=Hu(t,[r,o,a]),{x:p,y:m}=Hu({x:t.x+t.width,y:t.y+t.height},[r,o,a]),y=s-p,g=u-m;return{left:Math.floor(c),top:Math.floor(h),right:Math.floor(y),bottom:Math.floor(g)}}const D0=(t,r,o,a,s,u)=>{const c=D8(u,r,o),h=(r-c.x)/t.width,p=(o-c.y)/t.height,m=Math.min(h,p),y=ji(m,a,s),g=t.x+t.width/2,x=t.y+t.height/2,b=r/2-g*y,_=o/2-x*y,E=O8(t,b,_,y,r,o),C={left:Math.min(E.left-c.left,0),top:Math.min(E.top-c.top,0),right:Math.min(E.right-c.right,0),bottom:Math.min(E.bottom-c.bottom,0)};return{x:b-C.left+C.right,y:_-C.top+C.bottom,zoom:y}},ll=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ki(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 N_(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function R_(t,r={width:0,height:0},o,a,s){const u={...t},c=a.get(o);if(c){const h=c.origin||s;u.x+=c.internals.positionAbsolute.x-(r.width??0)*h[0],u.y+=c.internals.positionAbsolute.y-(r.height??0)*h[1]}return u}function T1(t,r){if(t.size!==r.size)return!1;for(const o of t)if(!r.has(o))return!1;return!0}function z8(){let t,r;return{promise:new Promise((a,s)=>{t=a,r=s}),resolve:t,reject:r}}function B8(t){return{...v_,...t||{}}}function Za(t,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:a,containerBounds:s}){const{x:u,y:c}=gn(t),h=vl({x:u-(s?.left??0),y:c-(s?.top??0)},a),{x:p,y:m}=o?xl(h,r):h;return{xSnapped:p,ySnapped:m,...h}}const O0=t=>({width:t.offsetWidth,height:t.offsetHeight}),M_=t=>t?.getRootNode?.()||window?.document,U8=["INPUT","SELECT","TEXTAREA"];function D_(t){const r=t.composedPath?.()?.[0]||t.target;return r?.nodeType!==1?!1:U8.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const O_=t=>"clientX"in t,gn=(t,r)=>{const o=O_(t),a=o?t.clientX:t.touches?.[0].clientX,s=o?t.clientY:t.touches?.[0].clientY;return{x:a-(r?.left??0),y:s-(r?.top??0)}},C1=(t,r,o,a,s)=>{const u=r.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(c=>{const h=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:s,position:c.getAttribute("data-handlepos"),x:(h.left-o.left)/a,y:(h.top-o.top)/a,...O0(c)}})};function z_({sourceX:t,sourceY:r,targetX:o,targetY:a,sourceControlX:s,sourceControlY:u,targetControlX:c,targetControlY:h}){const p=t*.125+s*.375+c*.375+o*.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 ou(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function N1({pos:t,x1:r,y1:o,x2:a,y2:s,c:u}){switch(t){case ve.Left:return[r-ou(r-a,u),o];case ve.Right:return[r+ou(a-r,u),o];case ve.Top:return[r,o-ou(o-s,u)];case ve.Bottom:return[r,o+ou(s-o,u)]}}function ac({sourceX:t,sourceY:r,sourcePosition:o=ve.Bottom,targetX:a,targetY:s,targetPosition:u=ve.Top,curvature:c=.25}){const[h,p]=N1({pos:o,x1:t,y1:r,x2:a,y2:s,c}),[m,y]=N1({pos:u,x1:a,y1:s,x2:t,y2:r,c}),[g,x,b,_]=z_({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,_]}function B_({sourceX:t,sourceY:r,targetX:o,targetY:a}){const s=Math.abs(o-t)/2,u=o<t?o+s:o-s,c=Math.abs(a-r)/2,h=a<r?a+c:a-c;return[u,h,s,c]}function H8({sourceNode:t,targetNode:r,selected:o=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:u="basic"}){if(u==="manual")return a;const c=s&&o?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 c+h}function L8({sourceNode:t,targetNode:r,width:o,height:a,transform:s}){const u=oc(Uu(t),Uu(r));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c={x:-s[0]/s[2],y:-s[1]/s[2],width:o/s[2],height:a/s[2]};return al(c,ic(u))>0}const j8=({source:t,sourceHandle:r,target:o,targetHandle:a})=>`xy-edge__${t}${r||""}-${o}${a||""}`,F8=(t,r)=>r.some(o=>o.source===t.source&&o.target===t.target&&(o.sourceHandle===t.sourceHandle||!o.sourceHandle&&!t.sourceHandle)&&(o.targetHandle===t.targetHandle||!o.targetHandle&&!t.targetHandle)),Mh=(t,r,o={})=>{if(!t.source||!t.target)return r;const a=o.getEdgeId||j8;let s;return E_(t)?s={...t}:s={...t,id:a(t)},F8(s,r)?r:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,r.concat(s))};function U_({sourceX:t,sourceY:r,targetX:o,targetY:a}){const[s,u,c,h]=B_({sourceX:t,sourceY:r,targetX:o,targetY:a});return[`M ${t},${r}L ${o},${a}`,s,u,c,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}},k8=({source:t,sourcePosition:r=ve.Bottom,target:o})=>r===ve.Left||r===ve.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.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 V8({source:t,sourcePosition:r=ve.Bottom,target:o,targetPosition:a=ve.Top,center:s,offset:u,stepPosition:c}){const h=R1[r],p=R1[a],m={x:t.x+h.x*u,y:t.y+h.y*u},y={x:o.x+p.x*u,y:o.y+p.y*u},g=k8({source:m,sourcePosition:r,target:y}),x=g.x!==0?"x":"y",b=g[x];let _=[],E,C;const w={x:0,y:0},O={x:0,y:0},[,,S,N]=B_({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(h[x]*p[x]===-1){x==="x"?(E=s.x??m.x+(y.x-m.x)*c,C=s.y??(m.y+y.y)/2):(E=s.x??(m.x+y.x)/2,C=s.y??m.y+(y.y-m.y)*c);const z=[{x:E,y:m.y},{x:E,y:y.y}],U=[{x:m.x,y:C},{x:y.x,y:C}];h[x]===b?_=x==="x"?z:U:_=x==="x"?U:z}else{const z=[{x:m.x,y:y.y}],U=[{x:y.x,y:m.y}];if(x==="x"?_=h.x===b?U:z:_=h.y===b?z:U,r===a){const $=Math.abs(t[x]-o[x]);if($<=u){const re=Math.min(u-1,u-$);h[x]===b?w[x]=(m[x]>t[x]?-1:1)*re:O[x]=(y[x]>o[x]?-1:1)*re}}if(r!==a){const $=x==="x"?"y":"x",re=h[x]===p[$],B=m[$]>y[$],q=m[$]<y[$];(h[x]===1&&(!re&&B||re&&q)||h[x]!==1&&(!re&&q||re&&B))&&(_=x==="x"?z:U)}const k={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(k.x-_[0].x),Math.abs(Y.x-_[0].x)),X=Math.max(Math.abs(k.y-_[0].y),Math.abs(Y.y-_[0].y));ae>=X?(E=(k.x+Y.x)/2,C=_[0].y):(E=_[0].x,C=(k.y+Y.y)/2)}return[[t,{x:m.x+w.x,y:m.y+w.y},..._,{x:y.x+O.x,y:y.y+O.y},o],E,C,S,N]}function G8(t,r,o,a){const s=Math.min(M1(t,r)/2,M1(r,o)/2,a),{x:u,y:c}=r;if(t.x===u&&u===o.x||t.y===c&&c===o.y)return`L${u} ${c}`;if(t.y===c){const m=t.x<o.x?-1:1,y=t.y<o.y?1:-1;return`L ${u+s*m},${c}Q ${u},${c} ${u},${c+s*y}`}const h=t.x<o.x?1:-1,p=t.y<o.y?-1:1;return`L ${u},${c+s*p}Q ${u},${c} ${u+s*h},${c}`}function Dh({sourceX:t,sourceY:r,sourcePosition:o=ve.Bottom,targetX:a,targetY:s,targetPosition:u=ve.Top,borderRadius:c=5,centerX:h,centerY:p,offset:m=20,stepPosition:y=.5}){const[g,x,b,_,E]=V8({source:{x:t,y:r},sourcePosition:o,target:{x:a,y:s},targetPosition:u,center:{x:h,y:p},offset:m,stepPosition:y});return[g.reduce((w,O,S)=>{let N="";return S>0&&S<g.length-1?N=G8(g[S-1],O,g[S+1],c):N=`${S===0?"M":"L"}${O.x} ${O.y}`,w+=N,w},""),x,b,_,E]}function D1(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function q8(t){const{sourceNode:r,targetNode:o}=t;if(!D1(r)||!D1(o))return null;const a=r.internals.handleBounds||O1(r.handles),s=o.internals.handleBounds||O1(o.handles),u=z1(a?.source??[],t.sourceHandle),c=z1(t.connectionMode===Li.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),t.targetHandle);if(!u||!c)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=c?.position||ve.Top,m=Bo(r,u,h),y=Bo(o,c,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=[],o=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?r.push(a):a.type==="target"&&o.push(a);return{source:r,target:o}}function Bo(t,r,o=ve.Left,a=!1){const s=(r?.x??0)+t.internals.positionAbsolute.x,u=(r?.y??0)+t.internals.positionAbsolute.y,{width:c,height:h}=r??hr(t);if(a)return{x:s+c/2,y:u+h/2};switch(r?.position??o){case ve.Top:return{x:s+c/2,y:u};case ve.Right:return{x:s+c,y:u+h/2};case ve.Bottom:return{x:s+c/2,y:u+h};case ve.Left:return{x:s,y:u+h/2}}}function z1(t,r){return t&&(r?t.find(o=>o.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 Y8(t,{id:r,defaultColor:o,defaultMarkerStart:a,defaultMarkerEnd:s}){const u=new Set;return t.reduce((c,h)=>([h.markerStart||a,h.markerEnd||s].forEach(p=>{if(p&&typeof p=="object"){const m=Oh(p,r);u.has(m)||(c.push({id:m,color:p.color||o,...p}),u.add(m))}}),c),[]).sort((c,h)=>c.id.localeCompare(h.id))}const H_=1e3,X8=10,z0={nodeOrigin:[0,0],nodeExtent:ol,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},I8={...z0,checkEquality:!0};function B0(t,r){const o={...t};for(const a in r)r[a]!==void 0&&(o[a]=r[a]);return o}function P8(t,r,o){const a=B0(z0,o);for(const s of t.values())if(s.parentId)H0(s,t,r,a);else{const u=gl(s,a.nodeOrigin),c=ki(s.extent)?s.extent:a.nodeExtent,h=zo(u,c,hr(s));s.internals.positionAbsolute=h}}function $8(t,r){if(!t.handles)return t.measured?r?.internals.handleBounds:void 0;const o=[],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"?o.push(u):s.type==="target"&&a.push(u)}return{source:o,target:a}}function U0(t){return t==="manual"}function zh(t,r,o,a={}){const s=B0(I8,a),u={i:0},c=new Map(r),h=s?.elevateNodesOnSelect&&!U0(s.zIndexMode)?H_:0;let p=t.length>0;r.clear(),o.clear();for(const m of t){let y=c.get(m.id);if(s.checkEquality&&m===y?.internals.userNode)r.set(m.id,y);else{const g=gl(m,s.nodeOrigin),x=ki(m.extent)?m.extent:s.nodeExtent,b=zo(g,x,hr(m));y={...s.defaults,...m,measured:{width:m.measured?.width,height:m.measured?.height},internals:{positionAbsolute:b,handleBounds:$8(m,y),z:L_(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,o,a,u)}return p}function Z8(t,r){if(!t.parentId)return;const o=r.get(t.parentId);o?o.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function H0(t,r,o,a,s){const{elevateNodesOnSelect:u,nodeOrigin:c,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}Z8(t,o),s&&!y.parentId&&y.internals.rootParentIndex===void 0&&p==="auto"&&(y.internals.rootParentIndex=++s.i,y.internals.z=y.internals.z+s.i*X8),s&&y.internals.rootParentIndex!==void 0&&(s.i=y.internals.rootParentIndex);const g=u&&!U0(p)?H_:0,{x,y:b,z:_}=Q8(t,y,c,h,g,p),{positionAbsolute:E}=t.internals,C=x!==E.x||b!==E.y;(C||_!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:C?{x,y:b}:E,z:_}})}function L_(t,r,o){const a=pn(t.zIndex)?t.zIndex:0;return U0(o)?a:a+(t.selected?r:0)}function Q8(t,r,o,a,s,u){const{x:c,y:h}=r.internals.positionAbsolute,p=hr(t),m=gl(t,o),y=ki(t.extent)?zo(m,t.extent,p):m;let g=zo({x:c+y.x,y:h+y.y},a,p);t.extent==="parent"&&(g=A_(g,p,r));const x=L_(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,o,a=[0,0]){const s=[],u=new Map;for(const c of t){const h=r.get(c.parentId);if(!h)continue;const p=u.get(c.parentId)?.expandedRect??Fi(h),m=C_(p,c.rect);u.set(c.parentId,{expandedRect:m,parent:h})}return u.size>0&&u.forEach(({expandedRect:c,parent:h},p)=>{const m=h.internals.positionAbsolute,y=hr(h),g=h.origin??a,x=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,b=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,_=Math.max(y.width,Math.round(c.width)),E=Math.max(y.height,Math.round(c.height)),C=(_-y.width)*g[0],w=(E-y.height)*g[1];(x>0||b>0||C||w)&&(s.push({id:p,type:"position",position:{x:h.position.x-x+C,y:h.position.y-b+w}}),o.get(p)?.forEach(O=>{t.some(S=>S.id===O.id)||s.push({id:O.id,type:"position",position:{x:O.position.x+x,y:O.position.y+b}})})),(y.width<c.width||y.height<c.height||x||b)&&s.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:_+(x?g[0]*x-C:0),height:E+(b?g[1]*b-w:0)}})}),s}function K8(t,r,o,a,s,u,c){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 _=r.get(b.id);if(!_)continue;if(_.hidden){r.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),p=!0;continue}const E=O0(b.nodeElement),C=_.measured.width!==E.width||_.measured.height!==E.height;if(!!(E.width&&E.height&&(C||!_.internals.handleBounds||b.force))){const O=b.nodeElement.getBoundingClientRect(),S=ki(_.extent)?_.extent:u;let{positionAbsolute:N}=_.internals;_.parentId&&_.extent==="parent"?N=A_(N,E,r.get(_.parentId)):S&&(N=zo(N,S,E));const D={..._,measured:E,internals:{..._.internals,positionAbsolute:N,handleBounds:{source:C1("source",b.nodeElement,O,g,_.id),target:C1("target",b.nodeElement,O,g,_.id)}}};r.set(_.id,D),_.parentId&&H0(D,r,o,{nodeOrigin:s,zIndexMode:c}),p=!0,C&&(m.push({id:_.id,type:"dimensions",dimensions:E}),_.expandParent&&_.parentId&&x.push({id:_.id,parentId:_.parentId,rect:Fi(D,s)}))}}if(x.length>0){const b=L0(x,r,o,s);m.push(...b)}return{changes:m,updatedInternals:p}}async function J8({delta:t,panZoom:r,transform:o,translateExtent:a,width:s,height:u}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const c=await r.setViewportConstrained({x:o[0]+t.x,y:o[1]+t.y,zoom:o[2]},[[0,0],[s,u]],a),h=!!c&&(c.x!==o[0]||c.y!==o[1]||c.k!==o[2]);return Promise.resolve(h)}function B1(t,r,o,a,s,u){let c=s;const h=a.get(c)||new Map;a.set(c,h.set(o,r)),c=`${s}-${t}`;const p=a.get(c)||new Map;if(a.set(c,p.set(o,r)),u){c=`${s}-${t}-${u}`;const m=a.get(c)||new Map;a.set(c,m.set(o,r))}}function j_(t,r,o){t.clear(),r.clear();for(const a of o){const{source:s,target:u,sourceHandle:c=null,targetHandle:h=null}=a,p={edgeId:a.id,source:s,target:u,sourceHandle:c,targetHandle:h},m=`${s}-${c}--${u}-${h}`,y=`${u}-${h}--${s}-${c}`;B1("source",p,y,t,s,c),B1("target",p,m,t,u,h),r.set(a.id,a)}}function F_(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:F_(o,r):!1}function U1(t,r,o){let a=t;do{if(a?.matches?.(r))return!0;if(a===o)return!1;a=a?.parentElement}while(a);return!1}function W8(t,r,o,a){const s=new Map;for(const[u,c]of t)if((c.selected||c.id===a)&&(!c.parentId||!F_(c,t))&&(c.draggable||r&&typeof c.draggable>"u")){const h=t.get(u);h&&s.set(u,{id:u,position:h.position||{x:0,y:0},distance:{x:o.x-h.internals.positionAbsolute.x,y:o.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:o,dragging:a=!0}){const s=[];for(const[c,h]of r){const p=o.get(c)?.internals.userNode;p&&s.push({...p,position:h.position,dragging:a})}if(!t)return[s[0],s];const u=o.get(t)?.internals.userNode;return[u?{...u,position:r.get(t)?.position||u.position,dragging:a}:s[0],s]}function eD({dragItems:t,snapGrid:r,x:o,y:a}){const s=t.values().next().value;if(!s)return null;const u={x:o-s.distance.x,y:a-s.distance.y},c=xl(u,r);return{x:c.x-u.x,y:c.y-u.y}}function tD({onNodeMouseDown:t,getStoreItems:r,onDragStart:o,onDrag:a,onDragStop:s}){let u={x:null,y:null},c=0,h=new Map,p=!1,m={x:0,y:0},y=null,g=!1,x=null,b=!1,_=!1,E=null;function C({noDragClassName:O,handleSelector:S,domNode:N,isSelectable:D,nodeId:z,nodeClickDistance:U=0}){x=$t(N);function k({x:$,y:re}){const{nodeLookup:B,nodeExtent:q,snapGrid:R,snapToGrid:L,nodeOrigin:V,onNodeDrag:P,onSelectionDrag:te,onError:M,updateNodePositions:F}=r();u={x:$,y:re};let J=!1;const ne=h.size>1,se=ne&&q?Rh(yl(h)):null,he=ne&&L?eD({dragItems:h,snapGrid:R,x:$,y:re}):null;for(const[fe,ue]of h){if(!B.has(fe))continue;let me={x:$-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 ee=null;if(ne&&q&&!ue.extent&&se){const{positionAbsolute:ge}=ue.internals,xe=ge.x-se.x+q[0][0],Ee=ge.x+ue.measured.width-se.x2+q[1][0],Te=ge.y-se.y+q[0][1],je=ge.y+ue.measured.height-se.y2+q[1][1];ee=[[xe,Te],[Ee,je]]}const{position:ce,positionAbsolute:de}=w_({nodeId:fe,nextPosition:me,nodeLookup:B,nodeExtent:ee||q,nodeOrigin:V,onError:M});J=J||ue.position.x!==ce.x||ue.position.y!==ce.y,ue.position=ce,ue.internals.positionAbsolute=de}if(_=_||J,!!J&&(F(h,!0),E&&(a||P||!z&&te))){const[fe,ue]=Zd({nodeId:z,dragItems:h,nodeLookup:B});a?.(E,h,fe,ue),P?.(E,fe,ue),z||te?.(E,ue)}}async function Y(){if(!y)return;const{transform:$,panBy:re,autoPanSpeed:B,autoPanOnNodeDrag:q}=r();if(!q){p=!1,cancelAnimationFrame(c);return}const[R,L]=T_(m,y,B);(R!==0||L!==0)&&(u.x=(u.x??0)-R/$[2],u.y=(u.y??0)-L/$[2],await re({x:R,y:L})&&k(u)),c=requestAnimationFrame(Y)}function ae($){const{nodeLookup:re,multiSelectionActive:B,nodesDraggable:q,transform:R,snapGrid:L,snapToGrid:V,selectNodesOnDrag:P,onNodeDragStart:te,onSelectionDragStart:M,unselectNodesAndEdges:F}=r();g=!0,(!P||!D)&&!B&&z&&(re.get(z)?.selected||F()),D&&P&&z&&t?.(z);const J=Za($.sourceEvent,{transform:R,snapGrid:L,snapToGrid:V,containerBounds:y});if(u=J,h=W8(re,q,J,z),h.size>0&&(o||te||!z&&M)){const[ne,se]=Zd({nodeId:z,dragItems:h,nodeLookup:re});o?.($.sourceEvent,h,ne,se),te?.($.sourceEvent,ne,se),z||M?.($.sourceEvent,se)}}const X=n_().clickDistance(U).on("start",$=>{const{domNode:re,nodeDragThreshold:B,transform:q,snapGrid:R,snapToGrid:L}=r();y=re?.getBoundingClientRect()||null,b=!1,_=!1,E=$.sourceEvent,B===0&&ae($),u=Za($.sourceEvent,{transform:q,snapGrid:R,snapToGrid:L,containerBounds:y}),m=gn($.sourceEvent,y)}).on("drag",$=>{const{autoPanOnNodeDrag:re,transform:B,snapGrid:q,snapToGrid:R,nodeDragThreshold:L,nodeLookup:V}=r(),P=Za($.sourceEvent,{transform:B,snapGrid:q,snapToGrid:R,containerBounds:y});if(E=$.sourceEvent,($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||z&&!V.has(z))&&(b=!0),!b){if(!p&&re&&g&&(p=!0,Y()),!g){const te=gn($.sourceEvent,y),M=te.x-m.x,F=te.y-m.y;Math.sqrt(M*M+F*F)>L&&ae($)}(u.x!==P.xSnapped||u.y!==P.ySnapped)&&h&&g&&(m=gn($.sourceEvent,y),k(P))}}).on("end",$=>{if(!(!g||b)&&(p=!1,g=!1,cancelAnimationFrame(c),h.size>0)){const{nodeLookup:re,updateNodePositions:B,onNodeDragStop:q,onSelectionDragStop:R}=r();if(_&&(B(h,!1),_=!1),s||q||!z&&R){const[L,V]=Zd({nodeId:z,dragItems:h,nodeLookup:re,dragging:!1});s?.($.sourceEvent,h,L,V),q?.($.sourceEvent,L,V),z||R?.($.sourceEvent,V)}}}).filter($=>{const re=$.target;return!$.button&&(!O||!U1(re,`.${O}`,N))&&(!S||U1(re,S,N))});x.call(X)}function w(){x?.on(".drag",null)}return{update:C,destroy:w}}function nD(t,r,o){const a=[],s={x:t.x-o,y:t.y-o,width:o*2,height:o*2};for(const u of r.values())al(s,Fi(u))>0&&a.push(u);return a}const rD=250;function oD(t,r,o,a){let s=[],u=1/0;const c=nD(t,o,r+rD);for(const h of c){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}=Bo(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 k_(t,r,o,a,s,u=!1){const c=a.get(t);if(!c)return null;const h=s==="strict"?c.internals.handleBounds?.[r]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],p=(o?h?.find(m=>m.id===o):h?.[0])??null;return p&&u?{...p,...Bo(c,p,p.position,!0)}:p}function V_(t,r){return t||(r?.classList.contains("target")?"target":r?.classList.contains("source")?"source":null)}function iD(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const G_=()=>!0;function aD(t,{connectionMode:r,connectionRadius:o,handleId:a,nodeId:s,edgeUpdaterType:u,isTarget:c,domNode:h,nodeLookup:p,lib:m,autoPanOnConnect:y,flowId:g,panBy:x,cancelConnection:b,onConnectStart:_,onConnect:E,onConnectEnd:C,isValidConnection:w=G_,onReconnectEnd:O,updateConnection:S,getTransform:N,getFromHandle:D,autoPanSpeed:z,dragThreshold:U=1,handleDomNode:k}){const Y=M_(t.target);let ae=0,X;const{x:$,y:re}=gn(t),B=V_(u,k),q=h?.getBoundingClientRect();let R=!1;if(!q||!B)return;const L=k_(s,B,a,p,r);if(!L)return;let V=gn(t,q),P=!1,te=null,M=!1,F=null;function J(){if(!y||!q)return;const[ce,de]=T_(V,q,z);x({x:ce,y:de}),ae=requestAnimationFrame(J)}const ne={...L,nodeId:s,type:B,position:L.position},se=p.get(s);let fe={inProgress:!0,isValid:null,from:Bo(se,ne,ve.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:se,to:V,toHandle:null,toPosition:S1[ne.position],toNode:null,pointer:V};function ue(){R=!0,S(fe),_?.(t,{nodeId:s,handleId:a,handleType:B})}U===0&&ue();function me(ce){if(!R){const{x:je,y:Ie}=gn(ce),wt=je-$,At=Ie-re;if(!(wt*wt+At*At>U*U))return;ue()}if(!D()||!ne){ee(ce);return}const de=N();V=gn(ce,q),X=oD(vl(V,de,!1,[1,1]),o,p,ne),P||(J(),P=!0);const ge=q_(ce,{handle:X,connectionMode:r,fromNodeId:s,fromHandleId:a,fromType:c?"target":"source",isValidConnection:w,doc:Y,lib:m,flowId:g,nodeLookup:p});F=ge.handleDomNode,te=ge.connection,M=iD(!!X,ge.isValid);const xe=p.get(s),Ee=xe?Bo(xe,ne,ve.Left,!0):fe.from,Te={...fe,from:Ee,isValid:M,to:ge.toHandle&&M?Hu({x:ge.toHandle.x,y:ge.toHandle.y},de):V,toHandle:ge.toHandle,toPosition:M&&ge.toHandle?ge.toHandle.position:S1[ne.position],toNode:ge.toHandle?p.get(ge.toHandle.nodeId):null,pointer:V};S(Te),fe=Te}function ee(ce){if(!("touches"in ce&&ce.touches.length>0)){if(R){(X||F)&&te&&M&&E?.(te);const{inProgress:de,...ge}=fe,xe={...ge,toPosition:fe.toHandle?fe.toPosition:null};C?.(ce,xe),u&&O?.(ce,xe)}b(),cancelAnimationFrame(ae),P=!1,M=!1,te=null,F=null,Y.removeEventListener("mousemove",me),Y.removeEventListener("mouseup",ee),Y.removeEventListener("touchmove",me),Y.removeEventListener("touchend",ee)}}Y.addEventListener("mousemove",me),Y.addEventListener("mouseup",ee),Y.addEventListener("touchmove",me),Y.addEventListener("touchend",ee)}function q_(t,{handle:r,connectionMode:o,fromNodeId:a,fromHandleId:s,fromType:u,doc:c,lib:h,flowId:p,isValidConnection:m=G_,nodeLookup:y}){const g=u==="target",x=r?c.querySelector(`.${h}-flow__handle[data-id="${p}-${r?.nodeId}-${r?.id}-${r?.type}"]`):null,{x:b,y:_}=gn(t),E=c.elementFromPoint(b,_),C=E?.classList.contains(`${h}-flow__handle`)?E:x,w={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const O=V_(void 0,C),S=C.getAttribute("data-nodeid"),N=C.getAttribute("data-handleid"),D=C.classList.contains("connectable"),z=C.classList.contains("connectableend");if(!S||!O)return w;const U={source:g?S:a,sourceHandle:g?N:s,target:g?a:S,targetHandle:g?s:N};w.connection=U;const Y=D&&z&&(o===Li.Strict?g&&O==="source"||!g&&O==="target":S!==a||N!==s);w.isValid=Y&&m(U),w.toHandle=k_(S,O,N,y,o,!0)}return w}const Bh={onPointerDown:aD,isValid:q_};function lD({domNode:t,panZoom:r,getTransform:o,getViewScale:a}){const s=$t(t);function u({translateExtent:h,width:p,height:m,zoomStep:y=1,pannable:g=!0,zoomable:x=!0,inversePan:b=!1}){const _=S=>{if(S.sourceEvent.type!=="wheel"||!r)return;const N=o(),D=S.sourceEvent.ctrlKey&&ll()?10:1,z=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*y,U=N[2]*Math.pow(2,z*D);r.scaleTo(U)};let E=[0,0];const C=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(E=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},w=S=>{const N=o();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!r)return;const D=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],z=[D[0]-E[0],D[1]-E[1]];E=D;const U=a()*Math.max(N[2],Math.log(N[2]))*(b?-1:1),k={x:N[0]-z[0]*U,y:N[1]-z[1]*U},Y=[[0,0],[p,m]];r.setViewportConstrained({x:k.x,y:k.y,zoom:N[2]},Y,h)},O=y_().on("start",C).on("zoom",g?w:null).on("zoom.wheel",x?_:null);s.call(O,{})}function c(){s.on("zoom",null)}return{update:u,destroy:c,pointer:hn}}const lc=t=>({x:t.x,y:t.y,zoom:t.k}),Qd=({x:t,y:r,zoom:o})=>rc.translate(t,r).scale(o),Ri=(t,r)=>t.target.closest(`.${r}`),Y_=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),sD=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Kd=(t,r=0,o=sD,a=()=>{})=>{const s=typeof r=="number"&&r>0;return s||a(),s?t.transition().duration(r).ease(o).on("end",a):t},X_=t=>{const r=t.ctrlKey&&ll()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function uD({zoomPanValues:t,noWheelClassName:r,d3Selection:o,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:u,zoomOnPinch:c,onPanZoomStart:h,onPanZoom:p,onPanZoomEnd:m}){return y=>{if(Ri(y,r))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const g=o.property("__zoom").k||1;if(y.ctrlKey&&c){const C=hn(y),w=X_(y),O=g*Math.pow(2,w);a.scaleTo(o,O,C,y);return}const x=y.deltaMode===1?20:1;let b=s===No.Vertical?0:y.deltaX*x,_=s===No.Horizontal?0:y.deltaY*x;!ll()&&y.shiftKey&&s!==No.Vertical&&(b=y.deltaY*x,_=0),a.translateBy(o,-(b/g)*u,-(_/g)*u,{internal:!0});const E=lc(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(p?.(y,E),t.panScrollTimeout=setTimeout(()=>{m?.(y,E),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h?.(y,E))}}function cD({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:o}){return function(a,s){const u=a.type==="wheel",c=!r&&u&&!a.ctrlKey,h=Ri(a,t);if(a.ctrlKey&&u&&h&&a.preventDefault(),c||h)return null;a.preventDefault(),o.call(this,a,s)}}function fD({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){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),o&&o?.(a.sourceEvent,s)}}function dD({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:a,onPanZoom:s}){return u=>{t.usedRightMouseButton=!!(o&&Y_(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 hD({zoomPanValues:t,panOnDrag:r,panOnScroll:o,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:u}){return c=>{if(!c.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,u&&Y_(r,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&u(c.sourceEvent),t.usedRightMouseButton=!1,a(!1),s)){const h=lc(c.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{s?.(c.sourceEvent,h)},o?150:0)}}}function mD({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:u,userSelectionActive:c,noWheelClassName:h,noPanClassName:p,lib:m,connectionInProgress:y}){return g=>{const x=t||r,b=o&&g.ctrlKey,_=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Ri(g,`${m}-flow__node`)||Ri(g,`${m}-flow__edge`)))return!0;if(!a&&!x&&!s&&!u&&!o||c||y&&!_||Ri(g,h)&&_||Ri(g,p)&&(!_||s&&_&&!t)||!o&&g.ctrlKey&&_)return!1;if(!o&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!x&&!s&&!b&&_||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||_)&&E}}function pD({domNode:t,minZoom:r,maxZoom:o,translateExtent:a,viewport:s,onPanZoom:u,onPanZoomStart:c,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=y_().scaleExtent([r,o]).translateExtent(a),x=$t(t).call(g);O({x:s.x,y:s.y,zoom:ji(s.zoom,r,o)},[[0,0],[y.width,y.height]],a);const b=x.on("wheel.zoom"),_=x.on("dblclick.zoom");g.wheelDelta(X_);function E(X,$){return x?new Promise(re=>{g?.interpolate($?.interpolate==="linear"?$a:gu).transform(Kd(x,$?.duration,$?.ease,()=>re(!0)),X)}):Promise.resolve(!1)}function C({noWheelClassName:X,noPanClassName:$,onPaneContextMenu:re,userSelectionActive:B,panOnScroll:q,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:V,preventScrolling:P,zoomOnPinch:te,zoomOnScroll:M,zoomOnDoubleClick:F,zoomActivationKeyPressed:J,lib:ne,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 ee=me?uD({zoomPanValues:m,noWheelClassName:X,d3Selection:x,d3Zoom:g,panOnScrollMode:L,panOnScrollSpeed:V,zoomOnPinch:te,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:h}):cD({noWheelClassName:X,preventScrolling:P,d3ZoomHandler:b});if(x.on("wheel.zoom",ee,{passive:!1}),!B){const de=fD({zoomPanValues:m,onDraggingChange:p,onPanZoomStart:c});g.on("start",de);const ge=dD({zoomPanValues:m,panOnDrag:R,onPaneContextMenu:!!re,onPanZoom:u,onTransformChange:se});g.on("zoom",ge);const xe=hD({zoomPanValues:m,panOnDrag:R,panOnScroll:q,onPaneContextMenu:re,onPanZoomEnd:h,onDraggingChange:p});g.on("end",xe)}const ce=mD({zoomActivationKeyPressed:J,panOnDrag:R,zoomOnScroll:M,panOnScroll:q,zoomOnDoubleClick:F,zoomOnPinch:te,userSelectionActive:B,noPanClassName:$,noWheelClassName:X,lib:ne,connectionInProgress:he});g.filter(ce),F?x.on("dblclick.zoom",_):x.on("dblclick.zoom",null)}function w(){g.on("zoom",null)}async function O(X,$,re){const B=Qd(X),q=g?.constrain()(B,$,re);return q&&await E(q),new Promise(R=>R(q))}async function S(X,$){const re=Qd(X);return await E(re,$),new Promise(B=>B(re))}function N(X){if(x){const $=Qd(X),re=x.property("__zoom");(re.k!==X.zoom||re.x!==X.x||re.y!==X.y)&&g?.transform(x,$,null,{sync:!0})}}function D(){const X=x?g_(x.node()):{x:0,y:0,k:1};return{x:X.x,y:X.y,zoom:X.k}}function z(X,$){return x?new Promise(re=>{g?.interpolate($?.interpolate==="linear"?$a:gu).scaleTo(Kd(x,$?.duration,$?.ease,()=>re(!0)),X)}):Promise.resolve(!1)}function U(X,$){return x?new Promise(re=>{g?.interpolate($?.interpolate==="linear"?$a:gu).scaleBy(Kd(x,$?.duration,$?.ease,()=>re(!0)),X)}):Promise.resolve(!1)}function k(X){g?.scaleExtent(X)}function Y(X){g?.translateExtent(X)}function ae(X){const $=!pn(X)||X<0?0:X;g?.clickDistance($)}return{update:C,destroy:w,setViewport:S,setViewportConstrained:O,getViewport:D,scaleTo:z,scaleBy:U,setScaleExtent:k,setTranslateExtent:Y,syncViewport:N,setClickDistance:ae}}var Vi;(function(t){t.Line="line",t.Handle="handle"})(Vi||(Vi={}));function gD({width:t,prevWidth:r,height:o,prevHeight:a,affectsX:s,affectsY:u}){const c=t-r,h=o-a,p=[c>0?1:c<0?-1:0,h>0?1:h<0?-1:0];return c&&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"),o=t.includes("bottom")||t.includes("top"),a=t.includes("left"),s=t.includes("top");return{isHorizontal:r,isVertical:o,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 iu(t,r,o){return Math.max(0,r-t,t-o)}function L1(t,r){return t?!r:r}function yD(t,r,o,a,s,u,c,h){let{affectsX:p,affectsY:m}=r;const{isHorizontal:y,isVertical:g}=r,x=y&&g,{xSnapped:b,ySnapped:_}=o,{minWidth:E,maxWidth:C,minHeight:w,maxHeight:O}=a,{x:S,y:N,width:D,height:z,aspectRatio:U}=t;let k=Math.floor(y?b-t.pointerX:0),Y=Math.floor(g?_-t.pointerY:0);const ae=D+(p?-k:k),X=z+(m?-Y:Y),$=-u[0]*D,re=-u[1]*z;let B=iu(ae,E,C),q=iu(X,w,O);if(c){let V=0,P=0;p&&k<0?V=qr(S+k+$,c[0][0]):!p&&k>0&&(V=Yr(S+ae+$,c[1][0])),m&&Y<0?P=qr(N+Y+re,c[0][1]):!m&&Y>0&&(P=Yr(N+X+re,c[1][1])),B=Math.max(B,V),q=Math.max(q,P)}if(h){let V=0,P=0;p&&k>0?V=Yr(S+k,h[0][0]):!p&&k<0&&(V=qr(S+ae,h[1][0])),m&&Y>0?P=Yr(N+Y,h[0][1]):!m&&Y<0&&(P=qr(N+X,h[1][1])),B=Math.max(B,V),q=Math.max(q,P)}if(s){if(y){const V=iu(ae/U,w,O)*U;if(B=Math.max(B,V),c){let P=0;!p&&!m||p&&!m&&x?P=Yr(N+re+ae/U,c[1][1])*U:P=qr(N+re+(p?k:-k)/U,c[0][1])*U,B=Math.max(B,P)}if(h){let P=0;!p&&!m||p&&!m&&x?P=qr(N+ae/U,h[1][1])*U:P=Yr(N+(p?k:-k)/U,h[0][1])*U,B=Math.max(B,P)}}if(g){const V=iu(X*U,E,C)/U;if(q=Math.max(q,V),c){let P=0;!p&&!m||m&&!p&&x?P=Yr(S+X*U+$,c[1][0])/U:P=qr(S+(m?Y:-Y)*U+$,c[0][0])/U,q=Math.max(q,P)}if(h){let P=0;!p&&!m||m&&!p&&x?P=qr(S+X*U,h[1][0])/U:P=Yr(S+(m?Y:-Y)*U,h[0][0])/U,q=Math.max(q,P)}}}Y=Y+(Y<0?q:-q),k=k+(k<0?B:-B),s&&(x?ae>X*U?Y=(L1(p,m)?-k:k)/U:k=(L1(p,m)?-Y:Y)*U:y?(Y=k/U,m=p):(k=Y*U,p=m));const R=p?S+k:S,L=m?N+Y:N;return{width:D+(p?-k:k),height:z+(m?-Y:Y),x:u[0]*k*(p?-1:1)+R,y:u[1]*Y*(m?-1:1)+L}}const I_={width:0,height:0,x:0,y:0},xD={...I_,pointerX:0,pointerY:0,aspectRatio:1};function vD(t){return[[0,0],[t.measured.width,t.measured.height]]}function bD(t,r,o){const a=r.position.x+t.position.x,s=r.position.y+t.position.y,u=t.measured.width??0,c=t.measured.height??0,h=o[0]*u,p=o[1]*c;return[[a-h,s-p],[a+u-h,s+c-p]]}function _D({domNode:t,nodeId:r,getStoreItems:o,onChange:a,onEnd:s}){const u=$t(t);let c={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:_,onResizeEnd:E,shouldResize:C}){let w={...I_},O={...xD};c={boundaries:y,resizeDirection:x,keepAspectRatio:g,controlDirection:H1(m)};let S,N=null,D=[],z,U,k,Y=!1;const ae=n_().on("start",X=>{const{nodeLookup:$,transform:re,snapGrid:B,snapToGrid:q,nodeOrigin:R,paneDomNode:L}=o();if(S=$.get(r),!S)return;N=L?.getBoundingClientRect()??null;const{xSnapped:V,ySnapped:P}=Za(X.sourceEvent,{transform:re,snapGrid:B,snapToGrid:q,containerBounds:N});w={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},O={...w,pointerX:V,pointerY:P,aspectRatio:w.width/w.height},z=void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(z=$.get(S.parentId),U=z&&S.extent==="parent"?vD(z):void 0),D=[],k=void 0;for(const[te,M]of $)if(M.parentId===r&&(D.push({id:te,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const F=bD(M,S,M.origin??R);k?k=[[Math.min(F[0][0],k[0][0]),Math.min(F[0][1],k[0][1])],[Math.max(F[1][0],k[1][0]),Math.max(F[1][1],k[1][1])]]:k=F}b?.(X,{...w})}).on("drag",X=>{const{transform:$,snapGrid:re,snapToGrid:B,nodeOrigin:q}=o(),R=Za(X.sourceEvent,{transform:$,snapGrid:re,snapToGrid:B,containerBounds:N}),L=[];if(!S)return;const{x:V,y:P,width:te,height:M}=w,F={},J=S.origin??q,{width:ne,height:se,x:he,y:fe}=yD(O,c.controlDirection,R,c.boundaries,c.keepAspectRatio,J,U,k),ue=ne!==te,me=se!==M,ee=he!==V&&ue,ce=fe!==P&&me;if(!ee&&!ce&&!ue&&!me)return;if((ee||ce||J[0]===1||J[1]===1)&&(F.x=ee?he:w.x,F.y=ce?fe:w.y,w.x=F.x,w.y=F.y,D.length>0)){const Ee=he-V,Te=fe-P;for(const je of D)je.position={x:je.position.x-Ee+J[0]*(ne-te),y:je.position.y-Te+J[1]*(se-M)},L.push(je)}if((ue||me)&&(F.width=ue&&(!c.resizeDirection||c.resizeDirection==="horizontal")?ne:w.width,F.height=me&&(!c.resizeDirection||c.resizeDirection==="vertical")?se:w.height,w.width=F.width,w.height=F.height),z&&S.expandParent){const Ee=J[0]*(F.width??0);F.x&&F.x<Ee&&(w.x=Ee,O.x=O.x-(F.x-Ee));const Te=J[1]*(F.height??0);F.y&&F.y<Te&&(w.y=Te,O.y=O.y-(F.y-Te))}const de=gD({width:w.width,prevWidth:te,height:w.height,prevHeight:M,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ge={...w,direction:de};C?.(X,ge)!==!1&&(Y=!0,_?.(X,ge),a(F,L))}).on("end",X=>{Y&&(E?.(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 ED(){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 o=typeof Object.is=="function"?Object.is:r,a=t.useState,s=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function h(g,x){var b=x(),_=a({inst:{value:b,getSnapshot:x}}),E=_[0].inst,C=_[1];return u(function(){E.value=b,E.getSnapshot=x,p(E)&&C({inst:E})},[g,b,x]),s(function(){return p(E)&&C({inst:E}),g(function(){p(E)&&C({inst:E})})},[g]),c(b),b}function p(g){var x=g.getSnapshot;g=g.value;try{var b=x();return!o(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 SD(){return F1||(F1=1,eh.exports=ED()),eh.exports}var k1;function wD(){if(k1)return Wd;k1=1;var t=cl(),r=SD();function o(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var a=typeof Object.is=="function"?Object.is:o,s=r.useSyncExternalStore,u=t.useRef,c=t.useEffect,h=t.useMemo,p=t.useDebugValue;return Wd.useSyncExternalStoreWithSelector=function(m,y,g,x,b){var _=u(null);if(_.current===null){var E={hasValue:!1,value:null};_.current=E}else E=_.current;_=h(function(){function w(z){if(!O){if(O=!0,S=z,z=x(z),b!==void 0&&E.hasValue){var U=E.value;if(b(U,z))return N=U}return N=z}if(U=N,a(S,z))return U;var k=x(z);return b!==void 0&&b(U,k)?(S=z,U):(S=z,N=k)}var O=!1,S,N,D=g===void 0?null:g;return[function(){return w(y())},D===null?void 0:function(){return w(D())}]},[y,g,x,b]);var C=s(m,_[0],_[1]);return c(function(){E.hasValue=!0,E.value=C},[C]),p(C),C},Wd}var V1;function AD(){return V1||(V1=1,Jd.exports=wD()),Jd.exports}var TD=AD();const CD=pv(TD),ND={},G1=t=>{let r;const o=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),o.forEach(_=>_(r,b))}},s=()=>r,p={setState:a,getState:s,getInitialState:()=>m,subscribe:y=>(o.add(y),()=>o.delete(y)),destroy:()=>{(ND?"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."),o.clear()}},m=r=t(a,s,p);return p},RD=t=>t?G1(t):G1,{useDebugValue:MD}=k2,{useSyncExternalStoreWithSelector:DD}=CD,OD=t=>t;function P_(t,r=OD,o){const a=DD(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return MD(a),a}const q1=(t,r)=>{const o=RD(t),a=(s,u=r)=>P_(o,s,u);return Object.assign(a,o),a},zD=(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 o=Object.keys(t);if(o.length!==Object.keys(r).length)return!1;for(const a of o)if(!Object.prototype.hasOwnProperty.call(r,a)||!Object.is(t[a],r[a]))return!1;return!0}var BD=gv();const sc=j.createContext(null),UD=sc.Provider,$_=zn.error001();function Ue(t,r){const o=j.useContext(sc);if(o===null)throw new Error($_);return P_(o,t,r)}function We(){const t=j.useContext(sc);if(t===null)throw new Error($_);return j.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Y1={display:"none"},HD={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Z_="react-flow__node-desc",Q_="react-flow__edge-desc",LD="react-flow__aria-live",jD=t=>t.ariaLiveMessage,FD=t=>t.ariaLabelConfig;function kD({rfId:t}){const r=Ue(jD);return A.jsx("div",{id:`${LD}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:HD,children:r})}function VD({rfId:t,disableKeyboardA11y:r}){const o=Ue(FD);return A.jsxs(A.Fragment,{children:[A.jsx("div",{id:`${Z_}-${t}`,style:Y1,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),A.jsx("div",{id:`${Q_}-${t}`,style:Y1,children:o["edge.a11yDescription.default"]}),!r&&A.jsx(kD,{rfId:t})]})}const Ro=j.forwardRef(({position:t="top-left",children:r,className:o,style:a,...s},u)=>{const c=`${t}`.split("-");return A.jsx("div",{className:dt(["react-flow__panel",o,...c]),style:a,ref:u,...s,children:r})});Ro.displayName="Panel";function GD({proOptions:t,position:r="bottom-right"}){return t?.hideAttribution?null:A.jsx(Ro,{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:A.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const qD=t=>{const r=[],o=[];for(const[,a]of t.nodeLookup)a.selected&&r.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&o.push(a);return{selectedNodes:r,selectedEdges:o}},au=t=>t.id;function YD(t,r){return Je(t.selectedNodes.map(au),r.selectedNodes.map(au))&&Je(t.selectedEdges.map(au),r.selectedEdges.map(au))}function XD({onSelectionChange:t}){const r=We(),{selectedNodes:o,selectedEdges:a}=Ue(qD,YD);return j.useEffect(()=>{const s={nodes:o,edges:a};t?.(s),r.getState().onSelectionChangeHandlers.forEach(u=>u(s))},[o,a,t]),null}const ID=t=>!!t.onSelectionChangeHandlers;function PD({onSelectionChange:t}){const r=Ue(ID);return t||r?A.jsx(XD,{onSelectionChange:t}):null}const K_=[0,0],$D={x:0,y:0,zoom:1},ZD=["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=[...ZD,"rfId"],QD=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:ol,nodeOrigin:K_,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function KD(t){const{setNodes:r,setEdges:o,setMinZoom:a,setMaxZoom:s,setTranslateExtent:u,setNodeExtent:c,reset:h,setDefaultNodesAndEdges:p}=Ue(QD,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"?o(x):g==="minZoom"?a(x):g==="maxZoom"?s(x):g==="translateExtent"?u(x):g==="nodeExtent"?c(x):g==="ariaLabelConfig"?m.setState({ariaLabelConfig:B8(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 P1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function JD(t){const[r,o]=j.useState(t==="system"?null:t);return j.useEffect(()=>{if(t!=="system"){o(t);return}const a=P1(),s=()=>o(a?.matches?"dark":"light");return s(),a?.addEventListener("change",s),()=>{a?.removeEventListener("change",s)}},[t]),r!==null?r:P1()?.matches?"dark":"light"}const $1=typeof document<"u"?document:null;function sl(t=null,r={target:$1,actInsideInputWithModifier:!0}){const[o,a]=j.useState(!1),s=j.useRef(!1),u=j.useRef(new Set([])),[c,h]=j.useMemo(()=>{if(t!==null){const m=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
747
|
+
`).replace(`
|
|
748
|
+
|
|
749
|
+
`,`
|
|
750
|
+
+`).split(`
|
|
751
|
+
`)),y=m.reduce((g,x)=>g.concat(...x),[]);return[m,y]}return[[],[]]},[t]);return j.useEffect(()=>{const p=r?.target??$1,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)&&D_(b))return!1;const E=Q1(b.code,h);if(u.current.add(b[E]),Z1(c,u.current,!1)){const C=b.composedPath?.()?.[0]||b.target,w=C?.nodeName==="BUTTON"||C?.nodeName==="A";r.preventDefault!==!1&&(s.current||!w)&&b.preventDefault(),a(!0)}},g=b=>{const _=Q1(b.code,h);Z1(c,u.current,!0)?(a(!1),u.current.clear()):u.current.delete(b[_]),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]),o}function Z1(t,r,o){return t.filter(a=>o||a.length===r.size).some(a=>a.every(s=>r.has(s)))}function Q1(t,r){return r.includes(t)?"code":"key"}const WD=()=>{const t=We();return j.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1/1.2,{duration:r?.duration}):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(r,{duration:o?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,o)=>{const{transform:[a,s,u],panZoom:c}=t.getState();return c?(await c.setViewport({x:r.x??a,y:r.y??s,zoom:r.zoom??u},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,a]=t.getState().transform;return{x:r,y:o,zoom:a}},setCenter:async(r,o,a)=>t.getState().setCenter(r,o,a),fitBounds:async(r,o)=>{const{width:a,height:s,minZoom:u,maxZoom:c,panZoom:h}=t.getState(),p=D0(r,a,s,u,c,o?.padding??.1);return h?(await h.setViewport(p,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{const{transform:a,snapGrid:s,snapToGrid:u,domNode:c}=t.getState();if(!c)return r;const{x:h,y:p}=c.getBoundingClientRect(),m={x:r.x-h,y:r.y-p},y=o.snapGrid??s,g=o.snapToGrid??u;return vl(m,a,g,y)},flowToScreenPosition:r=>{const{transform:o,domNode:a}=t.getState();if(!a)return r;const{x:s,y:u}=a.getBoundingClientRect(),c=Hu(r,o);return{x:c.x+s,y:c.y+u}}}),[])};function J_(t,r){const o=[],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 c=a.get(u.id);c?c.push(u):a.set(u.id,[u])}for(const u of r){const c=a.get(u.id);if(!c){o.push(u);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){o.push({...c[0].item});continue}const h={...u};for(const p of c)e5(p,h);o.push(h)}return s.length&&s.forEach(u=>{u.index!==void 0?o.splice(u.index,0,{...u.item}):o.push({...u.item})}),o}function e5(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 W_(t,r){return J_(t,r)}function eE(t,r){return J_(t,r)}function wo(t,r){return{id:t,type:"select",selected:r}}function Mi(t,r=new Set,o=!1){const a=[];for(const[s,u]of t){const c=r.has(s);!(u.selected===void 0&&!c)&&u.selected!==c&&(o&&(u.selected=c),a.push(wo(u.id,c)))}return a}function K1({items:t=[],lookup:r}){const o=[],a=new Map(t.map(s=>[s.id,s]));for(const[s,u]of t.entries()){const c=r.get(u.id),h=c?.internals?.userNode??c;h!==void 0&&h!==u&&o.push({id:u.id,item:u,type:"replace"}),h===void 0&&o.push({item:u,type:"add",index:s})}for(const[s]of r)a.get(s)===void 0&&o.push({id:s,type:"remove"});return o}function J1(t){return{id:t.id,type:"remove"}}const W1=t=>w8(t),t5=t=>E_(t);function tE(t){return j.forwardRef(t)}const n5=typeof window<"u"?j.useLayoutEffect:j.useEffect;function ev(t){const[r,o]=j.useState(BigInt(0)),[a]=j.useState(()=>r5(()=>o(s=>s+BigInt(1))));return n5(()=>{const s=a.get();s.length&&(t(s),a.reset())},[r]),a}function r5(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const nE=j.createContext(null);function o5({children:t}){const r=We(),o=j.useCallback(h=>{const{nodes:p=[],setNodes:m,hasDefaultNodes:y,onNodesChange:g,nodeLookup:x,fitViewQueued:b,onNodesChangeMiddlewareMap:_}=r.getState();let E=p;for(const w of h)E=typeof w=="function"?w(E):w;let C=K1({items:E,lookup:x});for(const w of _.values())C=w(C);y&&m(E),C.length>0?g?.(C):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:O,setNodes:S}=r.getState();w&&S(O)})},[]),a=ev(o),s=j.useCallback(h=>{const{edges:p=[],setEdges:m,hasDefaultEdges:y,onEdgesChange:g,edgeLookup:x}=r.getState();let b=p;for(const _ of h)b=typeof _=="function"?_(b):_;y?m(b):g&&g(K1({items:b,lookup:x}))},[]),u=ev(s),c=j.useMemo(()=>({nodeQueue:a,edgeQueue:u}),[]);return A.jsx(nE.Provider,{value:c,children:t})}function i5(){const t=j.useContext(nE);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const a5=t=>!!t.panZoom;function uc(){const t=WD(),r=We(),o=i5(),a=Ue(a5),s=j.useMemo(()=>{const u=g=>r.getState().nodeLookup.get(g),c=g=>{o.nodeQueue.push(g)},h=g=>{o.edgeQueue.push(g)},p=g=>{const{nodeLookup:x,nodeOrigin:b}=r.getState(),_=W1(g)?g:x.get(g.id),E=_.parentId?R_(_.position,_.measured,_.parentId,x,b):_.position,C={..._,position:E,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return Fi(C)},m=(g,x,b={replace:!1})=>{c(_=>_.map(E=>{if(E.id===g){const C=typeof x=="function"?x(E):x;return b.replace&&W1(C)?C:{...E,...C}}return E}))},y=(g,x,b={replace:!1})=>{h(_=>_.map(E=>{if(E.id===g){const C=typeof x=="function"?x(E):x;return b.replace&&t5(C)?C:{...E,...C}}return E}))};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:c,setEdges:h,addNodes:g=>{const x=Array.isArray(g)?g:[g];o.nodeQueue.push(b=>[...b,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];o.edgeQueue.push(b=>[...b,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:b}=r.getState(),[_,E,C]=b;return{nodes:g.map(w=>({...w})),edges:x.map(w=>({...w})),viewport:{x:_,y:E,zoom:C}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:b,edges:_,onNodesDelete:E,onEdgesDelete:C,triggerNodeChanges:w,triggerEdgeChanges:O,onDelete:S,onBeforeDelete:N}=r.getState(),{nodes:D,edges:z}=await R8({nodesToRemove:g,edgesToRemove:x,nodes:b,edges:_,onBeforeDelete:N}),U=z.length>0,k=D.length>0;if(U){const Y=z.map(J1);C?.(z),O(Y)}if(k){const Y=D.map(J1);E?.(D),w(Y)}return(k||U)&&S?.({nodes:D,edges:z}),{deletedNodes:D,deletedEdges:z}},getIntersectingNodes:(g,x=!0,b)=>{const _=A1(g),E=_?g:p(g),C=b!==void 0;return E?(b||r.getState().nodes).filter(w=>{const O=r.getState().nodeLookup.get(w.id);if(O&&!_&&(w.id===g.id||!O.internals.positionAbsolute))return!1;const S=Fi(C?w:O),N=al(S,E);return x&&N>0||N>=S.width*S.height||N>=E.width*E.height}):[]},isNodeIntersecting:(g,x,b=!0)=>{const E=A1(g)?g:p(g);if(!E)return!1;const C=al(E,x);return b&&C>0||C>=x.width*x.height||C>=E.width*E.height},updateNode:m,updateNodeData:(g,x,b={replace:!1})=>{m(g,_=>{const E=typeof x=="function"?x(_):x;return b.replace?{..._,data:E}:{..._,data:{..._.data,...E}}},b)},updateEdge:y,updateEdgeData:(g,x,b={replace:!1})=>{y(g,_=>{const E=typeof x=="function"?x(_):x;return b.replace?{..._,data:E}:{..._,data:{..._.data,...E}}},b)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:b}=r.getState();return A8(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??z8();return r.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),o.nodeQueue.push(b=>[...b]),x.promise}}},[]);return j.useMemo(()=>({...s,...t,viewportInitialized:a}),[a])}const tv=t=>t.selected,l5=typeof window<"u"?window:void 0;function s5({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=We(),{deleteElements:a}=uc(),s=sl(t,{actInsideInputWithModifier:!1}),u=sl(r,{target:l5});j.useEffect(()=>{if(s){const{edges:c,nodes:h}=o.getState();a({nodes:h.filter(tv),edges:c.filter(tv)}),o.setState({nodesSelectionActive:!1})}},[s]),j.useEffect(()=>{o.setState({multiSelectionActive:u})},[u])}function u5(t){const r=We();j.useEffect(()=>{const o=()=>{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){o(),window.addEventListener("resize",o);const a=new ResizeObserver(()=>o());return a.observe(t.current),()=>{window.removeEventListener("resize",o),a&&t.current&&a.unobserve(t.current)}}},[])}const cc={position:"absolute",width:"100%",height:"100%",top:0,left:0},c5=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function f5({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:u=No.Free,zoomOnDoubleClick:c=!0,panOnDrag:h=!0,defaultViewport:p,translateExtent:m,minZoom:y,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:b=!0,children:_,noWheelClassName:E,noPanClassName:C,onViewportChange:w,isControlledViewport:O,paneClickDistance:S,selectionOnDrag:N}){const D=We(),z=j.useRef(null),{userSelectionActive:U,lib:k,connectionInProgress:Y}=Ue(c5,Je),ae=sl(x),X=j.useRef();u5(z);const $=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=pD({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:V,onMoveStart:P}=D.getState();P?.(R,L),V?.(L)},onPanZoom:(R,L)=>{const{onViewportChange:V,onMove:P}=D.getState();P?.(R,L),V?.(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:V,onMoveEnd:P}=D.getState();P?.(R,L),V?.(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:o,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:u,zoomOnDoubleClick:c,panOnDrag:h,zoomActivationKeyPressed:ae,preventScrolling:b,noPanClassName:C,userSelectionActive:U,noWheelClassName:E,lib:k,onTransformChange:$,connectionInProgress:Y,selectionOnDrag:N,paneClickDistance:S})},[t,r,o,a,s,u,c,h,ae,b,C,U,E,k,$,Y,N,S]),A.jsx("div",{className:"react-flow__renderer",ref:z,style:cc,children:_})}const d5=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function h5(){const{userSelectionActive:t,userSelectionRect:r}=Ue(d5,Je);return t&&r?A.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)=>o=>{o.target===r.current&&t?.(o)},m5=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function p5({isSelecting:t,selectionKeyPressed:r,selectionMode:o=il.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:u,onSelectionStart:c,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:m,onPaneScroll:y,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:b,children:_}){const E=We(),{userSelectionActive:C,elementsSelectable:w,dragging:O,connectionInProgress:S}=Ue(m5,Je),N=w&&(t||C),D=j.useRef(null),z=j.useRef(),U=j.useRef(new Set),k=j.useRef(new Set),Y=j.useRef(!1),ae=V=>{if(Y.current||S){Y.current=!1;return}p?.(V),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},X=V=>{if(Array.isArray(a)&&a?.includes(2)){V.preventDefault();return}m?.(V)},$=y?V=>y(V):void 0,re=V=>{Y.current&&(V.stopPropagation(),Y.current=!1)},B=V=>{const{domNode:P}=E.getState();if(z.current=P?.getBoundingClientRect(),!z.current)return;const te=V.target===D.current;if(!te&&!!V.target.closest(".nokey")||!t||!(u&&te||r)||V.button!==0||!V.isPrimary)return;V.target?.setPointerCapture?.(V.pointerId),Y.current=!1;const{x:J,y:ne}=gn(V.nativeEvent,z.current);E.setState({userSelectionRect:{width:0,height:0,startX:J,startY:ne,x:J,y:ne}}),te||(V.stopPropagation(),V.preventDefault())},q=V=>{const{userSelectionRect:P,transform:te,nodeLookup:M,edgeLookup:F,connectionLookup:J,triggerNodeChanges:ne,triggerEdgeChanges:se,defaultEdgeOptions:he,resetSelectedElements:fe}=E.getState();if(!z.current||!P)return;const{x:ue,y:me}=gn(V.nativeEvent,z.current),{startX:ee,startY:ce}=P;if(!Y.current){const Te=r?0:s;if(Math.hypot(ue-ee,me-ce)<=Te)return;fe(),c?.(V)}Y.current=!0;const de={startX:ee,startY:ce,x:ue<ee?ue:ee,y:me<ce?me:ce,width:Math.abs(ue-ee),height:Math.abs(me-ce)},ge=U.current,xe=k.current;U.current=new Set(M0(M,de,te,o===il.Partial,!0).map(Te=>Te.id)),k.current=new Set;const Ee=he?.selectable??!0;for(const Te of U.current){const je=J.get(Te);if(je)for(const{edgeId:Ie}of je.values()){const wt=F.get(Ie);wt&&(wt.selectable??Ee)&&k.current.add(Ie)}}if(!T1(ge,U.current)){const Te=Mi(M,U.current,!0);ne(Te)}if(!T1(xe,k.current)){const Te=Mi(F,k.current);se(Te)}E.setState({userSelectionRect:de,userSelectionActive:!0,nodesSelectionActive:!1})},R=V=>{V.button===0&&(V.target?.releasePointerCapture?.(V.pointerId),!C&&V.target===D.current&&E.getState().userSelectionRect&&ae?.(V),E.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(h?.(V),E.setState({nodesSelectionActive:U.current.size>0})))},L=a===!0||Array.isArray(a)&&a.includes(0);return A.jsxs("div",{className:dt(["react-flow__pane",{draggable:L,dragging:O,selection:t}]),onClick:N?void 0:nh(ae,D),onContextMenu:nh(X,D),onWheel:nh($,D),onPointerEnter:N?void 0:g,onPointerMove:N?q:x,onPointerUp:N?R:void 0,onPointerDownCapture:N?B:void 0,onClickCapture:N?re:void 0,onPointerLeave:b,ref:D,style:cc,children:[_,A.jsx(h5,{})]})}function Uh({id:t,store:r,unselect:o=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:u,multiSelectionActive:c,nodeLookup:h,onError:p}=r.getState(),m=h.get(t);if(!m){p?.("012",zn.error012(t));return}r.setState({nodesSelectionActive:!1}),m.selected?(o||m.selected&&c)&&(u({nodes:[m],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):s([t])}function rE({nodeRef:t,disabled:r=!1,noDragClassName:o,handleSelector:a,nodeId:s,isSelectable:u,nodeClickDistance:c}){const h=We(),[p,m]=j.useState(!1),y=j.useRef();return j.useEffect(()=>{y.current=tD({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:o,handleSelector:a,domNode:t.current,isSelectable:u,nodeId:s,nodeClickDistance:c}),()=>{y.current?.destroy()}},[o,a,r,u,t,s,c]),p}const g5=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function oE(){const t=We();return j.useCallback(o=>{const{nodeExtent:a,snapToGrid:s,snapGrid:u,nodesDraggable:c,onError:h,updateNodePositions:p,nodeLookup:m,nodeOrigin:y}=t.getState(),g=new Map,x=g5(c),b=s?u[0]:5,_=s?u[1]:5,E=o.direction.x*b*o.factor,C=o.direction.y*_*o.factor;for(const[,w]of m){if(!x(w))continue;let O={x:w.internals.positionAbsolute.x+E,y:w.internals.positionAbsolute.y+C};s&&(O=xl(O,u));const{position:S,positionAbsolute:N}=w_({nodeId:w.id,nextPosition:O,nodeLookup:m,nodeExtent:a,nodeOrigin:y,onError:h});w.position=S,w.internals.positionAbsolute=N,g.set(w.id,w)}p(g)},[])}const j0=j.createContext(null),y5=j0.Provider;j0.Consumer;const iE=()=>j.useContext(j0),x5=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),v5=(t,r,o)=>a=>{const{connectionClickStartHandle:s,connectionMode:u,connection:c}=a,{fromHandle:h,toHandle:p,isValid:m}=c,y=p?.nodeId===t&&p?.id===r&&p?.type===o;return{connectingFrom:h?.nodeId===t&&h?.id===r&&h?.type===o,connectingTo:y,clickConnecting:s?.nodeId===t&&s?.id===r&&s?.type===o,isPossibleEndHandle:u===Li.Strict?h?.type!==o:t!==h?.nodeId||r!==h?.id,connectionInProcess:!!h,clickConnectionInProcess:!!s,valid:y&&m}};function b5({type:t="source",position:r=ve.Top,isValidConnection:o,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:u=!0,id:c,onConnect:h,children:p,className:m,onMouseDown:y,onTouchStart:g,...x},b){const _=c||null,E=t==="target",C=We(),w=iE(),{connectOnClick:O,noPanClassName:S,rfId:N}=Ue(x5,Je),{connectingFrom:D,connectingTo:z,clickConnecting:U,isPossibleEndHandle:k,connectionInProcess:Y,clickConnectionInProcess:ae,valid:X}=Ue(v5(w,_,t),Je);w||C.getState().onError?.("010",zn.error010());const $=q=>{const{defaultEdgeOptions:R,onConnect:L,hasDefaultEdges:V}=C.getState(),P={...R,...q};if(V){const{edges:te,setEdges:M}=C.getState();M(Mh(P,te))}L?.(P),h?.(P)},re=q=>{if(!w)return;const R=O_(q.nativeEvent);if(s&&(R&&q.button===0||!R)){const L=C.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:E,handleId:_,nodeId:w,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...V)=>C.getState().onConnectEnd?.(...V),updateConnection:L.updateConnection,onConnect:$,isValidConnection:o||((...V)=>C.getState().isValidConnection?.(...V)??!0),getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}R?y?.(q):g?.(q)},B=q=>{const{onClickConnectStart:R,onClickConnectEnd:L,connectionClickStartHandle:V,connectionMode:P,isValidConnection:te,lib:M,rfId:F,nodeLookup:J,connection:ne}=C.getState();if(!w||!V&&!s)return;if(!V){R?.(q.nativeEvent,{nodeId:w,handleId:_,handleType:t}),C.setState({connectionClickStartHandle:{nodeId:w,type:t,id:_}});return}const se=M_(q.target),he=o||te,{connection:fe,isValid:ue}=Bh.isValid(q.nativeEvent,{handle:{nodeId:w,id:_,type:t},connectionMode:P,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:he,flowId:F,doc:se,lib:M,nodeLookup:J});ue&&fe&&$(fe);const me=structuredClone(ne);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,L?.(q,me),C.setState({connectionClickStartHandle:null})};return A.jsx("div",{"data-handleid":_,"data-nodeid":w,"data-handlepos":r,"data-id":`${N}-${w}-${_}-${t}`,className:dt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",S,m,{source:!E,target:E,connectable:a,connectablestart:s,connectableend:u,clickconnecting:U,connectingfrom:D,connectingto:z,valid:X,connectionindicator:a&&(!Y||k)&&(Y||ae?u:s)}]),onMouseDown:re,onTouchStart:re,onClick:O?B:void 0,ref:b,...x,children:p})}const ul=j.memo(tE(b5));function _5({data:t,isConnectable:r,sourcePosition:o=ve.Bottom}){return A.jsxs(A.Fragment,{children:[t?.label,A.jsx(ul,{type:"source",position:o,isConnectable:r})]})}function E5({data:t,isConnectable:r,targetPosition:o=ve.Top,sourcePosition:a=ve.Bottom}){return A.jsxs(A.Fragment,{children:[A.jsx(ul,{type:"target",position:o,isConnectable:r}),t?.label,A.jsx(ul,{type:"source",position:a,isConnectable:r})]})}function S5(){return null}function w5({data:t,isConnectable:r,targetPosition:o=ve.Top}){return A.jsxs(A.Fragment,{children:[A.jsx(ul,{type:"target",position:o,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:_5,default:E5,output:w5,group:S5};function A5(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 T5=t=>{const{width:r,height:o,x:a,y:s}=yl(t.nodeLookup,{filter:u=>!!u.selected});return{width:pn(r)?r:null,height:pn(o)?o:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${s}px)`}};function C5({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const a=We(),{width:s,height:u,transformString:c,userSelectionActive:h}=Ue(T5,Je),p=oE(),m=j.useRef(null);j.useEffect(()=>{o||m.current?.focus({preventScroll:!0})},[o]);const y=!h&&s!==null&&u!==null;if(rE({nodeRef:m,disabled:!y}),!y)return null;const g=t?b=>{const _=a.getState().nodes.filter(E=>E.selected);t(b,_)}:void 0,x=b=>{Object.prototype.hasOwnProperty.call(Lu,b.key)&&(b.preventDefault(),p({direction:Lu[b.key],factor:b.shiftKey?4:1}))};return A.jsx("div",{className:dt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:c},children:A.jsx("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:o?void 0:-1,onKeyDown:o?void 0:x,style:{width:s,height:u}})})}const rv=typeof window<"u"?window:void 0,N5=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function aE({children:t,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:u,onPaneScroll:c,paneClickDistance:h,deleteKeyCode:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:g,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:_,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:w,zoomOnScroll:O,zoomOnPinch:S,panOnScroll:N,panOnScrollSpeed:D,panOnScrollMode:z,zoomOnDoubleClick:U,panOnDrag:k,defaultViewport:Y,translateExtent:ae,minZoom:X,maxZoom:$,preventScrolling:re,onSelectionContextMenu:B,noWheelClassName:q,noPanClassName:R,disableKeyboardA11y:L,onViewportChange:V,isControlledViewport:P}){const{nodesSelectionActive:te,userSelectionActive:M}=Ue(N5,Je),F=sl(m,{target:rv}),J=sl(E,{target:rv}),ne=J||k,se=J||N,he=y&&ne!==!0,fe=F||M||he;return s5({deleteKeyCode:p,multiSelectionKeyCode:_}),A.jsx(f5,{onPaneContextMenu:u,elementsSelectable:w,zoomOnScroll:O,zoomOnPinch:S,panOnScroll:se,panOnScrollSpeed:D,panOnScrollMode:z,zoomOnDoubleClick:U,panOnDrag:!F&&ne,defaultViewport:Y,translateExtent:ae,minZoom:X,maxZoom:$,zoomActivationKeyCode:C,preventScrolling:re,noWheelClassName:q,noPanClassName:R,onViewportChange:V,isControlledViewport:P,paneClickDistance:h,selectionOnDrag:he,children:A.jsxs(p5,{onSelectionStart:x,onSelectionEnd:b,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:ne,isSelecting:!!fe,selectionMode:g,selectionKeyPressed:F,paneClickDistance:h,selectionOnDrag:he,children:[t,te&&A.jsx(C5,{onSelectionContextMenu:B,noPanClassName:R,disableKeyboardA11y:L})]})})}aE.displayName="FlowRenderer";const R5=j.memo(aE),M5=t=>r=>t?M0(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function D5(t){return Ue(j.useCallback(M5(t),[t]),Je)}const O5=t=>t.updateNodeInternals;function z5(){const t=Ue(O5),[r]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const a=new Map;o.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 B5({node:t,nodeType:r,hasDimensions:o,resizeObserver:a}){const s=We(),u=j.useRef(null),c=j.useRef(null),h=j.useRef(t.sourcePosition),p=j.useRef(t.targetPosition),m=j.useRef(r),y=o&&!!t.internals.handleBounds;return j.useEffect(()=>{u.current&&!t.hidden&&(!y||c.current!==u.current)&&(c.current&&a?.unobserve(c.current),a?.observe(u.current),c.current=u.current)},[y,t.hidden]),j.useEffect(()=>()=>{c.current&&(a?.unobserve(c.current),c.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 U5({id:t,onClick:r,onMouseEnter:o,onMouseMove:a,onMouseLeave:s,onContextMenu:u,onDoubleClick:c,nodesDraggable:h,elementsSelectable:p,nodesConnectable:m,nodesFocusable:y,resizeObserver:g,noDragClassName:x,noPanClassName:b,disableKeyboardA11y:_,rfId:E,nodeTypes:C,nodeClickDistance:w,onError:O}){const{node:S,internals:N,isParent:D}=Ue(ue=>{const me=ue.nodeLookup.get(t),ee=ue.parentLookup.has(t);return{node:me,internals:me.internals,isParent:ee}},Je);let z=S.type||"default",U=C?.[z]||nv[z];U===void 0&&(O?.("003",zn.error003(z)),z="default",U=C?.default||nv.default);const k=!!(S.draggable||h&&typeof S.draggable>"u"),Y=!!(S.selectable||p&&typeof S.selectable>"u"),ae=!!(S.connectable||m&&typeof S.connectable>"u"),X=!!(S.focusable||y&&typeof S.focusable>"u"),$=We(),re=N_(S),B=B5({node:S,nodeType:z,hasDimensions:re,resizeObserver:g}),q=rE({nodeRef:B,disabled:S.hidden||!k,noDragClassName:x,handleSelector:S.dragHandle,nodeId:t,isSelectable:Y,nodeClickDistance:w}),R=oE();if(S.hidden)return null;const L=hr(S),V=A5(S),P=Y||k||r||o||a||s,te=o?ue=>o(ue,{...N.userNode}):void 0,M=a?ue=>a(ue,{...N.userNode}):void 0,F=s?ue=>s(ue,{...N.userNode}):void 0,J=u?ue=>u(ue,{...N.userNode}):void 0,ne=c?ue=>c(ue,{...N.userNode}):void 0,se=ue=>{const{selectNodesOnDrag:me,nodeDragThreshold:ee}=$.getState();Y&&(!me||!k||ee>0)&&Uh({id:t,store:$,nodeRef:B}),r&&r(ue,{...N.userNode})},he=ue=>{if(!(D_(ue.nativeEvent)||_)){if(x_.includes(ue.key)&&Y){const me=ue.key==="Escape";Uh({id:t,store:$,unselect:me,nodeRef:B})}else if(k&&S.selected&&Object.prototype.hasOwnProperty.call(Lu,ue.key)){ue.preventDefault();const{ariaLabelConfig:me}=$.getState();$.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),R({direction:Lu[ue.key],factor:ue.shiftKey?4:1})}}},fe=()=>{if(_||!B.current?.matches(":focus-visible"))return;const{transform:ue,width:me,height:ee,autoPanOnNodeFocus:ce,setCenter:de}=$.getState();if(!ce)return;M0(new Map([[t,S]]),{x:0,y:0,width:me,height:ee},ue,!0).length>0||de(S.position.x+L.width/2,S.position.y+L.height/2,{zoom:ue[2]})};return A.jsx("div",{className:dt(["react-flow__node",`react-flow__node-${z}`,{[b]:k},S.className,{selected:S.selected,selectable:Y,parent:D,draggable:k,dragging:q}]),ref:B,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:re?"visible":"hidden",...S.style,...V},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:te,onMouseMove:M,onMouseLeave:F,onContextMenu:J,onClick:se,onDoubleClick:ne,onKeyDown:X?he:void 0,tabIndex:X?0:void 0,onFocus:X?fe:void 0,role:S.ariaRole??(X?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${Z_}-${E}`,"aria-label":S.ariaLabel,...S.domAttributes,children:A.jsx(y5,{value:t,children:A.jsx(U,{id:t,data:S.data,type:z,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:S.selected??!1,selectable:Y,draggable:k,deletable:S.deletable??!0,isConnectable:ae,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:q,dragHandle:S.dragHandle,zIndex:N.z,parentId:S.parentId,...L})})})}var H5=j.memo(U5);const L5=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function lE(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:a,elementsSelectable:s,onError:u}=Ue(L5,Je),c=D5(t.onlyRenderVisibleElements),h=z5();return A.jsx("div",{className:"react-flow__nodes",style:cc,children:c.map(p=>A.jsx(H5,{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:o,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:t.nodeClickDistance,onError:u},p))})}lE.displayName="NodeRenderer";const j5=j.memo(lE);function F5(t){return Ue(j.useCallback(o=>{if(!t)return o.edges.map(s=>s.id);const a=[];if(o.width&&o.height)for(const s of o.edges){const u=o.nodeLookup.get(s.source),c=o.nodeLookup.get(s.target);u&&c&&L8({sourceNode:u,targetNode:c,width:o.width,height:o.height,transform:o.transform})&&a.push(s.id)}return a},[t]),Je)}const k5=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t}};return A.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},V5=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t,fill:t}};return A.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ov={[Bu.Arrow]:k5,[Bu.ArrowClosed]:V5};function G5(t){const r=We();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(ov,t)?ov[t]:(r.getState().onError?.("009",zn.error009(t)),null),[t])}const q5=({id:t,type:r,color:o,width:a=12.5,height:s=12.5,markerUnits:u="strokeWidth",strokeWidth:c,orient:h="auto-start-reverse"})=>{const p=G5(r);return p?A.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:A.jsx(p,{color:o,strokeWidth:c})}):null},sE=({defaultColor:t,rfId:r})=>{const o=Ue(u=>u.edges),a=Ue(u=>u.defaultEdgeOptions),s=j.useMemo(()=>Y8(o,{id:r,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[o,a,r,t]);return s.length?A.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:A.jsx("defs",{children:s.map(u=>A.jsx(q5,{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};sE.displayName="MarkerDefinitions";var Y5=j.memo(sE);function uE({x:t,y:r,label:o,labelStyle:a,labelShowBg:s=!0,labelBgStyle:u,labelBgPadding:c=[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]),_=j.useRef(null);return j.useEffect(()=>{if(_.current){const E=_.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[o]),o?A.jsxs("g",{transform:`translate(${t-g.width/2} ${r-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...y,children:[s&&A.jsx("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:u,rx:h,ry:h}),A.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:_,style:a,children:o}),p]}):null}uE.displayName="EdgeText";const X5=j.memo(uE);function bl({path:t,labelX:r,labelY:o,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p,interactionWidth:m=20,...y}){return A.jsxs(A.Fragment,{children:[A.jsx("path",{...y,d:t,fill:"none",className:dt(["react-flow__edge-path",y.className])}),m?A.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:m,className:"react-flow__edge-interaction"}):null,a&&pn(r)&&pn(o)?A.jsx(X5,{x:r,y:o,label:a,labelStyle:s,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:p}):null]})}function iv({pos:t,x1:r,y1:o,x2:a,y2:s}){return t===ve.Left||t===ve.Right?[.5*(r+a),o]:[r,.5*(o+s)]}function F0({sourceX:t,sourceY:r,sourcePosition:o=ve.Bottom,targetX:a,targetY:s,targetPosition:u=ve.Top}){const[c,h]=iv({pos:o,x1:t,y1:r,x2:a,y2:s}),[p,m]=iv({pos:u,x1:a,y1:s,x2:t,y2:r}),[y,g,x,b]=z_({sourceX:t,sourceY:r,targetX:a,targetY:s,sourceControlX:c,sourceControlY:h,targetControlX:p,targetControlY:m});return[`M${t},${r} C${c},${h} ${p},${m} ${a},${s}`,y,g,x,b]}function cE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,sourcePosition:c,targetPosition:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:_,markerEnd:E,markerStart:C,interactionWidth:w})=>{const[O,S,N]=F0({sourceX:o,sourceY:a,sourcePosition:c,targetX:s,targetY:u,targetPosition:h}),D=t.isInternal?void 0:r;return A.jsx(bl,{id:D,path:O,labelX:S,labelY:N,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:_,markerEnd:E,markerStart:C,interactionWidth:w})})}const I5=cE({isInternal:!1}),fE=cE({isInternal:!0});I5.displayName="SimpleBezierEdge";fE.displayName="SimpleBezierEdgeInternal";function dE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,label:c,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,sourcePosition:b=ve.Bottom,targetPosition:_=ve.Top,markerEnd:E,markerStart:C,pathOptions:w,interactionWidth:O})=>{const[S,N,D]=Dh({sourceX:o,sourceY:a,sourcePosition:b,targetX:s,targetY:u,targetPosition:_,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),z=t.isInternal?void 0:r;return A.jsx(bl,{id:z,path:S,labelX:N,labelY:D,label:c,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:E,markerStart:C,interactionWidth:O})})}const hE=dE({isInternal:!1}),mE=dE({isInternal:!0});hE.displayName="SmoothStepEdge";mE.displayName="SmoothStepEdgeInternal";function pE(t){return j.memo(({id:r,...o})=>{const a=t.isInternal?void 0:r;return A.jsx(hE,{...o,id:a,pathOptions:j.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const P5=pE({isInternal:!1}),gE=pE({isInternal:!0});P5.displayName="StepEdge";gE.displayName="StepEdgeInternal";function yE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,label:c,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:b,markerStart:_,interactionWidth:E})=>{const[C,w,O]=U_({sourceX:o,sourceY:a,targetX:s,targetY:u}),S=t.isInternal?void 0:r;return A.jsx(bl,{id:S,path:C,labelX:w,labelY:O,label:c,labelStyle:h,labelShowBg:p,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:g,style:x,markerEnd:b,markerStart:_,interactionWidth:E})})}const $5=yE({isInternal:!1}),xE=yE({isInternal:!0});$5.displayName="StraightEdge";xE.displayName="StraightEdgeInternal";function vE(t){return j.memo(({id:r,sourceX:o,sourceY:a,targetX:s,targetY:u,sourcePosition:c=ve.Bottom,targetPosition:h=ve.Top,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:_,markerEnd:E,markerStart:C,pathOptions:w,interactionWidth:O})=>{const[S,N,D]=ac({sourceX:o,sourceY:a,sourcePosition:c,targetX:s,targetY:u,targetPosition:h,curvature:w?.curvature}),z=t.isInternal?void 0:r;return A.jsx(bl,{id:z,path:S,labelX:N,labelY:D,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:b,style:_,markerEnd:E,markerStart:C,interactionWidth:O})})}const Z5=vE({isInternal:!1}),bE=vE({isInternal:!0});Z5.displayName="BezierEdge";bE.displayName="BezierEdgeInternal";const av={default:bE,straight:xE,step:gE,smoothstep:mE,simplebezier:fE},lv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Q5=(t,r,o)=>o===ve.Left?t-r:o===ve.Right?t+r:t,K5=(t,r,o)=>o===ve.Top?t-r:o===ve.Bottom?t+r:t,sv="react-flow__edgeupdater";function uv({position:t,centerX:r,centerY:o,radius:a=10,onMouseDown:s,onMouseEnter:u,onMouseOut:c,type:h}){return A.jsx("circle",{onMouseDown:s,onMouseEnter:u,onMouseOut:c,className:dt([sv,`${sv}-${h}`]),cx:Q5(r,a,t),cy:K5(o,a,t),r:a,stroke:"transparent",fill:"transparent"})}function J5({isReconnectable:t,reconnectRadius:r,edge:o,sourceX:a,sourceY:s,targetX:u,targetY:c,sourcePosition:h,targetPosition:p,onReconnect:m,onReconnectStart:y,onReconnectEnd:g,setReconnecting:x,setUpdateHover:b}){const _=We(),E=(N,D)=>{if(N.button!==0)return;const{autoPanOnConnect:z,domNode:U,connectionMode:k,connectionRadius:Y,lib:ae,onConnectStart:X,cancelConnection:$,nodeLookup:re,rfId:B,panBy:q,updateConnection:R}=_.getState(),L=D.type==="target",V=(M,F)=>{x(!1),g?.(M,o,D.type,F)},P=M=>m?.(o,M),te=(M,F)=>{x(!0),y?.(N,o,D.type),X?.(M,F)};Bh.onPointerDown(N.nativeEvent,{autoPanOnConnect:z,connectionMode:k,connectionRadius:Y,domNode:U,handleId:D.id,nodeId:D.nodeId,nodeLookup:re,isTarget:L,edgeUpdaterType:D.type,lib:ae,flowId:B,cancelConnection:$,panBy:q,isValidConnection:(...M)=>_.getState().isValidConnection?.(...M)??!0,onConnect:P,onConnectStart:te,onConnectEnd:(...M)=>_.getState().onConnectEnd?.(...M),onReconnectEnd:V,updateConnection:R,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},C=N=>E(N,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),w=N=>E(N,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),O=()=>b(!0),S=()=>b(!1);return A.jsxs(A.Fragment,{children:[(t===!0||t==="source")&&A.jsx(uv,{position:h,centerX:a,centerY:s,radius:r,onMouseDown:C,onMouseEnter:O,onMouseOut:S,type:"source"}),(t===!0||t==="target")&&A.jsx(uv,{position:p,centerX:u,centerY:c,radius:r,onMouseDown:w,onMouseEnter:O,onMouseOut:S,type:"target"})]})}function W5({id:t,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:a,onClick:s,onDoubleClick:u,onContextMenu:c,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,reconnectRadius:y,onReconnect:g,onReconnectStart:x,onReconnectEnd:b,rfId:_,edgeTypes:E,noPanClassName:C,onError:w,disableKeyboardA11y:O}){let S=Ue(de=>de.edgeLookup.get(t));const N=Ue(de=>de.defaultEdgeOptions);S=N?{...N,...S}:S;let D=S.type||"default",z=E?.[D]||av[D];z===void 0&&(w?.("011",zn.error011(D)),D="default",z=E?.default||av.default);const U=!!(S.focusable||r&&typeof S.focusable>"u"),k=typeof g<"u"&&(S.reconnectable||o&&typeof S.reconnectable>"u"),Y=!!(S.selectable||a&&typeof S.selectable>"u"),ae=j.useRef(null),[X,$]=j.useState(!1),[re,B]=j.useState(!1),q=We(),{zIndex:R,sourceX:L,sourceY:V,targetX:P,targetY:te,sourcePosition:M,targetPosition:F}=Ue(j.useCallback(de=>{const ge=de.nodeLookup.get(S.source),xe=de.nodeLookup.get(S.target);if(!ge||!xe)return{zIndex:S.zIndex,...lv};const Ee=q8({id:t,sourceNode:ge,targetNode:xe,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:de.connectionMode,onError:w});return{zIndex:H8({selected:S.selected,zIndex:S.zIndex,sourceNode:ge,targetNode:xe,elevateOnSelect:de.elevateEdgesOnSelect,zIndexMode:de.zIndexMode}),...Ee||lv}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),Je),J=j.useMemo(()=>S.markerStart?`url('#${Oh(S.markerStart,_)}')`:void 0,[S.markerStart,_]),ne=j.useMemo(()=>S.markerEnd?`url('#${Oh(S.markerEnd,_)}')`:void 0,[S.markerEnd,_]);if(S.hidden||L===null||V===null||P===null||te===null)return null;const se=de=>{const{addSelectedEdges:ge,unselectNodesAndEdges:xe,multiSelectionActive:Ee}=q.getState();Y&&(q.setState({nodesSelectionActive:!1}),S.selected&&Ee?(xe({nodes:[],edges:[S]}),ae.current?.blur()):ge([t])),s&&s(de,S)},he=u?de=>{u(de,{...S})}:void 0,fe=c?de=>{c(de,{...S})}:void 0,ue=h?de=>{h(de,{...S})}:void 0,me=p?de=>{p(de,{...S})}:void 0,ee=m?de=>{m(de,{...S})}:void 0,ce=de=>{if(!O&&x_.includes(de.key)&&Y){const{unselectNodesAndEdges:ge,addSelectedEdges:xe}=q.getState();de.key==="Escape"?(ae.current?.blur(),ge({edges:[S]})):xe([t])}};return A.jsx("svg",{style:{zIndex:R},children:A.jsxs("g",{className:dt(["react-flow__edge",`react-flow__edge-${D}`,S.className,C,{selected:S.selected,animated:S.animated,inactive:!Y&&!s,updating:X,selectable:Y}]),onClick:se,onDoubleClick:he,onContextMenu:fe,onMouseEnter:ue,onMouseMove:me,onMouseLeave:ee,onKeyDown:U?ce:void 0,tabIndex:U?0:void 0,role:S.ariaRole??(U?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":U?`${Q_}-${_}`:void 0,ref:ae,...S.domAttributes,children:[!re&&A.jsx(z,{id:t,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:Y,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:L,sourceY:V,targetX:P,targetY:te,sourcePosition:M,targetPosition:F,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:J,markerEnd:ne,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),k&&A.jsx(J5,{edge:S,isReconnectable:k,reconnectRadius:y,onReconnect:g,onReconnectStart:x,onReconnectEnd:b,sourceX:L,sourceY:V,targetX:P,targetY:te,sourcePosition:M,targetPosition:F,setUpdateHover:$,setReconnecting:B})]})})}var e6=j.memo(W5);const t6=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function _E({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:o,edgeTypes:a,noPanClassName:s,onReconnect:u,onEdgeContextMenu:c,onEdgeMouseEnter:h,onEdgeMouseMove:p,onEdgeMouseLeave:m,onEdgeClick:y,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:b,onReconnectEnd:_,disableKeyboardA11y:E}){const{edgesFocusable:C,edgesReconnectable:w,elementsSelectable:O,onError:S}=Ue(t6,Je),N=F5(r);return A.jsxs("div",{className:"react-flow__edges",children:[A.jsx(Y5,{defaultColor:t,rfId:o}),N.map(D=>A.jsx(e6,{id:D,edgesFocusable:C,edgesReconnectable:w,elementsSelectable:O,noPanClassName:s,onReconnect:u,onContextMenu:c,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,onClick:y,reconnectRadius:g,onDoubleClick:x,onReconnectStart:b,onReconnectEnd:_,rfId:o,onError:S,edgeTypes:a,disableKeyboardA11y:E},D))]})}_E.displayName="EdgeRenderer";const n6=j.memo(_E),r6=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function o6({children:t}){const r=Ue(r6);return A.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function i6(t){const r=uc(),o=j.useRef(!1);j.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const a6=t=>t.panZoom?.syncViewport;function l6(t){const r=Ue(a6),o=We();return j.useEffect(()=>{t&&(r?.(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function s6(t){return t.connection.inProgress?{...t.connection,to:vl(t.connection.to,t.transform)}:{...t.connection}}function u6(t){return s6}function c6(t){const r=u6();return Ue(r,Je)}const f6=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function d6({containerStyle:t,style:r,type:o,component:a}){const{nodesConnectable:s,width:u,height:c,isValid:h,inProgress:p}=Ue(f6,Je);return!(u&&s&&p)?null:A.jsx("svg",{style:t,width:u,height:c,className:"react-flow__connectionline react-flow__container",children:A.jsx("g",{className:dt(["react-flow__connection",__(h)]),children:A.jsx(EE,{style:r,type:o,CustomComponent:a,isValid:h})})})}const EE=({style:t,type:r=Xr.Bezier,CustomComponent:o,isValid:a})=>{const{inProgress:s,from:u,fromNode:c,fromHandle:h,fromPosition:p,to:m,toNode:y,toHandle:g,toPosition:x,pointer:b}=c6();if(!s)return;if(o)return A.jsx(o,{connectionLineType:r,connectionLineStyle:t,fromNode:c,fromHandle:h,fromX:u.x,fromY:u.y,toX:m.x,toY:m.y,fromPosition:p,toPosition:x,connectionStatus:__(a),toNode:y,toHandle:g,pointer:b});let _="";const E={sourceX:u.x,sourceY:u.y,sourcePosition:p,targetX:m.x,targetY:m.y,targetPosition:x};switch(r){case Xr.Bezier:[_]=ac(E);break;case Xr.SimpleBezier:[_]=F0(E);break;case Xr.Step:[_]=Dh({...E,borderRadius:0});break;case Xr.SmoothStep:[_]=Dh(E);break;default:[_]=U_(E)}return A.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:t})};EE.displayName="ConnectionLine";const h6={};function cv(t=h6){j.useRef(t),We(),j.useEffect(()=>{},[t])}function m6(){We(),j.useRef(!1),j.useEffect(()=>{},[])}function SE({nodeTypes:t,edgeTypes:r,onInit:o,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:y,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:b,connectionLineType:_,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:w,selectionKeyCode:O,selectionOnDrag:S,selectionMode:N,multiSelectionKeyCode:D,panActivationKeyCode:z,zoomActivationKeyCode:U,deleteKeyCode:k,onlyRenderVisibleElements:Y,elementsSelectable:ae,defaultViewport:X,translateExtent:$,minZoom:re,maxZoom:B,preventScrolling:q,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:V,panOnScroll:P,panOnScrollSpeed:te,panOnScrollMode:M,zoomOnDoubleClick:F,panOnDrag:J,onPaneClick:ne,onPaneMouseEnter:se,onPaneMouseMove:he,onPaneMouseLeave:fe,onPaneScroll:ue,onPaneContextMenu:me,paneClickDistance:ee,nodeClickDistance:ce,onEdgeContextMenu:de,onEdgeMouseEnter:ge,onEdgeMouseMove:xe,onEdgeMouseLeave:Ee,reconnectRadius:Te,onReconnect:je,onReconnectStart:Ie,onReconnectEnd:wt,noDragClassName:At,noWheelClassName:vn,noPanClassName:jn,disableKeyboardA11y:Fn,nodeExtent:Pe,rfId:bn,viewport:an,onViewportChange:_n}){return cv(t),cv(r),m6(),i6(o),l6(an),A.jsx(R5,{onPaneClick:ne,onPaneMouseEnter:se,onPaneMouseMove:he,onPaneMouseLeave:fe,onPaneContextMenu:me,onPaneScroll:ue,paneClickDistance:ee,deleteKeyCode:k,selectionKeyCode:O,selectionOnDrag:S,selectionMode:N,onSelectionStart:x,onSelectionEnd:b,multiSelectionKeyCode:D,panActivationKeyCode:z,zoomActivationKeyCode:U,elementsSelectable:ae,zoomOnScroll:L,zoomOnPinch:V,zoomOnDoubleClick:F,panOnScroll:P,panOnScrollSpeed:te,panOnScrollMode:M,panOnDrag:J,defaultViewport:X,translateExtent:$,minZoom:re,maxZoom:B,onSelectionContextMenu:g,preventScrolling:q,noDragClassName:At,noWheelClassName:vn,noPanClassName:jn,disableKeyboardA11y:Fn,onViewportChange:_n,isControlledViewport:!!an,children:A.jsxs(o6,{children:[A.jsx(n6,{edgeTypes:r,onEdgeClick:s,onEdgeDoubleClick:c,onReconnect:je,onReconnectStart:Ie,onReconnectEnd:wt,onlyRenderVisibleElements:Y,onEdgeContextMenu:de,onEdgeMouseEnter:ge,onEdgeMouseMove:xe,onEdgeMouseLeave:Ee,reconnectRadius:Te,defaultMarkerColor:R,noPanClassName:jn,disableKeyboardA11y:Fn,rfId:bn}),A.jsx(d6,{style:E,type:_,component:C,containerStyle:w}),A.jsx("div",{className:"react-flow__edgelabel-renderer"}),A.jsx(j5,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:m,onNodeContextMenu:y,nodeClickDistance:ce,onlyRenderVisibleElements:Y,noPanClassName:jn,noDragClassName:At,disableKeyboardA11y:Fn,nodeExtent:Pe,rfId:bn}),A.jsx("div",{className:"react-flow__viewport-portal"})]})})}SE.displayName="GraphView";const p6=j.memo(SE),fv=({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,width:s,height:u,fitView:c,fitViewOptions:h,minZoom:p=.5,maxZoom:m=2,nodeOrigin:y,nodeExtent:g,zIndexMode:x="basic"}={})=>{const b=new Map,_=new Map,E=new Map,C=new Map,w=a??r??[],O=o??t??[],S=y??[0,0],N=g??ol;j_(E,C,w);const D=zh(O,b,_,{nodeOrigin:S,nodeExtent:N,zIndexMode:x});let z=[0,0,1];if(c&&s&&u){const U=yl(b,{filter:X=>!!((X.width||X.initialWidth)&&(X.height||X.initialHeight))}),{x:k,y:Y,zoom:ae}=D0(U,s,u,p,m,h?.padding??.1);z=[k,Y,ae]}return{rfId:"1",width:s??0,height:u??0,transform:z,nodes:O,nodesInitialized:D,nodeLookup:b,parentLookup:_,edges:w,edgeLookup:C,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:p,maxZoom:m,translateExtent:ol,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Li.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:c??!1,fitViewOptions:h,fitViewResolver:null,connection:{...b_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:M8,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:v_,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},g6=({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,width:s,height:u,fitView:c,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:y,nodeExtent:g,zIndexMode:x})=>zD((b,_)=>{async function E(){const{nodeLookup:C,panZoom:w,fitViewOptions:O,fitViewResolver:S,width:N,height:D,minZoom:z,maxZoom:U}=_();w&&(await N8({nodes:C,width:N,height:D,panZoom:w,minZoom:z,maxZoom:U},O),S?.resolve(!0),b({fitViewResolver:null}))}return{...fv({nodes:t,edges:r,width:s,height:u,fitView:c,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:y,nodeExtent:g,defaultNodes:o,defaultEdges:a,zIndexMode:x}),setNodes:C=>{const{nodeLookup:w,parentLookup:O,nodeOrigin:S,elevateNodesOnSelect:N,fitViewQueued:D,zIndexMode:z}=_(),U=zh(C,w,O,{nodeOrigin:S,nodeExtent:g,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:z});D&&U?(E(),b({nodes:C,nodesInitialized:U,fitViewQueued:!1,fitViewOptions:void 0})):b({nodes:C,nodesInitialized:U})},setEdges:C=>{const{connectionLookup:w,edgeLookup:O}=_();j_(w,O,C),b({edges:C})},setDefaultNodesAndEdges:(C,w)=>{if(C){const{setNodes:O}=_();O(C),b({hasDefaultNodes:!0})}if(w){const{setEdges:O}=_();O(w),b({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:w,nodeLookup:O,parentLookup:S,domNode:N,nodeOrigin:D,nodeExtent:z,debug:U,fitViewQueued:k,zIndexMode:Y}=_(),{changes:ae,updatedInternals:X}=K8(C,O,S,N,D,z,Y);X&&(P8(O,S,{nodeOrigin:D,nodeExtent:z,zIndexMode:Y}),k?(E(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),ae?.length>0&&(U&&console.log("React Flow: trigger node changes",ae),w?.(ae)))},updateNodePositions:(C,w=!1)=>{const O=[];let S=[];const{nodeLookup:N,triggerNodeChanges:D,connection:z,updateConnection:U,onNodesChangeMiddlewareMap:k}=_();for(const[Y,ae]of C){const X=N.get(Y),$=!!(X?.expandParent&&X?.parentId&&ae?.position),re={id:Y,type:"position",position:$?{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=Bo(X,z.fromHandle,ve.Left,!0);U({...z,from:B})}$&&X.parentId&&O.push({id:Y,parentId:X.parentId,rect:{...ae.internals.positionAbsolute,width:ae.measured.width??0,height:ae.measured.height??0}}),S.push(re)}if(O.length>0){const{parentLookup:Y,nodeOrigin:ae}=_(),X=L0(O,N,Y,ae);S.push(...X)}for(const Y of k.values())S=Y(S);D(S)},triggerNodeChanges:C=>{const{onNodesChange:w,setNodes:O,nodes:S,hasDefaultNodes:N,debug:D}=_();if(C?.length){if(N){const z=W_(C,S);O(z)}D&&console.log("React Flow: trigger node changes",C),w?.(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:w,setEdges:O,edges:S,hasDefaultEdges:N,debug:D}=_();if(C?.length){if(N){const z=eE(C,S);O(z)}D&&console.log("React Flow: trigger edge changes",C),w?.(C)}},addSelectedNodes:C=>{const{multiSelectionActive:w,edgeLookup:O,nodeLookup:S,triggerNodeChanges:N,triggerEdgeChanges:D}=_();if(w){const z=C.map(U=>wo(U,!0));N(z);return}N(Mi(S,new Set([...C]),!0)),D(Mi(O))},addSelectedEdges:C=>{const{multiSelectionActive:w,edgeLookup:O,nodeLookup:S,triggerNodeChanges:N,triggerEdgeChanges:D}=_();if(w){const z=C.map(U=>wo(U,!0));D(z);return}D(Mi(O,new Set([...C]))),N(Mi(S,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:w}={})=>{const{edges:O,nodes:S,nodeLookup:N,triggerNodeChanges:D,triggerEdgeChanges:z}=_(),U=C||S,k=w||O,Y=[];for(const X of U){if(!X.selected)continue;const $=N.get(X.id);$&&($.selected=!1),Y.push(wo(X.id,!1))}const ae=[];for(const X of k)X.selected&&ae.push(wo(X.id,!1));D(Y),z(ae)},setMinZoom:C=>{const{panZoom:w,maxZoom:O}=_();w?.setScaleExtent([C,O]),b({minZoom:C})},setMaxZoom:C=>{const{panZoom:w,minZoom:O}=_();w?.setScaleExtent([O,C]),b({maxZoom:C})},setTranslateExtent:C=>{_().panZoom?.setTranslateExtent(C),b({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:w,triggerNodeChanges:O,triggerEdgeChanges:S,elementsSelectable:N}=_();if(!N)return;const D=w.reduce((U,k)=>k.selected?[...U,wo(k.id,!1)]:U,[]),z=C.reduce((U,k)=>k.selected?[...U,wo(k.id,!1)]:U,[]);O(D),S(z)},setNodeExtent:C=>{const{nodes:w,nodeLookup:O,parentLookup:S,nodeOrigin:N,elevateNodesOnSelect:D,nodeExtent:z,zIndexMode:U}=_();C[0][0]===z[0][0]&&C[0][1]===z[0][1]&&C[1][0]===z[1][0]&&C[1][1]===z[1][1]||(zh(w,O,S,{nodeOrigin:N,nodeExtent:C,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:U}),b({nodeExtent:C}))},panBy:C=>{const{transform:w,width:O,height:S,panZoom:N,translateExtent:D}=_();return J8({delta:C,panZoom:N,transform:w,translateExtent:D,width:O,height:S})},setCenter:async(C,w,O)=>{const{width:S,height:N,maxZoom:D,panZoom:z}=_();if(!z)return Promise.resolve(!1);const U=typeof O?.zoom<"u"?O.zoom:D;return await z.setViewport({x:S/2-C*U,y:N/2-w*U,zoom:U},{duration:O?.duration,ease:O?.ease,interpolate:O?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{b({connection:{...b_}})},updateConnection:C=>{b({connection:C})},reset:()=>b({...fv()})}},Object.is);function wE({initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:a,initialWidth:s,initialHeight:u,initialMinZoom:c,initialMaxZoom:h,initialFitViewOptions:p,fitView:m,nodeOrigin:y,nodeExtent:g,zIndexMode:x,children:b}){const[_]=j.useState(()=>g6({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,width:s,height:u,fitView:m,minZoom:c,maxZoom:h,fitViewOptions:p,nodeOrigin:y,nodeExtent:g,zIndexMode:x}));return A.jsx(UD,{value:_,children:A.jsx(o5,{children:b})})}function y6({children:t,nodes:r,edges:o,defaultNodes:a,defaultEdges:s,width:u,height:c,fitView:h,fitViewOptions:p,minZoom:m,maxZoom:y,nodeOrigin:g,nodeExtent:x,zIndexMode:b}){return j.useContext(sc)?A.jsx(A.Fragment,{children:t}):A.jsx(wE,{initialNodes:r,initialEdges:o,defaultNodes:a,defaultEdges:s,initialWidth:u,initialHeight:c,fitView:h,initialFitViewOptions:p,initialMinZoom:m,initialMaxZoom:y,nodeOrigin:g,nodeExtent:x,zIndexMode:b,children:t})}const x6={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function v6({nodes:t,edges:r,defaultNodes:o,defaultEdges:a,className:s,nodeTypes:u,edgeTypes:c,onNodeClick:h,onEdgeClick:p,onInit:m,onMove:y,onMoveStart:g,onMoveEnd:x,onConnect:b,onConnectStart:_,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:w,onNodeMouseEnter:O,onNodeMouseMove:S,onNodeMouseLeave:N,onNodeContextMenu:D,onNodeDoubleClick:z,onNodeDragStart:U,onNodeDrag:k,onNodeDragStop:Y,onNodesDelete:ae,onEdgesDelete:X,onDelete:$,onSelectionChange:re,onSelectionDragStart:B,onSelectionDrag:q,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:V,onSelectionEnd:P,onBeforeDelete:te,connectionMode:M,connectionLineType:F=Xr.Bezier,connectionLineStyle:J,connectionLineComponent:ne,connectionLineContainerStyle:se,deleteKeyCode:he="Backspace",selectionKeyCode:fe="Shift",selectionOnDrag:ue=!1,selectionMode:me=il.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:ce=ll()?"Meta":"Control",zoomActivationKeyCode:de=ll()?"Meta":"Control",snapToGrid:ge,snapGrid:xe,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:Te,nodesDraggable:je,autoPanOnNodeFocus:Ie,nodesConnectable:wt,nodesFocusable:At,nodeOrigin:vn=K_,edgesFocusable:jn,edgesReconnectable:Fn,elementsSelectable:Pe=!0,defaultViewport:bn=$D,minZoom:an=.5,maxZoom:_n=2,translateExtent:kn=ol,preventScrolling:dc=!0,nodeExtent:Lo,defaultMarkerColor:hc="#b1b1b7",zoomOnScroll:mc=!0,zoomOnPinch:Wr=!0,panOnScroll:Tt=!1,panOnScrollSpeed:En=.5,panOnScrollMode:Ct=No.Free,zoomOnDoubleClick:pc=!0,panOnDrag:gc=!0,onPaneClick:yc,onPaneMouseEnter:jo,onPaneMouseMove:Fo,onPaneMouseLeave:ko,onPaneScroll:Vn,onPaneContextMenu:Vo,paneClickDistance:eo=1,nodeClickDistance:xc=0,children:El,onReconnect:Yi,onReconnectStart:to,onReconnectEnd:vc,onEdgeContextMenu:Sl,onEdgeDoubleClick:wl,onEdgeMouseEnter:Al,onEdgeMouseMove:Xi,onEdgeMouseLeave:Ii,reconnectRadius:Tl=10,onNodesChange:Cl,onEdgesChange:Sn,noDragClassName:ht="nodrag",noWheelClassName:_t="nowheel",noPanClassName:Gn="nopan",fitView:Go,fitViewOptions:Nl,connectOnClick:bc,attributionPosition:Rl,proOptions:no,defaultEdgeOptions:Pi,elevateNodesOnSelect:mr=!0,elevateEdgesOnSelect:pr=!1,disableKeyboardA11y:gr=!1,autoPanOnConnect:yr,autoPanOnNodeDrag:it,autoPanSpeed:Ml,connectionRadius:Dl,isValidConnection:qn,onError:xr,style:_c,id:$i,nodeDragThreshold:Ol,connectionDragThreshold:Ec,viewport:qo,onViewportChange:Yo,width:ln,height:Dt,colorMode:zl="light",debug:Sc,onScroll:Xo,ariaLabelConfig:Bl,zIndexMode:ro="basic",...wc},Ot){const oo=$i||"1",Ul=JD(zl),Zi=j.useCallback(Yn=>{Yn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xo?.(Yn)},[Xo]);return A.jsx("div",{"data-testid":"rf__wrapper",...wc,onScroll:Zi,style:{..._c,...x6},ref:Ot,className:dt(["react-flow",s,Ul]),id:$i,role:"application",children:A.jsxs(y6,{nodes:t,edges:r,width:ln,height:Dt,fitView:Go,fitViewOptions:Nl,minZoom:an,maxZoom:_n,nodeOrigin:vn,nodeExtent:Lo,zIndexMode:ro,children:[A.jsx(p6,{onInit:m,onNodeClick:h,onEdgeClick:p,onNodeMouseEnter:O,onNodeMouseMove:S,onNodeMouseLeave:N,onNodeContextMenu:D,onNodeDoubleClick:z,nodeTypes:u,edgeTypes:c,connectionLineType:F,connectionLineStyle:J,connectionLineComponent:ne,connectionLineContainerStyle:se,selectionKeyCode:fe,selectionOnDrag:ue,selectionMode:me,deleteKeyCode:he,multiSelectionKeyCode:ce,panActivationKeyCode:ee,zoomActivationKeyCode:de,onlyRenderVisibleElements:Ee,defaultViewport:bn,translateExtent:kn,minZoom:an,maxZoom:_n,preventScrolling:dc,zoomOnScroll:mc,zoomOnPinch:Wr,zoomOnDoubleClick:pc,panOnScroll:Tt,panOnScrollSpeed:En,panOnScrollMode:Ct,panOnDrag:gc,onPaneClick:yc,onPaneMouseEnter:jo,onPaneMouseMove:Fo,onPaneMouseLeave:ko,onPaneScroll:Vn,onPaneContextMenu:Vo,paneClickDistance:eo,nodeClickDistance:xc,onSelectionContextMenu:L,onSelectionStart:V,onSelectionEnd:P,onReconnect:Yi,onReconnectStart:to,onReconnectEnd:vc,onEdgeContextMenu:Sl,onEdgeDoubleClick:wl,onEdgeMouseEnter:Al,onEdgeMouseMove:Xi,onEdgeMouseLeave:Ii,reconnectRadius:Tl,defaultMarkerColor:hc,noDragClassName:ht,noWheelClassName:_t,noPanClassName:Gn,rfId:oo,disableKeyboardA11y:gr,nodeExtent:Lo,viewport:qo,onViewportChange:Yo}),A.jsx(KD,{nodes:t,edges:r,defaultNodes:o,defaultEdges:a,onConnect:b,onConnectStart:_,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:w,nodesDraggable:je,autoPanOnNodeFocus:Ie,nodesConnectable:wt,nodesFocusable:At,edgesFocusable:jn,edgesReconnectable:Fn,elementsSelectable:Pe,elevateNodesOnSelect:mr,elevateEdgesOnSelect:pr,minZoom:an,maxZoom:_n,nodeExtent:Lo,onNodesChange:Cl,onEdgesChange:Sn,snapToGrid:ge,snapGrid:xe,connectionMode:M,translateExtent:kn,connectOnClick:bc,defaultEdgeOptions:Pi,fitView:Go,fitViewOptions:Nl,onNodesDelete:ae,onEdgesDelete:X,onDelete:$,onNodeDragStart:U,onNodeDrag:k,onNodeDragStop:Y,onSelectionDrag:q,onSelectionDragStart:B,onSelectionDragStop:R,onMove:y,onMoveStart:g,onMoveEnd:x,noPanClassName:Gn,nodeOrigin:vn,rfId:oo,autoPanOnConnect:yr,autoPanOnNodeDrag:it,autoPanSpeed:Ml,onError:xr,connectionRadius:Dl,isValidConnection:qn,selectNodesOnDrag:Te,nodeDragThreshold:Ol,connectionDragThreshold:Ec,onBeforeDelete:te,debug:Sc,ariaLabelConfig:Bl,zIndexMode:ro}),A.jsx(PD,{onSelectionChange:re}),El,A.jsx(GD,{proOptions:no,position:Rl}),A.jsx(VD,{rfId:oo,disableKeyboardA11y:gr})]})})}var b6=tE(v6);const _6=t=>t.domNode?.querySelector(".react-flow__edgelabel-renderer");function E6({children:t}){const r=Ue(_6);return r?BD.createPortal(t,r):null}function S6({dimensions:t,lineWidth:r,variant:o,className:a}){return A.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",o,a])})}function w6({radius:t,className:r}){return A.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 A6={[Zr.Dots]:1,[Zr.Lines]:1,[Zr.Cross]:6},T6=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function AE({id:t,variant:r=Zr.Dots,gap:o=20,size:a,lineWidth:s=1,offset:u=0,color:c,bgColor:h,style:p,className:m,patternClassName:y}){const g=j.useRef(null),{transform:x,patternId:b}=Ue(T6,Je),_=a||A6[r],E=r===Zr.Dots,C=r===Zr.Cross,w=Array.isArray(o)?o:[o,o],O=[w[0]*x[2]||1,w[1]*x[2]||1],S=_*x[2],N=Array.isArray(u)?u:[u,u],D=C?[S,S]:O,z=[N[0]*x[2]||1+D[0]/2,N[1]*x[2]||1+D[1]/2],U=`${b}${t||""}`;return A.jsxs("svg",{className:dt(["react-flow__background",m]),style:{...p,...cc,"--xy-background-color-props":h,"--xy-background-pattern-color-props":c},ref:g,"data-testid":"rf__background",children:[A.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:E?A.jsx(w6,{radius:S/2,className:y}):A.jsx(S6,{dimensions:D,lineWidth:s,variant:r,className:y})}),A.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}AE.displayName="Background";j.memo(AE);function C6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:A.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function N6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:A.jsx("path",{d:"M0 0h32v4.2H0z"})})}function R6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:A.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 M6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.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 D6(){return A.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:A.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,...o}){return A.jsx("button",{type:"button",className:dt(["react-flow__controls-button",r]),...o,children:t})}const O6=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function TE({style:t,showZoom:r=!0,showFitView:o=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:u,onZoomOut:c,onFitView:h,onInteractiveChange:p,className:m,children:y,position:g="bottom-left",orientation:x="vertical","aria-label":b}){const _=We(),{isInteractive:E,minZoomReached:C,maxZoomReached:w,ariaLabelConfig:O}=Ue(O6,Je),{zoomIn:S,zoomOut:N,fitView:D}=uc(),z=()=>{S(),u?.()},U=()=>{N(),c?.()},k=()=>{D(s),h?.()},Y=()=>{_.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),p?.(!E)},ae=x==="horizontal"?"horizontal":"vertical";return A.jsxs(Ro,{className:dt(["react-flow__controls",ae,m]),position:g,style:t,"data-testid":"rf__controls","aria-label":b??O["controls.ariaLabel"],children:[r&&A.jsxs(A.Fragment,{children:[A.jsx(lu,{onClick:z,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:w,children:A.jsx(C6,{})}),A.jsx(lu,{onClick:U,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:C,children:A.jsx(N6,{})})]}),o&&A.jsx(lu,{className:"react-flow__controls-fitview",onClick:k,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:A.jsx(R6,{})}),a&&A.jsx(lu,{className:"react-flow__controls-interactive",onClick:Y,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:E?A.jsx(D6,{}):A.jsx(M6,{})}),y]})}TE.displayName="Controls";const z6=j.memo(TE);function B6({id:t,x:r,y:o,width:a,height:s,style:u,color:c,strokeColor:h,strokeWidth:p,className:m,borderRadius:y,shapeRendering:g,selected:x,onClick:b}){const{background:_,backgroundColor:E}=u||{},C=c||_||E;return A.jsx("rect",{className:dt(["react-flow__minimap-node",{selected:x},m]),x:r,y:o,rx:y,ry:y,width:a,height:s,style:{fill:C,stroke:h,strokeWidth:p},shapeRendering:g,onClick:b?w=>b(w,t):void 0})}const U6=j.memo(B6),H6=t=>t.nodes.map(r=>r.id),rh=t=>t instanceof Function?t:()=>t;function L6({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:u=U6,onClick:c}){const h=Ue(H6,Je),p=rh(r),m=rh(t),y=rh(o),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return A.jsx(A.Fragment,{children:h.map(x=>A.jsx(F6,{id:x,nodeColorFunc:p,nodeStrokeColorFunc:m,nodeClassNameFunc:y,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:u,onClick:c,shapeRendering:g},x))})}function j6({id:t,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:u,shapeRendering:c,NodeComponent:h,onClick:p}){const{node:m,x:y,y:g,width:x,height:b}=Ue(_=>{const E=_.nodeLookup.get(t);if(!E)return{node:void 0,x:0,y:0,width:0,height:0};const C=E.internals.userNode,{x:w,y:O}=E.internals.positionAbsolute,{width:S,height:N}=hr(C);return{node:C,x:w,y:O,width:S,height:N}},Je);return!m||m.hidden||!N_(m)?null:A.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:o(m),strokeWidth:u,shapeRendering:c,onClick:p,id:m.id})}const F6=j.memo(j6);var k6=j.memo(L6);const V6=200,G6=150,q6=t=>!t.hidden,Y6=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?C_(yl(t.nodeLookup,{filter:q6}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},X6="react-flow__minimap-desc";function CE({style:t,className:r,nodeStrokeColor:o,nodeColor:a,nodeClassName:s="",nodeBorderRadius:u=5,nodeStrokeWidth:c,nodeComponent:h,bgColor:p,maskColor:m,maskStrokeColor:y,maskStrokeWidth:g,position:x="bottom-right",onClick:b,onNodeClick:_,pannable:E=!1,zoomable:C=!1,ariaLabel:w,inversePan:O,zoomStep:S=1,offsetScale:N=5}){const D=We(),z=j.useRef(null),{boundingRect:U,viewBB:k,rfId:Y,panZoom:ae,translateExtent:X,flowWidth:$,flowHeight:re,ariaLabelConfig:B}=Ue(Y6,Je),q=t?.width??V6,R=t?.height??G6,L=U.width/q,V=U.height/R,P=Math.max(L,V),te=P*q,M=P*R,F=N*P,J=U.x-(te-U.width)/2-F,ne=U.y-(M-U.height)/2-F,se=te+F*2,he=M+F*2,fe=`${X6}-${Y}`,ue=j.useRef(0),me=j.useRef();ue.current=P,j.useEffect(()=>{if(z.current&&ae)return me.current=lD({domNode:z.current,panZoom:ae,getTransform:()=>D.getState().transform,getViewScale:()=>ue.current}),()=>{me.current?.destroy()}},[ae]),j.useEffect(()=>{me.current?.update({translateExtent:X,width:$,height:re,inversePan:O,pannable:E,zoomStep:S,zoomable:C})},[E,C,O,S,X,$,re]);const ee=b?ge=>{const[xe,Ee]=me.current?.pointer(ge)||[0,0];b(ge,{x:xe,y:Ee})}:void 0,ce=_?j.useCallback((ge,xe)=>{const Ee=D.getState().nodeLookup.get(xe).internals.userNode;_(ge,Ee)},[]):void 0,de=w??B["minimap.ariaLabel"];return A.jsx(Ro,{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*P:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:dt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:A.jsxs("svg",{width:q,height:R,viewBox:`${J} ${ne} ${se} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":fe,ref:z,onClick:ee,children:[de&&A.jsx("title",{id:fe,children:de}),A.jsx(k6,{onClick:ce,nodeColor:a,nodeStrokeColor:o,nodeBorderRadius:u,nodeClassName:s,nodeStrokeWidth:c,nodeComponent:h}),A.jsx("path",{className:"react-flow__minimap-mask",d:`M${J-F},${ne-F}h${se+F*2}v${he+F*2}h${-se-F*2}z
|
|
752
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CE.displayName="MiniMap";j.memo(CE);const I6=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,P6={[Vi.Line]:"right",[Vi.Handle]:"bottom-right"};function $6({nodeId:t,position:r,variant:o=Vi.Handle,className:a,style:s=void 0,children:u,color:c,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:_,onResizeStart:E,onResize:C,onResizeEnd:w}){const O=iE(),S=typeof t=="string"?t:O,N=We(),D=j.useRef(null),z=o===Vi.Handle,U=Ue(j.useCallback(I6(z&&b),[z,b]),Je),k=j.useRef(null),Y=r??P6[o];j.useEffect(()=>{if(!(!D.current||!S))return k.current||(k.current=_D({domNode:D.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:X,transform:$,snapGrid:re,snapToGrid:B,nodeOrigin:q,domNode:R}=N.getState();return{nodeLookup:X,transform:$,snapGrid:re,snapToGrid:B,nodeOrigin:q,paneDomNode:R}},onChange:(X,$)=>{const{triggerNodeChanges:re,nodeLookup:B,parentLookup:q,nodeOrigin:R}=N.getState(),L=[],V={x:X.x,y:X.y},P=B.get(S);if(P&&P.expandParent&&P.parentId){const te=P.origin??R,M=X.width??P.measured.width??0,F=X.height??P.measured.height??0,J={id:P.id,parentId:P.parentId,rect:{width:M,height:F,...R_({x:X.x??P.position.x,y:X.y??P.position.y},{width:M,height:F},P.parentId,B,te)}},ne=L0([J],B,q,R);L.push(...ne),V.x=X.x?Math.max(te[0]*M,X.x):void 0,V.y=X.y?Math.max(te[1]*F,X.y):void 0}if(V.x!==void 0&&V.y!==void 0){const te={id:S,type:"position",position:{...V}};L.push(te)}if(X.width!==void 0&&X.height!==void 0){const M={id:S,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:X.width,height:X.height}};L.push(M)}for(const te of $){const M={...te,type:"position"};L.push(M)}re(L)},onEnd:({width:X,height:$})=>{const re={id:S,type:"dimensions",resizing:!1,dimensions:{width:X,height:$}};N.getState().triggerNodeChanges([re])}})),k.current.update({controlPosition:Y,boundaries:{minWidth:h,minHeight:p,maxWidth:m,maxHeight:y},keepAspectRatio:g,resizeDirection:x,onResizeStart:E,onResize:C,onResizeEnd:w,shouldResize:_}),()=>{k.current?.destroy()}},[Y,h,p,m,y,g,E,C,w,_]);const ae=Y.split("-");return A.jsx("div",{className:dt(["react-flow__resize-control","nodrag",...ae,o,a]),ref:D,style:{...s,scale:U,...c&&{[z?"backgroundColor":"borderColor"]:c}},children:u})}j.memo($6);const dv=16,hv=({id:t,type:r,position:o})=>{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",A.jsx(ul,{id:t,type:r,position:o,style:{background:"none",border:"none",width:dv,height:dv},children:A.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:o=1/0,step:a=.01,label:s,onChange:u})=>{const c=j.useRef(!1),h=j.useRef(0),p=j.useRef(0),[m,y]=j.useState(!1),[g,x]=j.useState(""),b=j.useRef(null),_=j.useRef(null),E=D=>Math.min(o,Math.max(r,D)),C=j.useCallback(D=>{m||(c.current=!0,h.current=D.clientX,p.current=t,D.preventDefault())},[t,m]);j.useEffect(()=>{const D=U=>{if(!c.current)return;const k=(U.clientX-h.current)*a;u(E(parseFloat((p.current+k).toFixed(6))))},z=()=>{c.current=!1};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",z),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",z)}},[a,r,o,u]);const w=()=>{x(String(t)),y(!0),setTimeout(()=>b.current?.select(),0)},O=()=>{const D=parseFloat(g);isNaN(D)||u(E(D)),y(!1)},S=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(E(parseFloat((t+a).toFixed(6))))):(D.key==="ArrowLeft"||D.key==="ArrowDown")&&(D.preventDefault(),u(E(parseFloat((t-a).toFixed(6))))))},N=Number.isInteger(t)?t.toFixed(1):t.toFixed(3).replace(/0+$/,"");return A.jsxs("div",{className:"flex items-center w-20 relative nodrag",children:[s&&A.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:A.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})}),A.jsx("div",{ref:_,tabIndex:0,onMouseDown:C,onDoubleClick:w,onKeyDown:S,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?A.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"}):A.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:A.jsx("p",{children:N})})})]})},_l=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:()=>{}}),oh=t=>Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0"),ih=t=>parseInt(t,16)/255,NE=([t,r,o])=>`#${oh(t)}${oh(r)}${oh(o)}`,RE=t=>[ih(t.slice(1,3)),ih(t.slice(3,5)),ih(t.slice(5,7))],k0=({color:t,onChange:r})=>{const o=j.useRef(null);return A.jsxs("div",{className:"relative",children:[A.jsx("button",{onClick:()=>o.current?.click(),className:"w-8 h-5.5 rounded border-2 border-neutral-200 cursor-pointer",style:{backgroundColor:t},title:t}),A.jsx("input",{ref:o,type:"color",value:t,onChange:a=>r(a.target.value),className:"absolute opacity-0 w-0 h-0 pointer-events-none"})]})},Ho=({onClick:t})=>A.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:"↺"}),Z6=({name:t,type:r})=>{const{showStats:o}=j.useContext(_l);return A.jsxs("div",{className:" min-w-40 flex flex-col gap-0.5 items-end",children:[A.jsx("span",{className:"font-mono text-xs text-neutral-900",children:t.replace("u_","").replaceAll("_"," ").replace(/\b\w/g,a=>a.toUpperCase())}),o&&A.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:r})]})},Q6=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r??t.default??0),u=c=>{s(c),o(c)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx(Bn,{value:a,min:t.min,max:t.max,step:.01,onChange:u}),t.default!==void 0&&A.jsx(Ho,{onClick:()=>u(t.default)})]})},K6=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r??t.default??[0,0]),u=(c,h)=>{const p=[...a];p[c]=h,s(p),o(p)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx("div",{className:"flex gap-2 flex-wrap flex-col",children:["x","y"].map((c,h)=>A.jsx(Bn,{label:c,value:a[h],onChange:p=>u(h,p)},c))}),t.default!==void 0&&A.jsx(Ho,{onClick:()=>{s(t.default),o(t.default)}})]})},J6=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r??t.default??[1,1,1]),u=c=>{s(c),o(c)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx(k0,{color:NE(a),onChange:c=>u(RE(c))}),t.default!==void 0&&A.jsx(Ho,{onClick:()=>u(t.default)})]})},W6=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r??t.default??[1,1,1,1]),[u,c,h,p]=a,m=y=>{s(y),o(y)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx(k0,{color:NE([u,c,h]),onChange:y=>{const[g,x,b]=RE(y);m([g,x,b,p])}}),A.jsx(Bn,{label:"a",value:p,min:0,max:1,step:.01,onChange:y=>m([u,c,h,y])}),t.default!==void 0&&A.jsx(Ho,{onClick:()=>m(t.default)})]})},eO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r??t.default??[0,0,0]),u=(c,h)=>{const p=[...a];p[c]=h,s(p),o(p)};return A.jsxs("div",{className:"flex items-center ",children:[A.jsx("div",{className:"flex flex-col gap-2",children:["x","y","z"].map((c,h)=>A.jsx(Bn,{label:c,value:a[h],onChange:p=>u(h,p)},c))}),t.default!==void 0&&A.jsx(Ho,{onClick:()=>{s(t.default),o(t.default)}})]})},tO=({field:t,initialValue:r,handleUpdateUniformField:o})=>{const[a,s]=j.useState(r??t.default??[0,0,0,0]),u=(c,h)=>{const p=[...a];p[c]=h,s(p),o(p)};return A.jsxs("div",{className:"flex items-center gap-2 px-2",children:[A.jsx("div",{className:"flex flex-col gap-2",children:["x","y","z","w"].map((c,h)=>A.jsx(Bn,{label:c,value:a[h],onChange:p=>u(h,p)},c))}),t.default!==void 0&&A.jsx(Ho,{onClick:()=>{s(t.default),o(t.default)}})]})},nO=({handleUpdateUniformField:t})=>{const[r,o]=j.useState(!1),[a,s]=j.useState(0),u=j.useRef(0),c=j.useRef(0),h=j.useRef(0),p=j.useRef(t);p.current=t,j.useEffect(()=>{if(!r)return;c.current=Date.now();const g=()=>{const x=u.current+(Date.now()-c.current)/1e3;s(x),p.current(x),h.current=requestAnimationFrame(g)};return h.current=requestAnimationFrame(g),()=>{cancelAnimationFrame(h.current),u.current+=(Date.now()-c.current)/1e3}},[r]);const m=()=>o(g=>!g),y=()=>{o(!1),u.current=0,s(0),p.current(0)};return A.jsxs("div",{className:"flex items-center ",children:[A.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?"⏸":"▶"}),A.jsxs("span",{className:"font-mono text-xs text-neutral-500 px-2 w-16 text-right tabular-nums",children:[a.toFixed(2),"s"]}),A.jsx(Ho,{onClick:y})]})},rO=({handleUpdateUniformField:t})=>{const{mousePosition:r}=j.useContext(_l),[o,a]=j.useState([0,0]),s=j.useRef(t);return s.current=t,j.useEffect(()=>{let u;const c=()=>{const h=[r.current[0],r.current[1]];a(h),s.current(h),u=requestAnimationFrame(c)};return u=requestAnimationFrame(c),()=>cancelAnimationFrame(u)},[]),A.jsx("div",{className:"flex items-center ",children:A.jsx("div",{className:"flex gap-2 flex-col",children:["x","y"].map((u,c)=>A.jsxs("div",{className:"flex items-center w-20 relative",children:[A.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:A.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 leading-0 -translate-y-0.5 translate-x-0.5",children:u})}),A.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:o[c].toFixed(3)})]},u))})})},oO=({initialValue:t,handleUpdateUniformField:r})=>{const[o,a]=j.useState(!1),s=t?.src instanceof HTMLVideoElement?t.src:null,u=typeof t?.src=="string"?t.src:s?.src??null,c=s!==null,[h,p]=j.useState(u),[m,y]=j.useState(c),[g,x]=j.useState(u?u.split("/").pop()??null:null),[b,_]=j.useState(()=>s&&s.readyState>=1?[s.videoWidth,s.videoHeight]:null);j.useEffect(()=>{if(b===null){if(s){const w=()=>_([s.videoWidth,s.videoHeight]);s.readyState>=1?w():s.addEventListener("loadedmetadata",w,{once:!0})}else if(u&&!c){const w=new Image;w.onload=()=>_([w.naturalWidth,w.naturalHeight]),w.src=u}}},[]);const E=j.useRef(null),C=w=>{if(!w)return;const O=URL.createObjectURL(w),S=w.type.startsWith("video/");if(p(O),y(S),x(w.name),_(null),S){const N=document.createElement("video");N.autoplay=!0,N.muted=!0,N.loop=!0,N.playsInline=!0,N.onloadedmetadata=()=>_([N.videoWidth,N.videoHeight]),N.src=O,N.play(),r({type:"texture",src:N})}else{const N=new Image;N.onload=()=>_([N.naturalWidth,N.naturalHeight]),N.src=O,r({type:"texture",src:O})}};return j.useEffect(()=>{if(!o)return;const w=O=>{if(O.clipboardData){for(const S of O.clipboardData.items)if(S.type.startsWith("image/")||S.type.startsWith("video/")){C(S.getAsFile());break}}};return window.addEventListener("paste",w),()=>window.removeEventListener("paste",w)},[o]),A.jsx("div",{className:"flex items-center ",children:A.jsxs("div",{className:"flex flex-col items-start gap-2",children:[A.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 ${o?"bg-neutral-50 border-neutral-300":"bg-neutral-100 border-neutral-50"}`,children:h?m?A.jsx("video",{src:h,className:"w-full h-full object-contain",autoPlay:!0,muted:!0,loop:!0,playsInline:!0}):A.jsx("img",{src:h,className:"w-full h-full object-contain"}):o?"cmd+V":A.jsxs(A.Fragment,{children:[A.jsx("p",{children:"Paste"}),A.jsx("p",{children:"Here"})]})}),A.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[A.jsx("button",{className:"button-base",onClick:()=>E.current?.click(),children:h?"Replace":"Upload"}),g&&A.jsx("span",{className:"text-[10px] text-neutral-400 font-mono truncate max-w-32",title:g,children:g}),b&&A.jsxs("span",{className:"text-[10px] text-neutral-400 font-mono",children:[b[0],"×",b[1]]})]}),A.jsx("input",{ref:E,type:"file",accept:"image/*,video/*",className:"hidden",onChange:w=>C(w.target.files?.[0]??null)})]})})},iO=[{position:0,color:"#000000"},{position:1,color:"#ffffff"}],aO=({width:t,height:r,handleUpdateUniformField:o})=>{const a=j.useRef(o);return a.current=o,j.useEffect(()=>{a.current([t,r])},[t,r]),A.jsx("div",{className:"flex items-center ",children:A.jsx("div",{className:"flex gap-2 flex-col",children:["w","h"].map((s,u)=>A.jsxs("div",{className:"flex items-center w-20 relative",children:[A.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:A.jsx("p",{className:"text-[11px] font-mono w-3 text-neutral-500 leading-0 -translate-y-0.5 translate-x-0.5",children:s})}),A.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))})})},lO=({initialValue:t,handleUpdateUniformField:r})=>{const[o,a]=j.useState(t?.stops??iO),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=kb(o,b/(g.width-1)),x.fillRect(b,0,1,g.height);r({type:"gradient",stops:o})}},[o]);const c=g=>x=>{x.preventDefault();const b=u.current;if(!b)return;const _=C=>{const w=b.getBoundingClientRect(),S=Math.max(0,Math.min(C.clientX-w.left,w.width))/w.width;a(N=>N.map((D,z)=>z===g?{...D,position:S}:D))},E=()=>{window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",E)};window.addEventListener("mousemove",_),window.addEventListener("mouseup",E)},h=()=>a(g=>[...g,{position:1,color:"#ffffff"}]),p=g=>{o.length<=1||a(x=>x.filter((b,_)=>_!==g))},m=(g,x)=>a(b=>b.map((_,E)=>E===g?{..._,position:x}:_)),y=(g,x)=>a(b=>b.map((_,E)=>E===g?{..._,color:x}:_));return A.jsxs("div",{className:"flex flex-col gap-3 p-2",children:[A.jsxs("div",{ref:u,className:"relative w-32 h-4 nodrag nopan",children:[A.jsx("canvas",{ref:s,width:128,height:16,className:"w-32 h-4 rounded-sm border-2 border-neutral-200"}),o.map((g,x)=>A.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:c(x)},x))]}),A.jsxs("div",{className:"flex items-center justify-between w-32",children:[A.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"STOPS"}),A.jsx("button",{onClick:h,className:"font-mono text-[10px] text-neutral-500 hover:text-neutral-800 leading-none",children:"ADD +"})]}),A.jsx("div",{className:"flex flex-col gap-1.5",children:o.map((g,x)=>A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(Bn,{value:g.position,min:0,max:1,step:.01,onChange:b=>m(x,b)}),A.jsx(k0,{color:g.color,onChange:b=>y(x,b)}),o.length>1&&A.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))})]})},sO=(t,r)=>{const o={};for(const a of t)switch(a.type){case"float":o[a.name]=a.default??0;break;case"vec2":o[a.name]=a.default??[0,0];break;case"vec3":o[a.name]=a.default??[0,0,0];break;case"vec4":o[a.name]=a.default??[0,0,0,0];break}if(r)for(const a of t)a.name in r&&(o[a.name]=r[a.name]);return o};function uO(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 ME=({shader:t,initialUniforms:r,handleUpdateUniform:o})=>{const a=j.useMemo(()=>Bi(t),[t.source]),s=j.useMemo(()=>sO(a,r),[a]),u=j.useRef(s);return j.useEffect(()=>{u.current={...s},o(u.current)},[s]),a.length===0?A.jsxs("p",{className:"px-2 py-3 font-mono text-xs",children:["No uniforms found."," ",A.jsxs("span",{children:["Add ",A.jsx("code",{className:"",children:"// [min, max, default]"})," comments to float uniforms."]})]}):A.jsx("div",{className:"rounded flex flex-col gap-1",children:a.map(c=>{const h=`${c.name}-${c.type}`,p=g=>{u.current[c.name]=g,o(u.current)},m=g=>{g===null?delete u.current[c.name]:u.current[c.name]=g,o(u.current)};let y=null;switch(c.type){case"float":y=c.special==="time"?A.jsx(nO,{field:c,handleUpdateUniformField:p}):A.jsx(Q6,{field:c,initialValue:s[c.name],handleUpdateUniformField:p});break;case"vec2":y=c.special==="mouse"?A.jsx(rO,{field:c,handleUpdateUniformField:p}):c.special==="resolution"?A.jsx(aO,{field:c,width:t.resolution.width,height:t.resolution.height,handleUpdateUniformField:p}):A.jsx(K6,{field:c,initialValue:s[c.name],handleUpdateUniformField:p});break;case"vec3":y=c.color?A.jsx(J6,{field:c,initialValue:s[c.name],handleUpdateUniformField:p}):A.jsx(eO,{field:c,initialValue:s[c.name],handleUpdateUniformField:p});break;case"vec4":y=c.color?A.jsx(W6,{field:c,initialValue:s[c.name],handleUpdateUniformField:p}):A.jsx(tO,{field:c,initialValue:s[c.name],handleUpdateUniformField:p});break;case"sampler2D":c.source==="texture"?y=A.jsx(oO,{field:c,initialValue:s[c.name],handleUpdateUniformField:m}):c.source==="gradient"&&(y=A.jsx(lO,{field:c,initialValue:s[c.name],handleUpdateUniformField:p}));break}return y===null?null:A.jsxs("div",{className:"flex items-center gap-4 rounded-sm mb-1",children:[A.jsx(Z6,{name:c.name,type:uO(c)}),A.jsx("div",{className:"bg-neutral-100 p-1 rounded-md",children:y})]},h)})})},fc=({children:t,open:r,className:o,handleOpenChange:a})=>{const s=j.useRef(null),[u,c]=j.useState(r);return j.useEffect(()=>{c(!!r)},[r]),j.useEffect(()=>{s.current!==null&&(u?s.current.showModal():s.current.close()),a(u)},[u]),A.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"} ${o} nopan nodrag nowheel`,children:t})},mv="pnpm i @sequenza/lib",DE=({uniforms:t,patch:r,open:o,onOpenChange:a})=>{const s=YN(t,r),[u,c]=j.useState("idle"),[h,p]=j.useState("idle"),m=()=>{navigator.clipboard.writeText(mv),c("done"),setTimeout(()=>c("idle"),1800)},y=()=>{navigator.clipboard.writeText(s),p("done"),setTimeout(()=>p("idle"),1800)};return A.jsxs(fc,{open:o,handleOpenChange:a,className:"flex flex-col gap-4 p-6 overflow-y-auto",children:[A.jsxs("div",{className:"flex items-center justify-between",children:[A.jsx("h2",{className:"text-sm font-medium text-neutral-800",children:"Integrate shader"}),A.jsx("button",{className:"button-base",onClick:()=>a(!1),children:"Close"})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("p",{className:"text-xs text-neutral-500",children:"Install"}),A.jsxs("div",{className:"flex items-center gap-2 bg-neutral-50 rounded py-4 px-4",children:[A.jsx("code",{className:"text-xs text-neutral-700 w-full select-all",children:mv}),A.jsx("button",{className:"button-base",onClick:m,children:u==="done"?"Copied!":"Copy"})]})]}),A.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-h-0",children:[A.jsx("p",{className:"text-xs text-neutral-500",children:"Component"}),A.jsxs("div",{className:"relative flex-1 min-h-0 bg-neutral-50 rounded",children:[A.jsx("button",{className:"absolute top-4 right-4 button-base",onClick:y,children:h==="done"?"Copied!":"Copy"}),A.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"})]})]})]})},cO=({open:t,onOpenChange:r,shader:o,patch:a,uniforms:s,nodeId:u,handleUpdateUniforms:c,handleUpdateNode:h})=>{const p=j.useRef(null),m=j.useRef(null),[y,g]=j.useState(!1),[x,b]=j.useState(null),_=(D,z)=>{const U=D.split(/\n(?=\d+: )/),k={};for(const $ of U){const re=$.match(/^(\d+): ([\s\S]*)/);re&&(k[parseInt(re[1],10)]=re[2].trimEnd())}const Y=Math.max(1,z-3),ae=z+3,X=[];for(let $=Y;$<=ae;$++)k[$]!==void 0&&X.push(`${$}: ${k[$]}`);return X.join(`
|
|
753
|
+
`)},[E,C]=j.useState({w:1,h:1}),{width:w,height:O}=o.resolution;j.useEffect(()=>{const D=m.current;if(!D)return;const z=new ResizeObserver(([U])=>{const{width:k,height:Y}=U.contentRect;C({w:k,h:Y})});return z.observe(D),()=>z.disconnect()},[]);const S=()=>{p.current?.toBlob(D=>{D&&navigator.clipboard.write([new ClipboardItem({"image/png":D})])})},N=()=>{const D=p.current?.toDataURL("image/png");if(!D)return;const z=document.createElement("a");z.href=D,z.download=`${o.name}.png`,z.click()};return A.jsxs(fc,{open:t,handleOpenChange:r,className:"flex flex-col w-full h-full",children:[A.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0",children:[A.jsx("h2",{className:"text-sm font-medium text-neutral-800",children:o.name}),A.jsx("button",{className:"button-base",onClick:()=>r(!1),children:"Close"})]}),A.jsxs("div",{className:"flex gap-16 px-6 pb-6 flex-1 min-h-0 items-center",children:[A.jsx("div",{className:"flex flex-col gap-8",children:A.jsx("div",{className:"flex flex-col gap-2",children:A.jsx(ME,{shader:o,initialUniforms:s.current[o.id],handleUpdateUniform:D=>c(o.id,D)})})}),A.jsxs("div",{className:"h-full w-full flex flex-col gap-4 ",children:[A.jsx("div",{ref:m,className:"flex bg-neutral-50 rounded w-4/5 items-center justify-center h-full",children:A.jsx(Vb,{ref:p,animate:!0,width:w,height:O,patch:a,uniforms:s,className:w/O>E.w/E.h?"w-full":"h-full",onError:D=>b(D)})}),A.jsxs("div",{className:"flex flex-col gap-2 ",children:[A.jsxs("div",{className:"flex gap-1 bg-neutral-100 p-1 rounded-md w-min",children:[A.jsx(Bn,{label:"w",value:w,min:1,step:1,onChange:D=>h(u,z=>({...z,shader:{...z.shader,resolution:{width:D,height:O}}}))}),A.jsx(Bn,{label:"h",value:O,min:1,step:1,onChange:D=>h(u,z=>({...z,shader:{...z.shader,resolution:{width:w,height:D}}}))})]}),A.jsxs("div",{className:"flex gap-1 h-min w-min",children:[A.jsx("button",{className:"button-base",onClick:()=>g(!0),children:"Export"}),A.jsx(DE,{uniforms:s.current,patch:a,open:y,onOpenChange:g}),A.jsx("button",{className:"button-base",onClick:S,children:"Copy"}),A.jsx("button",{className:"button-base",onClick:N,children:"Save"})]})]})]})]}),x&&A.jsxs("div",{className:"flex flex-col gap-2 mx-6 mb-6 p-2 bg-white border-2 border-red-100 rounded-md",children:[A.jsx("p",{className:"text-white w-min text-nowrap bg-red-700 px-2 py-1 rounded text-xs",children:x.shaderName}),A.jsx("pre",{className:"text-xs text-red-600 font-mono whitespace-pre-wrap break-all",children:_(x.message,x.line)}),A.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"})]})]})},fO=({data:t,selected:r,id:o})=>{const{patches:a,uniforms:s,handleUpdateUniforms:u,handleUpdateNode:c,showStats:h,setOpenExportNodeId:p,openPreviewNodeId:m,setOpenPreviewNodeId:y}=j.useContext(_l);if(!a||a[t.shader.id]===void 0)return null;const{width:g,height:x}=t.shader.resolution,[b,_]=j.useState(null),E=j.useRef(null),[C,w]=j.useState("idle"),[O,S]=j.useState("idle"),N=()=>{E.current?.toBlob(k=>{k&&navigator.clipboard.write([new ClipboardItem({"image/png":k})])}),w("done"),setTimeout(()=>w("idle"),1800)},D=()=>{const k=E.current?.toDataURL("image/png");if(!k)return;const Y=document.createElement("a");Y.href=k,Y.download=`${t.shader.name}.png`,Y.click()},z=j.useMemo(()=>Bi(t.shader).filter(k=>k.type==="sampler2D"&&k.source==="input").map(k=>k.name),[t.shader]),U=(k,Y)=>{const ae=k.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 $=Math.max(1,Y-3),re=Y+3,B=[];for(let q=$;q<=re;q++)X[q]!==void 0&&B.push(`${q}: ${X[q]}`);return B.join(`
|
|
754
|
+
`)};return A.jsxs("div",{className:`
|
|
755
|
+
flex flex-col gap-4 bg-white rounded-lg p-6 relative transition-[outline] outline-neutral-200 duration-75
|
|
756
|
+
${r?"outline-4":"outline-0"}
|
|
757
|
+
`,children:[A.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&&A.jsxs(A.Fragment,{children:[A.jsxs("p",{className:"text-xs text-neutral-500 absolute -top-6",children:["ID: ",t.shader.id]}),A.jsx("p",{className:"text-xs text-neutral-500 absolute -top-10",children:t.shader.name})]}),z.map(k=>A.jsx(hv,{id:k,type:"target",position:ve.Top},k)),A.jsxs("div",{className:"flex gap-8",children:[A.jsx("div",{className:"flex flex-col gap-2",children:A.jsx(ME,{shader:t.shader,initialUniforms:s.current[t.shader.id],handleUpdateUniform:k=>{u(t.shader.id,k)}})}),A.jsxs("div",{className:"flex flex-col justify-center items-start gap-4 ",children:[A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsxs("div",{className:"relative max-w-96 group",children:[A.jsxs("div",{className:"flex absolute top-2 right-2 gap-2",children:[A.jsx("button",{className:"button-base group-hover:opacity-100 opacity-0",onClick:()=>y(o),children:"Expand"}),A.jsx(cO,{open:m===o,onOpenChange:k=>{y(k?o:null)},shader:t.shader,patch:a[t.shader.id],uniforms:s,nodeId:o,handleUpdateUniforms:u,handleUpdateNode:c}),A.jsx("button",{className:`button-base ${t.paused?"opacity-100":"group-hover:opacity-100 opacity-0"}`,onClick:()=>{c(o,k=>({...k,paused:!k.paused}))},children:t.paused?"Resume":"Pause"})]}),A.jsx(Vb,{ref:E,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:k=>{_(k)}})]}),A.jsxs("div",{className:"flex gap-1 bg-neutral-100 rounded-md p-1 w-min",children:[A.jsx(Bn,{label:"w",value:g,min:1,step:1,onChange:k=>c(o,Y=>({...Y,shader:{...Y.shader,resolution:{width:k,height:x}}}))}),A.jsx(Bn,{label:"h",value:x,min:1,step:1,onChange:k=>c(o,Y=>({...Y,shader:{...Y.shader,resolution:{width:g,height:k}}}))})]})]}),A.jsxs("div",{className:"flex gap-1",children:[A.jsx("button",{className:"button-base",onClick:()=>p(o),children:"Export"}),A.jsx("button",{className:"button-base",onClick:N,children:C==="done"?"Copied!":"Copy"}),A.jsx("button",{className:"button-base",onClick:D,children:"Save"})]})]})]}),b&&A.jsxs("div",{className:"flex flex-col gap-2 p-2 bg-white border-2 border-red-100 rounded-md relative",children:[A.jsx("p",{className:"text-white w-min text-nowrap bg-red-700 px-2 py-1 rounded text-xs",children:b.shaderName}),A.jsx("pre",{className:"text-xs text-red-600 font-mono whitespace-pre-wrap break-all",children:U(b.message,b.line)}),A.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),S("done"),setTimeout(()=>S("idle"),1800)},children:O==="done"?"Copied!":"Copy error"})]}),A.jsx(hv,{id:"out",type:"source",position:ve.Bottom})]})};function dO({sourceX:t,sourceY:r,targetX:o,targetY:a,sourcePosition:s,targetPosition:u,style:c={},markerEnd:h,id:p}){const[m,y,g]=ac({sourceX:t,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:u}),{shaders:x,handleInsertShader:b}=j.useContext(_l),[_,E]=j.useState(!1),C=()=>{console.log("d"),E(!0)};return A.jsxs(A.Fragment,{children:[A.jsx(bl,{path:m,markerEnd:h,style:c}),A.jsx(E6,{children:A.jsxs("div",{className:"absolute -translate-1/2 origin-center pointer-events-auto",style:{transform:`translate(${y}px,${g}px)`},children:[A.jsx("button",{className:"w-6 h-6 bg-neutral-200 rounded-full active:bg-neutral-200 z-10 flex items-center justify-center",onClick:()=>C(),children:"+"}),A.jsx(fc,{open:_,handleOpenChange:w=>{E(w)},children:A.jsxs("div",{className:"w-full h-full flex flex-col p-4",children:[A.jsxs("div",{className:"w-full flex justify-between",children:[A.jsx("p",{children:"Add a Shader"}),A.jsx("button",{className:"button-base",onClick:()=>{E(!1)},children:"Close"})]}),A.jsx("div",{className:"w-full flex flex-col",children:x.map(w=>A.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 hO({fromX:t,fromY:r,toX:o,toY:a,fromPosition:s,toPosition:u,toHandle:c}){const[h]=ac({sourceX:t,sourceY:r,sourcePosition:s,targetX:o,targetY:a,targetPosition:u}),p=c?"connect":"new",m=a-26,y=6,g=16,x=p.length*6+y*2;return A.jsxs("g",{children:[A.jsx("path",{fill:"none",stroke:"#b1b1b7",strokeWidth:1.5,d:h}),A.jsx("rect",{x:o-x/2,y:m-g/2,width:x,height:g,rx:4,fill:c?"#404040":"#e5e5e5",style:{pointerEvents:"none"}}),A.jsx("text",{x:o,y:m,textAnchor:"middle",dominantBaseline:"central",fontSize:10,fontFamily:"monospace",fill:c?"#ffffff":"#525252",style:{userSelect:"none",pointerEvents:"none"},children:p}),A.jsx("foreignObject",{x:o-8,y:a-8,width:16,height:16,style:{overflow:"visible"},children:A.jsx("div",{className:"w-4 h-4 rounded-full bg-neutral-400"})})]})}function ah(t,r,o){const a=new Map(t.map(u=>[u.id,u])),s=[o];for(;s.length>0;){const u=s.shift(),c=a.get(u);if(!c||c.type!=="shader")continue;const h=c,{width:p,height:m}=h.data.shader.resolution,y=S_(c,[...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 mO=({shaders:t,initialState:r,handleSave:o,className:a,initialShowStats:s,initialShaderPanelOpen:u,initialOpenPreviewNodeId:c,onEditorStateChange:h,onOpenPreviewNodeIdChange:p})=>{const[m,y]=j.useState(r?.edges??[]),[g,x]=j.useState(()=>{const ee=r?.nodes??[],ce=r?.edges??[],de=new Set(ce.map(Ee=>Ee.target)),ge=ee.filter(Ee=>!de.has(Ee.id)).map(Ee=>Ee.id);let xe=ee;for(const Ee of ge)xe=ah(xe,ce,Ee);return xe}),b=j.useCallback(ee=>x(ce=>W_(ee,ce)),[x]),_=j.useCallback(ee=>y(ce=>eE(ee,ce)),[y]),E=j.useCallback(ee=>{const ce=new Set,de=ge=>ce.has(ge)?!1:ge===ee.source?!0:(ce.add(ge),S_({id:ge},g,m).some(xe=>de(xe.id)));return!de(ee.target)},[g,m]),C=j.useCallback(ee=>{const ce=Mh({...ee,type:"insert"},m),de=ah(g,ce,ee.source);y(ce),x(de)},[m,g]),{screenToFlowPosition:w}=uc(),[O,S]=j.useState(null),N=j.useCallback((ee,ce)=>{if(!ce.isValid&&ce.fromNode){const{clientX:de,clientY:ge}="changedTouches"in ee?ee.changedTouches[0]:ee;S({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 ee=ce=>{(ce.metaKey||ce.ctrlKey)&&ce.key==="s"&&(ce.preventDefault(),o({nodes:g,edges:m,uniforms:D.current}),U(new Date))};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[g,m]);const k=ee=>{const ce=`${Math.random()*1e5}`,de={...ee,id:ce};return{id:ce,position:{x:0,y:0},data:{shader:de,uniforms:D,paused:!1},type:"shader"}},Y=ee=>{x(ce=>[...ce,k(ee)])},ae=(ee,ce)=>{const de=m.find(Ie=>Ie.id===ce);if(!de)return;const ge=de.source,xe=de.target,Ee=g.find(Ie=>Ie.id===ge),Te=g.find(Ie=>Ie.id===xe),je=de.targetHandle;if(Ee&&Te&&je){const Ie=k(ee),wt=Bi(Ie.data.shader);let At;for(const Pe of wt)if(Pe.type==="sampler2D"&&Pe.source==="input"){At=Pe.name;break}if(At===void 0)return;const[vn,jn,Fn]=F0({sourceX:Ee.position.x,sourceY:Ee.position.y,sourcePosition:ve.Bottom,targetX:Te.position.x,targetY:Te.position.y,targetPosition:ve.Top});Ie.position.x=jn,Ie.position.y=Fn,x(Pe=>[...Pe,Ie]),y(Pe=>{const bn=Pe.filter(kn=>kn.id!==ce),an={id:""+Math.random()*1e4,source:Ee.id,target:Ie.id,targetHandle:At,type:"insert"},_n={id:""+Math.random()*1e4,source:Ie.id,target:Te.id,targetHandle:je,type:"insert"};return bn.push(an),bn.push(_n),bn})}},[X,$]=j.useMemo(()=>{const ee={};for(const de of g)ee[de.id]=[];for(const de of m)ee[de.target].push({from:de.source,to:de.target,input:de.targetHandle??""});return[JSON.stringify(ee),ee]},[m,g]),[re,B]=j.useMemo(()=>{const ee={};for(const ce of g)if(ce.type==="shader"){const de=ce;ee[de.id]=de.data.shader}return[JSON.stringify(ee),ee]},[g]),q=j.useMemo(()=>{const ee={};for(const[ce,de]of Object.entries(B)){ee[ce]={shaders:[de],connections:[]};const ge=[ce];for(;ge.length!==0;){const xe=ge.shift();for(const Ee of $[xe]){const Te=Ee.from;ge.push(Te);const je=B[Te];ee[ce].shaders.push(je),ee[ce].connections.push(Ee)}}}return ee},[re,X]),R=j.useCallback((ee,ce)=>{D.current[ee]=ce},[]),L=j.useCallback((ee,ce)=>{x(de=>{const ge=de.map(xe=>{if(xe.id===ee&&xe.type==="shader"){const Ee=xe;return{...Ee,data:ce(Ee.data)}}return xe});return ah(ge,m,ee)})},[m]),V=j.useRef(0),P=j.useRef([0,0]);j.useEffect(()=>{const ee=setInterval(()=>{V.current=Date.now()},10),ce=de=>{P.current=[Math.min(1,de.clientX/window.innerWidth),Math.min(de.clientY/innerHeight,1)]};return window.addEventListener("mousemove",ce),()=>{clearInterval(ee),window.removeEventListener("mousemove",ce)}},[]);const te=(ee,ce,de)=>{if(g.find(xe=>xe.id===ce)){const xe=k(ee);xe.position=de;const Ee=Bi(xe.data.shader);let Te;for(const je of Ee)if(je.type==="sampler2D"&&je.source==="input"){Te=je.name;break}if(x(je=>[...je,xe]),Te!==void 0){const je={id:""+Math.random(),source:ce,target:xe.id,targetHandle:Te,type:"insert"};y(Ie=>Mh(je,Ie))}}},[M,F]=j.useState(s??!1),[J,ne]=j.useState(u??!0),[se,he]=j.useState(null),[fe,ue]=j.useState(c??null),me=ee=>{ue(ee),p?.(ee)};return j.useEffect(()=>{h?.({showStats:M,shaderPanelOpen:J})},[M,J]),A.jsxs("div",{className:`w-full h-full ${a}`,children:[A.jsx(_l.Provider,{value:{currentTime:V,mousePosition:P,shaders:t,patches:q,showStats:M,openExportNodeId:se,setOpenExportNodeId:he,openPreviewNodeId:fe,setOpenPreviewNodeId:me,uniforms:D,handleUpdateUniforms:R,handleUpdateNode:L,handleInsertShader:ae},children:A.jsxs(b6,{panOnScroll:!0,proOptions:{hideAttribution:!0},nodes:g,nodeTypes:{shader:fO},edges:m,edgeTypes:{insert:dO},onNodesChange:b,onEdgesChange:_,onConnect:C,onConnectEnd:N,connectionLineComponent:hO,isValidConnection:E,style:{background:"#F9F9F9"},fitView:!0,children:[A.jsx(z6,{style:{"--xy-controls-button-background-color-default":"transparent","--xy-controls-box-shadow-default":"none"}}),A.jsxs(Ro,{position:"top-left",className:"flex flex-col gap-4",children:[A.jsx("button",{className:"button-base",onClick:()=>F(!M),children:M?"Hide Stats":"Show Stats"}),M&&A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"flex flex-col gap-2",children:g.map(ee=>A.jsx("p",{className:"text-xs text-neutral-400",children:ee.id},ee.id))}),A.jsx("div",{className:"flex flex-col gap-2",children:m.map(ee=>A.jsxs("p",{className:"text-xs text-neutral-400",children:[ee.source," ",">"," ",ee.target," ",ee.targetHandle]},ee.id))})]})]}),t.length>0&&A.jsx(Ro,{position:"bottom-right",children:A.jsxs("div",{className:"w-56 flex flex-col rounded-sm bg-white overflow-hidden",children:[A.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[A.jsx("p",{className:"text-sm",children:"Add Shader"}),A.jsx("button",{className:"button-base",onClick:()=>ne(!J),children:J?"Hide":"Show"})]}),J&&A.jsx("div",{className:"flex flex-col gap-1 px-2 pb-2",children:t.sort((ee,ce)=>ee.name.localeCompare(ce.name)).map(ee=>A.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>Y(ee),children:ee.id.length>25?`${ee.id.slice(0,11)}...${ee.id.slice(-11)}`:ee.id},ee.id))})]})}),z&&A.jsx(Ro,{position:"bottom-center",children:A.jsxs("p",{className:"text-xs text-neutral-400",children:["Last saved at ",z.toLocaleTimeString()]})})]})}),se!==null&&q[se]&&A.jsx(DE,{uniforms:D.current,patch:q[se],open:!0,onOpenChange:ee=>{ee||he(null)}}),A.jsx(fc,{open:O!==null,handleOpenChange:ee=>{ee===!1&&S(null)},children:A.jsxs("div",{className:"w-full h-full flex flex-col p-4",children:[A.jsxs("div",{className:"w-full flex justify-between",children:[A.jsx("p",{children:"Add a Shader"}),A.jsx("button",{className:"button-base",onClick:()=>{S(null)},children:"Close"})]}),A.jsx("div",{className:"w-full flex flex-col",children:t.map(ee=>A.jsx("button",{className:"text-xs flex justify-start p-1 rounded-sm hover:bg-neutral-100 cursor-pointer text-neutral-500",onClick:()=>{O&&te(ee,O.sourceId,O.position),S(null)},children:ee.id},ee.id))})]})})]})},pO=t=>A.jsx(wE,{children:A.jsx(mO,{...t})});function gO(){const[t,r]=j.useState({}),o=j.useRef({});j.useEffect(()=>{const u={};for(const[h,p]of Object.entries(Kw))u[h]={id:h,source:p,name:h,resolution:{width:100,height:100}},o.current[h]={};console.log("[CONNECT]");const c=fu("http://localhost:3001");return c.on("shaders-found",h=>{const p={};for(const[m,y]of Object.entries(h))p[m]={id:m,source:y,name:m,resolution:{width:100,height:100}},o.current[m]={};r({...p,...u})}),()=>{console.log("[DISCONNECT]"),c.disconnect()}},[]);const a=j.useMemo(()=>{try{const u=JSON.parse(localStorage.getItem("sequenza-nodes")??"[]");let c=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=Bi(y.data.shader),b={};for(const _ of x){if(_.type==="sampler2D"&&_.source==="input")continue;const E=g[_.name];if(E!==void 0&&VN(E,_))b[_.name]=E;else{const C=GN(_);C!==void 0&&(b[_.name]=C)}}h[y.id]=b}if(c=c.filter(m=>{const y=u.find(E=>E.id===m.source),g=u.find(E=>E.id===m.target),x=m.targetHandle;if(!g||g&&g.type!=="shader")return!1;const _=Bi(g.data.shader);return!(!y||x===null||x===void 0||_.find(E=>E.name===x&&E.type==="sampler2D")===void 0)}),u!==null&&c!==null&&h!==null)return{nodes:u,edges:c,uniforms:h}}catch(u){console.error(u)}},[t]),s=Object.keys(t).length>0;return A.jsx("main",{className:"",children:A.jsx("div",{className:"w-full min-h-screen h-screen ",children:s&&A.jsx(pO,{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:c})=>{localStorage.setItem("sequenza-show-stats",String(u)),localStorage.setItem("sequenza-shader-panel-open",String(c))},onOpenPreviewNodeIdChange:u=>{u?localStorage.setItem("sequenza-open-preview-node",u):localStorage.removeItem("sequenza-open-preview-node")},handleSave:({nodes:u,edges:c,uniforms:h})=>{localStorage.setItem("sequenza-nodes",JSON.stringify(u)),localStorage.setItem("sequenza-edges",JSON.stringify(c)),localStorage.setItem("sequenza-uniforms",JSON.stringify(h))}})})})}I2.createRoot(document.getElementById("root")).render(A.jsx(j.StrictMode,{children:A.jsx(gO,{})}));
|