967 lines
595 KiB
JavaScript
967 lines
595 KiB
JavaScript
var Xx=Object.defineProperty;var Zx=(r,n,i)=>n in r?Xx(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i;var hr=(r,n,i)=>Zx(r,typeof n!="symbol"?n+"":n,i);function Wx(r,n){for(var i=0;i<n.length;i++){const a=n[i];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in r)){const l=Object.getOwnPropertyDescriptor(a,s);l&&Object.defineProperty(r,s,l.get?l:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function i(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(s){if(s.ep)return;s.ep=!0;const l=i(s);fetch(s.href,l)}})();function on(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Kx(r){if(r.__esModule)return r;var n=r.default;if(typeof n=="function"){var i=function a(){return this instanceof a?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};i.prototype=n.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var s=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(i,a,s.get?s:{enumerable:!0,get:function(){return r[a]}})}),i}var jf={exports:{}},Ho={};/**
|
|
* @license React
|
|
* react-jsx-runtime.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Vv;function Qx(){if(Vv)return Ho;Vv=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var f in s)f!=="key"&&(l[f]=s[f])}else l=s;return s=l.ref,{$$typeof:r,type:a,key:c,ref:s!==void 0?s:null,props:l}}return Ho.Fragment=n,Ho.jsx=i,Ho.jsxs=i,Ho}var Iv;function Jx(){return Iv||(Iv=1,jf.exports=Qx()),jf.exports}var A=Jx(),Uf={exports:{}},Ge={};/**
|
|
* @license React
|
|
* react.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Yv;function e_(){if(Yv)return Ge;Yv=1;var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=v&&G[v]||G["@@iterator"],typeof G=="function"?G:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,E={};function T(G,P,k){this.props=G,this.context=P,this.refs=E,this.updater=k||b}T.prototype.isReactComponent={},T.prototype.setState=function(G,P){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,P,"setState")},T.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=T.prototype;function N(G,P,k){this.props=G,this.context=P,this.refs=E,this.updater=k||b}var L=N.prototype=new M;L.constructor=N,x(L,T.prototype),L.isPureReactComponent=!0;var C=Array.isArray,R={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function _(G,P,k,V,Q,re){return k=re.ref,{$$typeof:r,type:G,key:P,ref:k!==void 0?k:null,props:re}}function $(G,P){return _(G.type,P,void 0,void 0,void 0,G.props)}function z(G){return typeof G=="object"&&G!==null&&G.$$typeof===r}function F(G){var P={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(k){return P[k]})}var Y=/\/+/g;function I(G,P){return typeof G=="object"&&G!==null&&G.key!=null?F(""+G.key):P.toString(36)}function j(){}function J(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(j,j):(G.status="pending",G.then(function(P){G.status==="pending"&&(G.status="fulfilled",G.value=P)},function(P){G.status==="pending"&&(G.status="rejected",G.reason=P)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function ae(G,P,k,V,Q){var re=typeof G;(re==="undefined"||re==="boolean")&&(G=null);var de=!1;if(G===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(G.$$typeof){case r:case n:de=!0;break;case m:return de=G._init,ae(de(G._payload),P,k,V,Q)}}if(de)return Q=Q(G),de=V===""?"."+I(G,0):V,C(Q)?(k="",de!=null&&(k=de.replace(Y,"$&/")+"/"),ae(Q,P,k,"",function(xe){return xe})):Q!=null&&(z(Q)&&(Q=$(Q,k+(Q.key==null||G&&G.key===Q.key?"":(""+Q.key).replace(Y,"$&/")+"/")+de)),P.push(Q)),1;de=0;var ge=V===""?".":V+":";if(C(G))for(var le=0;le<G.length;le++)V=G[le],re=ge+I(V,le),de+=ae(V,P,k,re,Q);else if(le=y(G),typeof le=="function")for(G=le.call(G),le=0;!(V=G.next()).done;)V=V.value,re=ge+I(V,le++),de+=ae(V,P,k,re,Q);else if(re==="object"){if(typeof G.then=="function")return ae(J(G),P,k,V,Q);throw P=String(G),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return de}function H(G,P,k){if(G==null)return G;var V=[],Q=0;return ae(G,V,"","",function(re){return P.call(k,re,Q++)}),V}function U(G){if(G._status===-1){var P=G._result;P=P(),P.then(function(k){(G._status===0||G._status===-1)&&(G._status=1,G._result=k)},function(k){(G._status===0||G._status===-1)&&(G._status=2,G._result=k)}),G._status===-1&&(G._status=0,G._result=P)}if(G._status===1)return G._result.default;throw G._result}var D=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)};function se(){}return Ge.Children={map:H,forEach:function(G,P,k){H(G,function(){P.apply(this,arguments)},k)},count:function(G){var P=0;return H(G,function(){P++}),P},toArray:function(G){return H(G,function(P){return P})||[]},only:function(G){if(!z(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},Ge.Component=T,Ge.Fragment=i,Ge.Profiler=s,Ge.PureComponent=N,Ge.StrictMode=a,Ge.Suspense=d,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ge.act=function(){throw Error("act(...) is not supported in production builds of React.")},Ge.cache=function(G){return function(){return G.apply(null,arguments)}},Ge.cloneElement=function(G,P,k){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var V=x({},G.props),Q=G.key,re=void 0;if(P!=null)for(de in P.ref!==void 0&&(re=void 0),P.key!==void 0&&(Q=""+P.key),P)!B.call(P,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&P.ref===void 0||(V[de]=P[de]);var de=arguments.length-2;if(de===1)V.children=k;else if(1<de){for(var ge=Array(de),le=0;le<de;le++)ge[le]=arguments[le+2];V.children=ge}return _(G.type,Q,void 0,void 0,re,V)},Ge.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:l,_context:G},G},Ge.createElement=function(G,P,k){var V,Q={},re=null;if(P!=null)for(V in P.key!==void 0&&(re=""+P.key),P)B.call(P,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(Q[V]=P[V]);var de=arguments.length-2;if(de===1)Q.children=k;else if(1<de){for(var ge=Array(de),le=0;le<de;le++)ge[le]=arguments[le+2];Q.children=ge}if(G&&G.defaultProps)for(V in de=G.defaultProps,de)Q[V]===void 0&&(Q[V]=de[V]);return _(G,re,void 0,void 0,null,Q)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(G){return{$$typeof:f,render:G}},Ge.isValidElement=z,Ge.lazy=function(G){return{$$typeof:m,_payload:{_status:-1,_result:G},_init:U}},Ge.memo=function(G,P){return{$$typeof:g,type:G,compare:P===void 0?null:P}},Ge.startTransition=function(G){var P=R.T,k={};R.T=k;try{var V=G(),Q=R.S;Q!==null&&Q(k,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(se,D)}catch(re){D(re)}finally{R.T=P}},Ge.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ge.use=function(G){return R.H.use(G)},Ge.useActionState=function(G,P,k){return R.H.useActionState(G,P,k)},Ge.useCallback=function(G,P){return R.H.useCallback(G,P)},Ge.useContext=function(G){return R.H.useContext(G)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(G,P){return R.H.useDeferredValue(G,P)},Ge.useEffect=function(G,P){return R.H.useEffect(G,P)},Ge.useId=function(){return R.H.useId()},Ge.useImperativeHandle=function(G,P,k){return R.H.useImperativeHandle(G,P,k)},Ge.useInsertionEffect=function(G,P){return R.H.useInsertionEffect(G,P)},Ge.useLayoutEffect=function(G,P){return R.H.useLayoutEffect(G,P)},Ge.useMemo=function(G,P){return R.H.useMemo(G,P)},Ge.useOptimistic=function(G,P){return R.H.useOptimistic(G,P)},Ge.useReducer=function(G,P,k){return R.H.useReducer(G,P,k)},Ge.useRef=function(G){return R.H.useRef(G)},Ge.useState=function(G){return R.H.useState(G)},Ge.useSyncExternalStore=function(G,P,k){return R.H.useSyncExternalStore(G,P,k)},Ge.useTransition=function(){return R.H.useTransition()},Ge.version="19.0.0",Ge}var Xv;function du(){return Xv||(Xv=1,Uf.exports=e_()),Uf.exports}var S=du();const bt=on(S),t_=Wx({__proto__:null,default:bt},[S]);var Bf={exports:{}},Po={},Ff={exports:{}},Hf={};/**
|
|
* @license React
|
|
* scheduler.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Zv;function n_(){return Zv||(Zv=1,function(r){function n(H,U){var D=H.length;H.push(U);e:for(;0<D;){var se=D-1>>>1,G=H[se];if(0<s(G,U))H[se]=U,H[D]=G,D=se;else break e}}function i(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var U=H[0],D=H.pop();if(D!==U){H[0]=D;e:for(var se=0,G=H.length,P=G>>>1;se<P;){var k=2*(se+1)-1,V=H[k],Q=k+1,re=H[Q];if(0>s(V,D))Q<G&&0>s(re,V)?(H[se]=re,H[Q]=D,se=Q):(H[se]=V,H[k]=D,se=k);else if(Q<G&&0>s(re,D))H[se]=re,H[Q]=D,se=Q;else break e}}return U}function s(H,U){var D=H.sortIndex-U.sortIndex;return D!==0?D:H.id-U.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;r.unstable_now=function(){return l.now()}}else{var c=Date,f=c.now();r.unstable_now=function(){return c.now()-f}}var d=[],g=[],m=1,v=null,y=3,b=!1,x=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(H){for(var U=i(g);U!==null;){if(U.callback===null)a(g);else if(U.startTime<=H)a(g),U.sortIndex=U.expirationTime,n(d,U);else break;U=i(g)}}function C(H){if(E=!1,L(H),!x)if(i(d)!==null)x=!0,J();else{var U=i(g);U!==null&&ae(C,U.startTime-H)}}var R=!1,B=-1,_=5,$=-1;function z(){return!(r.unstable_now()-$<_)}function F(){if(R){var H=r.unstable_now();$=H;var U=!0;try{e:{x=!1,E&&(E=!1,M(B),B=-1),b=!0;var D=y;try{t:{for(L(H),v=i(d);v!==null&&!(v.expirationTime>H&&z());){var se=v.callback;if(typeof se=="function"){v.callback=null,y=v.priorityLevel;var G=se(v.expirationTime<=H);if(H=r.unstable_now(),typeof G=="function"){v.callback=G,L(H),U=!0;break t}v===i(d)&&a(d),L(H)}else a(d);v=i(d)}if(v!==null)U=!0;else{var P=i(g);P!==null&&ae(C,P.startTime-H),U=!1}}break e}finally{v=null,y=D,b=!1}U=void 0}}finally{U?Y():R=!1}}}var Y;if(typeof N=="function")Y=function(){N(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,j=I.port2;I.port1.onmessage=F,Y=function(){j.postMessage(null)}}else Y=function(){T(F,0)};function J(){R||(R=!0,Y())}function ae(H,U){B=T(function(){H(r.unstable_now())},U)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(H){H.callback=null},r.unstable_continueExecution=function(){x||b||(x=!0,J())},r.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<H?Math.floor(1e3/H):5},r.unstable_getCurrentPriorityLevel=function(){return y},r.unstable_getFirstCallbackNode=function(){return i(d)},r.unstable_next=function(H){switch(y){case 1:case 2:case 3:var U=3;break;default:U=y}var D=y;y=U;try{return H()}finally{y=D}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(H,U){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var D=y;y=H;try{return U()}finally{y=D}},r.unstable_scheduleCallback=function(H,U,D){var se=r.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?se+D:se):D=se,H){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=D+G,H={id:m++,callback:U,priorityLevel:H,startTime:D,expirationTime:G,sortIndex:-1},D>se?(H.sortIndex=D,n(g,H),i(d)===null&&H===i(g)&&(E?(M(B),B=-1):E=!0,ae(C,D-se))):(H.sortIndex=G,n(d,H),x||b||(x=!0,J())),H},r.unstable_shouldYield=z,r.unstable_wrapCallback=function(H){var U=y;return function(){var D=y;y=U;try{return H.apply(this,arguments)}finally{y=D}}}}(Hf)),Hf}var Wv;function r_(){return Wv||(Wv=1,Ff.exports=n_()),Ff.exports}var Pf={exports:{}},Ut={};/**
|
|
* @license React
|
|
* react-dom.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Kv;function i_(){if(Kv)return Ut;Kv=1;var r=du();function n(d){var g="https://react.dev/errors/"+d;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)g+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(d,g,m){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:d,containerInfo:g,implementation:m}}var c=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,g){if(d==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ut.createPortal=function(d,g){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return l(d,g,null,m)},Ut.flushSync=function(d){var g=c.T,m=a.p;try{if(c.T=null,a.p=2,d)return d()}finally{c.T=g,a.p=m,a.d.f()}},Ut.preconnect=function(d,g){typeof d=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(d,g))},Ut.prefetchDNS=function(d){typeof d=="string"&&a.d.D(d)},Ut.preinit=function(d,g){if(typeof d=="string"&&g&&typeof g.as=="string"){var m=g.as,v=f(m,g.crossOrigin),y=typeof g.integrity=="string"?g.integrity:void 0,b=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;m==="style"?a.d.S(d,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:v,integrity:y,fetchPriority:b}):m==="script"&&a.d.X(d,{crossOrigin:v,integrity:y,fetchPriority:b,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ut.preinitModule=function(d,g){if(typeof d=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var m=f(g.as,g.crossOrigin);a.d.M(d,{crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&a.d.M(d)},Ut.preload=function(d,g){if(typeof d=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var m=g.as,v=f(m,g.crossOrigin);a.d.L(d,m,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ut.preloadModule=function(d,g){if(typeof d=="string")if(g){var m=f(g.as,g.crossOrigin);a.d.m(d,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:m,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else a.d.m(d)},Ut.requestFormReset=function(d){a.d.r(d)},Ut.unstable_batchedUpdates=function(d,g){return d(g)},Ut.useFormState=function(d,g,m){return c.H.useFormState(d,g,m)},Ut.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ut.version="19.0.0",Ut}var Qv;function o0(){if(Qv)return Pf.exports;Qv=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Pf.exports=i_(),Pf.exports}/**
|
|
* @license React
|
|
* react-dom-client.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Jv;function a_(){if(Jv)return Po;Jv=1;var r=r_(),n=du(),i=o0();function a(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+e+"; visit "+t+" 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)}var l=Symbol.for("react.element"),c=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),y=Symbol.for("react.consumer"),b=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),C=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function B(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var _=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case f:return"Portal";case m:return"Profiler";case g:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:return(e.displayName||"Context")+".Provider";case y:return(e._context.displayName||"Context")+".Consumer";case x:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.assign,Y,I;function j(e){if(Y===void 0)try{throw Error()}catch(o){var t=o.stack.trim().match(/\n( *(at )?)/);Y=t&&t[1]||"",I=-1<o.stack.indexOf(`
|
|
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
`+Y+e+I}var J=!1;function ae(e,t){if(!e||J)return"";J=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(t){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ie){var te=ie}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(ie){te=ie}e.call(ce.prototype)}}else{try{throw Error()}catch(ie){te=ie}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=u.DetermineComponentFrameRoot(),w=p[0],O=p[1];if(w&&O){var q=w.split(`
|
|
`),Z=O.split(`
|
|
`);for(h=u=0;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;for(;h<Z.length&&!Z[h].includes("DetermineComponentFrameRoot");)h++;if(u===q.length||h===Z.length)for(u=q.length-1,h=Z.length-1;1<=u&&0<=h&&q[u]!==Z[h];)h--;for(;1<=u&&0<=h;u--,h--)if(q[u]!==Z[h]){if(u!==1||h!==1)do if(u--,h--,0>h||q[u]!==Z[h]){var oe=`
|
|
`+q[u].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=u&&0<=h);break}}}finally{J=!1,Error.prepareStackTrace=o}return(o=e?e.displayName||e.name:"")?j(o):""}function H(e){switch(e.tag){case 26:case 27:case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 15:return e=ae(e.type,!1),e;case 11:return e=ae(e.type.render,!1),e;case 1:return e=ae(e.type,!0),e;default:return""}}function U(e){try{var t="";do t+=H(e),e=e.return;while(e);return t}catch(o){return`
|
|
Error generating stack: `+o.message+`
|
|
`+o.stack}}function D(e){var t=e,o=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(o=t.return),e=t.return;while(e)}return t.tag===3?o:null}function se(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function G(e){if(D(e)!==e)throw Error(a(188))}function P(e){var t=e.alternate;if(!t){if(t=D(e),t===null)throw Error(a(188));return t!==e?null:e}for(var o=e,u=t;;){var h=o.return;if(h===null)break;var p=h.alternate;if(p===null){if(u=h.return,u!==null){o=u;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===o)return G(h),e;if(p===u)return G(h),t;p=p.sibling}throw Error(a(188))}if(o.return!==u.return)o=h,u=p;else{for(var w=!1,O=h.child;O;){if(O===o){w=!0,o=h,u=p;break}if(O===u){w=!0,u=h,o=p;break}O=O.sibling}if(!w){for(O=p.child;O;){if(O===o){w=!0,o=p,u=h;break}if(O===u){w=!0,u=p,o=h;break}O=O.sibling}if(!w)throw Error(a(189))}}if(o.alternate!==u)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var V=Array.isArray,Q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},de=[],ge=-1;function le(e){return{current:e}}function xe(e){0>ge||(e.current=de[ge],de[ge]=null,ge--)}function pe(e,t){ge++,de[ge]=e.current,e.current=t}var Ae=le(null),Te=le(null),Le=le(null),ve=le(null);function he(e,t){switch(pe(Le,t),pe(Te,e),pe(Ae,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?wv(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=wv(e),t=Ev(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}xe(Ae),pe(Ae,t)}function K(){xe(Ae),xe(Te),xe(Le)}function Re(e){e.memoizedState!==null&&pe(ve,e);var t=Ae.current,o=Ev(t,e.type);t!==o&&(pe(Te,e),pe(Ae,o))}function Ve(e){Te.current===e&&(xe(Ae),xe(Te)),ve.current===e&&(xe(ve),Mo._currentValue=re)}var be=Object.prototype.hasOwnProperty,Se=r.unstable_scheduleCallback,ne=r.unstable_cancelCallback,et=r.unstable_shouldYield,ut=r.unstable_requestPaint,Ie=r.unstable_now,Et=r.unstable_getCurrentPriorityLevel,rt=r.unstable_ImmediatePriority,ct=r.unstable_UserBlockingPriority,Gt=r.unstable_NormalPriority,Ht=r.unstable_LowPriority,sn=r.unstable_IdlePriority,xn=r.log,ii=r.unstable_setDisableYieldValue,Mn=null,ft=null;function ji(e){if(ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Mn,e,void 0,(e.current.flags&128)===128)}catch{}}function Zt(e){if(typeof xn=="function"&&ii(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Mn,e)}catch{}}var Wt=Math.clz32?Math.clz32:G1,N1=Math.log,z1=Math.LN2;function G1(e){return e>>>=0,e===0?32:31-(N1(e)/z1|0)|0}var gs=128,ps=4194304;function ai(e){var t=e&42;if(t!==0)return t;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: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 e&4194176;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 ms(e,t){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,p=e.pingedLanes,w=e.warmLanes;e=e.finishedLanes!==0;var O=o&134217727;return O!==0?(o=O&~h,o!==0?u=ai(o):(p&=O,p!==0?u=ai(p):e||(w=O&~w,w!==0&&(u=ai(w))))):(O=o&~h,O!==0?u=ai(O):p!==0?u=ai(p):e||(w=o&~w,w!==0&&(u=ai(w)))),u===0?0:t!==0&&t!==u&&!(t&h)&&(h=u&-u,w=t&-t,h>=w||h===32&&(w&4194176)!==0)?t:u}function Va(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function M1(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64: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 t+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 dg(){var e=gs;return gs<<=1,!(gs&4194176)&&(gs=128),e}function hg(){var e=ps;return ps<<=1,!(ps&62914560)&&(ps=4194304),e}function ku(e){for(var t=[],o=0;31>o;o++)t.push(e);return t}function Ia(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function j1(e,t,o,u,h,p){var w=e.pendingLanes;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=o,e.entangledLanes&=o,e.errorRecoveryDisabledLanes&=o,e.shellSuspendCounter=0;var O=e.entanglements,q=e.expirationTimes,Z=e.hiddenUpdates;for(o=w&~o;0<o;){var oe=31-Wt(o),ce=1<<oe;O[oe]=0,q[oe]=-1;var te=Z[oe];if(te!==null)for(Z[oe]=null,oe=0;oe<te.length;oe++){var ie=te[oe];ie!==null&&(ie.lane&=-536870913)}o&=~ce}u!==0&&gg(e,u,0),p!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=p&~(w&~t))}function gg(e,t,o){e.pendingLanes|=t,e.suspendedLanes&=~t;var u=31-Wt(t);e.entangledLanes|=t,e.entanglements[u]=e.entanglements[u]|1073741824|o&4194218}function pg(e,t){var o=e.entangledLanes|=t;for(e=e.entanglements;o;){var u=31-Wt(o),h=1<<u;h&t|e[u]&t&&(e[u]|=t),o&=~h}}function mg(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vg(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Bv(e.type))}function U1(e,t){var o=Q.p;try{return Q.p=e,t()}finally{Q.p=o}}var Sr=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Sr,Pt="__reactProps$"+Sr,Ui="__reactContainer$"+Sr,Lu="__reactEvents$"+Sr,B1="__reactListeners$"+Sr,F1="__reactHandles$"+Sr,yg="__reactResources$"+Sr,Ya="__reactMarker$"+Sr;function Nu(e){delete e[Mt],delete e[Pt],delete e[Lu],delete e[B1],delete e[F1]}function oi(e){var t=e[Mt];if(t)return t;for(var o=e.parentNode;o;){if(t=o[Ui]||o[Mt]){if(o=t.alternate,t.child!==null||o!==null&&o.child!==null)for(e=_v(e);e!==null;){if(o=e[Mt])return o;e=_v(e)}return t}e=o,o=e.parentNode}return null}function Bi(e){if(e=e[Mt]||e[Ui]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Xa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Fi(e){var t=e[yg];return t||(t=e[yg]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function St(e){e[Ya]=!0}var bg=new Set,wg={};function si(e,t){Hi(e,t),Hi(e+"Capture",t)}function Hi(e,t){for(wg[e]=t,e=0;e<t.length;e++)bg.add(t[e])}var Wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H1=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]*$"),Eg={},Sg={};function P1(e){return be.call(Sg,e)?!0:be.call(Eg,e)?!1:H1.test(e)?Sg[e]=!0:(Eg[e]=!0,!1)}function vs(e,t,o){if(P1(t))if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var u=t.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+o)}}function ys(e,t,o){if(o===null)e.removeAttribute(t);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+o)}}function Kn(e,t,o,u){if(u===null)e.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(o);return}e.setAttributeNS(t,o,""+u)}}function ln(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $1(e){var t=xg(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),u=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,p=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return h.call(this)},set:function(w){u=""+w,p.call(this,w)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bs(e){e._valueTracker||(e._valueTracker=$1(e))}function _g(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),u="";return e&&(u=xg(e)?e.checked?"true":"false":e.value),e=u,e!==o?(t.setValue(e),!0):!1}function ws(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 q1=/[\n"\\]/g;function un(e){return e.replace(q1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zu(e,t,o,u,h,p,w,O){e.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.type=w:e.removeAttribute("type"),t!=null?w==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ln(t)):e.value!==""+ln(t)&&(e.value=""+ln(t)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),t!=null?Gu(e,w,ln(t)):o!=null?Gu(e,w,ln(o)):u!=null&&e.removeAttribute("value"),h==null&&p!=null&&(e.defaultChecked=!!p),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.name=""+ln(O):e.removeAttribute("name")}function Tg(e,t,o,u,h,p,w,O){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||t!=null))return;o=o!=null?""+ln(o):"",t=t!=null?""+ln(t):o,O||t===e.value||(e.value=t),e.defaultValue=t}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,e.checked=O?e.checked:!!u,e.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w)}function Gu(e,t,o){t==="number"&&ws(e.ownerDocument)===e||e.defaultValue===""+o||(e.defaultValue=""+o)}function Pi(e,t,o,u){if(e=e.options,t){t={};for(var h=0;h<o.length;h++)t["$"+o[h]]=!0;for(o=0;o<e.length;o++)h=t.hasOwnProperty("$"+e[o].value),e[o].selected!==h&&(e[o].selected=h),h&&u&&(e[o].defaultSelected=!0)}else{for(o=""+ln(o),t=null,h=0;h<e.length;h++){if(e[h].value===o){e[h].selected=!0,u&&(e[h].defaultSelected=!0);return}t!==null||e[h].disabled||(t=e[h])}t!==null&&(t.selected=!0)}}function Cg(e,t,o){if(t!=null&&(t=""+ln(t),t!==e.value&&(e.value=t),o==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=o!=null?""+ln(o):""}function Ag(e,t,o,u){if(t==null){if(u!=null){if(o!=null)throw Error(a(92));if(V(u)){if(1<u.length)throw Error(a(93));u=u[0]}o=u}o==null&&(o=""),t=o}o=ln(t),e.defaultValue=o,u=e.textContent,u===o&&u!==""&&u!==null&&(e.value=u)}function $i(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var V1=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 Rg(e,t,o){var u=t.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":u?e.setProperty(t,o):typeof o!="number"||o===0||V1.has(t)?t==="float"?e.cssFloat=o:e[t]=(""+o).trim():e[t]=o+"px"}function Dg(e,t,o){if(t!=null&&typeof t!="object")throw Error(a(62));if(e=e.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||t!=null&&t.hasOwnProperty(u)||(u.indexOf("--")===0?e.setProperty(u,""):u==="float"?e.cssFloat="":e[u]="");for(var h in t)u=t[h],t.hasOwnProperty(h)&&o[h]!==u&&Rg(e,h,u)}else for(var p in t)t.hasOwnProperty(p)&&Rg(e,p,t[p])}function Mu(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 I1=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"]]),Y1=/^[\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 Es(e){return Y1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var ju=null;function Uu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qi=null,Vi=null;function Og(e){var t=Bi(e);if(t&&(e=t.stateNode)){var o=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(zu(e,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),t=o.name,o.type==="radio"&&t!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+un(""+t)+'"][type="radio"]'),t=0;t<o.length;t++){var u=o[t];if(u!==e&&u.form===e.form){var h=u[Pt]||null;if(!h)throw Error(a(90));zu(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(t=0;t<o.length;t++)u=o[t],u.form===e.form&&_g(u)}break e;case"textarea":Cg(e,o.value,o.defaultValue);break e;case"select":t=o.value,t!=null&&Pi(e,!!o.multiple,t,!1)}}}var Bu=!1;function kg(e,t,o){if(Bu)return e(t,o);Bu=!0;try{var u=e(t);return u}finally{if(Bu=!1,(qi!==null||Vi!==null)&&(il(),qi&&(t=qi,e=Vi,Vi=qi=null,Og(t),e)))for(t=0;t<e.length;t++)Og(e[t])}}function Za(e,t){var o=e.stateNode;if(o===null)return null;var u=o[Pt]||null;if(u===null)return null;o=u[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(a(231,t,typeof o));return o}var Fu=!1;if(Wn)try{var Wa={};Object.defineProperty(Wa,"passive",{get:function(){Fu=!0}}),window.addEventListener("test",Wa,Wa),window.removeEventListener("test",Wa,Wa)}catch{Fu=!1}var xr=null,Hu=null,Ss=null;function Lg(){if(Ss)return Ss;var e,t=Hu,o=t.length,u,h="value"in xr?xr.value:xr.textContent,p=h.length;for(e=0;e<o&&t[e]===h[e];e++);var w=o-e;for(u=1;u<=w&&t[o-u]===h[p-u];u++);return Ss=h.slice(e,1<u?1-u:void 0)}function xs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _s(){return!0}function Ng(){return!1}function $t(e){function t(o,u,h,p,w){this._reactName=o,this._targetInst=h,this.type=u,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var O in e)e.hasOwnProperty(O)&&(o=e[O],this[O]=o?o(p):p[O]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?_s:Ng,this.isPropagationStopped=Ng,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=_s)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=_s)},persist:function(){},isPersistent:_s}),t}var li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ts=$t(li),Ka=F({},li,{view:0,detail:0}),X1=$t(Ka),Pu,$u,Qa,Cs=F({},Ka,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vu,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!==Qa&&(Qa&&e.type==="mousemove"?(Pu=e.screenX-Qa.screenX,$u=e.screenY-Qa.screenY):$u=Pu=0,Qa=e),Pu)},movementY:function(e){return"movementY"in e?e.movementY:$u}}),zg=$t(Cs),Z1=F({},Cs,{dataTransfer:0}),W1=$t(Z1),K1=F({},Ka,{relatedTarget:0}),qu=$t(K1),Q1=F({},li,{animationName:0,elapsedTime:0,pseudoElement:0}),J1=$t(Q1),eS=F({},li,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tS=$t(eS),nS=F({},li,{data:0}),Gg=$t(nS),rS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iS={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"},aS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=aS[e])?!!t[e]:!1}function Vu(){return oS}var sS=F({},Ka,{key:function(e){if(e.key){var t=rS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?iS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vu,charCode:function(e){return e.type==="keypress"?xs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lS=$t(sS),uS=F({},Cs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mg=$t(uS),cS=F({},Ka,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vu}),fS=$t(cS),dS=F({},li,{propertyName:0,elapsedTime:0,pseudoElement:0}),hS=$t(dS),gS=F({},Cs,{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}),pS=$t(gS),mS=F({},li,{newState:0,oldState:0}),vS=$t(mS),yS=[9,13,27,32],Iu=Wn&&"CompositionEvent"in window,Ja=null;Wn&&"documentMode"in document&&(Ja=document.documentMode);var bS=Wn&&"TextEvent"in window&&!Ja,jg=Wn&&(!Iu||Ja&&8<Ja&&11>=Ja),Ug=" ",Bg=!1;function Fg(e,t){switch(e){case"keyup":return yS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ii=!1;function wS(e,t){switch(e){case"compositionend":return Hg(t);case"keypress":return t.which!==32?null:(Bg=!0,Ug);case"textInput":return e=t.data,e===Ug&&Bg?null:e;default:return null}}function ES(e,t){if(Ii)return e==="compositionend"||!Iu&&Fg(e,t)?(e=Lg(),Ss=Hu=xr=null,Ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jg&&t.locale!=="ko"?null:t.data;default:return null}}var SS={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 Pg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!SS[e.type]:t==="textarea"}function $g(e,t,o,u){qi?Vi?Vi.push(u):Vi=[u]:qi=u,t=ul(t,"onChange"),0<t.length&&(o=new Ts("onChange","change",null,o,u),e.push({event:o,listeners:t}))}var eo=null,to=null;function xS(e){pv(e,0)}function As(e){var t=Xa(e);if(_g(t))return e}function qg(e,t){if(e==="change")return t}var Vg=!1;if(Wn){var Yu;if(Wn){var Xu="oninput"in document;if(!Xu){var Ig=document.createElement("div");Ig.setAttribute("oninput","return;"),Xu=typeof Ig.oninput=="function"}Yu=Xu}else Yu=!1;Vg=Yu&&(!document.documentMode||9<document.documentMode)}function Yg(){eo&&(eo.detachEvent("onpropertychange",Xg),to=eo=null)}function Xg(e){if(e.propertyName==="value"&&As(to)){var t=[];$g(t,to,e,Uu(e)),kg(xS,t)}}function _S(e,t,o){e==="focusin"?(Yg(),eo=t,to=o,eo.attachEvent("onpropertychange",Xg)):e==="focusout"&&Yg()}function TS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(to)}function CS(e,t){if(e==="click")return As(t)}function AS(e,t){if(e==="input"||e==="change")return As(t)}function RS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kt=typeof Object.is=="function"?Object.is:RS;function no(e,t){if(Kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var o=Object.keys(e),u=Object.keys(t);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var h=o[u];if(!be.call(t,h)||!Kt(e[h],t[h]))return!1}return!0}function Zg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wg(e,t){var o=Zg(e);e=0;for(var u;o;){if(o.nodeType===3){if(u=e+o.textContent.length,e<=t&&u>=t)return{node:o,offset:t-e};e=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Zg(o)}}function Kg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ws(e.document);t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=ws(e.document)}return t}function Zu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function DS(e,t){var o=Qg(t);t=e.focusedElem;var u=e.selectionRange;if(o!==t&&t&&t.ownerDocument&&Kg(t.ownerDocument.documentElement,t)){if(u!==null&&Zu(t)){if(e=u.start,o=u.end,o===void 0&&(o=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(o,t.value.length);else if(o=(e=t.ownerDocument||document)&&e.defaultView||window,o.getSelection){o=o.getSelection();var h=t.textContent.length,p=Math.min(u.start,h);u=u.end===void 0?p:Math.min(u.end,h),!o.extend&&p>u&&(h=u,u=p,p=h),h=Wg(t,p);var w=Wg(t,u);h&&w&&(o.rangeCount!==1||o.anchorNode!==h.node||o.anchorOffset!==h.offset||o.focusNode!==w.node||o.focusOffset!==w.offset)&&(e=e.createRange(),e.setStart(h.node,h.offset),o.removeAllRanges(),p>u?(o.addRange(e),o.extend(w.node,w.offset)):(e.setEnd(w.node,w.offset),o.addRange(e)))}}for(e=[],o=t;o=o.parentNode;)o.nodeType===1&&e.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)o=e[t],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var OS=Wn&&"documentMode"in document&&11>=document.documentMode,Yi=null,Wu=null,ro=null,Ku=!1;function Jg(e,t,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ku||Yi==null||Yi!==ws(u)||(u=Yi,"selectionStart"in u&&Zu(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ro&&no(ro,u)||(ro=u,u=ul(Wu,"onSelect"),0<u.length&&(t=new Ts("onSelect","select",null,t,o),e.push({event:t,listeners:u}),t.target=Yi)))}function ui(e,t){var o={};return o[e.toLowerCase()]=t.toLowerCase(),o["Webkit"+e]="webkit"+t,o["Moz"+e]="moz"+t,o}var Xi={animationend:ui("Animation","AnimationEnd"),animationiteration:ui("Animation","AnimationIteration"),animationstart:ui("Animation","AnimationStart"),transitionrun:ui("Transition","TransitionRun"),transitionstart:ui("Transition","TransitionStart"),transitioncancel:ui("Transition","TransitionCancel"),transitionend:ui("Transition","TransitionEnd")},Qu={},ep={};Wn&&(ep=document.createElement("div").style,"AnimationEvent"in window||(delete Xi.animationend.animation,delete Xi.animationiteration.animation,delete Xi.animationstart.animation),"TransitionEvent"in window||delete Xi.transitionend.transition);function ci(e){if(Qu[e])return Qu[e];if(!Xi[e])return e;var t=Xi[e],o;for(o in t)if(t.hasOwnProperty(o)&&o in ep)return Qu[e]=t[o];return e}var tp=ci("animationend"),np=ci("animationiteration"),rp=ci("animationstart"),kS=ci("transitionrun"),LS=ci("transitionstart"),NS=ci("transitioncancel"),ip=ci("transitionend"),ap=new Map,op="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 scrollEnd toggle touchMove waiting wheel".split(" ");function _n(e,t){ap.set(e,t),si(t,[e])}var cn=[],Zi=0,Ju=0;function Rs(){for(var e=Zi,t=Ju=Zi=0;t<e;){var o=cn[t];cn[t++]=null;var u=cn[t];cn[t++]=null;var h=cn[t];cn[t++]=null;var p=cn[t];if(cn[t++]=null,u!==null&&h!==null){var w=u.pending;w===null?h.next=h:(h.next=w.next,w.next=h),u.pending=h}p!==0&&sp(o,h,p)}}function Ds(e,t,o,u){cn[Zi++]=e,cn[Zi++]=t,cn[Zi++]=o,cn[Zi++]=u,Ju|=u,e.lanes|=u,e=e.alternate,e!==null&&(e.lanes|=u)}function ec(e,t,o,u){return Ds(e,t,o,u),Os(e)}function _r(e,t){return Ds(e,null,null,t),Os(e)}function sp(e,t,o){e.lanes|=o;var u=e.alternate;u!==null&&(u.lanes|=o);for(var h=!1,p=e.return;p!==null;)p.childLanes|=o,u=p.alternate,u!==null&&(u.childLanes|=o),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(h=!0)),e=p,p=p.return;h&&t!==null&&e.tag===3&&(p=e.stateNode,h=31-Wt(o),p=p.hiddenUpdates,e=p[h],e===null?p[h]=[t]:e.push(t),t.lane=o|536870912)}function Os(e){if(50<Do)throw Do=0,sf=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Wi={},lp=new WeakMap;function fn(e,t){if(typeof e=="object"&&e!==null){var o=lp.get(e);return o!==void 0?o:(t={value:e,source:t,stack:U(t)},lp.set(e,t),t)}return{value:e,source:t,stack:U(t)}}var Ki=[],Qi=0,ks=null,Ls=0,dn=[],hn=0,fi=null,Qn=1,Jn="";function di(e,t){Ki[Qi++]=Ls,Ki[Qi++]=ks,ks=e,Ls=t}function up(e,t,o){dn[hn++]=Qn,dn[hn++]=Jn,dn[hn++]=fi,fi=e;var u=Qn;e=Jn;var h=32-Wt(u)-1;u&=~(1<<h),o+=1;var p=32-Wt(t)+h;if(30<p){var w=h-h%5;p=(u&(1<<w)-1).toString(32),u>>=w,h-=w,Qn=1<<32-Wt(t)+h|o<<h|u,Jn=p+e}else Qn=1<<p|o<<h|u,Jn=e}function tc(e){e.return!==null&&(di(e,1),up(e,1,0))}function nc(e){for(;e===ks;)ks=Ki[--Qi],Ki[Qi]=null,Ls=Ki[--Qi],Ki[Qi]=null;for(;e===fi;)fi=dn[--hn],dn[hn]=null,Jn=dn[--hn],dn[hn]=null,Qn=dn[--hn],dn[hn]=null}var Bt=null,Dt=null,$e=!1,Tn=null,jn=!1,rc=Error(a(519));function hi(e){var t=Error(a(418,""));throw oo(fn(t,e)),rc}function cp(e){var t=e.stateNode,o=e.type,u=e.memoizedProps;switch(t[Mt]=e,t[Pt]=u,o){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(o=0;o<ko.length;o++)Fe(ko[o],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),Tg(t,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0),bs(t);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),Ag(t,u.value,u.defaultValue,u.children),bs(t)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||t.textContent===""+o||u.suppressHydrationWarning===!0||bv(t.textContent,o)?(u.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),u.onScroll!=null&&Fe("scroll",t),u.onScrollEnd!=null&&Fe("scrollend",t),u.onClick!=null&&(t.onclick=cl),t=!0):t=!1,t||hi(e)}function fp(e){for(Bt=e.return;Bt;)switch(Bt.tag){case 3:case 27:jn=!0;return;case 5:case 13:jn=!1;return;default:Bt=Bt.return}}function io(e){if(e!==Bt)return!1;if(!$e)return fp(e),$e=!0,!1;var t=!1,o;if((o=e.tag!==3&&e.tag!==27)&&((o=e.tag===5)&&(o=e.type,o=!(o!=="form"&&o!=="button")||_f(e.type,e.memoizedProps)),o=!o),o&&(t=!0),t&&Dt&&hi(e),fp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(o=e.data,o==="/$"){if(t===0){Dt=An(e.nextSibling);break e}t--}else o!=="$"&&o!=="$!"&&o!=="$?"||t++;e=e.nextSibling}Dt=null}}else Dt=Bt?An(e.stateNode.nextSibling):null;return!0}function ao(){Dt=Bt=null,$e=!1}function oo(e){Tn===null?Tn=[e]:Tn.push(e)}var so=Error(a(460)),dp=Error(a(474)),ic={then:function(){}};function hp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ns(){}function gp(e,t,o){switch(o=e[o],o===void 0?e.push(t):o!==t&&(t.then(Ns,Ns),t=o),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===so?Error(a(483)):e;default:if(typeof t.status=="string")t.then(Ns,Ns);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status="pending",e.then(function(u){if(t.status==="pending"){var h=t;h.status="fulfilled",h.value=u}},function(u){if(t.status==="pending"){var h=t;h.status="rejected",h.reason=u}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===so?Error(a(483)):e}throw lo=t,so}}var lo=null;function pp(){if(lo===null)throw Error(a(459));var e=lo;return lo=null,e}var Ji=null,uo=0;function zs(e){var t=uo;return uo+=1,Ji===null&&(Ji=[]),gp(Ji,e,t)}function co(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Gs(e,t){throw t.$$typeof===l?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function mp(e){var t=e._init;return t(e._payload)}function vp(e){function t(W,X){if(e){var ee=W.deletions;ee===null?(W.deletions=[X],W.flags|=16):ee.push(X)}}function o(W,X){if(!e)return null;for(;X!==null;)t(W,X),X=X.sibling;return null}function u(W){for(var X=new Map;W!==null;)W.key!==null?X.set(W.key,W):X.set(W.index,W),W=W.sibling;return X}function h(W,X){return W=Mr(W,X),W.index=0,W.sibling=null,W}function p(W,X,ee){return W.index=ee,e?(ee=W.alternate,ee!==null?(ee=ee.index,ee<X?(W.flags|=33554434,X):ee):(W.flags|=33554434,X)):(W.flags|=1048576,X)}function w(W){return e&&W.alternate===null&&(W.flags|=33554434),W}function O(W,X,ee,ue){return X===null||X.tag!==6?(X=Qc(ee,W.mode,ue),X.return=W,X):(X=h(X,ee),X.return=W,X)}function q(W,X,ee,ue){var Ce=ee.type;return Ce===d?oe(W,X,ee.props.children,ue,ee.key):X!==null&&(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===N&&mp(Ce)===X.type)?(X=h(X,ee.props),co(X,ee),X.return=W,X):(X=Js(ee.type,ee.key,ee.props,null,W.mode,ue),co(X,ee),X.return=W,X)}function Z(W,X,ee,ue){return X===null||X.tag!==4||X.stateNode.containerInfo!==ee.containerInfo||X.stateNode.implementation!==ee.implementation?(X=Jc(ee,W.mode,ue),X.return=W,X):(X=h(X,ee.children||[]),X.return=W,X)}function oe(W,X,ee,ue,Ce){return X===null||X.tag!==7?(X=xi(ee,W.mode,ue,Ce),X.return=W,X):(X=h(X,ee),X.return=W,X)}function ce(W,X,ee){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Qc(""+X,W.mode,ee),X.return=W,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case c:return ee=Js(X.type,X.key,X.props,null,W.mode,ee),co(ee,X),ee.return=W,ee;case f:return X=Jc(X,W.mode,ee),X.return=W,X;case N:var ue=X._init;return X=ue(X._payload),ce(W,X,ee)}if(V(X)||B(X))return X=xi(X,W.mode,ee,null),X.return=W,X;if(typeof X.then=="function")return ce(W,zs(X),ee);if(X.$$typeof===b)return ce(W,Ws(W,X),ee);Gs(W,X)}return null}function te(W,X,ee,ue){var Ce=X!==null?X.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Ce!==null?null:O(W,X,""+ee,ue);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case c:return ee.key===Ce?q(W,X,ee,ue):null;case f:return ee.key===Ce?Z(W,X,ee,ue):null;case N:return Ce=ee._init,ee=Ce(ee._payload),te(W,X,ee,ue)}if(V(ee)||B(ee))return Ce!==null?null:oe(W,X,ee,ue,null);if(typeof ee.then=="function")return te(W,X,zs(ee),ue);if(ee.$$typeof===b)return te(W,X,Ws(W,ee),ue);Gs(W,ee)}return null}function ie(W,X,ee,ue,Ce){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return W=W.get(ee)||null,O(X,W,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case c:return W=W.get(ue.key===null?ee:ue.key)||null,q(X,W,ue,Ce);case f:return W=W.get(ue.key===null?ee:ue.key)||null,Z(X,W,ue,Ce);case N:var je=ue._init;return ue=je(ue._payload),ie(W,X,ee,ue,Ce)}if(V(ue)||B(ue))return W=W.get(ee)||null,oe(X,W,ue,Ce,null);if(typeof ue.then=="function")return ie(W,X,ee,zs(ue),Ce);if(ue.$$typeof===b)return ie(W,X,ee,Ws(X,ue),Ce);Gs(X,ue)}return null}function De(W,X,ee,ue){for(var Ce=null,je=null,Oe=X,Ne=X=0,Tt=null;Oe!==null&&Ne<ee.length;Ne++){Oe.index>Ne?(Tt=Oe,Oe=null):Tt=Oe.sibling;var qe=te(W,Oe,ee[Ne],ue);if(qe===null){Oe===null&&(Oe=Tt);break}e&&Oe&&qe.alternate===null&&t(W,Oe),X=p(qe,X,Ne),je===null?Ce=qe:je.sibling=qe,je=qe,Oe=Tt}if(Ne===ee.length)return o(W,Oe),$e&&di(W,Ne),Ce;if(Oe===null){for(;Ne<ee.length;Ne++)Oe=ce(W,ee[Ne],ue),Oe!==null&&(X=p(Oe,X,Ne),je===null?Ce=Oe:je.sibling=Oe,je=Oe);return $e&&di(W,Ne),Ce}for(Oe=u(Oe);Ne<ee.length;Ne++)Tt=ie(Oe,W,Ne,ee[Ne],ue),Tt!==null&&(e&&Tt.alternate!==null&&Oe.delete(Tt.key===null?Ne:Tt.key),X=p(Tt,X,Ne),je===null?Ce=Tt:je.sibling=Tt,je=Tt);return e&&Oe.forEach(function($r){return t(W,$r)}),$e&&di(W,Ne),Ce}function ze(W,X,ee,ue){if(ee==null)throw Error(a(151));for(var Ce=null,je=null,Oe=X,Ne=X=0,Tt=null,qe=ee.next();Oe!==null&&!qe.done;Ne++,qe=ee.next()){Oe.index>Ne?(Tt=Oe,Oe=null):Tt=Oe.sibling;var $r=te(W,Oe,qe.value,ue);if($r===null){Oe===null&&(Oe=Tt);break}e&&Oe&&$r.alternate===null&&t(W,Oe),X=p($r,X,Ne),je===null?Ce=$r:je.sibling=$r,je=$r,Oe=Tt}if(qe.done)return o(W,Oe),$e&&di(W,Ne),Ce;if(Oe===null){for(;!qe.done;Ne++,qe=ee.next())qe=ce(W,qe.value,ue),qe!==null&&(X=p(qe,X,Ne),je===null?Ce=qe:je.sibling=qe,je=qe);return $e&&di(W,Ne),Ce}for(Oe=u(Oe);!qe.done;Ne++,qe=ee.next())qe=ie(Oe,W,Ne,qe.value,ue),qe!==null&&(e&&qe.alternate!==null&&Oe.delete(qe.key===null?Ne:qe.key),X=p(qe,X,Ne),je===null?Ce=qe:je.sibling=qe,je=qe);return e&&Oe.forEach(function(Yx){return t(W,Yx)}),$e&&di(W,Ne),Ce}function lt(W,X,ee,ue){if(typeof ee=="object"&&ee!==null&&ee.type===d&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case c:e:{for(var Ce=ee.key;X!==null;){if(X.key===Ce){if(Ce=ee.type,Ce===d){if(X.tag===7){o(W,X.sibling),ue=h(X,ee.props.children),ue.return=W,W=ue;break e}}else if(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===N&&mp(Ce)===X.type){o(W,X.sibling),ue=h(X,ee.props),co(ue,ee),ue.return=W,W=ue;break e}o(W,X);break}else t(W,X);X=X.sibling}ee.type===d?(ue=xi(ee.props.children,W.mode,ue,ee.key),ue.return=W,W=ue):(ue=Js(ee.type,ee.key,ee.props,null,W.mode,ue),co(ue,ee),ue.return=W,W=ue)}return w(W);case f:e:{for(Ce=ee.key;X!==null;){if(X.key===Ce)if(X.tag===4&&X.stateNode.containerInfo===ee.containerInfo&&X.stateNode.implementation===ee.implementation){o(W,X.sibling),ue=h(X,ee.children||[]),ue.return=W,W=ue;break e}else{o(W,X);break}else t(W,X);X=X.sibling}ue=Jc(ee,W.mode,ue),ue.return=W,W=ue}return w(W);case N:return Ce=ee._init,ee=Ce(ee._payload),lt(W,X,ee,ue)}if(V(ee))return De(W,X,ee,ue);if(B(ee)){if(Ce=B(ee),typeof Ce!="function")throw Error(a(150));return ee=Ce.call(ee),ze(W,X,ee,ue)}if(typeof ee.then=="function")return lt(W,X,zs(ee),ue);if(ee.$$typeof===b)return lt(W,X,Ws(W,ee),ue);Gs(W,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,X!==null&&X.tag===6?(o(W,X.sibling),ue=h(X,ee),ue.return=W,W=ue):(o(W,X),ue=Qc(ee,W.mode,ue),ue.return=W,W=ue),w(W)):o(W,X)}return function(W,X,ee,ue){try{uo=0;var Ce=lt(W,X,ee,ue);return Ji=null,Ce}catch(Oe){if(Oe===so)throw Oe;var je=vn(29,Oe,null,W.mode);return je.lanes=ue,je.return=W,je}finally{}}}var gi=vp(!0),yp=vp(!1),ea=le(null),Ms=le(0);function bp(e,t){e=cr,pe(Ms,e),pe(ea,t),cr=e|t.baseLanes}function ac(){pe(Ms,cr),pe(ea,ea.current)}function oc(){cr=Ms.current,xe(ea),xe(Ms)}var gn=le(null),Un=null;function Tr(e){var t=e.alternate;pe(vt,vt.current&1),pe(gn,e),Un===null&&(t===null||ea.current!==null||t.memoizedState!==null)&&(Un=e)}function wp(e){if(e.tag===22){if(pe(vt,vt.current),pe(gn,e),Un===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Un=e)}}else Cr()}function Cr(){pe(vt,vt.current),pe(gn,gn.current)}function er(e){xe(gn),Un===e&&(Un=null),xe(vt)}var vt=le(0);function js(e){for(var t=e;t!==null;){if(t.tag===13){var o=t.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(o,u){e.push(u)}};this.abort=function(){t.aborted=!0,e.forEach(function(o){return o()})}},GS=r.unstable_scheduleCallback,MS=r.unstable_NormalPriority,yt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sc(){return{controller:new zS,data:new Map,refCount:0}}function fo(e){e.refCount--,e.refCount===0&&GS(MS,function(){e.controller.abort()})}var ho=null,lc=0,ta=0,na=null;function jS(e,t){if(ho===null){var o=ho=[];lc=0,ta=pf(),na={status:"pending",value:void 0,then:function(u){o.push(u)}}}return lc++,t.then(Ep,Ep),t}function Ep(){if(--lc===0&&ho!==null){na!==null&&(na.status="fulfilled");var e=ho;ho=null,ta=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function US(e,t){var o=[],u={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return e.then(function(){u.status="fulfilled",u.value=t;for(var h=0;h<o.length;h++)(0,o[h])(t)},function(h){for(u.status="rejected",u.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),u}var Sp=z.S;z.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&jS(e,t),Sp!==null&&Sp(e,t)};var pi=le(null);function uc(){var e=pi.current;return e!==null?e:tt.pooledCache}function Us(e,t){t===null?pe(pi,pi.current):pe(pi,t.pool)}function xp(){var e=uc();return e===null?null:{parent:yt._currentValue,pool:e}}var Ar=0,Me=null,Ze=null,gt=null,Bs=!1,ra=!1,mi=!1,Fs=0,go=0,ia=null,BS=0;function dt(){throw Error(a(321))}function cc(e,t){if(t===null)return!1;for(var o=0;o<t.length&&o<e.length;o++)if(!Kt(e[o],t[o]))return!1;return!0}function fc(e,t,o,u,h,p){return Ar=p,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?vi:Rr,mi=!1,p=o(u,h),mi=!1,ra&&(p=Tp(t,o,u,h)),_p(e),p}function _p(e){z.H=Bn;var t=Ze!==null&&Ze.next!==null;if(Ar=0,gt=Ze=Me=null,Bs=!1,go=0,ia=null,t)throw Error(a(300));e===null||xt||(e=e.dependencies,e!==null&&Zs(e)&&(xt=!0))}function Tp(e,t,o,u){Me=e;var h=0;do{if(ra&&(ia=null),go=0,ra=!1,25<=h)throw Error(a(301));if(h+=1,gt=Ze=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}z.H=yi,p=t(o,u)}while(ra);return p}function FS(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?po(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Me.flags|=1024),t}function dc(){var e=Fs!==0;return Fs=0,e}function hc(e,t,o){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o}function gc(e){if(Bs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bs=!1}Ar=0,gt=Ze=Me=null,ra=!1,go=Fs=0,ia=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Me.memoizedState=gt=e:gt=gt.next=e,gt}function pt(){if(Ze===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=gt===null?Me.memoizedState:gt.next;if(t!==null)gt=t,Ze=e;else{if(e===null)throw Me.alternate===null?Error(a(467)):Error(a(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},gt===null?Me.memoizedState=gt=e:gt=gt.next=e}return gt}var Hs;Hs=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function po(e){var t=go;return go+=1,ia===null&&(ia=[]),e=gp(ia,e,t),t=Me,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?vi:Rr),e}function Ps(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return po(e);if(e.$$typeof===b)return jt(e)}throw Error(a(438,String(e)))}function pc(e){var t=null,o=Me.updateQueue;if(o!==null&&(t=o.memoCache),t==null){var u=Me.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(t={data:u.data.map(function(h){return h.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),o===null&&(o=Hs(),Me.updateQueue=o),o.memoCache=t,o=t.data[t.index],o===void 0)for(o=t.data[t.index]=Array(e),u=0;u<e;u++)o[u]=C;return t.index++,o}function tr(e,t){return typeof t=="function"?t(e):t}function $s(e){var t=pt();return mc(t,Ze,e)}function mc(e,t,o){var u=e.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=o;var h=e.baseQueue,p=u.pending;if(p!==null){if(h!==null){var w=h.next;h.next=p.next,p.next=w}t.baseQueue=h=p,u.pending=null}if(p=e.baseState,h===null)e.memoizedState=p;else{t=h.next;var O=w=null,q=null,Z=t,oe=!1;do{var ce=Z.lane&-536870913;if(ce!==Z.lane?(He&ce)===ce:(Ar&ce)===ce){var te=Z.revertLane;if(te===0)q!==null&&(q=q.next={lane:0,revertLane:0,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),ce===ta&&(oe=!0);else if((Ar&te)===te){Z=Z.next,te===ta&&(oe=!0);continue}else ce={lane:0,revertLane:Z.revertLane,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},q===null?(O=q=ce,w=p):q=q.next=ce,Me.lanes|=te,jr|=te;ce=Z.action,mi&&o(p,ce),p=Z.hasEagerState?Z.eagerState:o(p,ce)}else te={lane:ce,revertLane:Z.revertLane,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},q===null?(O=q=te,w=p):q=q.next=te,Me.lanes|=ce,jr|=ce;Z=Z.next}while(Z!==null&&Z!==t);if(q===null?w=p:q.next=O,!Kt(p,e.memoizedState)&&(xt=!0,oe&&(o=na,o!==null)))throw o;e.memoizedState=p,e.baseState=w,e.baseQueue=q,u.lastRenderedState=p}return h===null&&(u.lanes=0),[e.memoizedState,u.dispatch]}function vc(e){var t=pt(),o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=e;var u=o.dispatch,h=o.pending,p=t.memoizedState;if(h!==null){o.pending=null;var w=h=h.next;do p=e(p,w.action),w=w.next;while(w!==h);Kt(p,t.memoizedState)||(xt=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),o.lastRenderedState=p}return[p,u]}function Cp(e,t,o){var u=Me,h=pt(),p=$e;if(p){if(o===void 0)throw Error(a(407));o=o()}else o=t();var w=!Kt((Ze||h).memoizedState,o);if(w&&(h.memoizedState=o,xt=!0),h=h.queue,wc(Dp.bind(null,u,h,e),[e]),h.getSnapshot!==t||w||gt!==null&>.memoizedState.tag&1){if(u.flags|=2048,aa(9,Rp.bind(null,u,h,o,t),{destroy:void 0},null),tt===null)throw Error(a(349));p||Ar&60||Ap(u,t,o)}return o}function Ap(e,t,o){e.flags|=16384,e={getSnapshot:t,value:o},t=Me.updateQueue,t===null?(t=Hs(),Me.updateQueue=t,t.stores=[e]):(o=t.stores,o===null?t.stores=[e]:o.push(e))}function Rp(e,t,o,u){t.value=o,t.getSnapshot=u,Op(t)&&kp(e)}function Dp(e,t,o){return o(function(){Op(t)&&kp(e)})}function Op(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!Kt(e,o)}catch{return!0}}function kp(e){var t=_r(e,2);t!==null&&Ft(t,e,2)}function yc(e){var t=qt();if(typeof e=="function"){var o=e;if(e=o(),mi){Zt(!0);try{o()}finally{Zt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:e},t}function Lp(e,t,o,u){return e.baseState=o,mc(e,Ze,typeof u=="function"?u:tr)}function HS(e,t,o,u,h){if(Is(e))throw Error(a(485));if(e=t.action,e!==null){var p={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){p.listeners.push(w)}};z.T!==null?o(!0):p.isTransition=!1,u(p),o=t.pending,o===null?(p.next=t.pending=p,Np(t,p)):(p.next=o.next,t.pending=o.next=p)}}function Np(e,t){var o=t.action,u=t.payload,h=e.state;if(t.isTransition){var p=z.T,w={};z.T=w;try{var O=o(h,u),q=z.S;q!==null&&q(w,O),zp(e,t,O)}catch(Z){bc(e,t,Z)}finally{z.T=p}}else try{p=o(h,u),zp(e,t,p)}catch(Z){bc(e,t,Z)}}function zp(e,t,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){Gp(e,t,u)},function(u){return bc(e,t,u)}):Gp(e,t,o)}function Gp(e,t,o){t.status="fulfilled",t.value=o,Mp(t),e.state=o,t=e.pending,t!==null&&(o=t.next,o===t?e.pending=null:(o=o.next,t.next=o,Np(e,o)))}function bc(e,t,o){var u=e.pending;if(e.pending=null,u!==null){u=u.next;do t.status="rejected",t.reason=o,Mp(t),t=t.next;while(t!==u)}e.action=null}function Mp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jp(e,t){return t}function Up(e,t){if($e){var o=tt.formState;if(o!==null){e:{var u=Me;if($e){if(Dt){t:{for(var h=Dt,p=jn;h.nodeType!==8;){if(!p){h=null;break t}if(h=An(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){Dt=An(h.nextSibling),u=h.data==="F!";break e}}hi(u)}u=!1}u&&(t=o[0])}}return o=qt(),o.memoizedState=o.baseState=t,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jp,lastRenderedState:t},o.queue=u,o=nm.bind(null,Me,u),u.dispatch=o,u=yc(!1),p=Tc.bind(null,Me,!1,u.queue),u=qt(),h={state:t,dispatch:null,action:e,pending:null},u.queue=h,o=HS.bind(null,Me,h,p,o),h.dispatch=o,u.memoizedState=e,[t,o,!1]}function Bp(e){var t=pt();return Fp(t,Ze,e)}function Fp(e,t,o){t=mc(e,t,jp)[0],e=$s(tr)[0],t=typeof t=="object"&&t!==null&&typeof t.then=="function"?po(t):t;var u=pt(),h=u.queue,p=h.dispatch;return o!==u.memoizedState&&(Me.flags|=2048,aa(9,PS.bind(null,h,o),{destroy:void 0},null)),[t,p,e]}function PS(e,t){e.action=t}function Hp(e){var t=pt(),o=Ze;if(o!==null)return Fp(t,o,e);pt(),t=t.memoizedState,o=pt();var u=o.queue.dispatch;return o.memoizedState=e,[t,u,!1]}function aa(e,t,o,u){return e={tag:e,create:t,inst:o,deps:u,next:null},t=Me.updateQueue,t===null&&(t=Hs(),Me.updateQueue=t),o=t.lastEffect,o===null?t.lastEffect=e.next=e:(u=o.next,o.next=e,e.next=u,t.lastEffect=e),e}function Pp(){return pt().memoizedState}function qs(e,t,o,u){var h=qt();Me.flags|=e,h.memoizedState=aa(1|t,o,{destroy:void 0},u===void 0?null:u)}function Vs(e,t,o,u){var h=pt();u=u===void 0?null:u;var p=h.memoizedState.inst;Ze!==null&&u!==null&&cc(u,Ze.memoizedState.deps)?h.memoizedState=aa(t,o,p,u):(Me.flags|=e,h.memoizedState=aa(1|t,o,p,u))}function $p(e,t){qs(8390656,8,e,t)}function wc(e,t){Vs(2048,8,e,t)}function qp(e,t){return Vs(4,2,e,t)}function Vp(e,t){return Vs(4,4,e,t)}function Ip(e,t){if(typeof t=="function"){e=e();var o=t(e);return function(){typeof o=="function"?o():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Yp(e,t,o){o=o!=null?o.concat([e]):null,Vs(4,4,Ip.bind(null,t,e),o)}function Ec(){}function Xp(e,t){var o=pt();t=t===void 0?null:t;var u=o.memoizedState;return t!==null&&cc(t,u[1])?u[0]:(o.memoizedState=[e,t],e)}function Zp(e,t){var o=pt();t=t===void 0?null:t;var u=o.memoizedState;if(t!==null&&cc(t,u[1]))return u[0];if(u=e(),mi){Zt(!0);try{e()}finally{Zt(!1)}}return o.memoizedState=[u,t],u}function Sc(e,t,o){return o===void 0||Ar&1073741824?e.memoizedState=t:(e.memoizedState=o,e=Km(),Me.lanes|=e,jr|=e,o)}function Wp(e,t,o,u){return Kt(o,t)?o:ea.current!==null?(e=Sc(e,o,u),Kt(e,t)||(xt=!0),e):Ar&42?(e=Km(),Me.lanes|=e,jr|=e,t):(xt=!0,e.memoizedState=o)}function Kp(e,t,o,u,h){var p=Q.p;Q.p=p!==0&&8>p?p:8;var w=z.T,O={};z.T=O,Tc(e,!1,t,o);try{var q=h(),Z=z.S;if(Z!==null&&Z(O,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var oe=US(q,u);mo(e,t,oe,tn(e))}else mo(e,t,u,tn(e))}catch(ce){mo(e,t,{then:function(){},status:"rejected",reason:ce},tn())}finally{Q.p=p,z.T=w}}function $S(){}function xc(e,t,o,u){if(e.tag!==5)throw Error(a(476));var h=Qp(e).queue;Kp(e,h,t,re,o===null?$S:function(){return Jp(e),o(u)})}function Qp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:re},next:null};var o={};return t.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:o},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jp(e){var t=Qp(e).next.queue;mo(e,t,{},tn())}function _c(){return jt(Mo)}function em(){return pt().memoizedState}function tm(){return pt().memoizedState}function qS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var o=tn();e=kr(o);var u=Lr(t,e,o);u!==null&&(Ft(u,t,o),bo(u,t,o)),t={cache:sc()},e.payload=t;return}t=t.return}}function VS(e,t,o){var u=tn();o={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Is(e)?rm(t,o):(o=ec(e,t,o,u),o!==null&&(Ft(o,e,u),im(o,t,u)))}function nm(e,t,o){var u=tn();mo(e,t,o,u)}function mo(e,t,o,u){var h={lane:u,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Is(e))rm(t,h);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var w=t.lastRenderedState,O=p(w,o);if(h.hasEagerState=!0,h.eagerState=O,Kt(O,w))return Ds(e,t,h,0),tt===null&&Rs(),!1}catch{}finally{}if(o=ec(e,t,h,u),o!==null)return Ft(o,e,u),im(o,t,u),!0}return!1}function Tc(e,t,o,u){if(u={lane:2,revertLane:pf(),action:u,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(a(479))}else t=ec(e,o,u,2),t!==null&&Ft(t,e,2)}function Is(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function rm(e,t){ra=Bs=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function im(e,t,o){if(o&4194176){var u=t.lanes;u&=e.pendingLanes,o|=u,t.lanes=o,pg(e,o)}}var Bn={readContext:jt,use:Ps,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt};Bn.useCacheRefresh=dt,Bn.useMemoCache=dt,Bn.useHostTransitionStatus=dt,Bn.useFormState=dt,Bn.useActionState=dt,Bn.useOptimistic=dt;var vi={readContext:jt,use:Ps,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:$p,useImperativeHandle:function(e,t,o){o=o!=null?o.concat([e]):null,qs(4194308,4,Ip.bind(null,t,e),o)},useLayoutEffect:function(e,t){return qs(4194308,4,e,t)},useInsertionEffect:function(e,t){qs(4,2,e,t)},useMemo:function(e,t){var o=qt();t=t===void 0?null:t;var u=e();if(mi){Zt(!0);try{e()}finally{Zt(!1)}}return o.memoizedState=[u,t],u},useReducer:function(e,t,o){var u=qt();if(o!==void 0){var h=o(t);if(mi){Zt(!0);try{o(t)}finally{Zt(!1)}}}else h=t;return u.memoizedState=u.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},u.queue=e,e=e.dispatch=VS.bind(null,Me,e),[u.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,o=nm.bind(null,Me,t);return t.dispatch=o,[e.memoizedState,o]},useDebugValue:Ec,useDeferredValue:function(e,t){var o=qt();return Sc(o,e,t)},useTransition:function(){var e=yc(!1);return e=Kp.bind(null,Me,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,o){var u=Me,h=qt();if($e){if(o===void 0)throw Error(a(407));o=o()}else{if(o=t(),tt===null)throw Error(a(349));He&60||Ap(u,t,o)}h.memoizedState=o;var p={value:o,getSnapshot:t};return h.queue=p,$p(Dp.bind(null,u,p,e),[e]),u.flags|=2048,aa(9,Rp.bind(null,u,p,o,t),{destroy:void 0},null),o},useId:function(){var e=qt(),t=tt.identifierPrefix;if($e){var o=Jn,u=Qn;o=(u&~(1<<32-Wt(u)-1)).toString(32)+o,t=":"+t+"R"+o,o=Fs++,0<o&&(t+="H"+o.toString(32)),t+=":"}else o=BS++,t=":"+t+"r"+o.toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return qt().memoizedState=qS.bind(null,Me)}};vi.useMemoCache=pc,vi.useHostTransitionStatus=_c,vi.useFormState=Up,vi.useActionState=Up,vi.useOptimistic=function(e){var t=qt();t.memoizedState=t.baseState=e;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=o,t=Tc.bind(null,Me,!0,o),o.dispatch=t,[e,t]};var Rr={readContext:jt,use:Ps,useCallback:Xp,useContext:jt,useEffect:wc,useImperativeHandle:Yp,useInsertionEffect:qp,useLayoutEffect:Vp,useMemo:Zp,useReducer:$s,useRef:Pp,useState:function(){return $s(tr)},useDebugValue:Ec,useDeferredValue:function(e,t){var o=pt();return Wp(o,Ze.memoizedState,e,t)},useTransition:function(){var e=$s(tr)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:po(e),t]},useSyncExternalStore:Cp,useId:em};Rr.useCacheRefresh=tm,Rr.useMemoCache=pc,Rr.useHostTransitionStatus=_c,Rr.useFormState=Bp,Rr.useActionState=Bp,Rr.useOptimistic=function(e,t){var o=pt();return Lp(o,Ze,e,t)};var yi={readContext:jt,use:Ps,useCallback:Xp,useContext:jt,useEffect:wc,useImperativeHandle:Yp,useInsertionEffect:qp,useLayoutEffect:Vp,useMemo:Zp,useReducer:vc,useRef:Pp,useState:function(){return vc(tr)},useDebugValue:Ec,useDeferredValue:function(e,t){var o=pt();return Ze===null?Sc(o,e,t):Wp(o,Ze.memoizedState,e,t)},useTransition:function(){var e=vc(tr)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:po(e),t]},useSyncExternalStore:Cp,useId:em};yi.useCacheRefresh=tm,yi.useMemoCache=pc,yi.useHostTransitionStatus=_c,yi.useFormState=Hp,yi.useActionState=Hp,yi.useOptimistic=function(e,t){var o=pt();return Ze!==null?Lp(o,Ze,e,t):(o.baseState=e,[e,o.queue.dispatch])};function Cc(e,t,o,u){t=e.memoizedState,o=o(u,t),o=o==null?t:F({},t,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Ac={isMounted:function(e){return(e=e._reactInternals)?D(e)===e:!1},enqueueSetState:function(e,t,o){e=e._reactInternals;var u=tn(),h=kr(u);h.payload=t,o!=null&&(h.callback=o),t=Lr(e,h,u),t!==null&&(Ft(t,e,u),bo(t,e,u))},enqueueReplaceState:function(e,t,o){e=e._reactInternals;var u=tn(),h=kr(u);h.tag=1,h.payload=t,o!=null&&(h.callback=o),t=Lr(e,h,u),t!==null&&(Ft(t,e,u),bo(t,e,u))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var o=tn(),u=kr(o);u.tag=2,t!=null&&(u.callback=t),t=Lr(e,u,o),t!==null&&(Ft(t,e,o),bo(t,e,o))}};function am(e,t,o,u,h,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,p,w):t.prototype&&t.prototype.isPureReactComponent?!no(o,u)||!no(h,p):!0}function om(e,t,o,u){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(o,u),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(o,u),t.state!==e&&Ac.enqueueReplaceState(t,t.state,null)}function bi(e,t){var o=t;if("ref"in t){o={};for(var u in t)u!=="ref"&&(o[u]=t[u])}if(e=e.defaultProps){o===t&&(o=F({},o));for(var h in e)o[h]===void 0&&(o[h]=e[h])}return o}var Ys=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=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(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function sm(e){Ys(e)}function lm(e){console.error(e)}function um(e){Ys(e)}function Xs(e,t){try{var o=e.onUncaughtError;o(t.value,{componentStack:t.stack})}catch(u){setTimeout(function(){throw u})}}function cm(e,t,o){try{var u=e.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Rc(e,t,o){return o=kr(o),o.tag=3,o.payload={element:null},o.callback=function(){Xs(e,t)},o}function fm(e){return e=kr(e),e.tag=3,e}function dm(e,t,o,u){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var p=u.value;e.payload=function(){return h(p)},e.callback=function(){cm(t,o,u)}}var w=o.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){cm(t,o,u),typeof h!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function IS(e,t,o,u,h){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(t=o.alternate,t!==null&&yo(t,o,h,!0),o=gn.current,o!==null){switch(o.tag){case 13:return Un===null?cf():o.alternate===null&&st===0&&(st=3),o.flags&=-257,o.flags|=65536,o.lanes=h,u===ic?o.flags|=16384:(t=o.updateQueue,t===null?o.updateQueue=new Set([u]):t.add(u),df(e,u,h)),!1;case 22:return o.flags|=65536,u===ic?o.flags|=16384:(t=o.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=t):(o=t.retryQueue,o===null?t.retryQueue=new Set([u]):o.add(u)),df(e,u,h)),!1}throw Error(a(435,o.tag))}return df(e,u,h),cf(),!1}if($e)return t=gn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=h,u!==rc&&(e=Error(a(422),{cause:u}),oo(fn(e,o)))):(u!==rc&&(t=Error(a(423),{cause:u}),oo(fn(t,o))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,u=fn(u,o),h=Rc(e.stateNode,u,h),$c(e,h),st!==4&&(st=2)),!1;var p=Error(a(520),{cause:u});if(p=fn(p,o),Ao===null?Ao=[p]:Ao.push(p),st!==4&&(st=2),t===null)return!0;u=fn(u,o),o=t;do{switch(o.tag){case 3:return o.flags|=65536,e=h&-h,o.lanes|=e,e=Rc(o.stateNode,u,e),$c(o,e),!1;case 1:if(t=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Ur===null||!Ur.has(p))))return o.flags|=65536,h&=-h,o.lanes|=h,h=fm(h),dm(h,e,o,u),$c(o,h),!1}o=o.return}while(o!==null);return!1}var hm=Error(a(461)),xt=!1;function Ot(e,t,o,u){t.child=e===null?yp(t,null,o,u):gi(t,e.child,o,u)}function gm(e,t,o,u,h){o=o.render;var p=t.ref;if("ref"in u){var w={};for(var O in u)O!=="ref"&&(w[O]=u[O])}else w=u;return Ei(t),u=fc(e,t,o,w,p,h),O=dc(),e!==null&&!xt?(hc(e,t,h),nr(e,t,h)):($e&&O&&tc(t),t.flags|=1,Ot(e,t,u,h),t.child)}function pm(e,t,o,u,h){if(e===null){var p=o.type;return typeof p=="function"&&!Kc(p)&&p.defaultProps===void 0&&o.compare===null?(t.tag=15,t.type=p,mm(e,t,p,u,h)):(e=Js(o.type,null,u,t,t.mode,h),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!jc(e,h)){var w=p.memoizedProps;if(o=o.compare,o=o!==null?o:no,o(w,u)&&e.ref===t.ref)return nr(e,t,h)}return t.flags|=1,e=Mr(p,u),e.ref=t.ref,e.return=t,t.child=e}function mm(e,t,o,u,h){if(e!==null){var p=e.memoizedProps;if(no(p,u)&&e.ref===t.ref)if(xt=!1,t.pendingProps=u=p,jc(e,h))e.flags&131072&&(xt=!0);else return t.lanes=e.lanes,nr(e,t,h)}return Dc(e,t,o,u,h)}function vm(e,t,o){var u=t.pendingProps,h=u.children,p=(t.stateNode._pendingVisibility&2)!==0,w=e!==null?e.memoizedState:null;if(vo(e,t),u.mode==="hidden"||p){if(t.flags&128){if(u=w!==null?w.baseLanes|o:o,e!==null){for(h=t.child=e.child,p=0;h!==null;)p=p|h.lanes|h.childLanes,h=h.sibling;t.childLanes=p&~u}else t.childLanes=0,t.child=null;return ym(e,t,u,o)}if(o&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Us(t,w!==null?w.cachePool:null),w!==null?bp(t,w):ac(),wp(t);else return t.lanes=t.childLanes=536870912,ym(e,t,w!==null?w.baseLanes|o:o,o)}else w!==null?(Us(t,w.cachePool),bp(t,w),Cr(),t.memoizedState=null):(e!==null&&Us(t,null),ac(),Cr());return Ot(e,t,h,o),t.child}function ym(e,t,o,u){var h=uc();return h=h===null?null:{parent:yt._currentValue,pool:h},t.memoizedState={baseLanes:o,cachePool:h},e!==null&&Us(t,null),ac(),wp(t),e!==null&&yo(e,t,u,!0),null}function vo(e,t){var o=t.ref;if(o===null)e!==null&&e.ref!==null&&(t.flags|=2097664);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(e===null||e.ref!==o)&&(t.flags|=2097664)}}function Dc(e,t,o,u,h){return Ei(t),o=fc(e,t,o,u,void 0,h),u=dc(),e!==null&&!xt?(hc(e,t,h),nr(e,t,h)):($e&&u&&tc(t),t.flags|=1,Ot(e,t,o,h),t.child)}function bm(e,t,o,u,h,p){return Ei(t),t.updateQueue=null,o=Tp(t,u,o,h),_p(e),u=dc(),e!==null&&!xt?(hc(e,t,p),nr(e,t,p)):($e&&u&&tc(t),t.flags|=1,Ot(e,t,o,p),t.child)}function wm(e,t,o,u,h){if(Ei(t),t.stateNode===null){var p=Wi,w=o.contextType;typeof w=="object"&&w!==null&&(p=jt(w)),p=new o(u,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Ac,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=u,p.state=t.memoizedState,p.refs={},Hc(t),w=o.contextType,p.context=typeof w=="object"&&w!==null?jt(w):Wi,p.state=t.memoizedState,w=o.getDerivedStateFromProps,typeof w=="function"&&(Cc(t,o,w,u),p.state=t.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(w=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),w!==p.state&&Ac.enqueueReplaceState(p,p.state,null),Eo(t,u,p,h),wo(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),u=!0}else if(e===null){p=t.stateNode;var O=t.memoizedProps,q=bi(o,O);p.props=q;var Z=p.context,oe=o.contextType;w=Wi,typeof oe=="object"&&oe!==null&&(w=jt(oe));var ce=o.getDerivedStateFromProps;oe=typeof ce=="function"||typeof p.getSnapshotBeforeUpdate=="function",O=t.pendingProps!==O,oe||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(O||Z!==w)&&om(t,p,u,w),Or=!1;var te=t.memoizedState;p.state=te,Eo(t,u,p,h),wo(),Z=t.memoizedState,O||te!==Z||Or?(typeof ce=="function"&&(Cc(t,o,ce,u),Z=t.memoizedState),(q=Or||am(t,o,q,u,te,Z,w))?(oe||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=u,t.memoizedState=Z),p.props=u,p.state=Z,p.context=w,u=q):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),u=!1)}else{p=t.stateNode,Pc(e,t),w=t.memoizedProps,oe=bi(o,w),p.props=oe,ce=t.pendingProps,te=p.context,Z=o.contextType,q=Wi,typeof Z=="object"&&Z!==null&&(q=jt(Z)),O=o.getDerivedStateFromProps,(Z=typeof O=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==ce||te!==q)&&om(t,p,u,q),Or=!1,te=t.memoizedState,p.state=te,Eo(t,u,p,h),wo();var ie=t.memoizedState;w!==ce||te!==ie||Or||e!==null&&e.dependencies!==null&&Zs(e.dependencies)?(typeof O=="function"&&(Cc(t,o,O,u),ie=t.memoizedState),(oe=Or||am(t,o,oe,u,te,ie,q)||e!==null&&e.dependencies!==null&&Zs(e.dependencies))?(Z||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(u,ie,q),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(u,ie,q)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=u,t.memoizedState=ie),p.props=u,p.state=ie,p.context=q,u=oe):(typeof p.componentDidUpdate!="function"||w===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),u=!1)}return p=u,vo(e,t),u=(t.flags&128)!==0,p||u?(p=t.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&u?(t.child=gi(t,e.child,null,h),t.child=gi(t,null,o,h)):Ot(e,t,o,h),t.memoizedState=p.state,e=t.child):e=nr(e,t,h),e}function Em(e,t,o,u){return ao(),t.flags|=256,Ot(e,t,o,u),t.child}var Oc={dehydrated:null,treeContext:null,retryLane:0};function kc(e){return{baseLanes:e,cachePool:xp()}}function Lc(e,t,o){return e=e!==null?e.childLanes&~o:0,t&&(e|=yn),e}function Sm(e,t,o){var u=t.pendingProps,h=!1,p=(t.flags&128)!==0,w;if((w=p)||(w=e!==null&&e.memoizedState===null?!1:(vt.current&2)!==0),w&&(h=!0,t.flags&=-129),w=(t.flags&32)!==0,t.flags&=-33,e===null){if($e){if(h?Tr(t):Cr(),$e){var O=Dt,q;if(q=O){e:{for(q=O,O=jn;q.nodeType!==8;){if(!O){O=null;break e}if(q=An(q.nextSibling),q===null){O=null;break e}}O=q}O!==null?(t.memoizedState={dehydrated:O,treeContext:fi!==null?{id:Qn,overflow:Jn}:null,retryLane:536870912},q=vn(18,null,null,0),q.stateNode=O,q.return=t,t.child=q,Bt=t,Dt=null,q=!0):q=!1}q||hi(t)}if(O=t.memoizedState,O!==null&&(O=O.dehydrated,O!==null))return O.data==="$!"?t.lanes=16:t.lanes=536870912,null;er(t)}return O=u.children,u=u.fallback,h?(Cr(),h=t.mode,O=zc({mode:"hidden",children:O},h),u=xi(u,h,o,null),O.return=t,u.return=t,O.sibling=u,t.child=O,h=t.child,h.memoizedState=kc(o),h.childLanes=Lc(e,w,o),t.memoizedState=Oc,u):(Tr(t),Nc(t,O))}if(q=e.memoizedState,q!==null&&(O=q.dehydrated,O!==null)){if(p)t.flags&256?(Tr(t),t.flags&=-257,t=Gc(e,t,o)):t.memoizedState!==null?(Cr(),t.child=e.child,t.flags|=128,t=null):(Cr(),h=u.fallback,O=t.mode,u=zc({mode:"visible",children:u.children},O),h=xi(h,O,o,null),h.flags|=2,u.return=t,h.return=t,u.sibling=h,t.child=u,gi(t,e.child,null,o),u=t.child,u.memoizedState=kc(o),u.childLanes=Lc(e,w,o),t.memoizedState=Oc,t=h);else if(Tr(t),O.data==="$!"){if(w=O.nextSibling&&O.nextSibling.dataset,w)var Z=w.dgst;w=Z,u=Error(a(419)),u.stack="",u.digest=w,oo({value:u,source:null,stack:null}),t=Gc(e,t,o)}else if(xt||yo(e,t,o,!1),w=(o&e.childLanes)!==0,xt||w){if(w=tt,w!==null){if(u=o&-o,u&42)u=1;else switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:u=64;break;case 268435456:u=134217728;break;default:u=0}if(u=u&(w.suspendedLanes|o)?0:u,u!==0&&u!==q.retryLane)throw q.retryLane=u,_r(e,u),Ft(w,e,u),hm}O.data==="$?"||cf(),t=Gc(e,t,o)}else O.data==="$?"?(t.flags|=128,t.child=e.child,t=sx.bind(null,e),O._reactRetry=t,t=null):(e=q.treeContext,Dt=An(O.nextSibling),Bt=t,$e=!0,Tn=null,jn=!1,e!==null&&(dn[hn++]=Qn,dn[hn++]=Jn,dn[hn++]=fi,Qn=e.id,Jn=e.overflow,fi=t),t=Nc(t,u.children),t.flags|=4096);return t}return h?(Cr(),h=u.fallback,O=t.mode,q=e.child,Z=q.sibling,u=Mr(q,{mode:"hidden",children:u.children}),u.subtreeFlags=q.subtreeFlags&31457280,Z!==null?h=Mr(Z,h):(h=xi(h,O,o,null),h.flags|=2),h.return=t,u.return=t,u.sibling=h,t.child=u,u=h,h=t.child,O=e.child.memoizedState,O===null?O=kc(o):(q=O.cachePool,q!==null?(Z=yt._currentValue,q=q.parent!==Z?{parent:Z,pool:Z}:q):q=xp(),O={baseLanes:O.baseLanes|o,cachePool:q}),h.memoizedState=O,h.childLanes=Lc(e,w,o),t.memoizedState=Oc,u):(Tr(t),o=e.child,e=o.sibling,o=Mr(o,{mode:"visible",children:u.children}),o.return=t,o.sibling=null,e!==null&&(w=t.deletions,w===null?(t.deletions=[e],t.flags|=16):w.push(e)),t.child=o,t.memoizedState=null,o)}function Nc(e,t){return t=zc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zc(e,t){return Xm(e,t,0,null)}function Gc(e,t,o){return gi(t,e.child,null,o),e=Nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xm(e,t,o){e.lanes|=t;var u=e.alternate;u!==null&&(u.lanes|=t),Bc(e.return,t,o)}function Mc(e,t,o,u,h){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:h}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=u,p.tail=o,p.tailMode=h)}function _m(e,t,o){var u=t.pendingProps,h=u.revealOrder,p=u.tail;if(Ot(e,t,u.children,o),u=vt.current,u&2)u=u&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xm(e,o,t);else if(e.tag===19)xm(e,o,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}switch(pe(vt,u),h){case"forwards":for(o=t.child,h=null;o!==null;)e=o.alternate,e!==null&&js(e)===null&&(h=o),o=o.sibling;o=h,o===null?(h=t.child,t.child=null):(h=o.sibling,o.sibling=null),Mc(t,!1,h,o,p);break;case"backwards":for(o=null,h=t.child,t.child=null;h!==null;){if(e=h.alternate,e!==null&&js(e)===null){t.child=h;break}e=h.sibling,h.sibling=o,o=h,h=e}Mc(t,!0,o,null,p);break;case"together":Mc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nr(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),jr|=t.lanes,!(o&t.childLanes))if(e!==null){if(yo(e,t,o,!1),(o&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,o=Mr(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=Mr(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function jc(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Zs(e)))}function YS(e,t,o){switch(t.tag){case 3:he(t,t.stateNode.containerInfo),Dr(t,yt,e.memoizedState.cache),ao();break;case 27:case 5:Re(t);break;case 4:he(t,t.stateNode.containerInfo);break;case 10:Dr(t,t.type,t.memoizedProps.value);break;case 13:var u=t.memoizedState;if(u!==null)return u.dehydrated!==null?(Tr(t),t.flags|=128,null):o&t.child.childLanes?Sm(e,t,o):(Tr(t),e=nr(e,t,o),e!==null?e.sibling:null);Tr(t);break;case 19:var h=(e.flags&128)!==0;if(u=(o&t.childLanes)!==0,u||(yo(e,t,o,!1),u=(o&t.childLanes)!==0),h){if(u)return _m(e,t,o);t.flags|=128}if(h=t.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),pe(vt,vt.current),u)break;return null;case 22:case 23:return t.lanes=0,vm(e,t,o);case 24:Dr(t,yt,e.memoizedState.cache)}return nr(e,t,o)}function Tm(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!jc(e,o)&&!(t.flags&128))return xt=!1,YS(e,t,o);xt=!!(e.flags&131072)}else xt=!1,$e&&t.flags&1048576&&up(t,Ls,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var u=t.elementType,h=u._init;if(u=h(u._payload),t.type=u,typeof u=="function")Kc(u)?(e=bi(u,e),t.tag=1,t=wm(null,t,u,e,o)):(t.tag=0,t=Dc(null,t,u,e,o));else{if(u!=null){if(h=u.$$typeof,h===x){t.tag=11,t=gm(null,t,u,e,o);break e}else if(h===M){t.tag=14,t=pm(null,t,u,e,o);break e}}throw t=$(u)||u,Error(a(306,t,""))}}return t;case 0:return Dc(e,t,t.type,t.pendingProps,o);case 1:return u=t.type,h=bi(u,t.pendingProps),wm(e,t,u,h,o);case 3:e:{if(he(t,t.stateNode.containerInfo),e===null)throw Error(a(387));var p=t.pendingProps;h=t.memoizedState,u=h.element,Pc(e,t),Eo(t,p,null,o);var w=t.memoizedState;if(p=w.cache,Dr(t,yt,p),p!==h.cache&&Fc(t,[yt],o,!0),wo(),p=w.element,h.isDehydrated)if(h={element:p,isDehydrated:!1,cache:w.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Em(e,t,p,o);break e}else if(p!==u){u=fn(Error(a(424)),t),oo(u),t=Em(e,t,p,o);break e}else for(Dt=An(t.stateNode.containerInfo.firstChild),Bt=t,$e=!0,Tn=null,jn=!0,o=yp(t,null,p,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ao(),p===u){t=nr(e,t,o);break e}Ot(e,t,p,o)}t=t.child}return t;case 26:return vo(e,t),e===null?(o=Rv(t.type,null,t.pendingProps,null))?t.memoizedState=o:$e||(o=t.type,e=t.pendingProps,u=fl(Le.current).createElement(o),u[Mt]=t,u[Pt]=e,kt(u,o,e),St(u),t.stateNode=u):t.memoizedState=Rv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&$e&&(u=t.stateNode=Tv(t.type,t.pendingProps,Le.current),Bt=t,jn=!0,Dt=An(u.firstChild)),u=t.pendingProps.children,e!==null||$e?Ot(e,t,u,o):t.child=gi(t,null,u,o),vo(e,t),t.child;case 5:return e===null&&$e&&((h=u=Dt)&&(u=xx(u,t.type,t.pendingProps,jn),u!==null?(t.stateNode=u,Bt=t,Dt=An(u.firstChild),jn=!1,h=!0):h=!1),h||hi(t)),Re(t),h=t.type,p=t.pendingProps,w=e!==null?e.memoizedProps:null,u=p.children,_f(h,p)?u=null:w!==null&&_f(h,w)&&(t.flags|=32),t.memoizedState!==null&&(h=fc(e,t,FS,null,null,o),Mo._currentValue=h),vo(e,t),Ot(e,t,u,o),t.child;case 6:return e===null&&$e&&((e=o=Dt)&&(o=_x(o,t.pendingProps,jn),o!==null?(t.stateNode=o,Bt=t,Dt=null,e=!0):e=!1),e||hi(t)),null;case 13:return Sm(e,t,o);case 4:return he(t,t.stateNode.containerInfo),u=t.pendingProps,e===null?t.child=gi(t,null,u,o):Ot(e,t,u,o),t.child;case 11:return gm(e,t,t.type,t.pendingProps,o);case 7:return Ot(e,t,t.pendingProps,o),t.child;case 8:return Ot(e,t,t.pendingProps.children,o),t.child;case 12:return Ot(e,t,t.pendingProps.children,o),t.child;case 10:return u=t.pendingProps,Dr(t,t.type,u.value),Ot(e,t,u.children,o),t.child;case 9:return h=t.type._context,u=t.pendingProps.children,Ei(t),h=jt(h),u=u(h),t.flags|=1,Ot(e,t,u,o),t.child;case 14:return pm(e,t,t.type,t.pendingProps,o);case 15:return mm(e,t,t.type,t.pendingProps,o);case 19:return _m(e,t,o);case 22:return vm(e,t,o);case 24:return Ei(t),u=jt(yt),e===null?(h=uc(),h===null&&(h=tt,p=sc(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=o),h=p),t.memoizedState={parent:u,cache:h},Hc(t),Dr(t,yt,h)):(e.lanes&o&&(Pc(e,t),Eo(t,null,null,o),wo()),h=e.memoizedState,p=t.memoizedState,h.parent!==u?(h={parent:u,cache:u},t.memoizedState=h,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=h),Dr(t,yt,u)):(u=p.cache,Dr(t,yt,u),u!==h.cache&&Fc(t,[yt],o,!0))),Ot(e,t,t.pendingProps.children,o),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}var Uc=le(null),wi=null,rr=null;function Dr(e,t,o){pe(Uc,t._currentValue),t._currentValue=o}function ir(e){e._currentValue=Uc.current,xe(Uc)}function Bc(e,t,o){for(;e!==null;){var u=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,u!==null&&(u.childLanes|=t)):u!==null&&(u.childLanes&t)!==t&&(u.childLanes|=t),e===o)break;e=e.return}}function Fc(e,t,o,u){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var p=h.dependencies;if(p!==null){var w=h.child;p=p.firstContext;e:for(;p!==null;){var O=p;p=h;for(var q=0;q<t.length;q++)if(O.context===t[q]){p.lanes|=o,O=p.alternate,O!==null&&(O.lanes|=o),Bc(p.return,o,e),u||(w=null);break e}p=O.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(a(341));w.lanes|=o,p=w.alternate,p!==null&&(p.lanes|=o),Bc(w,o,e),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===e){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function yo(e,t,o,u){e=null;for(var h=t,p=!1;h!==null;){if(!p){if(h.flags&524288)p=!0;else if(h.flags&262144)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(a(387));if(w=w.memoizedProps,w!==null){var O=h.type;Kt(h.pendingProps.value,w.value)||(e!==null?e.push(O):e=[O])}}else if(h===ve.current){if(w=h.alternate,w===null)throw Error(a(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Mo):e=[Mo])}h=h.return}e!==null&&Fc(t,e,o,u),t.flags|=262144}function Zs(e){for(e=e.firstContext;e!==null;){if(!Kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ei(e){wi=e,rr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function jt(e){return Cm(wi,e)}function Ws(e,t){return wi===null&&Ei(e),Cm(e,t)}function Cm(e,t){var o=t._currentValue;if(t={context:t,memoizedValue:o,next:null},rr===null){if(e===null)throw Error(a(308));rr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rr=rr.next=t;return o}var Or=!1;function Hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function kr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lr(e,t,o){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,at&2){var h=u.pending;return h===null?t.next=t:(t.next=h.next,h.next=t),u.pending=t,t=Os(e),sp(e,null,o),t}return Ds(e,u,t,o),Os(e)}function bo(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194176)!==0)){var u=t.lanes;u&=e.pendingLanes,o|=u,t.lanes=o,pg(e,o)}}function $c(e,t){var o=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var h=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var w={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?h=p=w:p=p.next=w,o=o.next}while(o!==null);p===null?h=p=t:p=p.next=t}else h=p=t;o={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:u.shared,callbacks:u.callbacks},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}var qc=!1;function wo(){if(qc){var e=na;if(e!==null)throw e}}function Eo(e,t,o,u){qc=!1;var h=e.updateQueue;Or=!1;var p=h.firstBaseUpdate,w=h.lastBaseUpdate,O=h.shared.pending;if(O!==null){h.shared.pending=null;var q=O,Z=q.next;q.next=null,w===null?p=Z:w.next=Z,w=q;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,O=oe.lastBaseUpdate,O!==w&&(O===null?oe.firstBaseUpdate=Z:O.next=Z,oe.lastBaseUpdate=q))}if(p!==null){var ce=h.baseState;w=0,oe=Z=q=null,O=p;do{var te=O.lane&-536870913,ie=te!==O.lane;if(ie?(He&te)===te:(u&te)===te){te!==0&&te===ta&&(qc=!0),oe!==null&&(oe=oe.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var De=e,ze=O;te=t;var lt=o;switch(ze.tag){case 1:if(De=ze.payload,typeof De=="function"){ce=De.call(lt,ce,te);break e}ce=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=ze.payload,te=typeof De=="function"?De.call(lt,ce,te):De,te==null)break e;ce=F({},ce,te);break e;case 2:Or=!0}}te=O.callback,te!==null&&(e.flags|=64,ie&&(e.flags|=8192),ie=h.callbacks,ie===null?h.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:O.tag,payload:O.payload,callback:O.callback,next:null},oe===null?(Z=oe=ie,q=ce):oe=oe.next=ie,w|=te;if(O=O.next,O===null){if(O=h.shared.pending,O===null)break;ie=O,O=ie.next,ie.next=null,h.lastBaseUpdate=ie,h.shared.pending=null}}while(!0);oe===null&&(q=ce),h.baseState=q,h.firstBaseUpdate=Z,h.lastBaseUpdate=oe,p===null&&(h.shared.lanes=0),jr|=w,e.lanes=w,e.memoizedState=ce}}function Am(e,t){if(typeof e!="function")throw Error(a(191,e));e.call(t)}function Rm(e,t){var o=e.callbacks;if(o!==null)for(e.callbacks=null,e=0;e<o.length;e++)Am(o[e],t)}function So(e,t){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){u=void 0;var p=o.create,w=o.inst;u=p(),w.destroy=u}o=o.next}while(o!==h)}}catch(O){Qe(t,t.return,O)}}function Nr(e,t,o){try{var u=t.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var p=h.next;u=p;do{if((u.tag&e)===e){var w=u.inst,O=w.destroy;if(O!==void 0){w.destroy=void 0,h=t;var q=o;try{O()}catch(Z){Qe(h,q,Z)}}}u=u.next}while(u!==p)}}catch(Z){Qe(t,t.return,Z)}}function Dm(e){var t=e.updateQueue;if(t!==null){var o=e.stateNode;try{Rm(t,o)}catch(u){Qe(e,e.return,u)}}}function Om(e,t,o){o.props=bi(e.type,e.memoizedProps),o.state=e.memoizedState;try{o.componentWillUnmount()}catch(u){Qe(e,t,u)}}function Si(e,t){try{var o=e.ref;if(o!==null){var u=e.stateNode;switch(e.tag){case 26:case 27:case 5:var h=u;break;default:h=u}typeof o=="function"?e.refCleanup=o(h):o.current=h}}catch(p){Qe(e,t,p)}}function Qt(e,t){var o=e.ref,u=e.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(h){Qe(e,t,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){Qe(e,t,h)}else o.current=null}function km(e){var t=e.type,o=e.memoizedProps,u=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(h){Qe(e,e.return,h)}}function Lm(e,t,o){try{var u=e.stateNode;yx(u,e.type,o,t),u[Pt]=t}catch(h){Qe(e,e.return,h)}}function Nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==27&&e.tag!==18;){if(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 Ic(e,t,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,t?o.nodeType===8?o.parentNode.insertBefore(e,t):o.insertBefore(e,t):(o.nodeType===8?(t=o.parentNode,t.insertBefore(e,o)):(t=o,t.appendChild(e)),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=cl));else if(u!==4&&u!==27&&(e=e.child,e!==null))for(Ic(e,t,o),e=e.sibling;e!==null;)Ic(e,t,o),e=e.sibling}function Ks(e,t,o){var u=e.tag;if(u===5||u===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(u!==4&&u!==27&&(e=e.child,e!==null))for(Ks(e,t,o),e=e.sibling;e!==null;)Ks(e,t,o),e=e.sibling}var ar=!1,ot=!1,Yc=!1,zm=typeof WeakSet=="function"?WeakSet:Set,_t=null,Gm=!1;function XS(e,t){if(e=e.containerInfo,Sf=vl,e=Qg(e),Zu(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var w=0,O=-1,q=-1,Z=0,oe=0,ce=e,te=null;t:for(;;){for(var ie;ce!==o||h!==0&&ce.nodeType!==3||(O=w+h),ce!==p||u!==0&&ce.nodeType!==3||(q=w+u),ce.nodeType===3&&(w+=ce.nodeValue.length),(ie=ce.firstChild)!==null;)te=ce,ce=ie;for(;;){if(ce===e)break t;if(te===o&&++Z===h&&(O=w),te===p&&++oe===u&&(q=w),(ie=ce.nextSibling)!==null)break;ce=te,te=ce.parentNode}ce=ie}o=O===-1||q===-1?null:{start:O,end:q}}else o=null}o=o||{start:0,end:0}}else o=null;for(xf={focusedElem:e,selectionRange:o},vl=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,p=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&p!==null){e=void 0,o=t,h=p.memoizedProps,p=p.memoizedState,u=o.stateNode;try{var De=bi(o.type,h,o.elementType===o.type);e=u.getSnapshotBeforeUpdate(De,p),u.__reactInternalSnapshotBeforeUpdate=e}catch(ze){Qe(o,o.return,ze)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,o=e.nodeType,o===9)Af(e);else if(o===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Af(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}return De=Gm,Gm=!1,De}function Mm(e,t,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:sr(e,o),u&4&&So(5,o);break;case 1:if(sr(e,o),u&4)if(e=o.stateNode,t===null)try{e.componentDidMount()}catch(O){Qe(o,o.return,O)}else{var h=bi(o.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(h,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){Qe(o,o.return,O)}}u&64&&Dm(o),u&512&&Si(o,o.return);break;case 3:if(sr(e,o),u&64&&(u=o.updateQueue,u!==null)){if(e=null,o.child!==null)switch(o.child.tag){case 27:case 5:e=o.child.stateNode;break;case 1:e=o.child.stateNode}try{Rm(u,e)}catch(O){Qe(o,o.return,O)}}break;case 26:sr(e,o),u&512&&Si(o,o.return);break;case 27:case 5:sr(e,o),t===null&&u&4&&km(o),u&512&&Si(o,o.return);break;case 12:sr(e,o);break;case 13:sr(e,o),u&4&&Bm(e,o);break;case 22:if(h=o.memoizedState!==null||ar,!h){t=t!==null&&t.memoizedState!==null||ot;var p=ar,w=ot;ar=h,(ot=t)&&!w?zr(e,o,(o.subtreeFlags&8772)!==0):sr(e,o),ar=p,ot=w}u&512&&(o.memoizedProps.mode==="manual"?Si(o,o.return):Qt(o,o.return));break;default:sr(e,o)}}function jm(e){var t=e.alternate;t!==null&&(e.alternate=null,jm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nu(t)),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 mt=null,Jt=!1;function or(e,t,o){for(o=o.child;o!==null;)Um(e,t,o),o=o.sibling}function Um(e,t,o){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Mn,o)}catch{}switch(o.tag){case 26:ot||Qt(o,t),or(e,t,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ot||Qt(o,t);var u=mt,h=Jt;for(mt=o.stateNode,or(e,t,o),o=o.stateNode,t=o.attributes;t.length;)o.removeAttributeNode(t[0]);Nu(o),mt=u,Jt=h;break;case 5:ot||Qt(o,t);case 6:h=mt;var p=Jt;if(mt=null,or(e,t,o),mt=h,Jt=p,mt!==null)if(Jt)try{e=mt,u=o.stateNode,e.nodeType===8?e.parentNode.removeChild(u):e.removeChild(u)}catch(w){Qe(o,t,w)}else try{mt.removeChild(o.stateNode)}catch(w){Qe(o,t,w)}break;case 18:mt!==null&&(Jt?(t=mt,o=o.stateNode,t.nodeType===8?Cf(t.parentNode,o):t.nodeType===1&&Cf(t,o),Fo(t)):Cf(mt,o.stateNode));break;case 4:u=mt,h=Jt,mt=o.stateNode.containerInfo,Jt=!0,or(e,t,o),mt=u,Jt=h;break;case 0:case 11:case 14:case 15:ot||Nr(2,o,t),ot||Nr(4,o,t),or(e,t,o);break;case 1:ot||(Qt(o,t),u=o.stateNode,typeof u.componentWillUnmount=="function"&&Om(o,t,u)),or(e,t,o);break;case 21:or(e,t,o);break;case 22:ot||Qt(o,t),ot=(u=ot)||o.memoizedState!==null,or(e,t,o),ot=u;break;default:or(e,t,o)}}function Bm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fo(e)}catch(o){Qe(t,t.return,o)}}function ZS(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new zm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new zm),t;default:throw Error(a(435,e.tag))}}function Xc(e,t){var o=ZS(e);t.forEach(function(u){var h=lx.bind(null,e,u);o.has(u)||(o.add(u),u.then(h,h))})}function pn(e,t){var o=t.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],p=e,w=t,O=w;e:for(;O!==null;){switch(O.tag){case 27:case 5:mt=O.stateNode,Jt=!1;break e;case 3:mt=O.stateNode.containerInfo,Jt=!0;break e;case 4:mt=O.stateNode.containerInfo,Jt=!0;break e}O=O.return}if(mt===null)throw Error(a(160));Um(p,w,h),mt=null,Jt=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Fm(t,e),t=t.sibling}var Cn=null;function Fm(e,t){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pn(t,e),mn(e),u&4&&(Nr(3,e,e.return),So(3,e),Nr(5,e,e.return));break;case 1:pn(t,e),mn(e),u&512&&(ot||o===null||Qt(o,o.return)),u&64&&ar&&(e=e.updateQueue,e!==null&&(u=e.callbacks,u!==null&&(o=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var h=Cn;if(pn(t,e),mn(e),u&512&&(ot||o===null||Qt(o,o.return)),u&4){var p=o!==null?o.memoizedState:null;if(u=e.memoizedState,o===null)if(u===null)if(e.stateNode===null){e:{u=e.type,o=e.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":p=h.getElementsByTagName("title")[0],(!p||p[Ya]||p[Mt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(u),h.head.insertBefore(p,h.querySelector("head > title"))),kt(p,u,o),p[Mt]=e,St(p),u=p;break e;case"link":var w=kv("link","href",h).get(u+(o.href||""));if(w){for(var O=0;O<w.length;O++)if(p=w[O],p.getAttribute("href")===(o.href==null?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){w.splice(O,1);break t}}p=h.createElement(u),kt(p,u,o),h.head.appendChild(p);break;case"meta":if(w=kv("meta","content",h).get(u+(o.content||""))){for(O=0;O<w.length;O++)if(p=w[O],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){w.splice(O,1);break t}}p=h.createElement(u),kt(p,u,o),h.head.appendChild(p);break;default:throw Error(a(468,u))}p[Mt]=e,St(p),u=p}e.stateNode=u}else Lv(h,e.type,e.stateNode);else e.stateNode=Ov(h,u,e.memoizedProps);else p!==u?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,u===null?Lv(h,e.type,e.stateNode):Ov(h,u,e.memoizedProps)):u===null&&e.stateNode!==null&&Lm(e,e.memoizedProps,o.memoizedProps)}break;case 27:if(u&4&&e.alternate===null){h=e.stateNode,p=e.memoizedProps;try{for(var q=h.firstChild;q;){var Z=q.nextSibling,oe=q.nodeName;q[Ya]||oe==="HEAD"||oe==="BODY"||oe==="SCRIPT"||oe==="STYLE"||oe==="LINK"&&q.rel.toLowerCase()==="stylesheet"||h.removeChild(q),q=Z}for(var ce=e.type,te=h.attributes;te.length;)h.removeAttributeNode(te[0]);kt(h,ce,p),h[Mt]=e,h[Pt]=p}catch(De){Qe(e,e.return,De)}}case 5:if(pn(t,e),mn(e),u&512&&(ot||o===null||Qt(o,o.return)),e.flags&32){h=e.stateNode;try{$i(h,"")}catch(De){Qe(e,e.return,De)}}u&4&&e.stateNode!=null&&(h=e.memoizedProps,Lm(e,h,o!==null?o.memoizedProps:h)),u&1024&&(Yc=!0);break;case 6:if(pn(t,e),mn(e),u&4){if(e.stateNode===null)throw Error(a(162));u=e.memoizedProps,o=e.stateNode;try{o.nodeValue=u}catch(De){Qe(e,e.return,De)}}break;case 3:if(gl=null,h=Cn,Cn=dl(t.containerInfo),pn(t,e),Cn=h,mn(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{Fo(t.containerInfo)}catch(De){Qe(e,e.return,De)}Yc&&(Yc=!1,Hm(e));break;case 4:u=Cn,Cn=dl(e.stateNode.containerInfo),pn(t,e),mn(e),Cn=u;break;case 12:pn(t,e),mn(e);break;case 13:pn(t,e),mn(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(rf=Ie()),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,Xc(e,u)));break;case 22:if(u&512&&(ot||o===null||Qt(o,o.return)),q=e.memoizedState!==null,Z=o!==null&&o.memoizedState!==null,oe=ar,ce=ot,ar=oe||q,ot=ce||Z,pn(t,e),ot=ce,ar=oe,mn(e),t=e.stateNode,t._current=e,t._visibility&=-3,t._visibility|=t._pendingVisibility&2,u&8192&&(t._visibility=q?t._visibility&-2:t._visibility|1,q&&(t=ar||ot,o===null||Z||t||oa(e)),e.memoizedProps===null||e.memoizedProps.mode!=="manual"))e:for(o=null,t=e;;){if(t.tag===5||t.tag===26||t.tag===27){if(o===null){Z=o=t;try{if(h=Z.stateNode,q)p=h.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{w=Z.stateNode,O=Z.memoizedProps.style;var ie=O!=null&&O.hasOwnProperty("display")?O.display:null;w.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(De){Qe(Z,Z.return,De)}}}else if(t.tag===6){if(o===null){Z=t;try{Z.stateNode.nodeValue=q?"":Z.memoizedProps}catch(De){Qe(Z,Z.return,De)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;o===t&&(o=null),t=t.return}o===t&&(o=null),t.sibling.return=t.return,t=t.sibling}u&4&&(u=e.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,Xc(e,o))));break;case 19:pn(t,e),mn(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,Xc(e,u)));break;case 21:break;default:pn(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{if(e.tag!==27){e:{for(var o=e.return;o!==null;){if(Nm(o)){var u=o;break e}o=o.return}throw Error(a(160))}switch(u.tag){case 27:var h=u.stateNode,p=Vc(e);Ks(e,p,h);break;case 5:var w=u.stateNode;u.flags&32&&($i(w,""),u.flags&=-33);var O=Vc(e);Ks(e,O,w);break;case 3:case 4:var q=u.stateNode.containerInfo,Z=Vc(e);Ic(e,Z,q);break;default:throw Error(a(161))}}}catch(oe){Qe(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Hm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function sr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Mm(e,t.alternate,t),t=t.sibling}function oa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Nr(4,t,t.return),oa(t);break;case 1:Qt(t,t.return);var o=t.stateNode;typeof o.componentWillUnmount=="function"&&Om(t,t.return,o),oa(t);break;case 26:case 27:case 5:Qt(t,t.return),oa(t);break;case 22:Qt(t,t.return),t.memoizedState===null&&oa(t);break;default:oa(t)}e=e.sibling}}function zr(e,t,o){for(o=o&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var u=t.alternate,h=e,p=t,w=p.flags;switch(p.tag){case 0:case 11:case 15:zr(h,p,o),So(4,p);break;case 1:if(zr(h,p,o),u=p,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(Z){Qe(u,u.return,Z)}if(u=p,h=u.updateQueue,h!==null){var O=u.stateNode;try{var q=h.shared.hiddenCallbacks;if(q!==null)for(h.shared.hiddenCallbacks=null,h=0;h<q.length;h++)Am(q[h],O)}catch(Z){Qe(u,u.return,Z)}}o&&w&64&&Dm(p),Si(p,p.return);break;case 26:case 27:case 5:zr(h,p,o),o&&u===null&&w&4&&km(p),Si(p,p.return);break;case 12:zr(h,p,o);break;case 13:zr(h,p,o),o&&w&4&&Bm(h,p);break;case 22:p.memoizedState===null&&zr(h,p,o),Si(p,p.return);break;default:zr(h,p,o)}t=t.sibling}}function Zc(e,t){var o=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==o&&(e!=null&&e.refCount++,o!=null&&fo(o))}function Wc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fo(e))}function Gr(e,t,o,u){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Pm(e,t,o,u),t=t.sibling}function Pm(e,t,o,u){var h=t.flags;switch(t.tag){case 0:case 11:case 15:Gr(e,t,o,u),h&2048&&So(9,t);break;case 3:Gr(e,t,o,u),h&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&fo(e)));break;case 12:if(h&2048){Gr(e,t,o,u),e=t.stateNode;try{var p=t.memoizedProps,w=p.id,O=p.onPostCommit;typeof O=="function"&&O(w,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(q){Qe(t,t.return,q)}}else Gr(e,t,o,u);break;case 23:break;case 22:p=t.stateNode,t.memoizedState!==null?p._visibility&4?Gr(e,t,o,u):xo(e,t):p._visibility&4?Gr(e,t,o,u):(p._visibility|=4,sa(e,t,o,u,(t.subtreeFlags&10256)!==0)),h&2048&&Zc(t.alternate,t);break;case 24:Gr(e,t,o,u),h&2048&&Wc(t.alternate,t);break;default:Gr(e,t,o,u)}}function sa(e,t,o,u,h){for(h=h&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var p=e,w=t,O=o,q=u,Z=w.flags;switch(w.tag){case 0:case 11:case 15:sa(p,w,O,q,h),So(8,w);break;case 23:break;case 22:var oe=w.stateNode;w.memoizedState!==null?oe._visibility&4?sa(p,w,O,q,h):xo(p,w):(oe._visibility|=4,sa(p,w,O,q,h)),h&&Z&2048&&Zc(w.alternate,w);break;case 24:sa(p,w,O,q,h),h&&Z&2048&&Wc(w.alternate,w);break;default:sa(p,w,O,q,h)}t=t.sibling}}function xo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var o=e,u=t,h=u.flags;switch(u.tag){case 22:xo(o,u),h&2048&&Zc(u.alternate,u);break;case 24:xo(o,u),h&2048&&Wc(u.alternate,u);break;default:xo(o,u)}t=t.sibling}}var _o=8192;function la(e){if(e.subtreeFlags&_o)for(e=e.child;e!==null;)$m(e),e=e.sibling}function $m(e){switch(e.tag){case 26:la(e),e.flags&_o&&e.memoizedState!==null&&jx(Cn,e.memoizedState,e.memoizedProps);break;case 5:la(e);break;case 3:case 4:var t=Cn;Cn=dl(e.stateNode.containerInfo),la(e),Cn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=_o,_o=16777216,la(e),_o=t):la(e));break;default:la(e)}}function qm(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function To(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var o=0;o<t.length;o++){var u=t[o];_t=u,Im(u,e)}qm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vm(e),e=e.sibling}function Vm(e){switch(e.tag){case 0:case 11:case 15:To(e),e.flags&2048&&Nr(9,e,e.return);break;case 3:To(e);break;case 12:To(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&4&&(e.return===null||e.return.tag!==13)?(t._visibility&=-5,Qs(e)):To(e);break;default:To(e)}}function Qs(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var o=0;o<t.length;o++){var u=t[o];_t=u,Im(u,e)}qm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Nr(8,t,t.return),Qs(t);break;case 22:o=t.stateNode,o._visibility&4&&(o._visibility&=-5,Qs(t));break;default:Qs(t)}e=e.sibling}}function Im(e,t){for(;_t!==null;){var o=_t;switch(o.tag){case 0:case 11:case 15:Nr(8,o,t);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:fo(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,_t=u;else e:for(o=e;_t!==null;){u=_t;var h=u.sibling,p=u.return;if(jm(u),u===o){_t=null;break e}if(h!==null){h.return=p,_t=h;break e}_t=p}}}function WS(e,t,o,u){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(e,t,o,u){return new WS(e,t,o,u)}function Kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Mr(e,t){var o=e.alternate;return o===null?(o=vn(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&31457280,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o.refCleanup=e.refCleanup,o}function Ym(e,t){e.flags&=31457282;var o=e.alternate;return o===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=o.childLanes,e.lanes=o.lanes,e.child=o.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=o.memoizedProps,e.memoizedState=o.memoizedState,e.updateQueue=o.updateQueue,e.type=o.type,t=o.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Js(e,t,o,u,h,p){var w=0;if(u=e,typeof e=="function")Kc(e)&&(w=1);else if(typeof e=="string")w=Gx(e,o,Ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case d:return xi(o.children,h,p,t);case g:w=8,h|=24;break;case m:return e=vn(12,o,t,h|2),e.elementType=m,e.lanes=p,e;case E:return e=vn(13,o,t,h),e.elementType=E,e.lanes=p,e;case T:return e=vn(19,o,t,h),e.elementType=T,e.lanes=p,e;case L:return Xm(o,h,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v:case b:w=10;break e;case y:w=9;break e;case x:w=11;break e;case M:w=14;break e;case N:w=16,u=null;break e}w=29,o=Error(a(130,e===null?"null":typeof e,"")),u=null}return t=vn(w,o,t,h),t.elementType=e,t.type=u,t.lanes=p,t}function xi(e,t,o,u){return e=vn(7,e,u,t),e.lanes=o,e}function Xm(e,t,o,u){e=vn(22,e,u,t),e.elementType=L,e.lanes=o;var h={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var p=h._current;if(p===null)throw Error(a(456));if(!(h._pendingVisibility&2)){var w=_r(p,2);w!==null&&(h._pendingVisibility|=2,Ft(w,p,2))}},attach:function(){var p=h._current;if(p===null)throw Error(a(456));if(h._pendingVisibility&2){var w=_r(p,2);w!==null&&(h._pendingVisibility&=-3,Ft(w,p,2))}}};return e.stateNode=h,e}function Qc(e,t,o){return e=vn(6,e,null,t),e.lanes=o,e}function Jc(e,t,o){return t=vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lr(e){e.flags|=4}function Zm(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Nv(t)){if(t=gn.current,t!==null&&((He&4194176)===He?Un!==null:(He&62914560)!==He&&!(He&536870912)||t!==Un))throw lo=ic,dp;e.flags|=8192}}function el(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hg():536870912,e.lanes|=t,ca|=t)}function Co(e,t){if(!$e)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,u=0;if(t)for(var h=e.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags&31457280,u|=h.flags&31457280,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)o|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=u,e.childLanes=o,t}function KS(e,t,o){var u=t.pendingProps;switch(nc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return o=t.stateNode,u=null,e!==null&&(u=e.memoizedState.cache),t.memoizedState.cache!==u&&(t.flags|=2048),ir(yt),K(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(io(t)?lr(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tn!==null&&(lf(Tn),Tn=null))),it(t),null;case 26:return o=t.memoizedState,e===null?(lr(t),o!==null?(it(t),Zm(t,o)):(it(t),t.flags&=-16777217)):o?o!==e.memoizedState?(lr(t),it(t),Zm(t,o)):(it(t),t.flags&=-16777217):(e.memoizedProps!==u&&lr(t),it(t),t.flags&=-16777217),null;case 27:Ve(t),o=Le.current;var h=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==u&&lr(t);else{if(!u){if(t.stateNode===null)throw Error(a(166));return it(t),null}e=Ae.current,io(t)?cp(t):(e=Tv(h,u,o),t.stateNode=e,lr(t))}return it(t),null;case 5:if(Ve(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==u&&lr(t);else{if(!u){if(t.stateNode===null)throw Error(a(166));return it(t),null}if(e=Ae.current,io(t))cp(t);else{switch(h=fl(Le.current),e){case 1:e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":e=h.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":e=h.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":e=h.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof u.is=="string"?h.createElement("select",{is:u.is}):h.createElement("select"),u.multiple?e.multiple=!0:u.size&&(e.size=u.size);break;default:e=typeof u.is=="string"?h.createElement(o,{is:u.is}):h.createElement(o)}}e[Mt]=t,e[Pt]=u;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)e.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=e;e:switch(kt(e,o,u),o){case"button":case"input":case"select":case"textarea":e=!!u.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&lr(t)}}return it(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==u&&lr(t);else{if(typeof u!="string"&&t.stateNode===null)throw Error(a(166));if(e=Le.current,io(t)){if(e=t.stateNode,o=t.memoizedProps,u=null,h=Bt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||bv(e.nodeValue,o)),e||hi(t)}else e=fl(e).createTextNode(u),e[Mt]=t,t.stateNode=e}return it(t),null;case 13:if(u=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=io(t),u!==null&&u.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Mt]=t}else ao(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;it(t),h=!1}else Tn!==null&&(lf(Tn),Tn=null),h=!0;if(!h)return t.flags&256?(er(t),t):(er(t),null)}if(er(t),t.flags&128)return t.lanes=o,t;if(o=u!==null,e=e!==null&&e.memoizedState!==null,o){u=t.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool);var p=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),p!==h&&(u.flags|=2048)}return o!==e&&o&&(t.child.flags|=8192),el(t,t.updateQueue),it(t),null;case 4:return K(),e===null&&bf(t.stateNode.containerInfo),it(t),null;case 10:return ir(t.type),it(t),null;case 19:if(xe(vt),h=t.memoizedState,h===null)return it(t),null;if(u=(t.flags&128)!==0,p=h.rendering,p===null)if(u)Co(h,!1);else{if(st!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(p=js(e),p!==null){for(t.flags|=128,Co(h,!1),e=p.updateQueue,t.updateQueue=e,el(t,e),t.subtreeFlags=0,e=o,o=t.child;o!==null;)Ym(o,e),o=o.sibling;return pe(vt,vt.current&1|2),t.child}e=e.sibling}h.tail!==null&&Ie()>tl&&(t.flags|=128,u=!0,Co(h,!1),t.lanes=4194304)}else{if(!u)if(e=js(p),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,el(t,e),Co(h,!0),h.tail===null&&h.tailMode==="hidden"&&!p.alternate&&!$e)return it(t),null}else 2*Ie()-h.renderingStartTime>tl&&o!==536870912&&(t.flags|=128,u=!0,Co(h,!1),t.lanes=4194304);h.isBackwards?(p.sibling=t.child,t.child=p):(e=h.last,e!==null?e.sibling=p:t.child=p,h.last=p)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=Ie(),t.sibling=null,e=vt.current,pe(vt,u?e&1|2:e&1),t):(it(t),null);case 22:case 23:return er(t),oc(),u=t.memoizedState!==null,e!==null?e.memoizedState!==null!==u&&(t.flags|=8192):u&&(t.flags|=8192),u?o&536870912&&!(t.flags&128)&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),o=t.updateQueue,o!==null&&el(t,o.retryQueue),o=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(o=e.memoizedState.cachePool.pool),u=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(u=t.memoizedState.cachePool.pool),u!==o&&(t.flags|=2048),e!==null&&xe(pi),null;case 24:return o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),ir(yt),it(t),null;case 25:return null}throw Error(a(156,t.tag))}function QS(e,t){switch(nc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ir(yt),K(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ve(t),null;case 13:if(er(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ao()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(vt),null;case 4:return K(),null;case 10:return ir(t.type),null;case 22:case 23:return er(t),oc(),e!==null&&xe(pi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ir(yt),null;case 25:return null;default:return null}}function Wm(e,t){switch(nc(t),t.tag){case 3:ir(yt),K();break;case 26:case 27:case 5:Ve(t);break;case 4:K();break;case 13:er(t);break;case 19:xe(vt);break;case 10:ir(t.type);break;case 22:case 23:er(t),oc(),e!==null&&xe(pi);break;case 24:ir(yt)}}var JS={getCacheForType:function(e){var t=jt(yt),o=t.data.get(e);return o===void 0&&(o=e(),t.data.set(e,o)),o}},ex=typeof WeakMap=="function"?WeakMap:Map,at=0,tt=null,Ue=null,He=0,nt=0,en=null,ur=!1,ua=!1,ef=!1,cr=0,st=0,jr=0,_i=0,tf=0,yn=0,ca=0,Ao=null,Fn=null,nf=!1,rf=0,tl=1/0,nl=null,Ur=null,rl=!1,Ti=null,Ro=0,af=0,of=null,Do=0,sf=null;function tn(){if(at&2&&He!==0)return He&-He;if(z.T!==null){var e=ta;return e!==0?e:pf()}return vg()}function Km(){yn===0&&(yn=!(He&536870912)||$e?dg():536870912);var e=gn.current;return e!==null&&(e.flags|=32),yn}function Ft(e,t,o){(e===tt&&nt===2||e.cancelPendingCommit!==null)&&(fa(e,0),fr(e,He,yn,!1)),Ia(e,o),(!(at&2)||e!==tt)&&(e===tt&&(!(at&2)&&(_i|=o),st===4&&fr(e,He,yn,!1)),Hn(e))}function Qm(e,t,o){if(at&6)throw Error(a(327));var u=!o&&(t&60)===0&&(t&e.expiredLanes)===0||Va(e,t),h=u?rx(e,t):ff(e,t,!0),p=u;do{if(h===0){ua&&!u&&fr(e,t,0,!1);break}else if(h===6)fr(e,t,0,!ur);else{if(o=e.current.alternate,p&&!tx(o)){h=ff(e,t,!1),p=!1;continue}if(h===2){if(p=t,e.errorRecoveryDisabledLanes&p)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){t=w;e:{var O=e;h=Ao;var q=O.current.memoizedState.isDehydrated;if(q&&(fa(O,w).flags|=256),w=ff(O,w,!1),w!==2){if(ef&&!q){O.errorRecoveryDisabledLanes|=p,_i|=p,h=4;break e}p=Fn,Fn=h,p!==null&&lf(p)}h=w}if(p=!1,h!==2)continue}}if(h===1){fa(e,0),fr(e,t,0,!0);break}e:{switch(u=e,h){case 0:case 1:throw Error(a(345));case 4:if((t&4194176)===t){fr(u,t,yn,!ur);break e}break;case 2:Fn=null;break;case 3:case 5:break;default:throw Error(a(329))}if(u.finishedWork=o,u.finishedLanes=t,(t&62914560)===t&&(p=rf+300-Ie(),10<p)){if(fr(u,t,yn,!ur),ms(u,0)!==0)break e;u.timeoutHandle=Sv(Jm.bind(null,u,o,Fn,nl,nf,t,yn,_i,ca,ur,2,-0,0),p);break e}Jm(u,o,Fn,nl,nf,t,yn,_i,ca,ur,0,-0,0)}}break}while(!0);Hn(e)}function lf(e){Fn===null?Fn=e:Fn.push.apply(Fn,e)}function Jm(e,t,o,u,h,p,w,O,q,Z,oe,ce,te){var ie=t.subtreeFlags;if((ie&8192||(ie&16785408)===16785408)&&(Go={stylesheets:null,count:0,unsuspend:Mx},$m(t),t=Ux(),t!==null)){e.cancelPendingCommit=t(ov.bind(null,e,o,u,h,w,O,q,1,ce,te)),fr(e,p,w,!Z);return}ov(e,o,u,h,w,O,q,oe,ce,te)}function tx(e){for(var t=e;;){var o=t.tag;if((o===0||o===11||o===15)&&t.flags&16384&&(o=t.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var h=o[u],p=h.getSnapshot;h=h.value;try{if(!Kt(p(),h))return!1}catch{return!1}}if(o=t.child,t.subtreeFlags&16384&&o!==null)o.return=t,t=o;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function fr(e,t,o,u){t&=~tf,t&=~_i,e.suspendedLanes|=t,e.pingedLanes&=~t,u&&(e.warmLanes|=t),u=e.expirationTimes;for(var h=t;0<h;){var p=31-Wt(h),w=1<<p;u[p]=-1,h&=~w}o!==0&&gg(e,o,t)}function il(){return at&6?!0:(Oo(0),!1)}function uf(){if(Ue!==null){if(nt===0)var e=Ue.return;else e=Ue,rr=wi=null,gc(e),Ji=null,uo=0,e=Ue;for(;e!==null;)Wm(e.alternate,e),e=e.return;Ue=null}}function fa(e,t){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;o!==-1&&(e.timeoutHandle=-1,wx(o)),o=e.cancelPendingCommit,o!==null&&(e.cancelPendingCommit=null,o()),uf(),tt=e,Ue=o=Mr(e.current,null),He=t,nt=0,en=null,ur=!1,ua=Va(e,t),ef=!1,ca=yn=tf=_i=jr=st=0,Fn=Ao=null,nf=!1,t&8&&(t|=t&32);var u=e.entangledLanes;if(u!==0)for(e=e.entanglements,u&=t;0<u;){var h=31-Wt(u),p=1<<h;t|=e[h],u&=~p}return cr=t,Rs(),o}function ev(e,t){Me=null,z.H=Bn,t===so?(t=pp(),nt=3):t===dp?(t=pp(),nt=4):nt=t===hm?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,en=t,Ue===null&&(st=1,Xs(e,fn(t,e.current)))}function tv(){var e=z.H;return z.H=Bn,e===null?Bn:e}function nv(){var e=z.A;return z.A=JS,e}function cf(){st=4,ur||(He&4194176)!==He&&gn.current!==null||(ua=!0),!(jr&134217727)&&!(_i&134217727)||tt===null||fr(tt,He,yn,!1)}function ff(e,t,o){var u=at;at|=2;var h=tv(),p=nv();(tt!==e||He!==t)&&(nl=null,fa(e,t)),t=!1;var w=st;e:do try{if(nt!==0&&Ue!==null){var O=Ue,q=en;switch(nt){case 8:uf(),w=6;break e;case 3:case 2:case 6:gn.current===null&&(t=!0);var Z=nt;if(nt=0,en=null,da(e,O,q,Z),o&&ua){w=0;break e}break;default:Z=nt,nt=0,en=null,da(e,O,q,Z)}}nx(),w=st;break}catch(oe){ev(e,oe)}while(!0);return t&&e.shellSuspendCounter++,rr=wi=null,at=u,z.H=h,z.A=p,Ue===null&&(tt=null,He=0,Rs()),w}function nx(){for(;Ue!==null;)rv(Ue)}function rx(e,t){var o=at;at|=2;var u=tv(),h=nv();tt!==e||He!==t?(nl=null,tl=Ie()+500,fa(e,t)):ua=Va(e,t);e:do try{if(nt!==0&&Ue!==null){t=Ue;var p=en;t:switch(nt){case 1:nt=0,en=null,da(e,t,p,1);break;case 2:if(hp(p)){nt=0,en=null,iv(t);break}t=function(){nt===2&&tt===e&&(nt=7),Hn(e)},p.then(t,t);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:hp(p)?(nt=0,en=null,iv(t)):(nt=0,en=null,da(e,t,p,7));break;case 5:var w=null;switch(Ue.tag){case 26:w=Ue.memoizedState;case 5:case 27:var O=Ue;if(!w||Nv(w)){nt=0,en=null;var q=O.sibling;if(q!==null)Ue=q;else{var Z=O.return;Z!==null?(Ue=Z,al(Z)):Ue=null}break t}}nt=0,en=null,da(e,t,p,5);break;case 6:nt=0,en=null,da(e,t,p,6);break;case 8:uf(),st=6;break e;default:throw Error(a(462))}}ix();break}catch(oe){ev(e,oe)}while(!0);return rr=wi=null,z.H=u,z.A=h,at=o,Ue!==null?0:(tt=null,He=0,Rs(),st)}function ix(){for(;Ue!==null&&!et();)rv(Ue)}function rv(e){var t=Tm(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?al(e):Ue=t}function iv(e){var t=e,o=t.alternate;switch(t.tag){case 15:case 0:t=bm(o,t,t.pendingProps,t.type,void 0,He);break;case 11:t=bm(o,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:gc(t);default:Wm(o,t),t=Ue=Ym(t,cr),t=Tm(o,t,cr)}e.memoizedProps=e.pendingProps,t===null?al(e):Ue=t}function da(e,t,o,u){rr=wi=null,gc(t),Ji=null,uo=0;var h=t.return;try{if(IS(e,h,t,o,He)){st=1,Xs(e,fn(o,e.current)),Ue=null;return}}catch(p){if(h!==null)throw Ue=h,p;st=1,Xs(e,fn(o,e.current)),Ue=null;return}t.flags&32768?($e||u===1?e=!0:ua||He&536870912?e=!1:(ur=e=!0,(u===2||u===3||u===6)&&(u=gn.current,u!==null&&u.tag===13&&(u.flags|=16384))),av(t,e)):al(t)}function al(e){var t=e;do{if(t.flags&32768){av(t,ur);return}e=t.return;var o=KS(t.alternate,t,cr);if(o!==null){Ue=o;return}if(t=t.sibling,t!==null){Ue=t;return}Ue=t=e}while(t!==null);st===0&&(st=5)}function av(e,t){do{var o=QS(e.alternate,e);if(o!==null){o.flags&=32767,Ue=o;return}if(o=e.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!t&&(e=e.sibling,e!==null)){Ue=e;return}Ue=e=o}while(e!==null);st=6,Ue=null}function ov(e,t,o,u,h,p,w,O,q,Z){var oe=z.T,ce=Q.p;try{Q.p=2,z.T=null,ax(e,t,o,u,ce,h,p,w,O,q,Z)}finally{z.T=oe,Q.p=ce}}function ax(e,t,o,u,h,p,w,O){do ha();while(Ti!==null);if(at&6)throw Error(a(327));var q=e.finishedWork;if(u=e.finishedLanes,q===null)return null;if(e.finishedWork=null,e.finishedLanes=0,q===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var Z=q.lanes|q.childLanes;if(Z|=Ju,j1(e,u,Z,p,w,O),e===tt&&(Ue=tt=null,He=0),!(q.subtreeFlags&10256)&&!(q.flags&10256)||rl||(rl=!0,af=Z,of=o,ux(Gt,function(){return ha(),null})),o=(q.flags&15990)!==0,q.subtreeFlags&15990||o?(o=z.T,z.T=null,p=Q.p,Q.p=2,w=at,at|=4,XS(e,q),Fm(q,e),DS(xf,e.containerInfo),vl=!!Sf,xf=Sf=null,e.current=q,Mm(e,q.alternate,q),ut(),at=w,Q.p=p,z.T=o):e.current=q,rl?(rl=!1,Ti=e,Ro=u):sv(e,Z),Z=e.pendingLanes,Z===0&&(Ur=null),ji(q.stateNode),Hn(e),t!==null)for(h=e.onRecoverableError,q=0;q<t.length;q++)Z=t[q],h(Z.value,{componentStack:Z.stack});return Ro&3&&ha(),Z=e.pendingLanes,u&4194218&&Z&42?e===sf?Do++:(Do=0,sf=e):Do=0,Oo(0),null}function sv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,fo(t)))}function ha(){if(Ti!==null){var e=Ti,t=af;af=0;var o=mg(Ro),u=z.T,h=Q.p;try{if(Q.p=32>o?32:o,z.T=null,Ti===null)var p=!1;else{o=of,of=null;var w=Ti,O=Ro;if(Ti=null,Ro=0,at&6)throw Error(a(331));var q=at;if(at|=4,Vm(w.current),Pm(w,w.current,O,o),at=q,Oo(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Mn,w)}catch{}p=!0}return p}finally{Q.p=h,z.T=u,sv(e,t)}}return!1}function lv(e,t,o){t=fn(o,t),t=Rc(e.stateNode,t,2),e=Lr(e,t,2),e!==null&&(Ia(e,2),Hn(e))}function Qe(e,t,o){if(e.tag===3)lv(e,e,o);else for(;t!==null;){if(t.tag===3){lv(t,e,o);break}else if(t.tag===1){var u=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Ur===null||!Ur.has(u))){e=fn(o,e),o=fm(2),u=Lr(t,o,2),u!==null&&(dm(o,u,t,e),Ia(u,2),Hn(u));break}}t=t.return}}function df(e,t,o){var u=e.pingCache;if(u===null){u=e.pingCache=new ex;var h=new Set;u.set(t,h)}else h=u.get(t),h===void 0&&(h=new Set,u.set(t,h));h.has(o)||(ef=!0,h.add(o),e=ox.bind(null,e,t,o),t.then(e,e))}function ox(e,t,o){var u=e.pingCache;u!==null&&u.delete(t),e.pingedLanes|=e.suspendedLanes&o,e.warmLanes&=~o,tt===e&&(He&o)===o&&(st===4||st===3&&(He&62914560)===He&&300>Ie()-rf?!(at&2)&&fa(e,0):tf|=o,ca===He&&(ca=0)),Hn(e)}function uv(e,t){t===0&&(t=hg()),e=_r(e,t),e!==null&&(Ia(e,t),Hn(e))}function sx(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),uv(e,o)}function lx(e,t){var o=0;switch(e.tag){case 13:var u=e.stateNode,h=e.memoizedState;h!==null&&(o=h.retryLane);break;case 19:u=e.stateNode;break;case 22:u=e.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(t),uv(e,o)}function ux(e,t){return Se(e,t)}var ol=null,ga=null,hf=!1,sl=!1,gf=!1,Ci=0;function Hn(e){e!==ga&&e.next===null&&(ga===null?ol=ga=e:ga=ga.next=e),sl=!0,hf||(hf=!0,fx(cx))}function Oo(e,t){if(!gf&&sl){gf=!0;do for(var o=!1,u=ol;u!==null;){if(e!==0){var h=u.pendingLanes;if(h===0)var p=0;else{var w=u.suspendedLanes,O=u.pingedLanes;p=(1<<31-Wt(42|e)+1)-1,p&=h&~(w&~O),p=p&201326677?p&201326677|1:p?p|2:0}p!==0&&(o=!0,dv(u,p))}else p=He,p=ms(u,u===tt?p:0),!(p&3)||Va(u,p)||(o=!0,dv(u,p));u=u.next}while(o);gf=!1}}function cx(){sl=hf=!1;var e=0;Ci!==0&&(bx()&&(e=Ci),Ci=0);for(var t=Ie(),o=null,u=ol;u!==null;){var h=u.next,p=cv(u,t);p===0?(u.next=null,o===null?ol=h:o.next=h,h===null&&(ga=o)):(o=u,(e!==0||p&3)&&(sl=!0)),u=h}Oo(e)}function cv(e,t){for(var o=e.suspendedLanes,u=e.pingedLanes,h=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var w=31-Wt(p),O=1<<w,q=h[w];q===-1?(!(O&o)||O&u)&&(h[w]=M1(O,t)):q<=t&&(e.expiredLanes|=O),p&=~O}if(t=tt,o=He,o=ms(e,e===t?o:0),u=e.callbackNode,o===0||e===t&&nt===2||e.cancelPendingCommit!==null)return u!==null&&u!==null&&ne(u),e.callbackNode=null,e.callbackPriority=0;if(!(o&3)||Va(e,o)){if(t=o&-o,t===e.callbackPriority)return t;switch(u!==null&&ne(u),mg(o)){case 2:case 8:o=ct;break;case 32:o=Gt;break;case 268435456:o=sn;break;default:o=Gt}return u=fv.bind(null,e),o=Se(o,u),e.callbackPriority=t,e.callbackNode=o,t}return u!==null&&u!==null&&ne(u),e.callbackPriority=2,e.callbackNode=null,2}function fv(e,t){var o=e.callbackNode;if(ha()&&e.callbackNode!==o)return null;var u=He;return u=ms(e,e===tt?u:0),u===0?null:(Qm(e,u,t),cv(e,Ie()),e.callbackNode!=null&&e.callbackNode===o?fv.bind(null,e):null)}function dv(e,t){if(ha())return null;Qm(e,t,!0)}function fx(e){Ex(function(){at&6?Se(rt,e):e()})}function pf(){return Ci===0&&(Ci=dg()),Ci}function hv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Es(""+e)}function gv(e,t){var o=t.ownerDocument.createElement("input");return o.name=t.name,o.value=t.value,e.id&&o.setAttribute("form",e.id),t.parentNode.insertBefore(o,t),e=new FormData(e),o.parentNode.removeChild(o),e}function dx(e,t,o,u,h){if(t==="submit"&&o&&o.stateNode===h){var p=hv((h[Pt]||null).action),w=u.submitter;w&&(t=(t=w[Pt]||null)?hv(t.formAction):w.getAttribute("formAction"),t!==null&&(p=t,w=null));var O=new Ts("action","action",null,u,h);e.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ci!==0){var q=w?gv(h,w):new FormData(h);xc(o,{pending:!0,data:q,method:h.method,action:p},null,q)}}else typeof p=="function"&&(O.preventDefault(),q=w?gv(h,w):new FormData(h),xc(o,{pending:!0,data:q,method:h.method,action:p},p,q))},currentTarget:h}]})}}for(var mf=0;mf<op.length;mf++){var vf=op[mf],hx=vf.toLowerCase(),gx=vf[0].toUpperCase()+vf.slice(1);_n(hx,"on"+gx)}_n(tp,"onAnimationEnd"),_n(np,"onAnimationIteration"),_n(rp,"onAnimationStart"),_n("dblclick","onDoubleClick"),_n("focusin","onFocus"),_n("focusout","onBlur"),_n(kS,"onTransitionRun"),_n(LS,"onTransitionStart"),_n(NS,"onTransitionCancel"),_n(ip,"onTransitionEnd"),Hi("onMouseEnter",["mouseout","mouseover"]),Hi("onMouseLeave",["mouseout","mouseover"]),Hi("onPointerEnter",["pointerout","pointerover"]),Hi("onPointerLeave",["pointerout","pointerover"]),si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),si("onBeforeInput",["compositionend","keypress","textInput","paste"]),si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="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(" "),px=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function pv(e,t){t=(t&4)!==0;for(var o=0;o<e.length;o++){var u=e[o],h=u.event;u=u.listeners;e:{var p=void 0;if(t)for(var w=u.length-1;0<=w;w--){var O=u[w],q=O.instance,Z=O.currentTarget;if(O=O.listener,q!==p&&h.isPropagationStopped())break e;p=O,h.currentTarget=Z;try{p(h)}catch(oe){Ys(oe)}h.currentTarget=null,p=q}else for(w=0;w<u.length;w++){if(O=u[w],q=O.instance,Z=O.currentTarget,O=O.listener,q!==p&&h.isPropagationStopped())break e;p=O,h.currentTarget=Z;try{p(h)}catch(oe){Ys(oe)}h.currentTarget=null,p=q}}}}function Fe(e,t){var o=t[Lu];o===void 0&&(o=t[Lu]=new Set);var u=e+"__bubble";o.has(u)||(mv(t,e,2,!1),o.add(u))}function yf(e,t,o){var u=0;t&&(u|=4),mv(o,e,u,t)}var ll="_reactListening"+Math.random().toString(36).slice(2);function bf(e){if(!e[ll]){e[ll]=!0,bg.forEach(function(o){o!=="selectionchange"&&(px.has(o)||yf(o,!1,e),yf(o,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ll]||(t[ll]=!0,yf("selectionchange",!1,t))}}function mv(e,t,o,u){switch(Bv(t)){case 2:var h=Hx;break;case 8:h=Px;break;default:h=Lf}o=h.bind(null,t,o,e),h=void 0,!Fu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(h=!0),u?h!==void 0?e.addEventListener(t,o,{capture:!0,passive:h}):e.addEventListener(t,o,!0):h!==void 0?e.addEventListener(t,o,{passive:h}):e.addEventListener(t,o,!1)}function wf(e,t,o,u,h){var p=u;if(!(t&1)&&!(t&2)&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var O=u.stateNode.containerInfo;if(O===h||O.nodeType===8&&O.parentNode===h)break;if(w===4)for(w=u.return;w!==null;){var q=w.tag;if((q===3||q===4)&&(q=w.stateNode.containerInfo,q===h||q.nodeType===8&&q.parentNode===h))return;w=w.return}for(;O!==null;){if(w=oi(O),w===null)return;if(q=w.tag,q===5||q===6||q===26||q===27){u=p=w;continue e}O=O.parentNode}}u=u.return}kg(function(){var Z=p,oe=Uu(o),ce=[];e:{var te=ap.get(e);if(te!==void 0){var ie=Ts,De=e;switch(e){case"keypress":if(xs(o)===0)break e;case"keydown":case"keyup":ie=lS;break;case"focusin":De="focus",ie=qu;break;case"focusout":De="blur",ie=qu;break;case"beforeblur":case"afterblur":ie=qu;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=zg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=W1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=fS;break;case tp:case np:case rp:ie=J1;break;case ip:ie=hS;break;case"scroll":case"scrollend":ie=X1;break;case"wheel":ie=pS;break;case"copy":case"cut":case"paste":ie=tS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Mg;break;case"toggle":case"beforetoggle":ie=vS}var ze=(t&4)!==0,lt=!ze&&(e==="scroll"||e==="scrollend"),W=ze?te!==null?te+"Capture":null:te;ze=[];for(var X=Z,ee;X!==null;){var ue=X;if(ee=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||ee===null||W===null||(ue=Za(X,W),ue!=null&&ze.push(Lo(X,ue,ee))),lt)break;X=X.return}0<ze.length&&(te=new ie(te,De,null,o,oe),ce.push({event:te,listeners:ze}))}}if(!(t&7)){e:{if(te=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",te&&o!==ju&&(De=o.relatedTarget||o.fromElement)&&(oi(De)||De[Ui]))break e;if((ie||te)&&(te=oe.window===oe?oe:(te=oe.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(De=o.relatedTarget||o.toElement,ie=Z,De=De?oi(De):null,De!==null&&(lt=D(De),ze=De.tag,De!==lt||ze!==5&&ze!==27&&ze!==6)&&(De=null)):(ie=null,De=Z),ie!==De)){if(ze=zg,ue="onMouseLeave",W="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(ze=Mg,ue="onPointerLeave",W="onPointerEnter",X="pointer"),lt=ie==null?te:Xa(ie),ee=De==null?te:Xa(De),te=new ze(ue,X+"leave",ie,o,oe),te.target=lt,te.relatedTarget=ee,ue=null,oi(oe)===Z&&(ze=new ze(W,X+"enter",De,o,oe),ze.target=ee,ze.relatedTarget=lt,ue=ze),lt=ue,ie&&De)t:{for(ze=ie,W=De,X=0,ee=ze;ee;ee=pa(ee))X++;for(ee=0,ue=W;ue;ue=pa(ue))ee++;for(;0<X-ee;)ze=pa(ze),X--;for(;0<ee-X;)W=pa(W),ee--;for(;X--;){if(ze===W||W!==null&&ze===W.alternate)break t;ze=pa(ze),W=pa(W)}ze=null}else ze=null;ie!==null&&vv(ce,te,ie,ze,!1),De!==null&<!==null&&vv(ce,lt,De,ze,!0)}}e:{if(te=Z?Xa(Z):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var Ce=qg;else if(Pg(te))if(Vg)Ce=AS;else{Ce=TS;var je=_S}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?Z&&Mu(Z.elementType)&&(Ce=qg):Ce=CS;if(Ce&&(Ce=Ce(e,Z))){$g(ce,Ce,o,oe);break e}je&&je(e,te,Z),e==="focusout"&&Z&&te.type==="number"&&Z.memoizedProps.value!=null&&Gu(te,"number",te.value)}switch(je=Z?Xa(Z):window,e){case"focusin":(Pg(je)||je.contentEditable==="true")&&(Yi=je,Wu=Z,ro=null);break;case"focusout":ro=Wu=Yi=null;break;case"mousedown":Ku=!0;break;case"contextmenu":case"mouseup":case"dragend":Ku=!1,Jg(ce,o,oe);break;case"selectionchange":if(OS)break;case"keydown":case"keyup":Jg(ce,o,oe)}var Oe;if(Iu)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Ii?Fg(e,o)&&(Ne="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Ne="onCompositionStart");Ne&&(jg&&o.locale!=="ko"&&(Ii||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Ii&&(Oe=Lg()):(xr=oe,Hu="value"in xr?xr.value:xr.textContent,Ii=!0)),je=ul(Z,Ne),0<je.length&&(Ne=new Gg(Ne,e,null,o,oe),ce.push({event:Ne,listeners:je}),Oe?Ne.data=Oe:(Oe=Hg(o),Oe!==null&&(Ne.data=Oe)))),(Oe=bS?wS(e,o):ES(e,o))&&(Ne=ul(Z,"onBeforeInput"),0<Ne.length&&(je=new Gg("onBeforeInput","beforeinput",null,o,oe),ce.push({event:je,listeners:Ne}),je.data=Oe)),dx(ce,e,Z,o,oe)}pv(ce,t)})}function Lo(e,t,o){return{instance:e,listener:t,currentTarget:o}}function ul(e,t){for(var o=t+"Capture",u=[];e!==null;){var h=e,p=h.stateNode;h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=Za(e,o),h!=null&&u.unshift(Lo(e,h,p)),h=Za(e,t),h!=null&&u.push(Lo(e,h,p))),e=e.return}return u}function pa(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function vv(e,t,o,u,h){for(var p=t._reactName,w=[];o!==null&&o!==u;){var O=o,q=O.alternate,Z=O.stateNode;if(O=O.tag,q!==null&&q===u)break;O!==5&&O!==26&&O!==27||Z===null||(q=Z,h?(Z=Za(o,p),Z!=null&&w.unshift(Lo(o,Z,q))):h||(Z=Za(o,p),Z!=null&&w.push(Lo(o,Z,q)))),o=o.return}w.length!==0&&e.push({event:t,listeners:w})}var mx=/\r\n?/g,vx=/\u0000|\uFFFD/g;function yv(e){return(typeof e=="string"?e:""+e).replace(mx,`
|
|
`).replace(vx,"")}function bv(e,t){return t=yv(t),yv(e)===t}function cl(){}function We(e,t,o,u,h,p){switch(o){case"children":typeof u=="string"?t==="body"||t==="textarea"&&u===""||$i(e,u):(typeof u=="number"||typeof u=="bigint")&&t!=="body"&&$i(e,""+u);break;case"className":ys(e,"class",u);break;case"tabIndex":ys(e,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ys(e,o,u);break;case"style":Dg(e,u,p);break;case"data":if(t!=="object"){ys(e,"data",u);break}case"src":case"href":if(u===""&&(t!=="a"||o!=="href")){e.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(o);break}u=Es(""+u),e.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){e.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(o==="formAction"?(t!=="input"&&We(e,t,"name",h.name,h,null),We(e,t,"formEncType",h.formEncType,h,null),We(e,t,"formMethod",h.formMethod,h,null),We(e,t,"formTarget",h.formTarget,h,null)):(We(e,t,"encType",h.encType,h,null),We(e,t,"method",h.method,h,null),We(e,t,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(o);break}u=Es(""+u),e.setAttribute(o,u);break;case"onClick":u!=null&&(e.onclick=cl);break;case"onScroll":u!=null&&Fe("scroll",e);break;case"onScrollEnd":u!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"multiple":e.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":e.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){e.removeAttribute("xlink:href");break}o=Es(""+u),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(o,""+u):e.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(o,""):e.removeAttribute(o);break;case"capture":case"download":u===!0?e.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(o,u):e.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?e.setAttribute(o,u):e.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?e.removeAttribute(o):e.setAttribute(o,u);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),vs(e,"popover",u);break;case"xlinkActuate":Kn(e,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Kn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Kn(e,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Kn(e,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Kn(e,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Kn(e,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Kn(e,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":vs(e,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=I1.get(o)||o,vs(e,o,u))}}function Ef(e,t,o,u,h,p){switch(o){case"style":Dg(e,u,p);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(o=u.__html,o!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=o}}break;case"children":typeof u=="string"?$i(e,u):(typeof u=="number"||typeof u=="bigint")&&$i(e,""+u);break;case"onScroll":u!=null&&Fe("scroll",e);break;case"onScrollEnd":u!=null&&Fe("scrollend",e);break;case"onClick":u!=null&&(e.onclick=cl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wg.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),t=o.slice(2,h?o.length-7:void 0),p=e[Pt]||null,p=p!=null?p[o]:null,typeof p=="function"&&e.removeEventListener(t,p,h),typeof u=="function")){typeof p!="function"&&p!==null&&(o in e?e[o]=null:e.hasAttribute(o)&&e.removeAttribute(o)),e.addEventListener(t,u,h);break e}o in e?e[o]=u:u===!0?e.setAttribute(o,""):vs(e,o,u)}}}function kt(e,t,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var u=!1,h=!1,p;for(p in o)if(o.hasOwnProperty(p)){var w=o[p];if(w!=null)switch(p){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:We(e,t,p,w,o,null)}}h&&We(e,t,"srcSet",o.srcSet,o,null),u&&We(e,t,"src",o.src,o,null);return;case"input":Fe("invalid",e);var O=p=w=h=null,q=null,Z=null;for(u in o)if(o.hasOwnProperty(u)){var oe=o[u];if(oe!=null)switch(u){case"name":h=oe;break;case"type":w=oe;break;case"checked":q=oe;break;case"defaultChecked":Z=oe;break;case"value":p=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,t));break;default:We(e,t,u,oe,o,null)}}Tg(e,p,O,q,Z,w,h,!1),bs(e);return;case"select":Fe("invalid",e),u=w=p=null;for(h in o)if(o.hasOwnProperty(h)&&(O=o[h],O!=null))switch(h){case"value":p=O;break;case"defaultValue":w=O;break;case"multiple":u=O;default:We(e,t,h,O,o,null)}t=p,o=w,e.multiple=!!u,t!=null?Pi(e,!!u,t,!1):o!=null&&Pi(e,!!u,o,!0);return;case"textarea":Fe("invalid",e),p=h=u=null;for(w in o)if(o.hasOwnProperty(w)&&(O=o[w],O!=null))switch(w){case"value":u=O;break;case"defaultValue":h=O;break;case"children":p=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(a(91));break;default:We(e,t,w,O,o,null)}Ag(e,u,h,p),bs(e);return;case"option":for(q in o)if(o.hasOwnProperty(q)&&(u=o[q],u!=null))switch(q){case"selected":e.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:We(e,t,q,u,o,null)}return;case"dialog":Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(u=0;u<ko.length;u++)Fe(ko[u],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("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(Z in o)if(o.hasOwnProperty(Z)&&(u=o[Z],u!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:We(e,t,Z,u,o,null)}return;default:if(Mu(t)){for(oe in o)o.hasOwnProperty(oe)&&(u=o[oe],u!==void 0&&Ef(e,t,oe,u,o,void 0));return}}for(O in o)o.hasOwnProperty(O)&&(u=o[O],u!=null&&We(e,t,O,u,o,null))}function yx(e,t,o,u){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,w=null,O=null,q=null,Z=null,oe=null;for(ie in o){var ce=o[ie];if(o.hasOwnProperty(ie)&&ce!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":q=ce;default:u.hasOwnProperty(ie)||We(e,t,ie,null,u,ce)}}for(var te in u){var ie=u[te];if(ce=o[te],u.hasOwnProperty(te)&&(ie!=null||ce!=null))switch(te){case"type":p=ie;break;case"name":h=ie;break;case"checked":Z=ie;break;case"defaultChecked":oe=ie;break;case"value":w=ie;break;case"defaultValue":O=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,t));break;default:ie!==ce&&We(e,t,te,ie,u,ce)}}zu(e,w,O,q,Z,oe,p,h);return;case"select":ie=w=O=te=null;for(p in o)if(q=o[p],o.hasOwnProperty(p)&&q!=null)switch(p){case"value":break;case"multiple":ie=q;default:u.hasOwnProperty(p)||We(e,t,p,null,u,q)}for(h in u)if(p=u[h],q=o[h],u.hasOwnProperty(h)&&(p!=null||q!=null))switch(h){case"value":te=p;break;case"defaultValue":O=p;break;case"multiple":w=p;default:p!==q&&We(e,t,h,p,u,q)}t=O,o=w,u=ie,te!=null?Pi(e,!!o,te,!1):!!u!=!!o&&(t!=null?Pi(e,!!o,t,!0):Pi(e,!!o,o?[]:"",!1));return;case"textarea":ie=te=null;for(O in o)if(h=o[O],o.hasOwnProperty(O)&&h!=null&&!u.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:We(e,t,O,null,u,h)}for(w in u)if(h=u[w],p=o[w],u.hasOwnProperty(w)&&(h!=null||p!=null))switch(w){case"value":te=h;break;case"defaultValue":ie=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==p&&We(e,t,w,h,u,p)}Cg(e,te,ie);return;case"option":for(var De in o)if(te=o[De],o.hasOwnProperty(De)&&te!=null&&!u.hasOwnProperty(De))switch(De){case"selected":e.selected=!1;break;default:We(e,t,De,null,u,te)}for(q in u)if(te=u[q],ie=o[q],u.hasOwnProperty(q)&&te!==ie&&(te!=null||ie!=null))switch(q){case"selected":e.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:We(e,t,q,te,u,ie)}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 ze in o)te=o[ze],o.hasOwnProperty(ze)&&te!=null&&!u.hasOwnProperty(ze)&&We(e,t,ze,null,u,te);for(Z in u)if(te=u[Z],ie=o[Z],u.hasOwnProperty(Z)&&te!==ie&&(te!=null||ie!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,t));break;default:We(e,t,Z,te,u,ie)}return;default:if(Mu(t)){for(var lt in o)te=o[lt],o.hasOwnProperty(lt)&&te!==void 0&&!u.hasOwnProperty(lt)&&Ef(e,t,lt,void 0,u,te);for(oe in u)te=u[oe],ie=o[oe],!u.hasOwnProperty(oe)||te===ie||te===void 0&&ie===void 0||Ef(e,t,oe,te,u,ie);return}}for(var W in o)te=o[W],o.hasOwnProperty(W)&&te!=null&&!u.hasOwnProperty(W)&&We(e,t,W,null,u,te);for(ce in u)te=u[ce],ie=o[ce],!u.hasOwnProperty(ce)||te===ie||te==null&&ie==null||We(e,t,ce,te,u,ie)}var Sf=null,xf=null;function fl(e){return e.nodeType===9?e:e.ownerDocument}function wv(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 Ev(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function _f(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tf=null;function bx(){var e=window.event;return e&&e.type==="popstate"?e===Tf?!1:(Tf=e,!0):(Tf=null,!1)}var Sv=typeof setTimeout=="function"?setTimeout:void 0,wx=typeof clearTimeout=="function"?clearTimeout:void 0,xv=typeof Promise=="function"?Promise:void 0,Ex=typeof queueMicrotask=="function"?queueMicrotask:typeof xv<"u"?function(e){return xv.resolve(null).then(e).catch(Sx)}:Sv;function Sx(e){setTimeout(function(){throw e})}function Cf(e,t){var o=t,u=0;do{var h=o.nextSibling;if(e.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"){if(u===0){e.removeChild(h),Fo(t);return}u--}else o!=="$"&&o!=="$?"&&o!=="$!"||u++;o=h}while(o);Fo(t)}function Af(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var o=t;switch(t=t.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Af(o),Nu(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}e.removeChild(o)}}function xx(e,t,o,u){for(;e.nodeType===1;){var h=o;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!u&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(u){if(!e[Ya])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==h.rel||e.getAttribute("href")!==(h.href==null?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=An(e.nextSibling),e===null)break}return null}function _x(e,t,o){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!o||(e=An(e.nextSibling),e===null))return null;return e}function An(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}function _v(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(t===0)return e;t--}else o==="/$"&&t++}e=e.previousSibling}return null}function Tv(e,t,o){switch(t=fl(o),e){case"html":if(e=t.documentElement,!e)throw Error(a(452));return e;case"head":if(e=t.head,!e)throw Error(a(453));return e;case"body":if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}var bn=new Map,Cv=new Set;function dl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.ownerDocument}var dr=Q.d;Q.d={f:Tx,r:Cx,D:Ax,C:Rx,L:Dx,m:Ox,X:Lx,S:kx,M:Nx};function Tx(){var e=dr.f(),t=il();return e||t}function Cx(e){var t=Bi(e);t!==null&&t.tag===5&&t.type==="form"?Jp(t):dr.r(e)}var ma=typeof document>"u"?null:document;function Av(e,t,o){var u=ma;if(u&&typeof t=="string"&&t){var h=un(t);h='link[rel="'+e+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),Cv.has(h)||(Cv.add(h),e={rel:e,crossOrigin:o,href:t},u.querySelector(h)===null&&(t=u.createElement("link"),kt(t,"link",e),St(t),u.head.appendChild(t)))}}function Ax(e){dr.D(e),Av("dns-prefetch",e,null)}function Rx(e,t){dr.C(e,t),Av("preconnect",e,t)}function Dx(e,t,o){dr.L(e,t,o);var u=ma;if(u&&e&&t){var h='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+un(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+un(o.imageSizes)+'"]')):h+='[href="'+un(e)+'"]';var p=h;switch(t){case"style":p=va(e);break;case"script":p=ya(e)}bn.has(p)||(e=F({rel:"preload",href:t==="image"&&o&&o.imageSrcSet?void 0:e,as:t},o),bn.set(p,e),u.querySelector(h)!==null||t==="style"&&u.querySelector(No(p))||t==="script"&&u.querySelector(zo(p))||(t=u.createElement("link"),kt(t,"link",e),St(t),u.head.appendChild(t)))}}function Ox(e,t){dr.m(e,t);var o=ma;if(o&&e){var u=t&&typeof t.as=="string"?t.as:"script",h='link[rel="modulepreload"][as="'+un(u)+'"][href="'+un(e)+'"]',p=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ya(e)}if(!bn.has(p)&&(e=F({rel:"modulepreload",href:e},t),bn.set(p,e),o.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(zo(p)))return}u=o.createElement("link"),kt(u,"link",e),St(u),o.head.appendChild(u)}}}function kx(e,t,o){dr.S(e,t,o);var u=ma;if(u&&e){var h=Fi(u).hoistableStyles,p=va(e);t=t||"default";var w=h.get(p);if(!w){var O={loading:0,preload:null};if(w=u.querySelector(No(p)))O.loading=5;else{e=F({rel:"stylesheet",href:e,"data-precedence":t},o),(o=bn.get(p))&&Rf(e,o);var q=w=u.createElement("link");St(q),kt(q,"link",e),q._p=new Promise(function(Z,oe){q.onload=Z,q.onerror=oe}),q.addEventListener("load",function(){O.loading|=1}),q.addEventListener("error",function(){O.loading|=2}),O.loading|=4,hl(w,t,u)}w={type:"stylesheet",instance:w,count:1,state:O},h.set(p,w)}}}function Lx(e,t){dr.X(e,t);var o=ma;if(o&&e){var u=Fi(o).hoistableScripts,h=ya(e),p=u.get(h);p||(p=o.querySelector(zo(h)),p||(e=F({src:e,async:!0},t),(t=bn.get(h))&&Df(e,t),p=o.createElement("script"),St(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(h,p))}}function Nx(e,t){dr.M(e,t);var o=ma;if(o&&e){var u=Fi(o).hoistableScripts,h=ya(e),p=u.get(h);p||(p=o.querySelector(zo(h)),p||(e=F({src:e,async:!0,type:"module"},t),(t=bn.get(h))&&Df(e,t),p=o.createElement("script"),St(p),kt(p,"link",e),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},u.set(h,p))}}function Rv(e,t,o,u){var h=(h=Le.current)?dl(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(t=va(o.href),o=Fi(h).hoistableStyles,u=o.get(t),u||(u={type:"style",instance:null,count:0,state:null},o.set(t,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){e=va(o.href);var p=Fi(h).hoistableStyles,w=p.get(e);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,w),(p=h.querySelector(No(e)))&&!p._p&&(w.instance=p,w.state.loading=5),bn.has(e)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},bn.set(e,o),p||zx(h,e,o,w.state))),t&&u===null)throw Error(a(528,""));return w}if(t&&u!==null)throw Error(a(529,""));return null;case"script":return t=o.async,o=o.src,typeof o=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ya(o),o=Fi(h).hoistableScripts,u=o.get(t),u||(u={type:"script",instance:null,count:0,state:null},o.set(t,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function va(e){return'href="'+un(e)+'"'}function No(e){return'link[rel="stylesheet"]['+e+"]"}function Dv(e){return F({},e,{"data-precedence":e.precedence,precedence:null})}function zx(e,t,o,u){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?u.loading=1:(t=e.createElement("link"),u.preload=t,t.addEventListener("load",function(){return u.loading|=1}),t.addEventListener("error",function(){return u.loading|=2}),kt(t,"link",o),St(t),e.head.appendChild(t))}function ya(e){return'[src="'+un(e)+'"]'}function zo(e){return"script[async]"+e}function Ov(e,t,o){if(t.count++,t.instance===null)switch(t.type){case"style":var u=e.querySelector('style[data-href~="'+un(o.href)+'"]');if(u)return t.instance=u,St(u),u;var h=F({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(e.ownerDocument||e).createElement("style"),St(u),kt(u,"style",h),hl(u,o.precedence,e),t.instance=u;case"stylesheet":h=va(o.href);var p=e.querySelector(No(h));if(p)return t.state.loading|=4,t.instance=p,St(p),p;u=Dv(o),(h=bn.get(h))&&Rf(u,h),p=(e.ownerDocument||e).createElement("link"),St(p);var w=p;return w._p=new Promise(function(O,q){w.onload=O,w.onerror=q}),kt(p,"link",u),t.state.loading|=4,hl(p,o.precedence,e),t.instance=p;case"script":return p=ya(o.src),(h=e.querySelector(zo(p)))?(t.instance=h,St(h),h):(u=o,(h=bn.get(p))&&(u=F({},o),Df(u,h)),e=e.ownerDocument||e,h=e.createElement("script"),St(h),kt(h,"link",u),e.head.appendChild(h),t.instance=h);case"void":return null;default:throw Error(a(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(u=t.instance,t.state.loading|=4,hl(u,o.precedence,e));return t.instance}function hl(e,t,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,p=h,w=0;w<u.length;w++){var O=u[w];if(O.dataset.precedence===t)p=O;else if(p!==h)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=o.nodeType===9?o.head:o,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Df(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gl=null;function kv(e,t,o){if(gl===null){var u=new Map,h=gl=new Map;h.set(o,u)}else h=gl,u=h.get(o),u||(u=new Map,h.set(o,u));if(u.has(e))return u;for(u.set(e,null),o=o.getElementsByTagName(e),h=0;h<o.length;h++){var p=o[h];if(!(p[Ya]||p[Mt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(t)||"";w=e+w;var O=u.get(w);O?O.push(p):u.set(w,[p])}}return u}function Lv(e,t,o){e=e.ownerDocument||e,e.head.insertBefore(o,t==="title"?e.querySelector("head > title"):null)}function Gx(e,t,o){if(o===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Nv(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Go=null;function Mx(){}function jx(e,t,o){if(Go===null)throw Error(a(475));var u=Go;if(t.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var h=va(o.href),p=e.querySelector(No(h));if(p){e=p._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(u.count++,u=pl.bind(u),e.then(u,u)),t.state.loading|=4,t.instance=p,St(p);return}p=e.ownerDocument||e,o=Dv(o),(h=bn.get(h))&&Rf(o,h),p=p.createElement("link"),St(p);var w=p;w._p=new Promise(function(O,q){w.onload=O,w.onerror=q}),kt(p,"link",o),t.instance=p}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(u.count++,t=pl.bind(u),e.addEventListener("load",t),e.addEventListener("error",t))}}function Ux(){if(Go===null)throw Error(a(475));var e=Go;return e.stylesheets&&e.count===0&&Of(e,e.stylesheets),0<e.count?function(t){var o=setTimeout(function(){if(e.stylesheets&&Of(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(o)}}:null}function pl(){if(this.count--,this.count===0){if(this.stylesheets)Of(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ml=null;function Of(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ml=new Map,t.forEach(Bx,e),ml=null,pl.call(e))}function Bx(e,t){if(!(t.state.loading&4)){var o=ml.get(e);if(o)var u=o.get(null);else{o=new Map,ml.set(e,o);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var w=h[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(o.set(w.dataset.precedence,w),u=w)}u&&o.set(null,u)}h=t.instance,w=h.getAttribute("data-precedence"),p=o.get(w)||u,p===u&&o.set(null,h),o.set(w,h),this.count++,u=pl.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),p?p.parentNode.insertBefore(h,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),t.state.loading|=4}}var Mo={$$typeof:b,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function Fx(e,t,o,u,h,p,w,O){this.tag=1,this.containerInfo=e,this.finishedWork=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=ku(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ku(0),this.hiddenUpdates=ku(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function zv(e,t,o,u,h,p,w,O,q,Z,oe,ce){return e=new Fx(e,t,o,w,O,q,Z,ce),t=1,p===!0&&(t|=24),p=vn(3,null,null,t),e.current=p,p.stateNode=e,t=sc(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:u,isDehydrated:o,cache:t},Hc(p),e}function Gv(e){return e?(e=Wi,e):Wi}function Mv(e,t,o,u,h,p){h=Gv(h),u.context===null?u.context=h:u.pendingContext=h,u=kr(t),u.payload={element:o},p=p===void 0?null:p,p!==null&&(u.callback=p),o=Lr(e,u,t),o!==null&&(Ft(o,e,t),bo(o,e,t))}function jv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<t?o:t}}function kf(e,t){jv(e,t),(e=e.alternate)&&jv(e,t)}function Uv(e){if(e.tag===13){var t=_r(e,67108864);t!==null&&Ft(t,e,67108864),kf(e,67108864)}}var vl=!0;function Hx(e,t,o,u){var h=z.T;z.T=null;var p=Q.p;try{Q.p=2,Lf(e,t,o,u)}finally{Q.p=p,z.T=h}}function Px(e,t,o,u){var h=z.T;z.T=null;var p=Q.p;try{Q.p=8,Lf(e,t,o,u)}finally{Q.p=p,z.T=h}}function Lf(e,t,o,u){if(vl){var h=Nf(u);if(h===null)wf(e,t,u,yl,o),Fv(e,u);else if(qx(h,e,t,o,u))u.stopPropagation();else if(Fv(e,u),t&4&&-1<$x.indexOf(e)){for(;h!==null;){var p=Bi(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=ai(p.pendingLanes);if(w!==0){var O=p;for(O.pendingLanes|=2,O.entangledLanes|=2;w;){var q=1<<31-Wt(w);O.entanglements[1]|=q,w&=~q}Hn(p),!(at&6)&&(tl=Ie()+500,Oo(0))}}break;case 13:O=_r(p,2),O!==null&&Ft(O,p,2),il(),kf(p,2)}if(p=Nf(u),p===null&&wf(e,t,u,yl,o),p===h)break;h=p}h!==null&&u.stopPropagation()}else wf(e,t,u,null,o)}}function Nf(e){return e=Uu(e),zf(e)}var yl=null;function zf(e){if(yl=null,e=oi(e),e!==null){var t=D(e);if(t===null)e=null;else{var o=t.tag;if(o===13){if(e=se(t),e!==null)return e;e=null}else if(o===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yl=e,null}function Bv(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(Et()){case rt:return 2;case ct:return 8;case Gt:case Ht:return 32;case sn:return 268435456;default:return 32}default:return 32}}var Gf=!1,Br=null,Fr=null,Hr=null,jo=new Map,Uo=new Map,Pr=[],$x="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 Fv(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Fr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":jo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(t.pointerId)}}function Bo(e,t,o,u,h,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:o,eventSystemFlags:u,nativeEvent:p,targetContainers:[h]},t!==null&&(t=Bi(t),t!==null&&Uv(t)),e):(e.eventSystemFlags|=u,t=e.targetContainers,h!==null&&t.indexOf(h)===-1&&t.push(h),e)}function qx(e,t,o,u,h){switch(t){case"focusin":return Br=Bo(Br,e,t,o,u,h),!0;case"dragenter":return Fr=Bo(Fr,e,t,o,u,h),!0;case"mouseover":return Hr=Bo(Hr,e,t,o,u,h),!0;case"pointerover":var p=h.pointerId;return jo.set(p,Bo(jo.get(p)||null,e,t,o,u,h)),!0;case"gotpointercapture":return p=h.pointerId,Uo.set(p,Bo(Uo.get(p)||null,e,t,o,u,h)),!0}return!1}function Hv(e){var t=oi(e.target);if(t!==null){var o=D(t);if(o!==null){if(t=o.tag,t===13){if(t=se(o),t!==null){e.blockedOn=t,U1(e.priority,function(){if(o.tag===13){var u=tn(),h=_r(o,u);h!==null&&Ft(h,o,u),kf(o,u)}});return}}else if(t===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function bl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var o=Nf(e.nativeEvent);if(o===null){o=e.nativeEvent;var u=new o.constructor(o.type,o);ju=u,o.target.dispatchEvent(u),ju=null}else return t=Bi(o),t!==null&&Uv(t),e.blockedOn=o,!1;t.shift()}return!0}function Pv(e,t,o){bl(e)&&o.delete(t)}function Vx(){Gf=!1,Br!==null&&bl(Br)&&(Br=null),Fr!==null&&bl(Fr)&&(Fr=null),Hr!==null&&bl(Hr)&&(Hr=null),jo.forEach(Pv),Uo.forEach(Pv)}function wl(e,t){e.blockedOn===t&&(e.blockedOn=null,Gf||(Gf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Vx)))}var El=null;function $v(e){El!==e&&(El=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){El===e&&(El=null);for(var t=0;t<e.length;t+=3){var o=e[t],u=e[t+1],h=e[t+2];if(typeof u!="function"){if(zf(u||o)===null)continue;break}var p=Bi(o);p!==null&&(e.splice(t,3),t-=3,xc(p,{pending:!0,data:h,method:o.method,action:u},u,h))}}))}function Fo(e){function t(q){return wl(q,e)}Br!==null&&wl(Br,e),Fr!==null&&wl(Fr,e),Hr!==null&&wl(Hr,e),jo.forEach(t),Uo.forEach(t);for(var o=0;o<Pr.length;o++){var u=Pr[o];u.blockedOn===e&&(u.blockedOn=null)}for(;0<Pr.length&&(o=Pr[0],o.blockedOn===null);)Hv(o),o.blockedOn===null&&Pr.shift();if(o=(e.ownerDocument||e).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var h=o[u],p=o[u+1],w=h[Pt]||null;if(typeof p=="function")w||$v(o);else if(w){var O=null;if(p&&p.hasAttribute("formAction")){if(h=p,w=p[Pt]||null)O=w.formAction;else if(zf(h)!==null)continue}else O=w.action;typeof O=="function"?o[u+1]=O:(o.splice(u,3),u-=3),$v(o)}}}function Mf(e){this._internalRoot=e}Sl.prototype.render=Mf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var o=t.current,u=tn();Mv(o,u,e,t,null,null)},Sl.prototype.unmount=Mf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e.tag===0&&ha(),Mv(e.current,2,null,e,null,null),il(),t[Ui]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var t=vg();e={blockedOn:null,target:e,priority:t};for(var o=0;o<Pr.length&&t!==0&&t<Pr[o].priority;o++);Pr.splice(o,0,e),o===0&&Hv(e)}};var qv=n.version;if(qv!=="19.0.0")throw Error(a(527,qv,"19.0.0"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=P(t),e=e!==null?k(e):null,e=e===null?null:e.stateNode,e};var Ix={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:z,findFiberByHostInstance:oi,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xl.isDisabled&&xl.supportsFiber)try{Mn=xl.inject(Ix),ft=xl}catch{}}return Po.createRoot=function(e,t){if(!s(e))throw Error(a(299));var o=!1,u="",h=sm,p=lm,w=um,O=null;return t!=null&&(t.unstable_strictMode===!0&&(o=!0),t.identifierPrefix!==void 0&&(u=t.identifierPrefix),t.onUncaughtError!==void 0&&(h=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(w=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(O=t.unstable_transitionCallbacks)),t=zv(e,1,!1,null,null,o,u,h,p,w,O,null),e[Ui]=t.current,bf(e.nodeType===8?e.parentNode:e),new Mf(t)},Po.hydrateRoot=function(e,t,o){if(!s(e))throw Error(a(299));var u=!1,h="",p=sm,w=lm,O=um,q=null,Z=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(w=o.onCaughtError),o.onRecoverableError!==void 0&&(O=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(q=o.unstable_transitionCallbacks),o.formState!==void 0&&(Z=o.formState)),t=zv(e,1,!0,t,o??null,u,h,p,w,O,q,Z),t.context=Gv(null),o=t.current,u=tn(),h=kr(u),h.callback=null,Lr(o,h,u),t.current.lanes=u,Ia(t,u),Hn(t),e[Ui]=t.current,bf(e),new Sl(t)},Po.version="19.0.0",Po}var ey;function o_(){if(ey)return Bf.exports;ey=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),Bf.exports=a_(),Bf.exports}var s_=o_();const ty=r=>{let n;const i=new Set,a=(g,m)=>{const v=typeof g=="function"?g(n):g;if(!Object.is(v,n)){const y=n;n=m??(typeof v!="object"||v===null)?v:Object.assign({},n,v),i.forEach(b=>b(n,y))}},s=()=>n,f={setState:a,getState:s,getInitialState:()=>d,subscribe:g=>(i.add(g),()=>i.delete(g))},d=n=r(a,s,f);return f},l_=r=>r?ty(r):ty,u_=r=>r;function c_(r,n=u_){const i=bt.useSyncExternalStore(r.subscribe,()=>n(r.getState()),()=>n(r.getInitialState()));return bt.useDebugValue(i),i}const f_=r=>{const n=l_(r),i=a=>c_(n,a);return Object.assign(i,n),i},yh=r=>f_;function s0(r,n){let i;try{i=r()}catch{return}return{getItem:s=>{var l;const c=d=>d===null?null:JSON.parse(d,void 0),f=(l=i.getItem(s))!=null?l:null;return f instanceof Promise?f.then(c):c(f)},setItem:(s,l)=>i.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>i.removeItem(s)}}const qd=r=>n=>{try{const i=r(n);return i instanceof Promise?i:{then(a){return qd(a)(i)},catch(a){return this}}}catch(i){return{then(a){return this},catch(a){return qd(a)(i)}}}},d_=(r,n)=>(i,a,s)=>{let l={storage:s0(()=>localStorage),partialize:E=>E,version:0,merge:(E,T)=>({...T,...E}),...n},c=!1;const f=new Set,d=new Set;let g=l.storage;if(!g)return r((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),i(...E)},a,s);const m=()=>{const E=l.partialize({...a()});return g.setItem(l.name,{state:E,version:l.version})},v=s.setState;s.setState=(E,T)=>{v(E,T),m()};const y=r((...E)=>{i(...E),m()},a,s);s.getInitialState=()=>y;let b;const x=()=>{var E,T;if(!g)return;c=!1,f.forEach(N=>{var L;return N((L=a())!=null?L:y)});const M=((T=l.onRehydrateStorage)==null?void 0:T.call(l,(E=a())!=null?E:y))||void 0;return qd(g.getItem.bind(g))(l.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==l.version){if(l.migrate){const L=l.migrate(N.state,N.version);return L instanceof Promise?L.then(C=>[!0,C]):[!0,L]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var L;const[C,R]=N;if(b=l.merge(R,(L=a())!=null?L:y),i(b,!0),C)return m()}).then(()=>{M==null||M(b,void 0),b=a(),c=!0,d.forEach(N=>N(b))}).catch(N=>{M==null||M(void 0,N)})};return s.persist={setOptions:E=>{l={...l,...E},E.storage&&(g=E.storage)},clearStorage:()=>{g==null||g.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>x(),hasHydrated:()=>c,onHydrate:E=>(f.add(E),()=>{f.delete(E)}),onFinishHydration:E=>(d.add(E),()=>{d.delete(E)})},l.skipHydration||x(),b||y},h_=d_;function l0(r){var n,i,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var s=r.length;for(n=0;n<s;n++)r[n]&&(i=l0(r[n]))&&(a&&(a+=" "),a+=i)}else for(i in r)r[i]&&(a&&(a+=" "),a+=i);return a}function u0(){for(var r,n,i=0,a="",s=arguments.length;i<s;i++)(r=arguments[i])&&(n=l0(r))&&(a&&(a+=" "),a+=n);return a}const bh="-",g_=r=>{const n=m_(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:a}=r;return{getClassGroupId:c=>{const f=c.split(bh);return f[0]===""&&f.length!==1&&f.shift(),c0(f,n)||p_(c)},getConflictingClassGroupIds:(c,f)=>{const d=i[c]||[];return f&&a[c]?[...d,...a[c]]:d}}},c0=(r,n)=>{var c;if(r.length===0)return n.classGroupId;const i=r[0],a=n.nextPart.get(i),s=a?c0(r.slice(1),a):void 0;if(s)return s;if(n.validators.length===0)return;const l=r.join(bh);return(c=n.validators.find(({validator:f})=>f(l)))==null?void 0:c.classGroupId},ny=/^\[(.+)\]$/,p_=r=>{if(ny.test(r)){const n=ny.exec(r)[1],i=n==null?void 0:n.substring(0,n.indexOf(":"));if(i)return"arbitrary.."+i}},m_=r=>{const{theme:n,classGroups:i}=r,a={nextPart:new Map,validators:[]};for(const s in i)Vd(i[s],a,s,n);return a},Vd=(r,n,i,a)=>{r.forEach(s=>{if(typeof s=="string"){const l=s===""?n:ry(n,s);l.classGroupId=i;return}if(typeof s=="function"){if(v_(s)){Vd(s(a),n,i,a);return}n.validators.push({validator:s,classGroupId:i});return}Object.entries(s).forEach(([l,c])=>{Vd(c,ry(n,l),i,a)})})},ry=(r,n)=>{let i=r;return n.split(bh).forEach(a=>{i.nextPart.has(a)||i.nextPart.set(a,{nextPart:new Map,validators:[]}),i=i.nextPart.get(a)}),i},v_=r=>r.isThemeGetter,y_=r=>{if(r<1)return{get:()=>{},set:()=>{}};let n=0,i=new Map,a=new Map;const s=(l,c)=>{i.set(l,c),n++,n>r&&(n=0,a=i,i=new Map)};return{get(l){let c=i.get(l);if(c!==void 0)return c;if((c=a.get(l))!==void 0)return s(l,c),c},set(l,c){i.has(l)?i.set(l,c):s(l,c)}}},Id="!",Yd=":",b_=Yd.length,w_=r=>{const{prefix:n,experimentalParseClassName:i}=r;let a=s=>{const l=[];let c=0,f=0,d=0,g;for(let x=0;x<s.length;x++){let E=s[x];if(c===0&&f===0){if(E===Yd){l.push(s.slice(d,x)),d=x+b_;continue}if(E==="/"){g=x;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const m=l.length===0?s:s.substring(d),v=E_(m),y=v!==m,b=g&&g>d?g-d:void 0;return{modifiers:l,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:b}};if(n){const s=n+Yd,l=a;a=c=>c.startsWith(s)?l(c.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(i){const s=a;a=l=>i({className:l,parseClassName:s})}return a},E_=r=>r.endsWith(Id)?r.substring(0,r.length-1):r.startsWith(Id)?r.substring(1):r,S_=r=>{const n=Object.fromEntries(r.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const s=[];let l=[];return a.forEach(c=>{c[0]==="["||n[c]?(s.push(...l.sort(),c),l=[]):l.push(c)}),s.push(...l.sort()),s}},x_=r=>({cache:y_(r.cacheSize),parseClassName:w_(r),sortModifiers:S_(r),...g_(r)}),__=/\s+/,T_=(r,n)=>{const{parseClassName:i,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:l}=n,c=[],f=r.trim().split(__);let d="";for(let g=f.length-1;g>=0;g-=1){const m=f[g],{isExternal:v,modifiers:y,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:E}=i(m);if(v){d=m+(d.length>0?" "+d:d);continue}let T=!!E,M=a(T?x.substring(0,E):x);if(!M){if(!T){d=m+(d.length>0?" "+d:d);continue}if(M=a(x),!M){d=m+(d.length>0?" "+d:d);continue}T=!1}const N=l(y).join(":"),L=b?N+Id:N,C=L+M;if(c.includes(C))continue;c.push(C);const R=s(M,T);for(let B=0;B<R.length;++B){const _=R[B];c.push(L+_)}d=m+(d.length>0?" "+d:d)}return d};function C_(){let r=0,n,i,a="";for(;r<arguments.length;)(n=arguments[r++])&&(i=f0(n))&&(a&&(a+=" "),a+=i);return a}const f0=r=>{if(typeof r=="string")return r;let n,i="";for(let a=0;a<r.length;a++)r[a]&&(n=f0(r[a]))&&(i&&(i+=" "),i+=n);return i};function A_(r,...n){let i,a,s,l=c;function c(d){const g=n.reduce((m,v)=>v(m),r());return i=x_(g),a=i.cache.get,s=i.cache.set,l=f,f(d)}function f(d){const g=a(d);if(g)return g;const m=T_(d,i);return s(d,m),m}return function(){return l(C_.apply(null,arguments))}}const Ct=r=>{const n=i=>i[r]||[];return n.isThemeGetter=!0,n},d0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,h0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,R_=/^\d+\/\d+$/,D_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,k_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,L_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,N_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ba=r=>R_.test(r),Be=r=>!!r&&!Number.isNaN(Number(r)),Ai=r=>!!r&&Number.isInteger(Number(r)),iy=r=>r.endsWith("%")&&Be(r.slice(0,-1)),qr=r=>D_.test(r),z_=()=>!0,G_=r=>O_.test(r)&&!k_.test(r),wh=()=>!1,M_=r=>L_.test(r),j_=r=>N_.test(r),U_=r=>!we(r)&&!Ee(r),B_=r=>Ga(r,m0,wh),we=r=>d0.test(r),Ri=r=>Ga(r,v0,G_),$f=r=>Ga(r,W_,Be),F_=r=>Ga(r,g0,wh),H_=r=>Ga(r,p0,j_),P_=r=>Ga(r,wh,M_),Ee=r=>h0.test(r),_l=r=>Ma(r,v0),$_=r=>Ma(r,K_),q_=r=>Ma(r,g0),V_=r=>Ma(r,m0),I_=r=>Ma(r,p0),Y_=r=>Ma(r,Q_,!0),Ga=(r,n,i)=>{const a=d0.exec(r);return a?a[1]?n(a[1]):i(a[2]):!1},Ma=(r,n,i=!1)=>{const a=h0.exec(r);return a?a[1]?n(a[1]):i:!1},g0=r=>r==="position",X_=new Set(["image","url"]),p0=r=>X_.has(r),Z_=new Set(["length","size","percentage"]),m0=r=>Z_.has(r),v0=r=>r==="length",W_=r=>r==="number",K_=r=>r==="family-name",Q_=r=>r==="shadow",J_=()=>{const r=Ct("color"),n=Ct("font"),i=Ct("text"),a=Ct("font-weight"),s=Ct("tracking"),l=Ct("leading"),c=Ct("breakpoint"),f=Ct("container"),d=Ct("spacing"),g=Ct("radius"),m=Ct("shadow"),v=Ct("inset-shadow"),y=Ct("drop-shadow"),b=Ct("blur"),x=Ct("perspective"),E=Ct("aspect"),T=Ct("ease"),M=Ct("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],B=()=>[ba,"px","full","auto",Ee,we,d],_=()=>[Ai,"none","subgrid",Ee,we],$=()=>["auto",{span:["full",Ai,Ee,we]},Ee,we],z=()=>[Ai,"auto",Ee,we],F=()=>["auto","min","max","fr",Ee,we],Y=()=>[Ee,we,d],I=()=>["start","end","center","between","around","evenly","stretch","baseline"],j=()=>["start","end","center","stretch"],J=()=>[Ee,we,d],ae=()=>["px",...J()],H=()=>["px","auto",...J()],U=()=>[ba,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",Ee,we,d],D=()=>[r,Ee,we],se=()=>[iy,Ri],G=()=>["","none","full",g,Ee,we],P=()=>["",Be,_l,Ri],k=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["","none",b,Ee,we],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ee,we],de=()=>["none",Be,Ee,we],ge=()=>["none",Be,Ee,we],le=()=>[Be,Ee,we],xe=()=>[ba,"full","px",Ee,we,d];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qr],breakpoint:[qr],color:[z_],container:[qr],"drop-shadow":[qr],ease:["in","out","in-out"],font:[U_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qr],shadow:[qr],spacing:[Be],text:[qr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ba,we,Ee,E]}],container:["container"],columns:[{columns:[Be,we,Ee,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...L(),we,Ee]}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Ai,"auto",Ee,we]}],basis:[{basis:[ba,"full","auto",Ee,we,f,d]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,ba,"auto","initial","none",we]}],grow:[{grow:["",Be,Ee,we]}],shrink:[{shrink:["",Be,Ee,we]}],order:[{order:[Ai,"first","last","none",Ee,we]}],"grid-cols":[{"grid-cols":_()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":_()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:Y()}],"gap-x":[{"gap-x":Y()}],"gap-y":[{"gap-y":Y()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...j(),"baseline"]}],"align-self":[{self:["auto",...j(),"baseline"]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:ae()}],px:[{px:ae()}],py:[{py:ae()}],ps:[{ps:ae()}],pe:[{pe:ae()}],pt:[{pt:ae()}],pr:[{pr:ae()}],pb:[{pb:ae()}],pl:[{pl:ae()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":J()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":J()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[f,"screen",...U()]}],"min-w":[{"min-w":[f,"screen","none",...U()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...U()]}],h:[{h:["screen",...U()]}],"min-h":[{"min-h":["screen","none",...U()]}],"max-h":[{"max-h":["screen",...U()]}],"font-size":[{text:["base",i,_l,Ri]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ee,$f]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",iy,we]}],"font-family":[{font:[$_,we,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ee,we]}],"line-clamp":[{"line-clamp":[Be,"none",Ee,$f]}],leading:[{leading:[Ee,we,l,d]}],"list-image":[{"list-image":["none",Ee,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",Ee,Ri]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Be,"auto",Ee,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...J()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),q_,F_]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",V_,B_]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ai,Ee,we],radial:["",Ee,we],conic:[Ai,Ee,we]},I_,H_]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...k(),"hidden","none"]}],"divide-style":[{divide:[...k(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...k(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,Ee,we]}],"outline-w":[{outline:["",Be,_l,Ri]}],"outline-color":[{outline:[r]}],shadow:[{shadow:["","none",m,Y_,P_]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",Ee,we,v]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Be,Ri]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":D()}],opacity:[{opacity:[Be,Ee,we]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none",Ee,we]}],blur:[{blur:Q()}],brightness:[{brightness:[Be,Ee,we]}],contrast:[{contrast:[Be,Ee,we]}],"drop-shadow":[{"drop-shadow":["","none",y,Ee,we]}],grayscale:[{grayscale:["",Be,Ee,we]}],"hue-rotate":[{"hue-rotate":[Be,Ee,we]}],invert:[{invert:["",Be,Ee,we]}],saturate:[{saturate:[Be,Ee,we]}],sepia:[{sepia:["",Be,Ee,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,we]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[Be,Ee,we]}],"backdrop-contrast":[{"backdrop-contrast":[Be,Ee,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,Ee,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,Ee,we]}],"backdrop-invert":[{"backdrop-invert":["",Be,Ee,we]}],"backdrop-opacity":[{"backdrop-opacity":[Be,Ee,we]}],"backdrop-saturate":[{"backdrop-saturate":[Be,Ee,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,Ee,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":J()}],"border-spacing-x":[{"border-spacing-x":J()}],"border-spacing-y":[{"border-spacing-y":J()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",Ee,we]}],ease:[{ease:["linear","initial",T,Ee,we]}],delay:[{delay:[Be,Ee,we]}],animate:[{animate:["none",M,Ee,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ee,we]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[Ee,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":J()}],"scroll-mx":[{"scroll-mx":J()}],"scroll-my":[{"scroll-my":J()}],"scroll-ms":[{"scroll-ms":J()}],"scroll-me":[{"scroll-me":J()}],"scroll-mt":[{"scroll-mt":J()}],"scroll-mr":[{"scroll-mr":J()}],"scroll-mb":[{"scroll-mb":J()}],"scroll-ml":[{"scroll-ml":J()}],"scroll-p":[{"scroll-p":J()}],"scroll-px":[{"scroll-px":J()}],"scroll-py":[{"scroll-py":J()}],"scroll-ps":[{"scroll-ps":J()}],"scroll-pe":[{"scroll-pe":J()}],"scroll-pt":[{"scroll-pt":J()}],"scroll-pr":[{"scroll-pr":J()}],"scroll-pb":[{"scroll-pb":J()}],"scroll-pl":[{"scroll-pl":J()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,we]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Be,_l,Ri,$f]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},eT=A_(J_);function Xe(...r){return eT(u0(r))}function tT(){const r="0123456789abcdef";let n="#";for(let i=0;i<6;i++)n+=r.charAt(Math.floor(Math.random()*16));return n}function y0(r){return r instanceof Error?r.message:`${r}`}const Eh=r=>{const n=r;n.use={};for(const i of Object.keys(n.getState()))n.use[i]=()=>n(a=>a[i]);return n},nT="",qn="ghost",rT="#B2EBF2",iT="#000",aT="#E2E2E2",oT="#EEEEEE",sT="#F57F17",lT="#969696",uT="#F57F17",ay="#B2EBF2",qf=20,oy=4,cT=20,fT=15,sy="*",dT=yh()(h_(r=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:sy,enableHealthCheck:!0,apiKey:null,setTheme:n=>r({theme:n}),setQueryLabel:n=>r({queryLabel:n}),setEnableHealthCheck:n=>r({enableHealthCheck:n}),setApiKey:n=>r({apiKey:n})}),{name:"settings-storage",storage:s0(()=>localStorage),version:4,migrate:(r,n)=>{n<2&&(r.showEdgeLabel=!1),n<3&&(r.queryLabel=sy),n<4&&(r.showPropertyPanel=!0,r.showNodeSearchBar=!0,r.showNodeLabel=!0,r.enableHealthCheck=!0,r.apiKey=null)}})),Pe=Eh(dT),hT={theme:"system",setTheme:()=>null},b0=S.createContext(hT);function gT({children:r,...n}){const[i,a]=S.useState(Pe.getState().theme);S.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),i==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c),a(c);return}l.classList.add(i)},[i]);const s={theme:i,setTheme:l=>{Pe.getState().setTheme(l),a(l)}};return A.jsx(b0.Provider,{...n,value:s,children:r})}const ly=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,uy=u0,w0=(r,n)=>i=>{var a;if((n==null?void 0:n.variants)==null)return uy(r,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:s,defaultVariants:l}=n,c=Object.keys(s).map(g=>{const m=i==null?void 0:i[g],v=l==null?void 0:l[g];if(m===null)return null;const y=ly(m)||ly(v);return s[g][y]}),f=i&&Object.entries(i).reduce((g,m)=>{let[v,y]=m;return y===void 0||(g[v]=y),g},{}),d=n==null||(a=n.compoundVariants)===null||a===void 0?void 0:a.reduce((g,m)=>{let{class:v,className:y,...b}=m;return Object.entries(b).every(x=>{let[E,T]=x;return Array.isArray(T)?T.includes({...l,...f}[E]):{...l,...f}[E]===T})?[...g,v,y]:g},[]);return uy(r,c,d,i==null?void 0:i.class,i==null?void 0:i.className)},pT=w0("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),E0=S.forwardRef(({className:r,variant:n,...i},a)=>A.jsx("div",{ref:a,role:"alert",className:Xe(pT({variant:n}),r),...i}));E0.displayName="Alert";const S0=S.forwardRef(({className:r,...n},i)=>A.jsx("h5",{ref:i,className:Xe("mb-1 leading-none font-medium tracking-tight",r),...n}));S0.displayName="AlertTitle";const x0=S.forwardRef(({className:r,...n},i)=>A.jsx("div",{ref:i,className:Xe("text-sm [&_p]:leading-relaxed",r),...n}));x0.displayName="AlertDescription";const mT=async r=>{const n=r.headers.get("content-type");if(n)if(n.includes("application/json")){const i=await r.json();return JSON.stringify(i,void 0,2)}else{if(n.startsWith("text/"))return await r.text();if(n.includes("application/xml")||n.includes("text/xml"))return await r.text();if(n.includes("application/octet-stream")){const i=await r.arrayBuffer();return new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}).decode(i)}else try{return await r.text()}catch(i){return console.warn("Failed to decode as text, may be binary:",i),`[Could not decode response body. Content-Type: ${n}]`}}else try{return await r.text()}catch(i){return console.warn("Failed to decode as text, may be binary:",i),"[Could not decode response body. No Content-Type header.]"}return""},Sh=async(r,n={})=>{const i=Pe.getState().apiKey,a={...n.headers||{},...i?{"X-API-Key":i}:{}},s=await fetch(nT+r,{...n,headers:a});if(!s.ok)throw new Error(`${s.status} ${s.statusText}
|
|
${await mT(s)}
|
|
${s.url}`);return s},vT=async r=>await(await Sh(`/graphs?label=${r}`)).json(),yT=async()=>await(await Sh("/graph/label/list")).json(),bT=async()=>{try{return await(await Sh("/health")).json()}catch(r){return{status:"error",message:y0(r)}}},wT=yh()(r=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const n=await bT();return n.status==="healthy"?(r({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:n}),!0):(r({health:!1,message:n.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{r({health:!0,message:null,messageTitle:null})},setErrorMessage:(n,i)=>{r({health:!1,message:n,messageTitle:i})}})),kn=Eh(wT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const ET=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_0=(...r)=>r.filter((n,i,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===i).join(" ").trim();/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/var ST={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const xT=S.forwardRef(({color:r="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:l,iconNode:c,...f},d)=>S.createElement("svg",{ref:d,...ST,width:n,height:n,stroke:r,strokeWidth:a?Number(i)*24/Number(n):i,className:_0("lucide",s),...f},[...c.map(([g,m])=>S.createElement(g,m)),...Array.isArray(l)?l:[l]]));/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const zt=(r,n)=>{const i=S.forwardRef(({className:a,...s},l)=>S.createElement(xT,{ref:l,iconNode:n,className:_0(`lucide-${ET(r)}`,a),...s}));return i.displayName=`${r}`,i};/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const _T=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],T0=zt("Check",_T);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const TT=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],CT=zt("ChevronsUpDown",TT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const AT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],RT=zt("CircleAlert",AT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const DT=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],OT=zt("Fullscreen",DT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const kT=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],LT=zt("Grip",kT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const NT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],C0=zt("LoaderCircle",NT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const zT=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],GT=zt("Maximize",zT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const MT=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],jT=zt("Minimize",MT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const UT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],BT=zt("Moon",UT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const FT=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],HT=zt("Pause",FT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const PT=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],$T=zt("Play",PT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const qT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VT=zt("Search",qT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const IT=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],YT=zt("Settings",IT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const XT=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ZT=zt("Sun",XT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const WT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],KT=zt("X",WT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const QT=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],JT=zt("ZoomIn",QT);/**
|
|
* @license lucide-react v0.475.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/const eC=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],tC=zt("ZoomOut",eC),nC=()=>{const r=kn.use.health(),n=kn.use.message(),i=kn.use.messageTitle(),[a,s]=S.useState(!1);return S.useEffect(()=>{setTimeout(()=>{s(!0)},50)},[]),A.jsxs(E0,{variant:r?"default":"destructive",className:Xe("bg-background/90 absolute top-2 left-1/2 flex w-auto -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",a?"translate-y-0 opacity-100":"-translate-y-20 opacity-0"),children:[!r&&A.jsx("div",{children:A.jsx(RT,{className:"size-4"})}),A.jsxs("div",{children:[A.jsx(S0,{className:"font-bold",children:i}),A.jsx(x0,{children:n})]})]})};function ht(r,n,{checkForDefaultPrevented:i=!0}={}){return function(s){if(r==null||r(s),i===!1||!s.defaultPrevented)return n==null?void 0:n(s)}}function cy(r,n){if(typeof r=="function")return r(n);r!=null&&(r.current=n)}function A0(...r){return n=>{let i=!1;const a=r.map(s=>{const l=cy(s,n);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let s=0;s<a.length;s++){const l=a[s];typeof l=="function"?l():cy(r[s],null)}}}}function Vt(...r){return S.useCallback(A0(...r),r)}function rC(r,n){const i=S.createContext(n),a=l=>{const{children:c,...f}=l,d=S.useMemo(()=>f,Object.values(f));return A.jsx(i.Provider,{value:d,children:c})};a.displayName=r+"Provider";function s(l){const c=S.useContext(i);if(c)return c;if(n!==void 0)return n;throw new Error(`\`${l}\` must be used within \`${r}\``)}return[a,s]}function rs(r,n=[]){let i=[];function a(l,c){const f=S.createContext(c),d=i.length;i=[...i,c];const g=v=>{var M;const{scope:y,children:b,...x}=v,E=((M=y==null?void 0:y[r])==null?void 0:M[d])||f,T=S.useMemo(()=>x,Object.values(x));return A.jsx(E.Provider,{value:T,children:b})};g.displayName=l+"Provider";function m(v,y){var E;const b=((E=y==null?void 0:y[r])==null?void 0:E[d])||f,x=S.useContext(b);if(x)return x;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[g,m]}const s=()=>{const l=i.map(c=>S.createContext(c));return function(f){const d=(f==null?void 0:f[r])||l;return S.useMemo(()=>({[`__scope${r}`]:{...f,[r]:d}}),[f,d])}};return s.scopeName=r,[a,iC(s,...n)]}function iC(...r){const n=r[0];if(r.length===1)return n;const i=()=>{const a=r.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=a.reduce((f,{useScope:d,scopeName:g})=>{const v=d(l)[`__scope${g}`];return{...f,...v}},{});return S.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return i.scopeName=n.scopeName,i}var xh=o0();const aC=on(xh);var is=S.forwardRef((r,n)=>{const{children:i,...a}=r,s=S.Children.toArray(i),l=s.find(oC);if(l){const c=l.props.children,f=s.map(d=>d===l?S.Children.count(c)>1?S.Children.only(null):S.isValidElement(c)?c.props.children:null:d);return A.jsx(Xd,{...a,ref:n,children:S.isValidElement(c)?S.cloneElement(c,void 0,f):null})}return A.jsx(Xd,{...a,ref:n,children:i})});is.displayName="Slot";var Xd=S.forwardRef((r,n)=>{const{children:i,...a}=r;if(S.isValidElement(i)){const s=lC(i),l=sC(a,i.props);return i.type!==S.Fragment&&(l.ref=n?A0(n,s):s),S.cloneElement(i,l)}return S.Children.count(i)>1?S.Children.only(null):null});Xd.displayName="SlotClone";var R0=({children:r})=>A.jsx(A.Fragment,{children:r});function oC(r){return S.isValidElement(r)&&r.type===R0}function sC(r,n){const i={...n};for(const a in n){const s=r[a],l=n[a];/^on[A-Z]/.test(a)?s&&l?i[a]=(...f)=>{l(...f),s(...f)}:s&&(i[a]=s):a==="style"?i[a]={...s,...l}:a==="className"&&(i[a]=[s,l].filter(Boolean).join(" "))}return{...r,...i}}function lC(r){var a,s;let n=(a=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?r.ref:(n=(s=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}var uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Je=uC.reduce((r,n)=>{const i=S.forwardRef((a,s)=>{const{asChild:l,...c}=a,f=l?is:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),A.jsx(f,{...c,ref:s})});return i.displayName=`Primitive.${n}`,{...r,[n]:i}},{});function cC(r,n){r&&xh.flushSync(()=>r.dispatchEvent(n))}function Qr(r){const n=S.useRef(r);return S.useEffect(()=>{n.current=r}),S.useMemo(()=>(...i)=>{var a;return(a=n.current)==null?void 0:a.call(n,...i)},[])}function fC(r,n=globalThis==null?void 0:globalThis.document){const i=Qr(r);S.useEffect(()=>{const a=s=>{s.key==="Escape"&&i(s)};return n.addEventListener("keydown",a,{capture:!0}),()=>n.removeEventListener("keydown",a,{capture:!0})},[i,n])}var dC="DismissableLayer",Zd="dismissableLayer.update",hC="dismissableLayer.pointerDownOutside",gC="dismissableLayer.focusOutside",fy,D0=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hu=S.forwardRef((r,n)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:f,...d}=r,g=S.useContext(D0),[m,v]=S.useState(null),y=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=S.useState({}),x=Vt(n,_=>v(_)),E=Array.from(g.layers),[T]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),M=E.indexOf(T),N=m?E.indexOf(m):-1,L=g.layersWithOutsidePointerEventsDisabled.size>0,C=N>=M,R=vC(_=>{const $=_.target,z=[...g.branches].some(F=>F.contains($));!C||z||(s==null||s(_),c==null||c(_),_.defaultPrevented||f==null||f())},y),B=yC(_=>{const $=_.target;[...g.branches].some(F=>F.contains($))||(l==null||l(_),c==null||c(_),_.defaultPrevented||f==null||f())},y);return fC(_=>{N===g.layers.size-1&&(a==null||a(_),!_.defaultPrevented&&f&&(_.preventDefault(),f()))},y),S.useEffect(()=>{if(m)return i&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(fy=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(m)),g.layers.add(m),dy(),()=>{i&&g.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=fy)}},[m,y,i,g]),S.useEffect(()=>()=>{m&&(g.layers.delete(m),g.layersWithOutsidePointerEventsDisabled.delete(m),dy())},[m,g]),S.useEffect(()=>{const _=()=>b({});return document.addEventListener(Zd,_),()=>document.removeEventListener(Zd,_)},[]),A.jsx(Je.div,{...d,ref:x,style:{pointerEvents:L?C?"auto":"none":void 0,...r.style},onFocusCapture:ht(r.onFocusCapture,B.onFocusCapture),onBlurCapture:ht(r.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ht(r.onPointerDownCapture,R.onPointerDownCapture)})});hu.displayName=dC;var pC="DismissableLayerBranch",mC=S.forwardRef((r,n)=>{const i=S.useContext(D0),a=S.useRef(null),s=Vt(n,a);return S.useEffect(()=>{const l=a.current;if(l)return i.branches.add(l),()=>{i.branches.delete(l)}},[i.branches]),A.jsx(Je.div,{...r,ref:s})});mC.displayName=pC;function vC(r,n=globalThis==null?void 0:globalThis.document){const i=Qr(r),a=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const l=f=>{if(f.target&&!a.current){let d=function(){O0(hC,i,g,{discrete:!0})};const g={originalEvent:f};f.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=d,n.addEventListener("click",s.current,{once:!0})):d()}else n.removeEventListener("click",s.current);a.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",l),n.removeEventListener("click",s.current)}},[n,i]),{onPointerDownCapture:()=>a.current=!0}}function yC(r,n=globalThis==null?void 0:globalThis.document){const i=Qr(r),a=S.useRef(!1);return S.useEffect(()=>{const s=l=>{l.target&&!a.current&&O0(gC,i,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",s),()=>n.removeEventListener("focusin",s)},[n,i]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function dy(){const r=new CustomEvent(Zd);document.dispatchEvent(r)}function O0(r,n,i,{discrete:a}){const s=i.originalEvent.target,l=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:i});n&&s.addEventListener(r,n,{once:!0}),a?cC(s,l):s.dispatchEvent(l)}var Vf=0;function k0(){S.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??hy()),document.body.insertAdjacentElement("beforeend",r[1]??hy()),Vf++,()=>{Vf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Vf--}},[])}function hy(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var If="focusScope.autoFocusOnMount",Yf="focusScope.autoFocusOnUnmount",gy={bubbles:!1,cancelable:!0},bC="FocusScope",_h=S.forwardRef((r,n)=>{const{loop:i=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=r,[f,d]=S.useState(null),g=Qr(s),m=Qr(l),v=S.useRef(null),y=Vt(n,E=>d(E)),b=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(a){let E=function(L){if(b.paused||!f)return;const C=L.target;f.contains(C)?v.current=C:Xr(v.current,{select:!0})},T=function(L){if(b.paused||!f)return;const C=L.relatedTarget;C!==null&&(f.contains(C)||Xr(v.current,{select:!0}))},M=function(L){if(document.activeElement===document.body)for(const R of L)R.removedNodes.length>0&&Xr(f)};document.addEventListener("focusin",E),document.addEventListener("focusout",T);const N=new MutationObserver(M);return f&&N.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",T),N.disconnect()}}},[a,f,b.paused]),S.useEffect(()=>{if(f){my.add(b);const E=document.activeElement;if(!f.contains(E)){const M=new CustomEvent(If,gy);f.addEventListener(If,g),f.dispatchEvent(M),M.defaultPrevented||(wC(TC(L0(f)),{select:!0}),document.activeElement===E&&Xr(f))}return()=>{f.removeEventListener(If,g),setTimeout(()=>{const M=new CustomEvent(Yf,gy);f.addEventListener(Yf,m),f.dispatchEvent(M),M.defaultPrevented||Xr(E??document.body,{select:!0}),f.removeEventListener(Yf,m),my.remove(b)},0)}}},[f,g,m,b]);const x=S.useCallback(E=>{if(!i&&!a||b.paused)return;const T=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,M=document.activeElement;if(T&&M){const N=E.currentTarget,[L,C]=EC(N);L&&C?!E.shiftKey&&M===C?(E.preventDefault(),i&&Xr(L,{select:!0})):E.shiftKey&&M===L&&(E.preventDefault(),i&&Xr(C,{select:!0})):M===N&&E.preventDefault()}},[i,a,b.paused]);return A.jsx(Je.div,{tabIndex:-1,...c,ref:y,onKeyDown:x})});_h.displayName=bC;function wC(r,{select:n=!1}={}){const i=document.activeElement;for(const a of r)if(Xr(a,{select:n}),document.activeElement!==i)return}function EC(r){const n=L0(r),i=py(n,r),a=py(n.reverse(),r);return[i,a]}function L0(r){const n=[],i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const s=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||s?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function py(r,n){for(const i of r)if(!SC(i,{upTo:n}))return i}function SC(r,{upTo:n}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(n!==void 0&&r===n)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function xC(r){return r instanceof HTMLInputElement&&"select"in r}function Xr(r,{select:n=!1}={}){if(r&&r.focus){const i=document.activeElement;r.focus({preventScroll:!0}),r!==i&&xC(r)&&n&&r.select()}}var my=_C();function _C(){let r=[];return{add(n){const i=r[0];n!==i&&(i==null||i.pause()),r=vy(r,n),r.unshift(n)},remove(n){var i;r=vy(r,n),(i=r[0])==null||i.resume()}}}function vy(r,n){const i=[...r],a=i.indexOf(n);return a!==-1&&i.splice(a,1),i}function TC(r){return r.filter(n=>n.tagName!=="A")}var Li=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},CC=t_.useId||(()=>{}),AC=0;function Ln(r){const[n,i]=S.useState(CC());return Li(()=>{i(a=>a??String(AC++))},[r]),n?`radix-${n}`:""}const RC=["top","right","bottom","left"],Jr=Math.min,nn=Math.max,nu=Math.round,Tl=Math.floor,Vn=r=>({x:r,y:r}),DC={left:"right",right:"left",bottom:"top",top:"bottom"},OC={start:"end",end:"start"};function Wd(r,n,i){return nn(r,Jr(n,i))}function br(r,n){return typeof r=="function"?r(n):r}function wr(r){return r.split("-")[0]}function ja(r){return r.split("-")[1]}function Th(r){return r==="x"?"y":"x"}function Ch(r){return r==="y"?"height":"width"}function ei(r){return["top","bottom"].includes(wr(r))?"y":"x"}function Ah(r){return Th(ei(r))}function kC(r,n,i){i===void 0&&(i=!1);const a=ja(r),s=Ah(r),l=Ch(s);let c=s==="x"?a===(i?"end":"start")?"right":"left":a==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(c=ru(c)),[c,ru(c)]}function LC(r){const n=ru(r);return[Kd(r),n,Kd(n)]}function Kd(r){return r.replace(/start|end/g,n=>OC[n])}function NC(r,n,i){const a=["left","right"],s=["right","left"],l=["top","bottom"],c=["bottom","top"];switch(r){case"top":case"bottom":return i?n?s:a:n?a:s;case"left":case"right":return n?l:c;default:return[]}}function zC(r,n,i,a){const s=ja(r);let l=NC(wr(r),i==="start",a);return s&&(l=l.map(c=>c+"-"+s),n&&(l=l.concat(l.map(Kd)))),l}function ru(r){return r.replace(/left|right|bottom|top/g,n=>DC[n])}function GC(r){return{top:0,right:0,bottom:0,left:0,...r}}function N0(r){return typeof r!="number"?GC(r):{top:r,right:r,bottom:r,left:r}}function iu(r){const{x:n,y:i,width:a,height:s}=r;return{width:a,height:s,top:i,left:n,right:n+a,bottom:i+s,x:n,y:i}}function yy(r,n,i){let{reference:a,floating:s}=r;const l=ei(n),c=Ah(n),f=Ch(c),d=wr(n),g=l==="y",m=a.x+a.width/2-s.width/2,v=a.y+a.height/2-s.height/2,y=a[f]/2-s[f]/2;let b;switch(d){case"top":b={x:m,y:a.y-s.height};break;case"bottom":b={x:m,y:a.y+a.height};break;case"right":b={x:a.x+a.width,y:v};break;case"left":b={x:a.x-s.width,y:v};break;default:b={x:a.x,y:a.y}}switch(ja(n)){case"start":b[c]-=y*(i&&g?-1:1);break;case"end":b[c]+=y*(i&&g?-1:1);break}return b}const MC=async(r,n,i)=>{const{placement:a="bottom",strategy:s="absolute",middleware:l=[],platform:c}=i,f=l.filter(Boolean),d=await(c.isRTL==null?void 0:c.isRTL(n));let g=await c.getElementRects({reference:r,floating:n,strategy:s}),{x:m,y:v}=yy(g,a,d),y=a,b={},x=0;for(let E=0;E<f.length;E++){const{name:T,fn:M}=f[E],{x:N,y:L,data:C,reset:R}=await M({x:m,y:v,initialPlacement:a,placement:y,strategy:s,middlewareData:b,rects:g,platform:c,elements:{reference:r,floating:n}});m=N??m,v=L??v,b={...b,[T]:{...b[T],...C}},R&&x<=50&&(x++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(g=R.rects===!0?await c.getElementRects({reference:r,floating:n,strategy:s}):R.rects),{x:m,y:v}=yy(g,y,d)),E=-1)}return{x:m,y:v,placement:y,strategy:s,middlewareData:b}};async function Jo(r,n){var i;n===void 0&&(n={});const{x:a,y:s,platform:l,rects:c,elements:f,strategy:d}=r,{boundary:g="clippingAncestors",rootBoundary:m="viewport",elementContext:v="floating",altBoundary:y=!1,padding:b=0}=br(n,r),x=N0(b),T=f[y?v==="floating"?"reference":"floating":v],M=iu(await l.getClippingRect({element:(i=await(l.isElement==null?void 0:l.isElement(T)))==null||i?T:T.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:g,rootBoundary:m,strategy:d})),N=v==="floating"?{x:a,y:s,width:c.floating.width,height:c.floating.height}:c.reference,L=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),C=await(l.isElement==null?void 0:l.isElement(L))?await(l.getScale==null?void 0:l.getScale(L))||{x:1,y:1}:{x:1,y:1},R=iu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:N,offsetParent:L,strategy:d}):N);return{top:(M.top-R.top+x.top)/C.y,bottom:(R.bottom-M.bottom+x.bottom)/C.y,left:(M.left-R.left+x.left)/C.x,right:(R.right-M.right+x.right)/C.x}}const jC=r=>({name:"arrow",options:r,async fn(n){const{x:i,y:a,placement:s,rects:l,platform:c,elements:f,middlewareData:d}=n,{element:g,padding:m=0}=br(r,n)||{};if(g==null)return{};const v=N0(m),y={x:i,y:a},b=Ah(s),x=Ch(b),E=await c.getDimensions(g),T=b==="y",M=T?"top":"left",N=T?"bottom":"right",L=T?"clientHeight":"clientWidth",C=l.reference[x]+l.reference[b]-y[b]-l.floating[x],R=y[b]-l.reference[b],B=await(c.getOffsetParent==null?void 0:c.getOffsetParent(g));let _=B?B[L]:0;(!_||!await(c.isElement==null?void 0:c.isElement(B)))&&(_=f.floating[L]||l.floating[x]);const $=C/2-R/2,z=_/2-E[x]/2-1,F=Jr(v[M],z),Y=Jr(v[N],z),I=F,j=_-E[x]-Y,J=_/2-E[x]/2+$,ae=Wd(I,J,j),H=!d.arrow&&ja(s)!=null&&J!==ae&&l.reference[x]/2-(J<I?F:Y)-E[x]/2<0,U=H?J<I?J-I:J-j:0;return{[b]:y[b]+U,data:{[b]:ae,centerOffset:J-ae-U,...H&&{alignmentOffset:U}},reset:H}}}),UC=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(n){var i,a;const{placement:s,middlewareData:l,rects:c,initialPlacement:f,platform:d,elements:g}=n,{mainAxis:m=!0,crossAxis:v=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:E=!0,...T}=br(r,n);if((i=l.arrow)!=null&&i.alignmentOffset)return{};const M=wr(s),N=ei(f),L=wr(f)===f,C=await(d.isRTL==null?void 0:d.isRTL(g.floating)),R=y||(L||!E?[ru(f)]:LC(f)),B=x!=="none";!y&&B&&R.push(...zC(f,E,x,C));const _=[f,...R],$=await Jo(n,T),z=[];let F=((a=l.flip)==null?void 0:a.overflows)||[];if(m&&z.push($[M]),v){const J=kC(s,c,C);z.push($[J[0]],$[J[1]])}if(F=[...F,{placement:s,overflows:z}],!z.every(J=>J<=0)){var Y,I;const J=(((Y=l.flip)==null?void 0:Y.index)||0)+1,ae=_[J];if(ae)return{data:{index:J,overflows:F},reset:{placement:ae}};let H=(I=F.filter(U=>U.overflows[0]<=0).sort((U,D)=>U.overflows[1]-D.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(b){case"bestFit":{var j;const U=(j=F.filter(D=>{if(B){const se=ei(D.placement);return se===N||se==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(se=>se>0).reduce((se,G)=>se+G,0)]).sort((D,se)=>D[1]-se[1])[0])==null?void 0:j[0];U&&(H=U);break}case"initialPlacement":H=f;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function by(r,n){return{top:r.top-n.height,right:r.right-n.width,bottom:r.bottom-n.height,left:r.left-n.width}}function wy(r){return RC.some(n=>r[n]>=0)}const BC=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(n){const{rects:i}=n,{strategy:a="referenceHidden",...s}=br(r,n);switch(a){case"referenceHidden":{const l=await Jo(n,{...s,elementContext:"reference"}),c=by(l,i.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wy(c)}}}case"escaped":{const l=await Jo(n,{...s,altBoundary:!0}),c=by(l,i.floating);return{data:{escapedOffsets:c,escaped:wy(c)}}}default:return{}}}}};async function FC(r,n){const{placement:i,platform:a,elements:s}=r,l=await(a.isRTL==null?void 0:a.isRTL(s.floating)),c=wr(i),f=ja(i),d=ei(i)==="y",g=["left","top"].includes(c)?-1:1,m=l&&d?-1:1,v=br(n,r);let{mainAxis:y,crossAxis:b,alignmentAxis:x}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof x=="number"&&(b=f==="end"?x*-1:x),d?{x:b*m,y:y*g}:{x:y*g,y:b*m}}const HC=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(n){var i,a;const{x:s,y:l,placement:c,middlewareData:f}=n,d=await FC(n,r);return c===((i=f.offset)==null?void 0:i.placement)&&(a=f.arrow)!=null&&a.alignmentOffset?{}:{x:s+d.x,y:l+d.y,data:{...d,placement:c}}}}},PC=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(n){const{x:i,y:a,placement:s}=n,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:T=>{let{x:M,y:N}=T;return{x:M,y:N}}},...d}=br(r,n),g={x:i,y:a},m=await Jo(n,d),v=ei(wr(s)),y=Th(v);let b=g[y],x=g[v];if(l){const T=y==="y"?"top":"left",M=y==="y"?"bottom":"right",N=b+m[T],L=b-m[M];b=Wd(N,b,L)}if(c){const T=v==="y"?"top":"left",M=v==="y"?"bottom":"right",N=x+m[T],L=x-m[M];x=Wd(N,x,L)}const E=f.fn({...n,[y]:b,[v]:x});return{...E,data:{x:E.x-i,y:E.y-a,enabled:{[y]:l,[v]:c}}}}}},$C=function(r){return r===void 0&&(r={}),{options:r,fn(n){const{x:i,y:a,placement:s,rects:l,middlewareData:c}=n,{offset:f=0,mainAxis:d=!0,crossAxis:g=!0}=br(r,n),m={x:i,y:a},v=ei(s),y=Th(v);let b=m[y],x=m[v];const E=br(f,n),T=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(d){const L=y==="y"?"height":"width",C=l.reference[y]-l.floating[L]+T.mainAxis,R=l.reference[y]+l.reference[L]-T.mainAxis;b<C?b=C:b>R&&(b=R)}if(g){var M,N;const L=y==="y"?"width":"height",C=["top","left"].includes(wr(s)),R=l.reference[v]-l.floating[L]+(C&&((M=c.offset)==null?void 0:M[v])||0)+(C?0:T.crossAxis),B=l.reference[v]+l.reference[L]+(C?0:((N=c.offset)==null?void 0:N[v])||0)-(C?T.crossAxis:0);x<R?x=R:x>B&&(x=B)}return{[y]:b,[v]:x}}}},qC=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(n){var i,a;const{placement:s,rects:l,platform:c,elements:f}=n,{apply:d=()=>{},...g}=br(r,n),m=await Jo(n,g),v=wr(s),y=ja(s),b=ei(s)==="y",{width:x,height:E}=l.floating;let T,M;v==="top"||v==="bottom"?(T=v,M=y===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(M=v,T=y==="end"?"top":"bottom");const N=E-m.top-m.bottom,L=x-m.left-m.right,C=Jr(E-m[T],N),R=Jr(x-m[M],L),B=!n.middlewareData.shift;let _=C,$=R;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&($=L),(a=n.middlewareData.shift)!=null&&a.enabled.y&&(_=N),B&&!y){const F=nn(m.left,0),Y=nn(m.right,0),I=nn(m.top,0),j=nn(m.bottom,0);b?$=x-2*(F!==0||Y!==0?F+Y:nn(m.left,m.right)):_=E-2*(I!==0||j!==0?I+j:nn(m.top,m.bottom))}await d({...n,availableWidth:$,availableHeight:_});const z=await c.getDimensions(f.floating);return x!==z.width||E!==z.height?{reset:{rects:!0}}:{}}}};function gu(){return typeof window<"u"}function Ua(r){return z0(r)?(r.nodeName||"").toLowerCase():"#document"}function rn(r){var n;return(r==null||(n=r.ownerDocument)==null?void 0:n.defaultView)||window}function Yn(r){var n;return(n=(z0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:n.documentElement}function z0(r){return gu()?r instanceof Node||r instanceof rn(r).Node:!1}function Nn(r){return gu()?r instanceof Element||r instanceof rn(r).Element:!1}function In(r){return gu()?r instanceof HTMLElement||r instanceof rn(r).HTMLElement:!1}function Ey(r){return!gu()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof rn(r).ShadowRoot}function as(r){const{overflow:n,overflowX:i,overflowY:a,display:s}=zn(r);return/auto|scroll|overlay|hidden|clip/.test(n+a+i)&&!["inline","contents"].includes(s)}function VC(r){return["table","td","th"].includes(Ua(r))}function pu(r){return[":popover-open",":modal"].some(n=>{try{return r.matches(n)}catch{return!1}})}function Rh(r){const n=Dh(),i=Nn(r)?zn(r):r;return["transform","translate","scale","rotate","perspective"].some(a=>i[a]?i[a]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(i.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(i.contain||"").includes(a))}function IC(r){let n=ti(r);for(;In(n)&&!Oa(n);){if(Rh(n))return n;if(pu(n))return null;n=ti(n)}return null}function Dh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oa(r){return["html","body","#document"].includes(Ua(r))}function zn(r){return rn(r).getComputedStyle(r)}function mu(r){return Nn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function ti(r){if(Ua(r)==="html")return r;const n=r.assignedSlot||r.parentNode||Ey(r)&&r.host||Yn(r);return Ey(n)?n.host:n}function G0(r){const n=ti(r);return Oa(n)?r.ownerDocument?r.ownerDocument.body:r.body:In(n)&&as(n)?n:G0(n)}function es(r,n,i){var a;n===void 0&&(n=[]),i===void 0&&(i=!0);const s=G0(r),l=s===((a=r.ownerDocument)==null?void 0:a.body),c=rn(s);if(l){const f=Qd(c);return n.concat(c,c.visualViewport||[],as(s)?s:[],f&&i?es(f):[])}return n.concat(s,es(s,[],i))}function Qd(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function M0(r){const n=zn(r);let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0;const s=In(r),l=s?r.offsetWidth:i,c=s?r.offsetHeight:a,f=nu(i)!==l||nu(a)!==c;return f&&(i=l,a=c),{width:i,height:a,$:f}}function Oh(r){return Nn(r)?r:r.contextElement}function Aa(r){const n=Oh(r);if(!In(n))return Vn(1);const i=n.getBoundingClientRect(),{width:a,height:s,$:l}=M0(n);let c=(l?nu(i.width):i.width)/a,f=(l?nu(i.height):i.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const YC=Vn(0);function j0(r){const n=rn(r);return!Dh()||!n.visualViewport?YC:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function XC(r,n,i){return n===void 0&&(n=!1),!i||n&&i!==rn(r)?!1:n}function Ni(r,n,i,a){n===void 0&&(n=!1),i===void 0&&(i=!1);const s=r.getBoundingClientRect(),l=Oh(r);let c=Vn(1);n&&(a?Nn(a)&&(c=Aa(a)):c=Aa(r));const f=XC(l,i,a)?j0(l):Vn(0);let d=(s.left+f.x)/c.x,g=(s.top+f.y)/c.y,m=s.width/c.x,v=s.height/c.y;if(l){const y=rn(l),b=a&&Nn(a)?rn(a):a;let x=y,E=Qd(x);for(;E&&a&&b!==x;){const T=Aa(E),M=E.getBoundingClientRect(),N=zn(E),L=M.left+(E.clientLeft+parseFloat(N.paddingLeft))*T.x,C=M.top+(E.clientTop+parseFloat(N.paddingTop))*T.y;d*=T.x,g*=T.y,m*=T.x,v*=T.y,d+=L,g+=C,x=rn(E),E=Qd(x)}}return iu({width:m,height:v,x:d,y:g})}function kh(r,n){const i=mu(r).scrollLeft;return n?n.left+i:Ni(Yn(r)).left+i}function U0(r,n,i){i===void 0&&(i=!1);const a=r.getBoundingClientRect(),s=a.left+n.scrollLeft-(i?0:kh(r,a)),l=a.top+n.scrollTop;return{x:s,y:l}}function ZC(r){let{elements:n,rect:i,offsetParent:a,strategy:s}=r;const l=s==="fixed",c=Yn(a),f=n?pu(n.floating):!1;if(a===c||f&&l)return i;let d={scrollLeft:0,scrollTop:0},g=Vn(1);const m=Vn(0),v=In(a);if((v||!v&&!l)&&((Ua(a)!=="body"||as(c))&&(d=mu(a)),In(a))){const b=Ni(a);g=Aa(a),m.x=b.x+a.clientLeft,m.y=b.y+a.clientTop}const y=c&&!v&&!l?U0(c,d,!0):Vn(0);return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-d.scrollLeft*g.x+m.x+y.x,y:i.y*g.y-d.scrollTop*g.y+m.y+y.y}}function WC(r){return Array.from(r.getClientRects())}function KC(r){const n=Yn(r),i=mu(r),a=r.ownerDocument.body,s=nn(n.scrollWidth,n.clientWidth,a.scrollWidth,a.clientWidth),l=nn(n.scrollHeight,n.clientHeight,a.scrollHeight,a.clientHeight);let c=-i.scrollLeft+kh(r);const f=-i.scrollTop;return zn(a).direction==="rtl"&&(c+=nn(n.clientWidth,a.clientWidth)-s),{width:s,height:l,x:c,y:f}}function QC(r,n){const i=rn(r),a=Yn(r),s=i.visualViewport;let l=a.clientWidth,c=a.clientHeight,f=0,d=0;if(s){l=s.width,c=s.height;const g=Dh();(!g||g&&n==="fixed")&&(f=s.offsetLeft,d=s.offsetTop)}return{width:l,height:c,x:f,y:d}}function JC(r,n){const i=Ni(r,!0,n==="fixed"),a=i.top+r.clientTop,s=i.left+r.clientLeft,l=In(r)?Aa(r):Vn(1),c=r.clientWidth*l.x,f=r.clientHeight*l.y,d=s*l.x,g=a*l.y;return{width:c,height:f,x:d,y:g}}function Sy(r,n,i){let a;if(n==="viewport")a=QC(r,i);else if(n==="document")a=KC(Yn(r));else if(Nn(n))a=JC(n,i);else{const s=j0(r);a={x:n.x-s.x,y:n.y-s.y,width:n.width,height:n.height}}return iu(a)}function B0(r,n){const i=ti(r);return i===n||!Nn(i)||Oa(i)?!1:zn(i).position==="fixed"||B0(i,n)}function e2(r,n){const i=n.get(r);if(i)return i;let a=es(r,[],!1).filter(f=>Nn(f)&&Ua(f)!=="body"),s=null;const l=zn(r).position==="fixed";let c=l?ti(r):r;for(;Nn(c)&&!Oa(c);){const f=zn(c),d=Rh(c);!d&&f.position==="fixed"&&(s=null),(l?!d&&!s:!d&&f.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||as(c)&&!d&&B0(r,c))?a=a.filter(m=>m!==c):s=f,c=ti(c)}return n.set(r,a),a}function t2(r){let{element:n,boundary:i,rootBoundary:a,strategy:s}=r;const c=[...i==="clippingAncestors"?pu(n)?[]:e2(n,this._c):[].concat(i),a],f=c[0],d=c.reduce((g,m)=>{const v=Sy(n,m,s);return g.top=nn(v.top,g.top),g.right=Jr(v.right,g.right),g.bottom=Jr(v.bottom,g.bottom),g.left=nn(v.left,g.left),g},Sy(n,f,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function n2(r){const{width:n,height:i}=M0(r);return{width:n,height:i}}function r2(r,n,i){const a=In(n),s=Yn(n),l=i==="fixed",c=Ni(r,!0,l,n);let f={scrollLeft:0,scrollTop:0};const d=Vn(0);if(a||!a&&!l)if((Ua(n)!=="body"||as(s))&&(f=mu(n)),a){const y=Ni(n,!0,l,n);d.x=y.x+n.clientLeft,d.y=y.y+n.clientTop}else s&&(d.x=kh(s));const g=s&&!a&&!l?U0(s,f):Vn(0),m=c.left+f.scrollLeft-d.x-g.x,v=c.top+f.scrollTop-d.y-g.y;return{x:m,y:v,width:c.width,height:c.height}}function Xf(r){return zn(r).position==="static"}function xy(r,n){if(!In(r)||zn(r).position==="fixed")return null;if(n)return n(r);let i=r.offsetParent;return Yn(r)===i&&(i=i.ownerDocument.body),i}function F0(r,n){const i=rn(r);if(pu(r))return i;if(!In(r)){let s=ti(r);for(;s&&!Oa(s);){if(Nn(s)&&!Xf(s))return s;s=ti(s)}return i}let a=xy(r,n);for(;a&&VC(a)&&Xf(a);)a=xy(a,n);return a&&Oa(a)&&Xf(a)&&!Rh(a)?i:a||IC(r)||i}const i2=async function(r){const n=this.getOffsetParent||F0,i=this.getDimensions,a=await i(r.floating);return{reference:r2(r.reference,await n(r.floating),r.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function a2(r){return zn(r).direction==="rtl"}const o2={convertOffsetParentRelativeRectToViewportRelativeRect:ZC,getDocumentElement:Yn,getClippingRect:t2,getOffsetParent:F0,getElementRects:i2,getClientRects:WC,getDimensions:n2,getScale:Aa,isElement:Nn,isRTL:a2};function H0(r,n){return r.x===n.x&&r.y===n.y&&r.width===n.width&&r.height===n.height}function s2(r,n){let i=null,a;const s=Yn(r);function l(){var f;clearTimeout(a),(f=i)==null||f.disconnect(),i=null}function c(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),l();const g=r.getBoundingClientRect(),{left:m,top:v,width:y,height:b}=g;if(f||n(),!y||!b)return;const x=Tl(v),E=Tl(s.clientWidth-(m+y)),T=Tl(s.clientHeight-(v+b)),M=Tl(m),L={rootMargin:-x+"px "+-E+"px "+-T+"px "+-M+"px",threshold:nn(0,Jr(1,d))||1};let C=!0;function R(B){const _=B[0].intersectionRatio;if(_!==d){if(!C)return c();_?c(!1,_):a=setTimeout(()=>{c(!1,1e-7)},1e3)}_===1&&!H0(g,r.getBoundingClientRect())&&c(),C=!1}try{i=new IntersectionObserver(R,{...L,root:s.ownerDocument})}catch{i=new IntersectionObserver(R,L)}i.observe(r)}return c(!0),l}function l2(r,n,i,a){a===void 0&&(a={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=a,g=Oh(r),m=s||l?[...g?es(g):[],...es(n)]:[];m.forEach(M=>{s&&M.addEventListener("scroll",i,{passive:!0}),l&&M.addEventListener("resize",i)});const v=g&&f?s2(g,i):null;let y=-1,b=null;c&&(b=new ResizeObserver(M=>{let[N]=M;N&&N.target===g&&b&&(b.unobserve(n),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var L;(L=b)==null||L.observe(n)})),i()}),g&&!d&&b.observe(g),b.observe(n));let x,E=d?Ni(r):null;d&&T();function T(){const M=Ni(r);E&&!H0(E,M)&&i(),E=M,x=requestAnimationFrame(T)}return i(),()=>{var M;m.forEach(N=>{s&&N.removeEventListener("scroll",i),l&&N.removeEventListener("resize",i)}),v==null||v(),(M=b)==null||M.disconnect(),b=null,d&&cancelAnimationFrame(x)}}const u2=HC,c2=PC,f2=UC,d2=qC,h2=BC,_y=jC,g2=$C,p2=(r,n,i)=>{const a=new Map,s={platform:o2,...i},l={...s.platform,_c:a};return MC(r,n,{...s,platform:l})};var $l=typeof document<"u"?S.useLayoutEffect:S.useEffect;function au(r,n){if(r===n)return!0;if(typeof r!=typeof n)return!1;if(typeof r=="function"&&r.toString()===n.toString())return!0;let i,a,s;if(r&&n&&typeof r=="object"){if(Array.isArray(r)){if(i=r.length,i!==n.length)return!1;for(a=i;a--!==0;)if(!au(r[a],n[a]))return!1;return!0}if(s=Object.keys(r),i=s.length,i!==Object.keys(n).length)return!1;for(a=i;a--!==0;)if(!{}.hasOwnProperty.call(n,s[a]))return!1;for(a=i;a--!==0;){const l=s[a];if(!(l==="_owner"&&r.$$typeof)&&!au(r[l],n[l]))return!1}return!0}return r!==r&&n!==n}function P0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Ty(r,n){const i=P0(r);return Math.round(n*i)/i}function Zf(r){const n=S.useRef(r);return $l(()=>{n.current=r}),n}function m2(r){r===void 0&&(r={});const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s,elements:{reference:l,floating:c}={},transform:f=!0,whileElementsMounted:d,open:g}=r,[m,v]=S.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[y,b]=S.useState(a);au(y,a)||b(a);const[x,E]=S.useState(null),[T,M]=S.useState(null),N=S.useCallback(D=>{D!==B.current&&(B.current=D,E(D))},[]),L=S.useCallback(D=>{D!==_.current&&(_.current=D,M(D))},[]),C=l||x,R=c||T,B=S.useRef(null),_=S.useRef(null),$=S.useRef(m),z=d!=null,F=Zf(d),Y=Zf(s),I=Zf(g),j=S.useCallback(()=>{if(!B.current||!_.current)return;const D={placement:n,strategy:i,middleware:y};Y.current&&(D.platform=Y.current),p2(B.current,_.current,D).then(se=>{const G={...se,isPositioned:I.current!==!1};J.current&&!au($.current,G)&&($.current=G,xh.flushSync(()=>{v(G)}))})},[y,n,i,Y,I]);$l(()=>{g===!1&&$.current.isPositioned&&($.current.isPositioned=!1,v(D=>({...D,isPositioned:!1})))},[g]);const J=S.useRef(!1);$l(()=>(J.current=!0,()=>{J.current=!1}),[]),$l(()=>{if(C&&(B.current=C),R&&(_.current=R),C&&R){if(F.current)return F.current(C,R,j);j()}},[C,R,j,F,z]);const ae=S.useMemo(()=>({reference:B,floating:_,setReference:N,setFloating:L}),[N,L]),H=S.useMemo(()=>({reference:C,floating:R}),[C,R]),U=S.useMemo(()=>{const D={position:i,left:0,top:0};if(!H.floating)return D;const se=Ty(H.floating,m.x),G=Ty(H.floating,m.y);return f?{...D,transform:"translate("+se+"px, "+G+"px)",...P0(H.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:se,top:G}},[i,f,H.floating,m.x,m.y]);return S.useMemo(()=>({...m,update:j,refs:ae,elements:H,floatingStyles:U}),[m,j,ae,H,U])}const v2=r=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:r,fn(i){const{element:a,padding:s}=typeof r=="function"?r(i):r;return a&&n(a)?a.current!=null?_y({element:a.current,padding:s}).fn(i):{}:a?_y({element:a,padding:s}).fn(i):{}}}},y2=(r,n)=>({...u2(r),options:[r,n]}),b2=(r,n)=>({...c2(r),options:[r,n]}),w2=(r,n)=>({...g2(r),options:[r,n]}),E2=(r,n)=>({...f2(r),options:[r,n]}),S2=(r,n)=>({...d2(r),options:[r,n]}),x2=(r,n)=>({...h2(r),options:[r,n]}),_2=(r,n)=>({...v2(r),options:[r,n]});var T2="Arrow",$0=S.forwardRef((r,n)=>{const{children:i,width:a=10,height:s=5,...l}=r;return A.jsx(Je.svg,{...l,ref:n,width:a,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?i:A.jsx("polygon",{points:"0,0 30,0 15,10"})})});$0.displayName=T2;var C2=$0;function q0(r){const[n,i]=S.useState(void 0);return Li(()=>{if(r){i({width:r.offsetWidth,height:r.offsetHeight});const a=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,f;if("borderBoxSize"in l){const d=l.borderBoxSize,g=Array.isArray(d)?d[0]:d;c=g.inlineSize,f=g.blockSize}else c=r.offsetWidth,f=r.offsetHeight;i({width:c,height:f})});return a.observe(r,{box:"border-box"}),()=>a.unobserve(r)}else i(void 0)},[r]),n}var Lh="Popper",[V0,vu]=rs(Lh),[A2,I0]=V0(Lh),Y0=r=>{const{__scopePopper:n,children:i}=r,[a,s]=S.useState(null);return A.jsx(A2,{scope:n,anchor:a,onAnchorChange:s,children:i})};Y0.displayName=Lh;var X0="PopperAnchor",Z0=S.forwardRef((r,n)=>{const{__scopePopper:i,virtualRef:a,...s}=r,l=I0(X0,i),c=S.useRef(null),f=Vt(n,c);return S.useEffect(()=>{l.onAnchorChange((a==null?void 0:a.current)||c.current)}),a?null:A.jsx(Je.div,{...s,ref:f})});Z0.displayName=X0;var Nh="PopperContent",[R2,D2]=V0(Nh),W0=S.forwardRef((r,n)=>{var ge,le,xe,pe,Ae,Te;const{__scopePopper:i,side:a="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:f=0,avoidCollisions:d=!0,collisionBoundary:g=[],collisionPadding:m=0,sticky:v="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:x,...E}=r,T=I0(Nh,i),[M,N]=S.useState(null),L=Vt(n,Le=>N(Le)),[C,R]=S.useState(null),B=q0(C),_=(B==null?void 0:B.width)??0,$=(B==null?void 0:B.height)??0,z=a+(l!=="center"?"-"+l:""),F=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},Y=Array.isArray(g)?g:[g],I=Y.length>0,j={padding:F,boundary:Y.filter(k2),altBoundary:I},{refs:J,floatingStyles:ae,placement:H,isPositioned:U,middlewareData:D}=m2({strategy:"fixed",placement:z,whileElementsMounted:(...Le)=>l2(...Le,{animationFrame:b==="always"}),elements:{reference:T.anchor},middleware:[y2({mainAxis:s+$,alignmentAxis:c}),d&&b2({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?w2():void 0,...j}),d&&E2({...j}),S2({...j,apply:({elements:Le,rects:ve,availableWidth:he,availableHeight:K})=>{const{width:Re,height:Ve}=ve.reference,be=Le.floating.style;be.setProperty("--radix-popper-available-width",`${he}px`),be.setProperty("--radix-popper-available-height",`${K}px`),be.setProperty("--radix-popper-anchor-width",`${Re}px`),be.setProperty("--radix-popper-anchor-height",`${Ve}px`)}}),C&&_2({element:C,padding:f}),L2({arrowWidth:_,arrowHeight:$}),y&&x2({strategy:"referenceHidden",...j})]}),[se,G]=J0(H),P=Qr(x);Li(()=>{U&&(P==null||P())},[U,P]);const k=(ge=D.arrow)==null?void 0:ge.x,V=(le=D.arrow)==null?void 0:le.y,Q=((xe=D.arrow)==null?void 0:xe.centerOffset)!==0,[re,de]=S.useState();return Li(()=>{M&&de(window.getComputedStyle(M).zIndex)},[M]),A.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...ae,transform:U?ae.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(pe=D.transformOrigin)==null?void 0:pe.x,(Ae=D.transformOrigin)==null?void 0:Ae.y].join(" "),...((Te=D.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:A.jsx(R2,{scope:i,placedSide:se,onArrowChange:R,arrowX:k,arrowY:V,shouldHideArrow:Q,children:A.jsx(Je.div,{"data-side":se,"data-align":G,...E,ref:L,style:{...E.style,animation:U?void 0:"none"}})})})});W0.displayName=Nh;var K0="PopperArrow",O2={top:"bottom",right:"left",bottom:"top",left:"right"},Q0=S.forwardRef(function(n,i){const{__scopePopper:a,...s}=n,l=D2(K0,a),c=O2[l.placedSide];return A.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:A.jsx(C2,{...s,ref:i,style:{...s.style,display:"block"}})})});Q0.displayName=K0;function k2(r){return r!==null}var L2=r=>({name:"transformOrigin",options:r,fn(n){var T,M,N;const{placement:i,rects:a,middlewareData:s}=n,c=((T=s.arrow)==null?void 0:T.centerOffset)!==0,f=c?0:r.arrowWidth,d=c?0:r.arrowHeight,[g,m]=J0(i),v={start:"0%",center:"50%",end:"100%"}[m],y=(((M=s.arrow)==null?void 0:M.x)??0)+f/2,b=(((N=s.arrow)==null?void 0:N.y)??0)+d/2;let x="",E="";return g==="bottom"?(x=c?v:`${y}px`,E=`${-d}px`):g==="top"?(x=c?v:`${y}px`,E=`${a.floating.height+d}px`):g==="right"?(x=`${-d}px`,E=c?v:`${b}px`):g==="left"&&(x=`${a.floating.width+d}px`,E=c?v:`${b}px`),{data:{x,y:E}}}});function J0(r){const[n,i="center"]=r.split("-");return[n,i]}var ew=Y0,zh=Z0,tw=W0,nw=Q0,N2="Portal",Gh=S.forwardRef((r,n)=>{var f;const{container:i,...a}=r,[s,l]=S.useState(!1);Li(()=>l(!0),[]);const c=i||s&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?aC.createPortal(A.jsx(Je.div,{...a,ref:n}),c):null});Gh.displayName=N2;function z2(r,n){return S.useReducer((i,a)=>n[i][a]??i,r)}var ni=r=>{const{present:n,children:i}=r,a=G2(n),s=typeof i=="function"?i({present:a.isPresent}):S.Children.only(i),l=Vt(a.ref,M2(s));return typeof i=="function"||a.isPresent?S.cloneElement(s,{ref:l}):null};ni.displayName="Presence";function G2(r){const[n,i]=S.useState(),a=S.useRef({}),s=S.useRef(r),l=S.useRef("none"),c=r?"mounted":"unmounted",[f,d]=z2(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const g=Cl(a.current);l.current=f==="mounted"?g:"none"},[f]),Li(()=>{const g=a.current,m=s.current;if(m!==r){const y=l.current,b=Cl(g);r?d("MOUNT"):b==="none"||(g==null?void 0:g.display)==="none"?d("UNMOUNT"):d(m&&y!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=r}},[r,d]),Li(()=>{if(n){let g;const m=n.ownerDocument.defaultView??window,v=b=>{const E=Cl(a.current).includes(b.animationName);if(b.target===n&&E&&(d("ANIMATION_END"),!s.current)){const T=n.style.animationFillMode;n.style.animationFillMode="forwards",g=m.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=T)})}},y=b=>{b.target===n&&(l.current=Cl(a.current))};return n.addEventListener("animationstart",y),n.addEventListener("animationcancel",v),n.addEventListener("animationend",v),()=>{m.clearTimeout(g),n.removeEventListener("animationstart",y),n.removeEventListener("animationcancel",v),n.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[n,d]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(g=>{g&&(a.current=getComputedStyle(g)),i(g)},[])}}function Cl(r){return(r==null?void 0:r.animationName)||"none"}function M2(r){var a,s;let n=(a=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?r.ref:(n=(s=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}function yu({prop:r,defaultProp:n,onChange:i=()=>{}}){const[a,s]=j2({defaultProp:n,onChange:i}),l=r!==void 0,c=l?r:a,f=Qr(i),d=S.useCallback(g=>{if(l){const v=typeof g=="function"?g(r):g;v!==r&&f(v)}else s(g)},[l,r,s,f]);return[c,d]}function j2({defaultProp:r,onChange:n}){const i=S.useState(r),[a]=i,s=S.useRef(a),l=Qr(n);return S.useEffect(()=>{s.current!==a&&(l(a),s.current=a)},[a,s,l]),i}var U2=function(r){if(typeof document>"u")return null;var n=Array.isArray(r)?r[0]:r;return n.ownerDocument.body},wa=new WeakMap,Al=new WeakMap,Rl={},Wf=0,rw=function(r){return r&&(r.host||rw(r.parentNode))},B2=function(r,n){return n.map(function(i){if(r.contains(i))return i;var a=rw(i);return a&&r.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",r,". Doing nothing"),null)}).filter(function(i){return!!i})},F2=function(r,n,i,a){var s=B2(n,Array.isArray(r)?r:[r]);Rl[i]||(Rl[i]=new WeakMap);var l=Rl[i],c=[],f=new Set,d=new Set(s),g=function(v){!v||f.has(v)||(f.add(v),g(v.parentNode))};s.forEach(g);var m=function(v){!v||d.has(v)||Array.prototype.forEach.call(v.children,function(y){if(f.has(y))m(y);else try{var b=y.getAttribute(a),x=b!==null&&b!=="false",E=(wa.get(y)||0)+1,T=(l.get(y)||0)+1;wa.set(y,E),l.set(y,T),c.push(y),E===1&&x&&Al.set(y,!0),T===1&&y.setAttribute(i,"true"),x||y.setAttribute(a,"true")}catch(M){console.error("aria-hidden: cannot operate on ",y,M)}})};return m(n),f.clear(),Wf++,function(){c.forEach(function(v){var y=wa.get(v)-1,b=l.get(v)-1;wa.set(v,y),l.set(v,b),y||(Al.has(v)||v.removeAttribute(a),Al.delete(v)),b||v.removeAttribute(i)}),Wf--,Wf||(wa=new WeakMap,wa=new WeakMap,Al=new WeakMap,Rl={})}},iw=function(r,n,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(r)?r:[r]),s=U2(r);return s?(a.push.apply(a,Array.from(s.querySelectorAll("[aria-live]"))),F2(a,s,i,"aria-hidden")):function(){return null}},Pn=function(){return Pn=Object.assign||function(n){for(var i,a=1,s=arguments.length;a<s;a++){i=arguments[a];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(n[l]=i[l])}return n},Pn.apply(this,arguments)};function aw(r,n){var i={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&n.indexOf(a)<0&&(i[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(r);s<a.length;s++)n.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(r,a[s])&&(i[a[s]]=r[a[s]]);return i}function H2(r,n,i){if(i||arguments.length===2)for(var a=0,s=n.length,l;a<s;a++)(l||!(a in n))&&(l||(l=Array.prototype.slice.call(n,0,a)),l[a]=n[a]);return r.concat(l||Array.prototype.slice.call(n))}var ql="right-scroll-bar-position",Vl="width-before-scroll-bar",P2="with-scroll-bars-hidden",$2="--removed-body-scroll-bar-size";function Kf(r,n){return typeof r=="function"?r(n):r&&(r.current=n),r}function q2(r,n){var i=S.useState(function(){return{value:r,callback:n,facade:{get current(){return i.value},set current(a){var s=i.value;s!==a&&(i.value=a,i.callback(a,s))}}}})[0];return i.callback=n,i.facade}var V2=typeof window<"u"?S.useLayoutEffect:S.useEffect,Cy=new WeakMap;function I2(r,n){var i=q2(null,function(a){return r.forEach(function(s){return Kf(s,a)})});return V2(function(){var a=Cy.get(i);if(a){var s=new Set(a),l=new Set(r),c=i.current;s.forEach(function(f){l.has(f)||Kf(f,null)}),l.forEach(function(f){s.has(f)||Kf(f,c)})}Cy.set(i,r)},[r]),i}function Y2(r){return r}function X2(r,n){n===void 0&&(n=Y2);var i=[],a=!1,s={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:r},useMedium:function(l){var c=n(l,a);return i.push(c),function(){i=i.filter(function(f){return f!==c})}},assignSyncMedium:function(l){for(a=!0;i.length;){var c=i;i=[],c.forEach(l)}i={push:function(f){return l(f)},filter:function(){return i}}},assignMedium:function(l){a=!0;var c=[];if(i.length){var f=i;i=[],f.forEach(l),c=i}var d=function(){var m=c;c=[],m.forEach(l)},g=function(){return Promise.resolve().then(d)};g(),i={push:function(m){c.push(m),g()},filter:function(m){return c=c.filter(m),i}}}};return s}function Z2(r){r===void 0&&(r={});var n=X2(null);return n.options=Pn({async:!0,ssr:!1},r),n}var ow=function(r){var n=r.sideCar,i=aw(r,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=n.read();if(!a)throw new Error("Sidecar medium not found");return S.createElement(a,Pn({},i))};ow.isSideCarExport=!0;function W2(r,n){return r.useMedium(n),ow}var sw=Z2(),Qf=function(){},bu=S.forwardRef(function(r,n){var i=S.useRef(null),a=S.useState({onScrollCapture:Qf,onWheelCapture:Qf,onTouchMoveCapture:Qf}),s=a[0],l=a[1],c=r.forwardProps,f=r.children,d=r.className,g=r.removeScrollBar,m=r.enabled,v=r.shards,y=r.sideCar,b=r.noIsolation,x=r.inert,E=r.allowPinchZoom,T=r.as,M=T===void 0?"div":T,N=r.gapMode,L=aw(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=y,R=I2([i,n]),B=Pn(Pn({},L),s);return S.createElement(S.Fragment,null,m&&S.createElement(C,{sideCar:sw,removeScrollBar:g,shards:v,noIsolation:b,inert:x,setCallbacks:l,allowPinchZoom:!!E,lockRef:i,gapMode:N}),c?S.cloneElement(S.Children.only(f),Pn(Pn({},B),{ref:R})):S.createElement(M,Pn({},B,{className:d,ref:R}),f))});bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bu.classNames={fullWidth:Vl,zeroRight:ql};var K2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Q2(){if(!document)return null;var r=document.createElement("style");r.type="text/css";var n=K2();return n&&r.setAttribute("nonce",n),r}function J2(r,n){r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}function eA(r){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(r)}var tA=function(){var r=0,n=null;return{add:function(i){r==0&&(n=Q2())&&(J2(n,i),eA(n)),r++},remove:function(){r--,!r&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},nA=function(){var r=tA();return function(n,i){S.useEffect(function(){return r.add(n),function(){r.remove()}},[n&&i])}},lw=function(){var r=nA(),n=function(i){var a=i.styles,s=i.dynamic;return r(a,s),null};return n},rA={left:0,top:0,right:0,gap:0},Jf=function(r){return parseInt(r||"",10)||0},iA=function(r){var n=window.getComputedStyle(document.body),i=n[r==="padding"?"paddingLeft":"marginLeft"],a=n[r==="padding"?"paddingTop":"marginTop"],s=n[r==="padding"?"paddingRight":"marginRight"];return[Jf(i),Jf(a),Jf(s)]},aA=function(r){if(r===void 0&&(r="margin"),typeof window>"u")return rA;var n=iA(r),i=document.documentElement.clientWidth,a=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,a-i+n[2]-n[0])}},oA=lw(),Ra="data-scroll-locked",sA=function(r,n,i,a){var s=r.left,l=r.top,c=r.right,f=r.gap;return i===void 0&&(i="margin"),`
|
|
.`.concat(P2,` {
|
|
overflow: hidden `).concat(a,`;
|
|
padding-right: `).concat(f,"px ").concat(a,`;
|
|
}
|
|
body[`).concat(Ra,`] {
|
|
overflow: hidden `).concat(a,`;
|
|
overscroll-behavior: contain;
|
|
`).concat([n&&"position: relative ".concat(a,";"),i==="margin"&&`
|
|
padding-left: `.concat(s,`px;
|
|
padding-top: `).concat(l,`px;
|
|
padding-right: `).concat(c,`px;
|
|
margin-left:0;
|
|
margin-top:0;
|
|
margin-right: `).concat(f,"px ").concat(a,`;
|
|
`),i==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
}
|
|
|
|
.`).concat(ql,` {
|
|
right: `).concat(f,"px ").concat(a,`;
|
|
}
|
|
|
|
.`).concat(Vl,` {
|
|
margin-right: `).concat(f,"px ").concat(a,`;
|
|
}
|
|
|
|
.`).concat(ql," .").concat(ql,` {
|
|
right: 0 `).concat(a,`;
|
|
}
|
|
|
|
.`).concat(Vl," .").concat(Vl,` {
|
|
margin-right: 0 `).concat(a,`;
|
|
}
|
|
|
|
body[`).concat(Ra,`] {
|
|
`).concat($2,": ").concat(f,`px;
|
|
}
|
|
`)},Ay=function(){var r=parseInt(document.body.getAttribute(Ra)||"0",10);return isFinite(r)?r:0},lA=function(){S.useEffect(function(){return document.body.setAttribute(Ra,(Ay()+1).toString()),function(){var r=Ay()-1;r<=0?document.body.removeAttribute(Ra):document.body.setAttribute(Ra,r.toString())}},[])},uA=function(r){var n=r.noRelative,i=r.noImportant,a=r.gapMode,s=a===void 0?"margin":a;lA();var l=S.useMemo(function(){return aA(s)},[s]);return S.createElement(oA,{styles:sA(l,!n,s,i?"":"!important")})},Jd=!1;if(typeof window<"u")try{var Dl=Object.defineProperty({},"passive",{get:function(){return Jd=!0,!0}});window.addEventListener("test",Dl,Dl),window.removeEventListener("test",Dl,Dl)}catch{Jd=!1}var Ea=Jd?{passive:!1}:!1,cA=function(r){return r.tagName==="TEXTAREA"},uw=function(r,n){if(!(r instanceof Element))return!1;var i=window.getComputedStyle(r);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!cA(r)&&i[n]==="visible")},fA=function(r){return uw(r,"overflowY")},dA=function(r){return uw(r,"overflowX")},Ry=function(r,n){var i=n.ownerDocument,a=n;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var s=cw(r,a);if(s){var l=fw(r,a),c=l[1],f=l[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},hA=function(r){var n=r.scrollTop,i=r.scrollHeight,a=r.clientHeight;return[n,i,a]},gA=function(r){var n=r.scrollLeft,i=r.scrollWidth,a=r.clientWidth;return[n,i,a]},cw=function(r,n){return r==="v"?fA(n):dA(n)},fw=function(r,n){return r==="v"?hA(n):gA(n)},pA=function(r,n){return r==="h"&&n==="rtl"?-1:1},mA=function(r,n,i,a,s){var l=pA(r,window.getComputedStyle(n).direction),c=l*a,f=i.target,d=n.contains(f),g=!1,m=c>0,v=0,y=0;do{var b=fw(r,f),x=b[0],E=b[1],T=b[2],M=E-T-l*x;(x||M)&&cw(r,f)&&(v+=M,y+=x),f instanceof ShadowRoot?f=f.host:f=f.parentNode}while(!d&&f!==document.body||d&&(n.contains(f)||n===f));return(m&&Math.abs(v)<1||!m&&Math.abs(y)<1)&&(g=!0),g},Ol=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Dy=function(r){return[r.deltaX,r.deltaY]},Oy=function(r){return r&&"current"in r?r.current:r},vA=function(r,n){return r[0]===n[0]&&r[1]===n[1]},yA=function(r){return`
|
|
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
|
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
|
`)},bA=0,Sa=[];function wA(r){var n=S.useRef([]),i=S.useRef([0,0]),a=S.useRef(),s=S.useState(bA++)[0],l=S.useState(lw)[0],c=S.useRef(r);S.useEffect(function(){c.current=r},[r]),S.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(s));var E=H2([r.lockRef.current],(r.shards||[]).map(Oy),!0).filter(Boolean);return E.forEach(function(T){return T.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),E.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(s))})}}},[r.inert,r.lockRef.current,r.shards]);var f=S.useCallback(function(E,T){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var M=Ol(E),N=i.current,L="deltaX"in E?E.deltaX:N[0]-M[0],C="deltaY"in E?E.deltaY:N[1]-M[1],R,B=E.target,_=Math.abs(L)>Math.abs(C)?"h":"v";if("touches"in E&&_==="h"&&B.type==="range")return!1;var $=Ry(_,B);if(!$)return!0;if($?R=_:(R=_==="v"?"h":"v",$=Ry(_,B)),!$)return!1;if(!a.current&&"changedTouches"in E&&(L||C)&&(a.current=R),!R)return!0;var z=a.current||R;return mA(z,T,E,z==="h"?L:C)},[]),d=S.useCallback(function(E){var T=E;if(!(!Sa.length||Sa[Sa.length-1]!==l)){var M="deltaY"in T?Dy(T):Ol(T),N=n.current.filter(function(R){return R.name===T.type&&(R.target===T.target||T.target===R.shadowParent)&&vA(R.delta,M)})[0];if(N&&N.should){T.cancelable&&T.preventDefault();return}if(!N){var L=(c.current.shards||[]).map(Oy).filter(Boolean).filter(function(R){return R.contains(T.target)}),C=L.length>0?f(T,L[0]):!c.current.noIsolation;C&&T.cancelable&&T.preventDefault()}}},[]),g=S.useCallback(function(E,T,M,N){var L={name:E,delta:T,target:M,should:N,shadowParent:EA(M)};n.current.push(L),setTimeout(function(){n.current=n.current.filter(function(C){return C!==L})},1)},[]),m=S.useCallback(function(E){i.current=Ol(E),a.current=void 0},[]),v=S.useCallback(function(E){g(E.type,Dy(E),E.target,f(E,r.lockRef.current))},[]),y=S.useCallback(function(E){g(E.type,Ol(E),E.target,f(E,r.lockRef.current))},[]);S.useEffect(function(){return Sa.push(l),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:y}),document.addEventListener("wheel",d,Ea),document.addEventListener("touchmove",d,Ea),document.addEventListener("touchstart",m,Ea),function(){Sa=Sa.filter(function(E){return E!==l}),document.removeEventListener("wheel",d,Ea),document.removeEventListener("touchmove",d,Ea),document.removeEventListener("touchstart",m,Ea)}},[]);var b=r.removeScrollBar,x=r.inert;return S.createElement(S.Fragment,null,x?S.createElement(l,{styles:yA(s)}):null,b?S.createElement(uA,{gapMode:r.gapMode}):null)}function EA(r){for(var n=null;r!==null;)r instanceof ShadowRoot&&(n=r.host,r=r.host),r=r.parentNode;return n}const SA=W2(sw,wA);var Mh=S.forwardRef(function(r,n){return S.createElement(bu,Pn({},r,{ref:n,sideCar:SA}))});Mh.classNames=bu.classNames;var jh="Popover",[dw,Az]=rs(jh,[vu]),os=vu(),[xA,ri]=dw(jh),hw=r=>{const{__scopePopover:n,children:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!1}=r,f=os(n),d=S.useRef(null),[g,m]=S.useState(!1),[v=!1,y]=yu({prop:a,defaultProp:s,onChange:l});return A.jsx(ew,{...f,children:A.jsx(xA,{scope:n,contentId:Ln(),triggerRef:d,open:v,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(b=>!b),[y]),hasCustomAnchor:g,onCustomAnchorAdd:S.useCallback(()=>m(!0),[]),onCustomAnchorRemove:S.useCallback(()=>m(!1),[]),modal:c,children:i})})};hw.displayName=jh;var gw="PopoverAnchor",_A=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=ri(gw,i),l=os(i),{onCustomAnchorAdd:c,onCustomAnchorRemove:f}=s;return S.useEffect(()=>(c(),()=>f()),[c,f]),A.jsx(zh,{...l,...a,ref:n})});_A.displayName=gw;var pw="PopoverTrigger",mw=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=ri(pw,i),l=os(i),c=Vt(n,s.triggerRef),f=A.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ew(s.open),...a,ref:c,onClick:ht(r.onClick,s.onOpenToggle)});return s.hasCustomAnchor?f:A.jsx(zh,{asChild:!0,...l,children:f})});mw.displayName=pw;var Uh="PopoverPortal",[TA,CA]=dw(Uh,{forceMount:void 0}),vw=r=>{const{__scopePopover:n,forceMount:i,children:a,container:s}=r,l=ri(Uh,n);return A.jsx(TA,{scope:n,forceMount:i,children:A.jsx(ni,{present:i||l.open,children:A.jsx(Gh,{asChild:!0,container:s,children:a})})})};vw.displayName=Uh;var ka="PopoverContent",yw=S.forwardRef((r,n)=>{const i=CA(ka,r.__scopePopover),{forceMount:a=i.forceMount,...s}=r,l=ri(ka,r.__scopePopover);return A.jsx(ni,{present:a||l.open,children:l.modal?A.jsx(AA,{...s,ref:n}):A.jsx(RA,{...s,ref:n})})});yw.displayName=ka;var AA=S.forwardRef((r,n)=>{const i=ri(ka,r.__scopePopover),a=S.useRef(null),s=Vt(n,a),l=S.useRef(!1);return S.useEffect(()=>{const c=a.current;if(c)return iw(c)},[]),A.jsx(Mh,{as:is,allowPinchZoom:!0,children:A.jsx(bw,{...r,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(r.onCloseAutoFocus,c=>{var f;c.preventDefault(),l.current||(f=i.triggerRef.current)==null||f.focus()}),onPointerDownOutside:ht(r.onPointerDownOutside,c=>{const f=c.detail.originalEvent,d=f.button===0&&f.ctrlKey===!0,g=f.button===2||d;l.current=g},{checkForDefaultPrevented:!1}),onFocusOutside:ht(r.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),RA=S.forwardRef((r,n)=>{const i=ri(ka,r.__scopePopover),a=S.useRef(!1),s=S.useRef(!1);return A.jsx(bw,{...r,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,f;(c=r.onCloseAutoFocus)==null||c.call(r,l),l.defaultPrevented||(a.current||(f=i.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:l=>{var d,g;(d=r.onInteractOutside)==null||d.call(r,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((g=i.triggerRef.current)==null?void 0:g.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),bw=S.forwardRef((r,n)=>{const{__scopePopover:i,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:g,onInteractOutside:m,...v}=r,y=ri(ka,i),b=os(i);return k0(),A.jsx(_h,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:l,children:A.jsx(hu,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:g,onDismiss:()=>y.onOpenChange(!1),children:A.jsx(tw,{"data-state":Ew(y.open),role:"dialog",id:y.contentId,...b,...v,ref:n,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),ww="PopoverClose",DA=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=ri(ww,i);return A.jsx(Je.button,{type:"button",...a,ref:n,onClick:ht(r.onClick,()=>s.onOpenChange(!1))})});DA.displayName=ww;var OA="PopoverArrow",kA=S.forwardRef((r,n)=>{const{__scopePopover:i,...a}=r,s=os(i);return A.jsx(nw,{...s,...a,ref:n})});kA.displayName=OA;function Ew(r){return r?"open":"closed"}var LA=hw,NA=mw,zA=vw,Sw=yw;const wu=LA,Eu=NA,ss=S.forwardRef(({className:r,align:n="center",sideOffset:i=4,...a},s)=>A.jsx(zA,{children:A.jsx(Sw,{ref:s,align:n,sideOffset:i,className:Xe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 rounded-md border p-4 shadow-md outline-none",r),...a})}));ss.displayName=Sw.displayName;const GA=({status:r})=>r?A.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"Storage Info"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"Working Directory:"}),A.jsx("span",{className:"truncate",children:r.working_directory}),A.jsx("span",{children:"Input Directory:"}),A.jsx("span",{className:"truncate",children:r.input_directory}),A.jsx("span",{children:"Indexed Files:"}),A.jsx("span",{children:r.indexed_files_count})]})]}),A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"LLM Binding:"}),A.jsx("span",{children:r.configuration.llm_binding}),A.jsx("span",{children:"LLM Binding Host:"}),A.jsx("span",{children:r.configuration.llm_binding_host}),A.jsx("span",{children:"LLM Model:"}),A.jsx("span",{children:r.configuration.llm_model}),A.jsx("span",{children:"Max Tokens:"}),A.jsx("span",{children:r.configuration.max_tokens})]})]}),A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"Embedding Binding:"}),A.jsx("span",{children:r.configuration.embedding_binding}),A.jsx("span",{children:"Embedding Binding Host:"}),A.jsx("span",{children:r.configuration.embedding_binding_host}),A.jsx("span",{children:"Embedding Model:"}),A.jsx("span",{children:r.configuration.embedding_model})]})]}),A.jsxs("div",{className:"space-y-1",children:[A.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),A.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[A.jsx("span",{children:"KV Storage:"}),A.jsx("span",{children:r.configuration.kv_storage}),A.jsx("span",{children:"Doc Status Storage:"}),A.jsx("span",{children:r.configuration.doc_status_storage}),A.jsx("span",{children:"Graph Storage:"}),A.jsx("span",{children:r.configuration.graph_storage}),A.jsx("span",{children:"Vector Storage:"}),A.jsx("span",{children:r.configuration.vector_storage})]})]})]}):A.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),MA=()=>{const r=kn.use.health(),n=kn.use.lastCheckTime(),i=kn.use.status(),[a,s]=S.useState(!1);return S.useEffect(()=>{s(!0);const l=setTimeout(()=>s(!1),300);return()=>clearTimeout(l)},[n]),A.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:A.jsxs(wu,{children:[A.jsx(Eu,{asChild:!0,children:A.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[A.jsx("div",{className:Xe("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",r?"bg-green-500":"bg-red-500",a&&"scale-125",a&&r&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",a&&!r&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),A.jsx("span",{className:"text-muted-foreground text-xs",children:r?"Connected":"Disconnected"})]})}),A.jsx(ss,{className:"w-auto",side:"top",align:"end",children:A.jsx(GA,{status:i})})]})})};var kl={exports:{}},ky;function jA(){if(ky)return kl.exports;ky=1;var r=typeof Reflect=="object"?Reflect:null,n=r&&typeof r.apply=="function"?r.apply:function(R,B,_){return Function.prototype.apply.call(R,B,_)},i;r&&typeof r.ownKeys=="function"?i=r.ownKeys:Object.getOwnPropertySymbols?i=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:i=function(R){return Object.getOwnPropertyNames(R)};function a(C){console&&console.warn&&console.warn(C)}var s=Number.isNaN||function(R){return R!==R};function l(){l.init.call(this)}kl.exports=l,kl.exports.once=M,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var c=10;function f(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(C){if(typeof C!="number"||C<0||s(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");c=C}}),l.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||s(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function d(C){return C._maxListeners===void 0?l.defaultMaxListeners:C._maxListeners}l.prototype.getMaxListeners=function(){return d(this)},l.prototype.emit=function(R){for(var B=[],_=1;_<arguments.length;_++)B.push(arguments[_]);var $=R==="error",z=this._events;if(z!==void 0)$=$&&z.error===void 0;else if(!$)return!1;if($){var F;if(B.length>0&&(F=B[0]),F instanceof Error)throw F;var Y=new Error("Unhandled error."+(F?" ("+F.message+")":""));throw Y.context=F,Y}var I=z[R];if(I===void 0)return!1;if(typeof I=="function")n(I,this,B);else for(var j=I.length,J=x(I,j),_=0;_<j;++_)n(J[_],this,B);return!0};function g(C,R,B,_){var $,z,F;if(f(B),z=C._events,z===void 0?(z=C._events=Object.create(null),C._eventsCount=0):(z.newListener!==void 0&&(C.emit("newListener",R,B.listener?B.listener:B),z=C._events),F=z[R]),F===void 0)F=z[R]=B,++C._eventsCount;else if(typeof F=="function"?F=z[R]=_?[B,F]:[F,B]:_?F.unshift(B):F.push(B),$=d(C),$>0&&F.length>$&&!F.warned){F.warned=!0;var Y=new Error("Possible EventEmitter memory leak detected. "+F.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");Y.name="MaxListenersExceededWarning",Y.emitter=C,Y.type=R,Y.count=F.length,a(Y)}return C}l.prototype.addListener=function(R,B){return g(this,R,B,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(R,B){return g(this,R,B,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function v(C,R,B){var _={fired:!1,wrapFn:void 0,target:C,type:R,listener:B},$=m.bind(_);return $.listener=B,_.wrapFn=$,$}l.prototype.once=function(R,B){return f(B),this.on(R,v(this,R,B)),this},l.prototype.prependOnceListener=function(R,B){return f(B),this.prependListener(R,v(this,R,B)),this},l.prototype.removeListener=function(R,B){var _,$,z,F,Y;if(f(B),$=this._events,$===void 0)return this;if(_=$[R],_===void 0)return this;if(_===B||_.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete $[R],$.removeListener&&this.emit("removeListener",R,_.listener||B));else if(typeof _!="function"){for(z=-1,F=_.length-1;F>=0;F--)if(_[F]===B||_[F].listener===B){Y=_[F].listener,z=F;break}if(z<0)return this;z===0?_.shift():E(_,z),_.length===1&&($[R]=_[0]),$.removeListener!==void 0&&this.emit("removeListener",R,Y||B)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(R){var B,_,$;if(_=this._events,_===void 0)return this;if(_.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):_[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete _[R]),this;if(arguments.length===0){var z=Object.keys(_),F;for($=0;$<z.length;++$)F=z[$],F!=="removeListener"&&this.removeAllListeners(F);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(B=_[R],typeof B=="function")this.removeListener(R,B);else if(B!==void 0)for($=B.length-1;$>=0;$--)this.removeListener(R,B[$]);return this};function y(C,R,B){var _=C._events;if(_===void 0)return[];var $=_[R];return $===void 0?[]:typeof $=="function"?B?[$.listener||$]:[$]:B?T($):x($,$.length)}l.prototype.listeners=function(R){return y(this,R,!0)},l.prototype.rawListeners=function(R){return y(this,R,!1)},l.listenerCount=function(C,R){return typeof C.listenerCount=="function"?C.listenerCount(R):b.call(C,R)},l.prototype.listenerCount=b;function b(C){var R=this._events;if(R!==void 0){var B=R[C];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}l.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function x(C,R){for(var B=new Array(R),_=0;_<R;++_)B[_]=C[_];return B}function E(C,R){for(;R+1<C.length;R++)C[R]=C[R+1];C.pop()}function T(C){for(var R=new Array(C.length),B=0;B<R.length;++B)R[B]=C[B].listener||C[B];return R}function M(C,R){return new Promise(function(B,_){function $(F){C.removeListener(R,z),_(F)}function z(){typeof C.removeListener=="function"&&C.removeListener("error",$),B([].slice.call(arguments))}L(C,R,z,{once:!0}),R!=="error"&&N(C,$,{once:!0})})}function N(C,R,B){typeof C.on=="function"&&L(C,"error",R,B)}function L(C,R,B,_){if(typeof C.on=="function")_.once?C.once(R,B):C.on(R,B);else if(typeof C.addEventListener=="function")C.addEventListener(R,function $(z){_.once&&C.removeEventListener(R,$),B(z)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return kl.exports}var xw=jA();function UA(){const r=arguments[0];for(let n=1,i=arguments.length;n<i;n++)if(arguments[n])for(const a in arguments[n])r[a]=arguments[n][a];return r}let wt=UA;typeof Object.assign=="function"&&(wt=Object.assign);function En(r,n,i,a){const s=r._nodes.get(n);let l=null;return s&&(a==="mixed"?l=s.out&&s.out[i]||s.undirected&&s.undirected[i]:a==="directed"?l=s.out&&s.out[i]:l=s.undirected&&s.undirected[i]),l}function Nt(r){return typeof r=="object"&&r!==null}function _w(r){let n;for(n in r)return!1;return!0}function wn(r,n,i){Object.defineProperty(r,n,{enumerable:!1,configurable:!1,writable:!0,value:i})}function Rn(r,n,i){const a={enumerable:!0,configurable:!0};typeof i=="function"?a.get=i:(a.value=i,a.writable=!1),Object.defineProperty(r,n,a)}function Ly(r){return!(!Nt(r)||r.attributes&&!Array.isArray(r.attributes))}function BA(){let r=Math.floor(Math.random()*256)&255;return()=>r++}function yr(){const r=arguments;let n=null,i=-1;return{[Symbol.iterator](){return this},next(){let a=null;do{if(n===null){if(i++,i>=r.length)return{done:!0};n=r[i][Symbol.iterator]()}if(a=n.next(),a.done){n=null;continue}break}while(!0);return a}}}function Ba(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Bh extends Error{constructor(n){super(),this.name="GraphError",this.message=n}}class ye extends Bh{constructor(n){super(n),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ye.prototype.constructor)}}class me extends Bh{constructor(n){super(n),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,me.prototype.constructor)}}class ke extends Bh{constructor(n){super(n),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ke.prototype.constructor)}}function Tw(r,n){this.key=r,this.attributes=n,this.clear()}Tw.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Cw(r,n){this.key=r,this.attributes=n,this.clear()}Cw.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Aw(r,n){this.key=r,this.attributes=n,this.clear()}Aw.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Fa(r,n,i,a,s){this.key=n,this.attributes=s,this.undirected=r,this.source=i,this.target=a}Fa.prototype.attach=function(){let r="out",n="in";this.undirected&&(r=n="undirected");const i=this.source.key,a=this.target.key;this.source[r][a]=this,!(this.undirected&&i===a)&&(this.target[n][i]=this)};Fa.prototype.attachMulti=function(){let r="out",n="in";const i=this.source.key,a=this.target.key;this.undirected&&(r=n="undirected");const s=this.source[r],l=s[a];if(typeof l>"u"){s[a]=this,this.undirected&&i===a||(this.target[n][i]=this);return}l.previous=this,this.next=l,s[a]=this,this.target[n][i]=this};Fa.prototype.detach=function(){const r=this.source.key,n=this.target.key;let i="out",a="in";this.undirected&&(i=a="undirected"),delete this.source[i][n],delete this.target[a][r]};Fa.prototype.detachMulti=function(){const r=this.source.key,n=this.target.key;let i="out",a="in";this.undirected&&(i=a="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[i][n],delete this.target[a][r]):(this.next.previous=void 0,this.source[i][n]=this.next,this.target[a][r]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Rw=0,Dw=1,FA=2,Ow=3;function Er(r,n,i,a,s,l,c){let f,d,g,m;if(a=""+a,i===Rw){if(f=r._nodes.get(a),!f)throw new me(`Graph.${n}: could not find the "${a}" node in the graph.`);g=s,m=l}else if(i===Ow){if(s=""+s,d=r._edges.get(s),!d)throw new me(`Graph.${n}: could not find the "${s}" edge in the graph.`);const v=d.source.key,y=d.target.key;if(a===v)f=d.target;else if(a===y)f=d.source;else throw new me(`Graph.${n}: the "${a}" node is not attached to the "${s}" edge (${v}, ${y}).`);g=l,m=c}else{if(d=r._edges.get(a),!d)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`);i===Dw?f=d.source:f=d.target,g=s,m=l}return[f,g,m]}function HA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);return c.attributes[f]}}function PA(r,n,i){r.prototype[n]=function(a,s){const[l]=Er(this,n,i,a,s);return l.attributes}}function $A(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);return c.attributes.hasOwnProperty(f)}}function qA(r,n,i){r.prototype[n]=function(a,s,l,c){const[f,d,g]=Er(this,n,i,a,s,l,c);return f.attributes[d]=g,this.emit("nodeAttributesUpdated",{key:f.key,type:"set",attributes:f.attributes,name:d}),this}}function VA(r,n,i){r.prototype[n]=function(a,s,l,c){const[f,d,g]=Er(this,n,i,a,s,l,c);if(typeof g!="function")throw new ye(`Graph.${n}: updater should be a function.`);const m=f.attributes,v=g(m[d]);return m[d]=v,this.emit("nodeAttributesUpdated",{key:f.key,type:"set",attributes:f.attributes,name:d}),this}}function IA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);return delete c.attributes[f],this.emit("nodeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:f}),this}}function YA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);if(!Nt(f))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return c.attributes=f,this.emit("nodeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function XA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);if(!Nt(f))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return wt(c.attributes,f),this.emit("nodeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:f}),this}}function ZA(r,n,i){r.prototype[n]=function(a,s,l){const[c,f]=Er(this,n,i,a,s,l);if(typeof f!="function")throw new ye(`Graph.${n}: provided updater is not a function.`);return c.attributes=f(c.attributes),this.emit("nodeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const WA=[{name:r=>`get${r}Attribute`,attacher:HA},{name:r=>`get${r}Attributes`,attacher:PA},{name:r=>`has${r}Attribute`,attacher:$A},{name:r=>`set${r}Attribute`,attacher:qA},{name:r=>`update${r}Attribute`,attacher:VA},{name:r=>`remove${r}Attribute`,attacher:IA},{name:r=>`replace${r}Attributes`,attacher:YA},{name:r=>`merge${r}Attributes`,attacher:XA},{name:r=>`update${r}Attributes`,attacher:ZA}];function KA(r){WA.forEach(function({name:n,attacher:i}){i(r,n("Node"),Rw),i(r,n("Source"),Dw),i(r,n("Target"),FA),i(r,n("Opposite"),Ow)})}function QA(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return l.attributes[s]}}function JA(r,n,i){r.prototype[n]=function(a){let s;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+a,c=""+arguments[1];if(s=En(this,l,c,i),!s)throw new me(`Graph.${n}: could not find an edge for the given path ("${l}" - "${c}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,s=this._edges.get(a),!s)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return s.attributes}}function eR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return l.attributes.hasOwnProperty(s)}}function tR(r,n,i){r.prototype[n]=function(a,s,l){let c;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const f=""+a,d=""+s;if(s=arguments[2],l=arguments[3],c=En(this,f,d,i),!c)throw new me(`Graph.${n}: could not find an edge for the given path ("${f}" - "${d}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,c=this._edges.get(a),!c)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return c.attributes[s]=l,this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:s}),this}}function nR(r,n,i){r.prototype[n]=function(a,s,l){let c;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const f=""+a,d=""+s;if(s=arguments[2],l=arguments[3],c=En(this,f,d,i),!c)throw new me(`Graph.${n}: could not find an edge for the given path ("${f}" - "${d}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,c=this._edges.get(a),!c)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(typeof l!="function")throw new ye(`Graph.${n}: updater should be a function.`);return c.attributes[s]=l(c.attributes[s]),this.emit("edgeAttributesUpdated",{key:c.key,type:"set",attributes:c.attributes,name:s}),this}}function rR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}return delete l.attributes[s],this.emit("edgeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:s}),this}}function iR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(!Nt(s))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return l.attributes=s,this.emit("edgeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function aR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(!Nt(s))throw new ye(`Graph.${n}: provided attributes are not a plain object.`);return wt(l.attributes,s),this.emit("edgeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:s}),this}}function oR(r,n,i){r.prototype[n]=function(a,s){let l;if(this.type!=="mixed"&&i!=="mixed"&&i!==this.type)throw new ke(`Graph.${n}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ke(`Graph.${n}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+a,f=""+s;if(s=arguments[2],l=En(this,c,f,i),!l)throw new me(`Graph.${n}: could not find an edge for the given path ("${c}" - "${f}").`)}else{if(i!=="mixed")throw new ke(`Graph.${n}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(a=""+a,l=this._edges.get(a),!l)throw new me(`Graph.${n}: could not find the "${a}" edge in the graph.`)}if(typeof s!="function")throw new ye(`Graph.${n}: provided updater is not a function.`);return l.attributes=s(l.attributes),this.emit("edgeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const sR=[{name:r=>`get${r}Attribute`,attacher:QA},{name:r=>`get${r}Attributes`,attacher:JA},{name:r=>`has${r}Attribute`,attacher:eR},{name:r=>`set${r}Attribute`,attacher:tR},{name:r=>`update${r}Attribute`,attacher:nR},{name:r=>`remove${r}Attribute`,attacher:rR},{name:r=>`replace${r}Attributes`,attacher:iR},{name:r=>`merge${r}Attributes`,attacher:aR},{name:r=>`update${r}Attributes`,attacher:oR}];function lR(r){sR.forEach(function({name:n,attacher:i}){i(r,n("Edge"),"mixed"),i(r,n("DirectedEdge"),"directed"),i(r,n("UndirectedEdge"),"undirected")})}const uR=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function cR(r,n,i,a){let s=!1;for(const l in n){if(l===a)continue;const c=n[l];if(s=i(c.key,c.attributes,c.source.key,c.target.key,c.source.attributes,c.target.attributes,c.undirected),r&&s)return c.key}}function fR(r,n,i,a){let s,l,c,f=!1;for(const d in n)if(d!==a){s=n[d];do{if(l=s.source,c=s.target,f=i(s.key,s.attributes,l.key,c.key,l.attributes,c.attributes,s.undirected),r&&f)return s.key;s=s.next}while(s!==void 0)}}function ed(r,n){const i=Object.keys(r),a=i.length;let s,l=0;return{[Symbol.iterator](){return this},next(){do if(s)s=s.next;else{if(l>=a)return{done:!0};const c=i[l++];if(c===n){s=void 0;continue}s=r[c]}while(!s);return{done:!1,value:{edge:s.key,attributes:s.attributes,source:s.source.key,target:s.target.key,sourceAttributes:s.source.attributes,targetAttributes:s.target.attributes,undirected:s.undirected}}}}}function dR(r,n,i,a){const s=n[i];if(!s)return;const l=s.source,c=s.target;if(a(s.key,s.attributes,l.key,c.key,l.attributes,c.attributes,s.undirected)&&r)return s.key}function hR(r,n,i,a){let s=n[i];if(!s)return;let l=!1;do{if(l=a(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),r&&l)return s.key;s=s.next}while(s!==void 0)}function td(r,n){let i=r[n];if(i.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!i)return{done:!0};const s={edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected};return i=i.next,{done:!1,value:s}}};let a=!1;return{[Symbol.iterator](){return this},next(){return a===!0?{done:!0}:(a=!0,{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}})}}}function gR(r,n){if(r.size===0)return[];if(n==="mixed"||n===r.type)return Array.from(r._edges.keys());const i=n==="undirected"?r.undirectedSize:r.directedSize,a=new Array(i),s=n==="undirected",l=r._edges.values();let c=0,f,d;for(;f=l.next(),f.done!==!0;)d=f.value,d.undirected===s&&(a[c++]=d.key);return a}function kw(r,n,i,a){if(n.size===0)return;const s=i!=="mixed"&&i!==n.type,l=i==="undirected";let c,f,d=!1;const g=n._edges.values();for(;c=g.next(),c.done!==!0;){if(f=c.value,s&&f.undirected!==l)continue;const{key:m,attributes:v,source:y,target:b}=f;if(d=a(m,v,y.key,b.key,y.attributes,b.attributes,f.undirected),r&&d)return m}}function pR(r,n){if(r.size===0)return Ba();const i=n!=="mixed"&&n!==r.type,a=n==="undirected",s=r._edges.values();return{[Symbol.iterator](){return this},next(){let l,c;for(;;){if(l=s.next(),l.done)return l;if(c=l.value,!(i&&c.undirected!==a))break}return{value:{edge:c.key,attributes:c.attributes,source:c.source.key,target:c.target.key,sourceAttributes:c.source.attributes,targetAttributes:c.target.attributes,undirected:c.undirected},done:!1}}}}function Fh(r,n,i,a,s,l){const c=n?fR:cR;let f;if(i!=="undirected"&&(a!=="out"&&(f=c(r,s.in,l),r&&f)||a!=="in"&&(f=c(r,s.out,l,a?void 0:s.key),r&&f))||i!=="directed"&&(f=c(r,s.undirected,l),r&&f))return f}function mR(r,n,i,a){const s=[];return Fh(!1,r,n,i,a,function(l){s.push(l)}),s}function vR(r,n,i){let a=Ba();return r!=="undirected"&&(n!=="out"&&typeof i.in<"u"&&(a=yr(a,ed(i.in))),n!=="in"&&typeof i.out<"u"&&(a=yr(a,ed(i.out,n?void 0:i.key)))),r!=="directed"&&typeof i.undirected<"u"&&(a=yr(a,ed(i.undirected))),a}function Hh(r,n,i,a,s,l,c){const f=i?hR:dR;let d;if(n!=="undirected"&&(typeof s.in<"u"&&a!=="out"&&(d=f(r,s.in,l,c),r&&d)||typeof s.out<"u"&&a!=="in"&&(a||s.key!==l)&&(d=f(r,s.out,l,c),r&&d))||n!=="directed"&&typeof s.undirected<"u"&&(d=f(r,s.undirected,l,c),r&&d))return d}function yR(r,n,i,a,s){const l=[];return Hh(!1,r,n,i,a,s,function(c){l.push(c)}),l}function bR(r,n,i,a){let s=Ba();return r!=="undirected"&&(typeof i.in<"u"&&n!=="out"&&a in i.in&&(s=yr(s,td(i.in,a))),typeof i.out<"u"&&n!=="in"&&a in i.out&&(n||i.key!==a)&&(s=yr(s,td(i.out,a)))),r!=="directed"&&typeof i.undirected<"u"&&a in i.undirected&&(s=yr(s,td(i.undirected,a))),s}function wR(r,n){const{name:i,type:a,direction:s}=n;r.prototype[i]=function(l,c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];if(!arguments.length)return gR(this,a);if(arguments.length===1){l=""+l;const f=this._nodes.get(l);if(typeof f>"u")throw new me(`Graph.${i}: could not find the "${l}" node in the graph.`);return mR(this.multi,a==="mixed"?this.type:a,s,f)}if(arguments.length===2){l=""+l,c=""+c;const f=this._nodes.get(l);if(!f)throw new me(`Graph.${i}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new me(`Graph.${i}: could not find the "${c}" target node in the graph.`);return yR(a,this.multi,s,f,c)}throw new ye(`Graph.${i}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ER(r,n){const{name:i,type:a,direction:s}=n,l="forEach"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[l]=function(g,m,v){if(!(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)){if(arguments.length===1)return v=g,kw(!1,this,a,v);if(arguments.length===2){g=""+g,v=m;const y=this._nodes.get(g);if(typeof y>"u")throw new me(`Graph.${l}: could not find the "${g}" node in the graph.`);return Fh(!1,this.multi,a==="mixed"?this.type:a,s,y,v)}if(arguments.length===3){g=""+g,m=""+m;const y=this._nodes.get(g);if(!y)throw new me(`Graph.${l}: could not find the "${g}" source node in the graph.`);if(!this._nodes.has(m))throw new me(`Graph.${l}: could not find the "${m}" target node in the graph.`);return Hh(!1,a,this.multi,s,y,m,v)}throw new ye(`Graph.${l}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const c="map"+i[0].toUpperCase()+i.slice(1);r.prototype[c]=function(){const g=Array.prototype.slice.call(arguments),m=g.pop();let v;if(g.length===0){let y=0;a!=="directed"&&(y+=this.undirectedSize),a!=="undirected"&&(y+=this.directedSize),v=new Array(y);let b=0;g.push((x,E,T,M,N,L,C)=>{v[b++]=m(x,E,T,M,N,L,C)})}else v=[],g.push((y,b,x,E,T,M,N)=>{v.push(m(y,b,x,E,T,M,N))});return this[l].apply(this,g),v};const f="filter"+i[0].toUpperCase()+i.slice(1);r.prototype[f]=function(){const g=Array.prototype.slice.call(arguments),m=g.pop(),v=[];return g.push((y,b,x,E,T,M,N)=>{m(y,b,x,E,T,M,N)&&v.push(y)}),this[l].apply(this,g),v};const d="reduce"+i[0].toUpperCase()+i.slice(1);r.prototype[d]=function(){let g=Array.prototype.slice.call(arguments);if(g.length<2||g.length>4)throw new ye(`Graph.${d}: invalid number of arguments (expecting 2, 3 or 4 and got ${g.length}).`);if(typeof g[g.length-1]=="function"&&typeof g[g.length-2]!="function")throw new ye(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let m,v;g.length===2?(m=g[0],v=g[1],g=[]):g.length===3?(m=g[1],v=g[2],g=[g[0]]):g.length===4&&(m=g[2],v=g[3],g=[g[0],g[1]]);let y=v;return g.push((b,x,E,T,M,N,L)=>{y=m(y,b,x,E,T,M,N,L)}),this[l].apply(this,g),y}}function SR(r,n){const{name:i,type:a,direction:s}=n,l="find"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[l]=function(d,g,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return!1;if(arguments.length===1)return m=d,kw(!0,this,a,m);if(arguments.length===2){d=""+d,m=g;const v=this._nodes.get(d);if(typeof v>"u")throw new me(`Graph.${l}: could not find the "${d}" node in the graph.`);return Fh(!0,this.multi,a==="mixed"?this.type:a,s,v,m)}if(arguments.length===3){d=""+d,g=""+g;const v=this._nodes.get(d);if(!v)throw new me(`Graph.${l}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(g))throw new me(`Graph.${l}: could not find the "${g}" target node in the graph.`);return Hh(!0,a,this.multi,s,v,g,m)}throw new ye(`Graph.${l}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const c="some"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[c]=function(){const d=Array.prototype.slice.call(arguments),g=d.pop();return d.push((v,y,b,x,E,T,M)=>g(v,y,b,x,E,T,M)),!!this[l].apply(this,d)};const f="every"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[f]=function(){const d=Array.prototype.slice.call(arguments),g=d.pop();return d.push((v,y,b,x,E,T,M)=>!g(v,y,b,x,E,T,M)),!this[l].apply(this,d)}}function xR(r,n){const{name:i,type:a,direction:s}=n,l=i.slice(0,-1)+"Entries";r.prototype[l]=function(c,f){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return Ba();if(!arguments.length)return pR(this,a);if(arguments.length===1){c=""+c;const d=this._nodes.get(c);if(!d)throw new me(`Graph.${l}: could not find the "${c}" node in the graph.`);return vR(a,s,d)}if(arguments.length===2){c=""+c,f=""+f;const d=this._nodes.get(c);if(!d)throw new me(`Graph.${l}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(f))throw new me(`Graph.${l}: could not find the "${f}" target node in the graph.`);return bR(a,s,d,f)}throw new ye(`Graph.${l}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function _R(r){uR.forEach(n=>{wR(r,n),ER(r,n),SR(r,n),xR(r,n)})}const TR=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Su(){this.A=null,this.B=null}Su.prototype.wrap=function(r){this.A===null?this.A=r:this.B===null&&(this.B=r)};Su.prototype.has=function(r){return this.A!==null&&r in this.A||this.B!==null&&r in this.B};function $o(r,n,i,a,s){for(const l in a){const c=a[l],f=c.source,d=c.target,g=f===i?d:f;if(n&&n.has(g.key))continue;const m=s(g.key,g.attributes);if(r&&m)return g.key}}function Ph(r,n,i,a,s){if(n!=="mixed"){if(n==="undirected")return $o(r,null,a,a.undirected,s);if(typeof i=="string")return $o(r,null,a,a[i],s)}const l=new Su;let c;if(n!=="undirected"){if(i!=="out"){if(c=$o(r,null,a,a.in,s),r&&c)return c;l.wrap(a.in)}if(i!=="in"){if(c=$o(r,l,a,a.out,s),r&&c)return c;l.wrap(a.out)}}if(n!=="directed"&&(c=$o(r,l,a,a.undirected,s),r&&c))return c}function CR(r,n,i){if(r!=="mixed"){if(r==="undirected")return Object.keys(i.undirected);if(typeof n=="string")return Object.keys(i[n])}const a=[];return Ph(!1,r,n,i,function(s){a.push(s)}),a}function qo(r,n,i){const a=Object.keys(i),s=a.length;let l=0;return{[Symbol.iterator](){return this},next(){let c=null;do{if(l>=s)return r&&r.wrap(i),{done:!0};const f=i[a[l++]],d=f.source,g=f.target;if(c=d===n?g:d,r&&r.has(c.key)){c=null;continue}}while(c===null);return{done:!1,value:{neighbor:c.key,attributes:c.attributes}}}}}function AR(r,n,i){if(r!=="mixed"){if(r==="undirected")return qo(null,i,i.undirected);if(typeof n=="string")return qo(null,i,i[n])}let a=Ba();const s=new Su;return r!=="undirected"&&(n!=="out"&&(a=yr(a,qo(s,i,i.in))),n!=="in"&&(a=yr(a,qo(s,i,i.out)))),r!=="directed"&&(a=yr(a,qo(s,i,i.undirected))),a}function RR(r,n){const{name:i,type:a,direction:s}=n;r.prototype[i]=function(l){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return[];l=""+l;const c=this._nodes.get(l);if(typeof c>"u")throw new me(`Graph.${i}: could not find the "${l}" node in the graph.`);return CR(a==="mixed"?this.type:a,s,c)}}function DR(r,n){const{name:i,type:a,direction:s}=n,l="forEach"+i[0].toUpperCase()+i.slice(1,-1);r.prototype[l]=function(g,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;g=""+g;const v=this._nodes.get(g);if(typeof v>"u")throw new me(`Graph.${l}: could not find the "${g}" node in the graph.`);Ph(!1,a==="mixed"?this.type:a,s,v,m)};const c="map"+i[0].toUpperCase()+i.slice(1);r.prototype[c]=function(g,m){const v=[];return this[l](g,(y,b)=>{v.push(m(y,b))}),v};const f="filter"+i[0].toUpperCase()+i.slice(1);r.prototype[f]=function(g,m){const v=[];return this[l](g,(y,b)=>{m(y,b)&&v.push(y)}),v};const d="reduce"+i[0].toUpperCase()+i.slice(1);r.prototype[d]=function(g,m,v){if(arguments.length<3)throw new ye(`Graph.${d}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let y=v;return this[l](g,(b,x)=>{y=m(y,b,x)}),y}}function OR(r,n){const{name:i,type:a,direction:s}=n,l=i[0].toUpperCase()+i.slice(1,-1),c="find"+l;r.prototype[c]=function(g,m){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return;g=""+g;const v=this._nodes.get(g);if(typeof v>"u")throw new me(`Graph.${c}: could not find the "${g}" node in the graph.`);return Ph(!0,a==="mixed"?this.type:a,s,v,m)};const f="some"+l;r.prototype[f]=function(g,m){return!!this[c](g,m)};const d="every"+l;r.prototype[d]=function(g,m){return!this[c](g,(y,b)=>!m(y,b))}}function kR(r,n){const{name:i,type:a,direction:s}=n,l=i.slice(0,-1)+"Entries";r.prototype[l]=function(c){if(a!=="mixed"&&this.type!=="mixed"&&a!==this.type)return Ba();c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new me(`Graph.${l}: could not find the "${c}" node in the graph.`);return AR(a==="mixed"?this.type:a,s,f)}}function LR(r){TR.forEach(n=>{RR(r,n),DR(r,n),OR(r,n),kR(r,n)})}function Ll(r,n,i,a,s){const l=a._nodes.values(),c=a.type;let f,d,g,m,v,y;for(;f=l.next(),f.done!==!0;){let b=!1;if(d=f.value,c!=="undirected"){m=d.out;for(g in m){v=m[g];do y=v.target,b=!0,s(d.key,y.key,d.attributes,y.attributes,v.key,v.attributes,v.undirected),v=v.next;while(v)}}if(c!=="directed"){m=d.undirected;for(g in m)if(!(n&&d.key>g)){v=m[g];do y=v.target,y.key!==g&&(y=v.source),b=!0,s(d.key,y.key,d.attributes,y.attributes,v.key,v.attributes,v.undirected),v=v.next;while(v)}}i&&!b&&s(d.key,null,d.attributes,null,null,null,null)}}function NR(r,n){const i={key:r};return _w(n.attributes)||(i.attributes=wt({},n.attributes)),i}function zR(r,n,i){const a={key:n,source:i.source.key,target:i.target.key};return _w(i.attributes)||(a.attributes=wt({},i.attributes)),r==="mixed"&&i.undirected&&(a.undirected=!0),a}function GR(r){if(!Nt(r))throw new ye('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in r))throw new ye("Graph.import: serialized node is missing its key.");if("attributes"in r&&(!Nt(r.attributes)||r.attributes===null))throw new ye("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function MR(r){if(!Nt(r))throw new ye('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in r))throw new ye("Graph.import: serialized edge is missing its source.");if(!("target"in r))throw new ye("Graph.import: serialized edge is missing its target.");if("attributes"in r&&(!Nt(r.attributes)||r.attributes===null))throw new ye("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in r&&typeof r.undirected!="boolean")throw new ye("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const jR=BA(),UR=new Set(["directed","undirected","mixed"]),Ny=new Set(["domain","_events","_eventsCount","_maxListeners"]),BR=[{name:r=>`${r}Edge`,generateKey:!0},{name:r=>`${r}DirectedEdge`,generateKey:!0,type:"directed"},{name:r=>`${r}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:r=>`${r}EdgeWithKey`},{name:r=>`${r}DirectedEdgeWithKey`,type:"directed"},{name:r=>`${r}UndirectedEdgeWithKey`,type:"undirected"}],FR={allowSelfLoops:!0,multi:!1,type:"mixed"};function HR(r,n,i){if(i&&!Nt(i))throw new ye(`Graph.addNode: invalid attributes. Expecting an object but got "${i}"`);if(n=""+n,i=i||{},r._nodes.has(n))throw new ke(`Graph.addNode: the "${n}" node already exist in the graph.`);const a=new r.NodeDataClass(n,i);return r._nodes.set(n,a),r.emit("nodeAdded",{key:n,attributes:i}),a}function zy(r,n,i){const a=new r.NodeDataClass(n,i);return r._nodes.set(n,a),r.emit("nodeAdded",{key:n,attributes:i}),a}function Lw(r,n,i,a,s,l,c,f){if(!a&&r.type==="undirected")throw new ke(`Graph.${n}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(a&&r.type==="directed")throw new ke(`Graph.${n}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(f&&!Nt(f))throw new ye(`Graph.${n}: invalid attributes. Expecting an object but got "${f}"`);if(l=""+l,c=""+c,f=f||{},!r.allowSelfLoops&&l===c)throw new ke(`Graph.${n}: source & target are the same ("${l}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const d=r._nodes.get(l),g=r._nodes.get(c);if(!d)throw new me(`Graph.${n}: source node "${l}" not found.`);if(!g)throw new me(`Graph.${n}: target node "${c}" not found.`);const m={key:null,undirected:a,source:l,target:c,attributes:f};if(i)s=r._edgeKeyGenerator();else if(s=""+s,r._edges.has(s))throw new ke(`Graph.${n}: the "${s}" edge already exists in the graph.`);if(!r.multi&&(a?typeof d.undirected[c]<"u":typeof d.out[c]<"u"))throw new ke(`Graph.${n}: an edge linking "${l}" to "${c}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const v=new Fa(a,s,d,g,f);r._edges.set(s,v);const y=l===c;return a?(d.undirectedDegree++,g.undirectedDegree++,y&&(d.undirectedLoops++,r._undirectedSelfLoopCount++)):(d.outDegree++,g.inDegree++,y&&(d.directedLoops++,r._directedSelfLoopCount++)),r.multi?v.attachMulti():v.attach(),a?r._undirectedSize++:r._directedSize++,m.key=s,r.emit("edgeAdded",m),s}function PR(r,n,i,a,s,l,c,f,d){if(!a&&r.type==="undirected")throw new ke(`Graph.${n}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(a&&r.type==="directed")throw new ke(`Graph.${n}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(f){if(d){if(typeof f!="function")throw new ye(`Graph.${n}: invalid updater function. Expecting a function but got "${f}"`)}else if(!Nt(f))throw new ye(`Graph.${n}: invalid attributes. Expecting an object but got "${f}"`)}l=""+l,c=""+c;let g;if(d&&(g=f,f=void 0),!r.allowSelfLoops&&l===c)throw new ke(`Graph.${n}: source & target are the same ("${l}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let m=r._nodes.get(l),v=r._nodes.get(c),y,b;if(!i&&(y=r._edges.get(s),y)){if((y.source.key!==l||y.target.key!==c)&&(!a||y.source.key!==c||y.target.key!==l))throw new ke(`Graph.${n}: inconsistency detected when attempting to merge the "${s}" edge with "${l}" source & "${c}" target vs. ("${y.source.key}", "${y.target.key}").`);b=y}if(!b&&!r.multi&&m&&(b=a?m.undirected[c]:m.out[c]),b){const N=[b.key,!1,!1,!1];if(d?!g:!f)return N;if(d){const L=b.attributes;b.attributes=g(L),r.emit("edgeAttributesUpdated",{type:"replace",key:b.key,attributes:b.attributes})}else wt(b.attributes,f),r.emit("edgeAttributesUpdated",{type:"merge",key:b.key,attributes:b.attributes,data:f});return N}f=f||{},d&&g&&(f=g(f));const x={key:null,undirected:a,source:l,target:c,attributes:f};if(i)s=r._edgeKeyGenerator();else if(s=""+s,r._edges.has(s))throw new ke(`Graph.${n}: the "${s}" edge already exists in the graph.`);let E=!1,T=!1;m||(m=zy(r,l,{}),E=!0,l===c&&(v=m,T=!0)),v||(v=zy(r,c,{}),T=!0),y=new Fa(a,s,m,v,f),r._edges.set(s,y);const M=l===c;return a?(m.undirectedDegree++,v.undirectedDegree++,M&&(m.undirectedLoops++,r._undirectedSelfLoopCount++)):(m.outDegree++,v.inDegree++,M&&(m.directedLoops++,r._directedSelfLoopCount++)),r.multi?y.attachMulti():y.attach(),a?r._undirectedSize++:r._directedSize++,x.key=s,r.emit("edgeAdded",x),[s,!0,E,T]}function xa(r,n){r._edges.delete(n.key);const{source:i,target:a,attributes:s}=n,l=n.undirected,c=i===a;l?(i.undirectedDegree--,a.undirectedDegree--,c&&(i.undirectedLoops--,r._undirectedSelfLoopCount--)):(i.outDegree--,a.inDegree--,c&&(i.directedLoops--,r._directedSelfLoopCount--)),r.multi?n.detachMulti():n.detach(),l?r._undirectedSize--:r._directedSize--,r.emit("edgeDropped",{key:n.key,attributes:s,source:i.key,target:a.key,undirected:l})}class Ke extends xw.EventEmitter{constructor(n){if(super(),n=wt({},FR,n),typeof n.multi!="boolean")throw new ye(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${n.multi}".`);if(!UR.has(n.type))throw new ye(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${n.type}".`);if(typeof n.allowSelfLoops!="boolean")throw new ye(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${n.allowSelfLoops}".`);const i=n.type==="mixed"?Tw:n.type==="directed"?Cw:Aw;wn(this,"NodeDataClass",i);const a="geid_"+jR()+"_";let s=0;const l=()=>{let c;do c=a+s++;while(this._edges.has(c));return c};wn(this,"_attributes",{}),wn(this,"_nodes",new Map),wn(this,"_edges",new Map),wn(this,"_directedSize",0),wn(this,"_undirectedSize",0),wn(this,"_directedSelfLoopCount",0),wn(this,"_undirectedSelfLoopCount",0),wn(this,"_edgeKeyGenerator",l),wn(this,"_options",n),Ny.forEach(c=>wn(this,c,this[c])),Rn(this,"order",()=>this._nodes.size),Rn(this,"size",()=>this._edges.size),Rn(this,"directedSize",()=>this._directedSize),Rn(this,"undirectedSize",()=>this._undirectedSize),Rn(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Rn(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Rn(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Rn(this,"multi",this._options.multi),Rn(this,"type",this._options.type),Rn(this,"allowSelfLoops",this._options.allowSelfLoops),Rn(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(n){return this._nodes.has(""+n)}hasDirectedEdge(n,i){if(this.type==="undirected")return!1;if(arguments.length===1){const a=""+n,s=this._edges.get(a);return!!s&&!s.undirected}else if(arguments.length===2){n=""+n,i=""+i;const a=this._nodes.get(n);return a?a.out.hasOwnProperty(i):!1}throw new ye(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(n,i){if(this.type==="directed")return!1;if(arguments.length===1){const a=""+n,s=this._edges.get(a);return!!s&&s.undirected}else if(arguments.length===2){n=""+n,i=""+i;const a=this._nodes.get(n);return a?a.undirected.hasOwnProperty(i):!1}throw new ye(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(n,i){if(arguments.length===1){const a=""+n;return this._edges.has(a)}else if(arguments.length===2){n=""+n,i=""+i;const a=this._nodes.get(n);return a?typeof a.out<"u"&&a.out.hasOwnProperty(i)||typeof a.undirected<"u"&&a.undirected.hasOwnProperty(i):!1}throw new ye(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(n,i){if(this.type==="undirected")return;if(n=""+n,i=""+i,this.multi)throw new ke("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const a=this._nodes.get(n);if(!a)throw new me(`Graph.directedEdge: could not find the "${n}" source node in the graph.`);if(!this._nodes.has(i))throw new me(`Graph.directedEdge: could not find the "${i}" target node in the graph.`);const s=a.out&&a.out[i]||void 0;if(s)return s.key}undirectedEdge(n,i){if(this.type==="directed")return;if(n=""+n,i=""+i,this.multi)throw new ke("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const a=this._nodes.get(n);if(!a)throw new me(`Graph.undirectedEdge: could not find the "${n}" source node in the graph.`);if(!this._nodes.has(i))throw new me(`Graph.undirectedEdge: could not find the "${i}" target node in the graph.`);const s=a.undirected&&a.undirected[i]||void 0;if(s)return s.key}edge(n,i){if(this.multi)throw new ke("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.edge: could not find the "${n}" source node in the graph.`);if(!this._nodes.has(i))throw new me(`Graph.edge: could not find the "${i}" target node in the graph.`);const s=a.out&&a.out[i]||a.undirected&&a.undirected[i]||void 0;if(s)return s.key}areDirectedNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areDirectedNeighbors: could not find the "${n}" node in the graph.`);return this.type==="undirected"?!1:i in a.in||i in a.out}areOutNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areOutNeighbors: could not find the "${n}" node in the graph.`);return this.type==="undirected"?!1:i in a.out}areInNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areInNeighbors: could not find the "${n}" node in the graph.`);return this.type==="undirected"?!1:i in a.in}areUndirectedNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areUndirectedNeighbors: could not find the "${n}" node in the graph.`);return this.type==="directed"?!1:i in a.undirected}areNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areNeighbors: could not find the "${n}" node in the graph.`);return this.type!=="undirected"&&(i in a.in||i in a.out)||this.type!=="directed"&&i in a.undirected}areInboundNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areInboundNeighbors: could not find the "${n}" node in the graph.`);return this.type!=="undirected"&&i in a.in||this.type!=="directed"&&i in a.undirected}areOutboundNeighbors(n,i){n=""+n,i=""+i;const a=this._nodes.get(n);if(!a)throw new me(`Graph.areOutboundNeighbors: could not find the "${n}" node in the graph.`);return this.type!=="undirected"&&i in a.out||this.type!=="directed"&&i in a.undirected}inDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inDegree: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree}outDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outDegree: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.outDegree}directedDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.directedDegree: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree+i.outDegree}undirectedDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.undirectedDegree: could not find the "${n}" node in the graph.`);return this.type==="directed"?0:i.undirectedDegree}inboundDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inboundDegree: could not find the "${n}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=i.undirectedDegree),this.type!=="undirected"&&(a+=i.inDegree),a}outboundDegree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outboundDegree: could not find the "${n}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=i.undirectedDegree),this.type!=="undirected"&&(a+=i.outDegree),a}degree(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.degree: could not find the "${n}" node in the graph.`);let a=0;return this.type!=="directed"&&(a+=i.undirectedDegree),this.type!=="undirected"&&(a+=i.inDegree+i.outDegree),a}inDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree-i.directedLoops}outDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.outDegree-i.directedLoops}directedDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.directedDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="undirected"?0:i.inDegree+i.outDegree-i.directedLoops*2}undirectedDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);return this.type==="directed"?0:i.undirectedDegree-i.undirectedLoops*2}inboundDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);let a=0,s=0;return this.type!=="directed"&&(a+=i.undirectedDegree,s+=i.undirectedLoops*2),this.type!=="undirected"&&(a+=i.inDegree,s+=i.directedLoops),a-s}outboundDegreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);let a=0,s=0;return this.type!=="directed"&&(a+=i.undirectedDegree,s+=i.undirectedLoops*2),this.type!=="undirected"&&(a+=i.outDegree,s+=i.directedLoops),a-s}degreeWithoutSelfLoops(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.degreeWithoutSelfLoops: could not find the "${n}" node in the graph.`);let a=0,s=0;return this.type!=="directed"&&(a+=i.undirectedDegree,s+=i.undirectedLoops*2),this.type!=="undirected"&&(a+=i.inDegree+i.outDegree,s+=i.directedLoops*2),a-s}source(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.source: could not find the "${n}" edge in the graph.`);return i.source.key}target(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.target: could not find the "${n}" edge in the graph.`);return i.target.key}extremities(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.extremities: could not find the "${n}" edge in the graph.`);return[i.source.key,i.target.key]}opposite(n,i){n=""+n,i=""+i;const a=this._edges.get(i);if(!a)throw new me(`Graph.opposite: could not find the "${i}" edge in the graph.`);const s=a.source.key,l=a.target.key;if(n===s)return l;if(n===l)return s;throw new me(`Graph.opposite: the "${n}" node is not attached to the "${i}" edge (${s}, ${l}).`)}hasExtremity(n,i){n=""+n,i=""+i;const a=this._edges.get(n);if(!a)throw new me(`Graph.hasExtremity: could not find the "${n}" edge in the graph.`);return a.source.key===i||a.target.key===i}isUndirected(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.isUndirected: could not find the "${n}" edge in the graph.`);return i.undirected}isDirected(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.isDirected: could not find the "${n}" edge in the graph.`);return!i.undirected}isSelfLoop(n){n=""+n;const i=this._edges.get(n);if(!i)throw new me(`Graph.isSelfLoop: could not find the "${n}" edge in the graph.`);return i.source===i.target}addNode(n,i){return HR(this,n,i).key}mergeNode(n,i){if(i&&!Nt(i))throw new ye(`Graph.mergeNode: invalid attributes. Expecting an object but got "${i}"`);n=""+n,i=i||{};let a=this._nodes.get(n);return a?(i&&(wt(a.attributes,i),this.emit("nodeAttributesUpdated",{type:"merge",key:n,attributes:a.attributes,data:i})),[n,!1]):(a=new this.NodeDataClass(n,i),this._nodes.set(n,a),this.emit("nodeAdded",{key:n,attributes:i}),[n,!0])}updateNode(n,i){if(i&&typeof i!="function")throw new ye(`Graph.updateNode: invalid updater function. Expecting a function but got "${i}"`);n=""+n;let a=this._nodes.get(n);if(a){if(i){const l=a.attributes;a.attributes=i(l),this.emit("nodeAttributesUpdated",{type:"replace",key:n,attributes:a.attributes})}return[n,!1]}const s=i?i({}):{};return a=new this.NodeDataClass(n,s),this._nodes.set(n,a),this.emit("nodeAdded",{key:n,attributes:s}),[n,!0]}dropNode(n){n=""+n;const i=this._nodes.get(n);if(!i)throw new me(`Graph.dropNode: could not find the "${n}" node in the graph.`);let a;if(this.type!=="undirected"){for(const s in i.out){a=i.out[s];do xa(this,a),a=a.next;while(a)}for(const s in i.in){a=i.in[s];do xa(this,a),a=a.next;while(a)}}if(this.type!=="directed")for(const s in i.undirected){a=i.undirected[s];do xa(this,a),a=a.next;while(a)}this._nodes.delete(n),this.emit("nodeDropped",{key:n,attributes:i.attributes})}dropEdge(n){let i;if(arguments.length>1){const a=""+arguments[0],s=""+arguments[1];if(i=En(this,a,s,this.type),!i)throw new me(`Graph.dropEdge: could not find the "${a}" -> "${s}" edge in the graph.`)}else if(n=""+n,i=this._edges.get(n),!i)throw new me(`Graph.dropEdge: could not find the "${n}" edge in the graph.`);return xa(this,i),this}dropDirectedEdge(n,i){if(arguments.length<2)throw new ke("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ke("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");n=""+n,i=""+i;const a=En(this,n,i,"directed");if(!a)throw new me(`Graph.dropDirectedEdge: could not find a "${n}" -> "${i}" edge in the graph.`);return xa(this,a),this}dropUndirectedEdge(n,i){if(arguments.length<2)throw new ke("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ke("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const a=En(this,n,i,"undirected");if(!a)throw new me(`Graph.dropUndirectedEdge: could not find a "${n}" -> "${i}" edge in the graph.`);return xa(this,a),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const n=this._nodes.values();let i;for(;i=n.next(),i.done!==!0;)i.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(n){return this._attributes[n]}getAttributes(){return this._attributes}hasAttribute(n){return this._attributes.hasOwnProperty(n)}setAttribute(n,i){return this._attributes[n]=i,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:n}),this}updateAttribute(n,i){if(typeof i!="function")throw new ye("Graph.updateAttribute: updater should be a function.");const a=this._attributes[n];return this._attributes[n]=i(a),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:n}),this}removeAttribute(n){return delete this._attributes[n],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:n}),this}replaceAttributes(n){if(!Nt(n))throw new ye("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=n,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(n){if(!Nt(n))throw new ye("Graph.mergeAttributes: provided attributes are not a plain object.");return wt(this._attributes,n),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:n}),this}updateAttributes(n){if(typeof n!="function")throw new ye("Graph.updateAttributes: provided updater is not a function.");return this._attributes=n(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(n,i){if(typeof n!="function")throw new ye("Graph.updateEachNodeAttributes: expecting an updater function.");if(i&&!Ly(i))throw new ye("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._nodes.values();let s,l;for(;s=a.next(),s.done!==!0;)l=s.value,l.attributes=n(l.key,l.attributes);this.emit("eachNodeAttributesUpdated",{hints:i||null})}updateEachEdgeAttributes(n,i){if(typeof n!="function")throw new ye("Graph.updateEachEdgeAttributes: expecting an updater function.");if(i&&!Ly(i))throw new ye("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const a=this._edges.values();let s,l,c,f;for(;s=a.next(),s.done!==!0;)l=s.value,c=l.source,f=l.target,l.attributes=n(l.key,l.attributes,c.key,f.key,c.attributes,f.attributes,l.undirected);this.emit("eachEdgeAttributesUpdated",{hints:i||null})}forEachAdjacencyEntry(n){if(typeof n!="function")throw new ye("Graph.forEachAdjacencyEntry: expecting a callback.");Ll(!1,!1,!1,this,n)}forEachAdjacencyEntryWithOrphans(n){if(typeof n!="function")throw new ye("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Ll(!1,!1,!0,this,n)}forEachAssymetricAdjacencyEntry(n){if(typeof n!="function")throw new ye("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Ll(!1,!0,!1,this,n)}forEachAssymetricAdjacencyEntryWithOrphans(n){if(typeof n!="function")throw new ye("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Ll(!1,!0,!0,this,n)}nodes(){return Array.from(this._nodes.keys())}forEachNode(n){if(typeof n!="function")throw new ye("Graph.forEachNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)s=a.value,n(s.key,s.attributes)}findNode(n){if(typeof n!="function")throw new ye("Graph.findNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)if(s=a.value,n(s.key,s.attributes))return s.key}mapNodes(n){if(typeof n!="function")throw new ye("Graph.mapNode: expecting a callback.");const i=this._nodes.values();let a,s;const l=new Array(this.order);let c=0;for(;a=i.next(),a.done!==!0;)s=a.value,l[c++]=n(s.key,s.attributes);return l}someNode(n){if(typeof n!="function")throw new ye("Graph.someNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)if(s=a.value,n(s.key,s.attributes))return!0;return!1}everyNode(n){if(typeof n!="function")throw new ye("Graph.everyNode: expecting a callback.");const i=this._nodes.values();let a,s;for(;a=i.next(),a.done!==!0;)if(s=a.value,!n(s.key,s.attributes))return!1;return!0}filterNodes(n){if(typeof n!="function")throw new ye("Graph.filterNodes: expecting a callback.");const i=this._nodes.values();let a,s;const l=[];for(;a=i.next(),a.done!==!0;)s=a.value,n(s.key,s.attributes)&&l.push(s.key);return l}reduceNodes(n,i){if(typeof n!="function")throw new ye("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ye("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let a=i;const s=this._nodes.values();let l,c;for(;l=s.next(),l.done!==!0;)c=l.value,a=n(a,c.key,c.attributes);return a}nodeEntries(){const n=this._nodes.values();return{[Symbol.iterator](){return this},next(){const i=n.next();if(i.done)return i;const a=i.value;return{value:{node:a.key,attributes:a.attributes},done:!1}}}}export(){const n=new Array(this._nodes.size);let i=0;this._nodes.forEach((s,l)=>{n[i++]=NR(l,s)});const a=new Array(this._edges.size);return i=0,this._edges.forEach((s,l)=>{a[i++]=zR(this.type,l,s)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:n,edges:a}}import(n,i=!1){if(n instanceof Ke)return n.forEachNode((d,g)=>{i?this.mergeNode(d,g):this.addNode(d,g)}),n.forEachEdge((d,g,m,v,y,b,x)=>{i?x?this.mergeUndirectedEdgeWithKey(d,m,v,g):this.mergeDirectedEdgeWithKey(d,m,v,g):x?this.addUndirectedEdgeWithKey(d,m,v,g):this.addDirectedEdgeWithKey(d,m,v,g)}),this;if(!Nt(n))throw new ye("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(n.attributes){if(!Nt(n.attributes))throw new ye("Graph.import: invalid attributes. Expecting a plain object.");i?this.mergeAttributes(n.attributes):this.replaceAttributes(n.attributes)}let a,s,l,c,f;if(n.nodes){if(l=n.nodes,!Array.isArray(l))throw new ye("Graph.import: invalid nodes. Expecting an array.");for(a=0,s=l.length;a<s;a++){c=l[a],GR(c);const{key:d,attributes:g}=c;i?this.mergeNode(d,g):this.addNode(d,g)}}if(n.edges){let d=!1;if(this.type==="undirected"&&(d=!0),l=n.edges,!Array.isArray(l))throw new ye("Graph.import: invalid edges. Expecting an array.");for(a=0,s=l.length;a<s;a++){f=l[a],MR(f);const{source:g,target:m,attributes:v,undirected:y=d}=f;let b;"key"in f?(b=i?y?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:y?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,b.call(this,f.key,g,m,v)):(b=i?y?this.mergeUndirectedEdge:this.mergeDirectedEdge:y?this.addUndirectedEdge:this.addDirectedEdge,b.call(this,g,m,v))}}return this}nullCopy(n){const i=new Ke(wt({},this._options,n));return i.replaceAttributes(wt({},this.getAttributes())),i}emptyCopy(n){const i=this.nullCopy(n);return this._nodes.forEach((a,s)=>{const l=wt({},a.attributes);a=new i.NodeDataClass(s,l),i._nodes.set(s,a)}),i}copy(n){if(n=n||{},typeof n.type=="string"&&n.type!==this.type&&n.type!=="mixed")throw new ke(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${n.type}" because this would mean losing information about the current graph.`);if(typeof n.multi=="boolean"&&n.multi!==this.multi&&n.multi!==!0)throw new ke("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof n.allowSelfLoops=="boolean"&&n.allowSelfLoops!==this.allowSelfLoops&&n.allowSelfLoops!==!0)throw new ke("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const i=this.emptyCopy(n),a=this._edges.values();let s,l;for(;s=a.next(),s.done!==!0;)l=s.value,Lw(i,"copy",!1,l.undirected,l.key,l.source.key,l.target.key,wt({},l.attributes));return i}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const n={};this._nodes.forEach((l,c)=>{n[c]=l.attributes});const i={},a={};this._edges.forEach((l,c)=>{const f=l.undirected?"--":"->";let d="",g=l.source.key,m=l.target.key,v;l.undirected&&g>m&&(v=g,g=m,m=v);const y=`(${g})${f}(${m})`;c.startsWith("geid_")?this.multi&&(typeof a[y]>"u"?a[y]=0:a[y]++,d+=`${a[y]}. `):d+=`[${c}]: `,d+=y,i[d]=l.attributes});const s={};for(const l in this)this.hasOwnProperty(l)&&!Ny.has(l)&&typeof this[l]!="function"&&typeof l!="symbol"&&(s[l]=this[l]);return s.attributes=this._attributes,s.nodes=n,s.edges=i,wn(s,"constructor",this.constructor),s}}typeof Symbol<"u"&&(Ke.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ke.prototype.inspect);BR.forEach(r=>{["add","merge","update"].forEach(n=>{const i=r.name(n),a=n==="add"?Lw:PR;r.generateKey?Ke.prototype[i]=function(s,l,c){return a(this,i,!0,(r.type||this.type)==="undirected",null,s,l,c,n==="update")}:Ke.prototype[i]=function(s,l,c,f){return a(this,i,!1,(r.type||this.type)==="undirected",s,l,c,f,n==="update")}})});KA(Ke);lR(Ke);_R(Ke);LR(Ke);class ts extends Ke{constructor(n){const i=wt({type:"directed"},n);if("multi"in i&&i.multi!==!1)throw new ye("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(i.type!=="directed")throw new ye('DirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}class Nw extends Ke{constructor(n){const i=wt({type:"undirected"},n);if("multi"in i&&i.multi!==!1)throw new ye("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(i.type!=="undirected")throw new ye('UndirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}class zw extends Ke{constructor(n){const i=wt({multi:!0},n);if("multi"in i&&i.multi!==!0)throw new ye("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(i)}}class Gw extends Ke{constructor(n){const i=wt({type:"directed",multi:!0},n);if("multi"in i&&i.multi!==!0)throw new ye("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(i.type!=="directed")throw new ye('MultiDirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}class Mw extends Ke{constructor(n){const i=wt({type:"undirected",multi:!0},n);if("multi"in i&&i.multi!==!0)throw new ye("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(i.type!=="undirected")throw new ye('MultiUndirectedGraph.from: inconsistent "'+i.type+'" type in given options!');super(i)}}function Ha(r){r.from=function(n,i){const a=wt({},n.options,i),s=new r(a);return s.import(n),s}}Ha(Ke);Ha(ts);Ha(Nw);Ha(zw);Ha(Gw);Ha(Mw);Ke.Graph=Ke;Ke.DirectedGraph=ts;Ke.UndirectedGraph=Nw;Ke.MultiGraph=zw;Ke.MultiDirectedGraph=Gw;Ke.MultiUndirectedGraph=Mw;Ke.InvalidArgumentsGraphError=ye;Ke.NotFoundGraphError=me;Ke.UsageGraphError=ke;function $R(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var a=i.call(r,n);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function Qo(r){var n=$R(r,"string");return typeof n=="symbol"?n:n+""}function At(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function Gy(r,n){for(var i=0;i<n.length;i++){var a=n[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,Qo(a.key),a)}}function Rt(r,n,i){return n&&Gy(r.prototype,n),i&&Gy(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function La(r){return La=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},La(r)}function jw(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jw=function(){return!!r})()}function qR(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function VR(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qR(r)}function It(r,n,i){return n=La(n),VR(r,jw()?Reflect.construct(n,i||[],La(r).constructor):n.apply(r,i))}function eh(r,n){return eh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},eh(r,n)}function Yt(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&eh(r,n)}function IR(r){if(Array.isArray(r))return r}function YR(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var a,s,l,c,f=[],d=!0,g=!1;try{if(l=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;d=!1}else for(;!(d=(a=l.call(i)).done)&&(f.push(a.value),f.length!==n);d=!0);}catch(m){g=!0,s=m}finally{try{if(!d&&i.return!=null&&(c=i.return(),Object(c)!==c))return}finally{if(g)throw s}}return f}}function th(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=Array(n);i<n;i++)a[i]=r[i];return a}function Uw(r,n){if(r){if(typeof r=="string")return th(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?th(r,n):void 0}}function XR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Na(r,n){return IR(r)||YR(r,n)||Uw(r,n)||XR()}var nd={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Bw=new Int8Array(4),Il=new Int32Array(Bw.buffer,0,1),Fw=new Float32Array(Bw.buffer,0,1),ZR=/^\s*rgba?\s*\(/,WR=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function KR(r){var n=0,i=0,a=0,s=1;if(r[0]==="#")r.length===4?(n=parseInt(r.charAt(1)+r.charAt(1),16),i=parseInt(r.charAt(2)+r.charAt(2),16),a=parseInt(r.charAt(3)+r.charAt(3),16)):(n=parseInt(r.charAt(1)+r.charAt(2),16),i=parseInt(r.charAt(3)+r.charAt(4),16),a=parseInt(r.charAt(5)+r.charAt(6),16)),r.length===9&&(s=parseInt(r.charAt(7)+r.charAt(8),16)/255);else if(ZR.test(r)){var l=r.match(WR);l&&(n=+l[1],i=+l[2],a=+l[3],l[4]&&(s=+l[4]))}return{r:n,g:i,b:a,a:s}}var Da={};for(var Nl in nd)Da[Nl]=Xn(nd[Nl]),Da[nd[Nl]]=Da[Nl];function Hw(r,n,i,a,s){return Il[0]=a<<24|i<<16|n<<8|r,Il[0]=Il[0]&4278190079,Fw[0]}function Xn(r){if(r=r.toLowerCase(),typeof Da[r]<"u")return Da[r];var n=KR(r),i=n.r,a=n.g,s=n.b,l=n.a;l=l*255|0;var c=Hw(i,a,s,l);return Da[r]=c,c}function QR(r,n){Fw[0]=Xn(r);var i=Il[0],a=i&255,s=i>>8&255,l=i>>16&255,c=i>>24&255;return[a,s,l,c]}var rd={};function Pw(r){if(typeof rd[r]<"u")return rd[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,a=r&255,s=255,l=Hw(n,i,a,s);return rd[r]=l,l}function My(r,n,i,a){return i+(n<<8)+(r<<16)}function jy(r,n,i,a,s,l){var c=Math.floor(i/l*s),f=Math.floor(r.drawingBufferHeight/l-a/l*s),d=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(c,f,1,1,r.RGBA,r.UNSIGNED_BYTE,d);var g=Na(d,4),m=g[0],v=g[1],y=g[2],b=g[3];return[m,v,y,b]}function fe(r,n,i){return(n=Qo(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function Uy(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);n&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),i.push.apply(i,a)}return i}function _e(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?Uy(Object(i),!0).forEach(function(a){fe(r,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Uy(Object(i)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(i,a))})}return r}function JR(r,n){for(;!{}.hasOwnProperty.call(r,n)&&(r=La(r))!==null;);return r}function nh(){return nh=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,n,i){var a=JR(r,n);if(a){var s=Object.getOwnPropertyDescriptor(a,n);return s.get?s.get.call(arguments.length<3?r:i):s.value}},nh.apply(null,arguments)}function $w(r,n,i,a){var s=nh(La(r.prototype),n,i);return typeof s=="function"?function(l){return s.apply(i,l)}:s}function eD(r){return r.normalized?1:r.size}function id(r){var n=0;return r.forEach(function(i){return n+=eD(i)}),n}function qw(r,n,i){var a=r==="VERTEX"?n.VERTEX_SHADER:n.FRAGMENT_SHADER,s=n.createShader(a);if(s===null)throw new Error("loadShader: error while creating the shader");n.shaderSource(s,i),n.compileShader(s);var l=n.getShaderParameter(s,n.COMPILE_STATUS);if(!l){var c=n.getShaderInfoLog(s);throw n.deleteShader(s),new Error(`loadShader: error while compiling the shader:
|
|
`.concat(c,`
|
|
`).concat(i))}return s}function tD(r,n){return qw("VERTEX",r,n)}function nD(r,n){return qw("FRAGMENT",r,n)}function rD(r,n){var i=r.createProgram();if(i===null)throw new Error("loadProgram: error while creating the program.");var a,s;for(a=0,s=n.length;a<s;a++)r.attachShader(i,n[a]);r.linkProgram(i);var l=r.getProgramParameter(i,r.LINK_STATUS);if(!l)throw r.deleteProgram(i),new Error("loadProgram: error while linking the program.");return i}function By(r){var n=r.gl,i=r.buffer,a=r.program,s=r.vertexShader,l=r.fragmentShader;n.deleteShader(s),n.deleteShader(l),n.deleteProgram(a),n.deleteBuffer(i)}function Fy(r){return r%1===0?r.toFixed(1):r.toString()}var Hy=`#define PICKING_MODE
|
|
`,iD=fe(fe(fe(fe(fe(fe(fe(fe({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),Vw=function(){function r(n,i,a){At(this,r),fe(this,"array",new Float32Array),fe(this,"constantArray",new Float32Array),fe(this,"capacity",0),fe(this,"verticesCount",0);var s=this.getDefinition();if(this.VERTICES=s.VERTICES,this.VERTEX_SHADER_SOURCE=s.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=s.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=s.UNIFORMS,this.ATTRIBUTES=s.ATTRIBUTES,this.METHOD=s.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in s?s.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in s?s.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in s,this.ATTRIBUTES_ITEMS_COUNT=id(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=a,this.normalProgram=this.getProgramInfo("normal",n,s.VERTEX_SHADER_SOURCE,s.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=i?this.getProgramInfo("pick",n,Hy+s.VERTEX_SHADER_SOURCE,Hy+s.FRAGMENT_SHADER_SOURCE,i):null,this.isInstanced){var l=id(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw new Error("Program: error while getting constant data (expected ".concat(this.VERTICES," items, received ").concat(this.CONSTANT_DATA.length," instead)"));this.constantArray=new Float32Array(this.CONSTANT_DATA.length*l);for(var c=0;c<this.CONSTANT_DATA.length;c++){var f=this.CONSTANT_DATA[c];if(f.length!==l)throw new Error("Program: error while getting constant data (one vector has ".concat(f.length," items instead of ").concat(l,")"));for(var d=0;d<f.length;d++)this.constantArray[c*l+d]=f[d]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return Rt(r,[{key:"kill",value:function(){By(this.normalProgram),this.pickProgram&&(By(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(i,a,s,l,c){var f=this.getDefinition(),d=a.createBuffer();if(d===null)throw new Error("Program: error while creating the WebGL buffer.");var g=tD(a,s),m=nD(a,l),v=rD(a,[g,m]),y={};f.UNIFORMS.forEach(function(E){var T=a.getUniformLocation(v,E);T&&(y[E]=T)});var b={};f.ATTRIBUTES.forEach(function(E){b[E.name]=a.getAttribLocation(v,E.name)});var x;if("CONSTANT_ATTRIBUTES"in f&&(f.CONSTANT_ATTRIBUTES.forEach(function(E){b[E.name]=a.getAttribLocation(v,E.name)}),x=a.createBuffer(),x===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:i,program:v,gl:a,frameBuffer:c,buffer:d,constantBuffer:x||{},uniformLocations:y,attributeLocations:b,isPicking:i==="pick",vertexShader:g,fragmentShader:m}}},{key:"bindProgram",value:function(i){var a=this,s=0,l=i.gl,c=i.buffer;this.isInstanced?(l.bindBuffer(l.ARRAY_BUFFER,i.constantBuffer),s=0,this.CONSTANT_ATTRIBUTES.forEach(function(f){return s+=a.bindAttribute(f,i,s,!1)}),l.bufferData(l.ARRAY_BUFFER,this.constantArray,l.STATIC_DRAW),l.bindBuffer(l.ARRAY_BUFFER,i.buffer),s=0,this.ATTRIBUTES.forEach(function(f){return s+=a.bindAttribute(f,i,s,!0)}),l.bufferData(l.ARRAY_BUFFER,this.array,l.DYNAMIC_DRAW)):(l.bindBuffer(l.ARRAY_BUFFER,c),s=0,this.ATTRIBUTES.forEach(function(f){return s+=a.bindAttribute(f,i,s)}),l.bufferData(l.ARRAY_BUFFER,this.array,l.DYNAMIC_DRAW)),l.bindBuffer(l.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(i){var a=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(s){return a.unbindAttribute(s,i,!1)}),this.ATTRIBUTES.forEach(function(s){return a.unbindAttribute(s,i,!0)})):this.ATTRIBUTES.forEach(function(s){return a.unbindAttribute(s,i)})}},{key:"bindAttribute",value:function(i,a,s,l){var c=iD[i.type];if(typeof c!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(i.type,'"'));var f=a.attributeLocations[i.name],d=a.gl;if(f!==-1){d.enableVertexAttribArray(f);var g=this.isInstanced?(l?this.ATTRIBUTES_ITEMS_COUNT:id(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(d.vertexAttribPointer(f,i.size,i.type,i.normalized||!1,g,s),this.isInstanced&&l)if(d instanceof WebGL2RenderingContext)d.vertexAttribDivisor(f,1);else{var m=d.getExtension("ANGLE_instanced_arrays");m&&m.vertexAttribDivisorANGLE(f,1)}}return i.size*c}},{key:"unbindAttribute",value:function(i,a,s){var l=a.attributeLocations[i.name],c=a.gl;if(l!==-1&&(c.disableVertexAttribArray(l),this.isInstanced&&s))if(c instanceof WebGL2RenderingContext)c.vertexAttribDivisor(l,0);else{var f=c.getExtension("ANGLE_instanced_arrays");f&&f.vertexAttribDivisorANGLE(l,0)}}},{key:"reallocate",value:function(i){i!==this.capacity&&(this.capacity=i,this.verticesCount=this.VERTICES*i,this.array=new Float32Array(this.isInstanced?this.capacity*this.ATTRIBUTES_ITEMS_COUNT:this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT))}},{key:"hasNothingToRender",value:function(){return this.verticesCount===0}},{key:"renderProgram",value:function(i,a){var s=a.gl,l=a.program;s.enable(s.BLEND),s.useProgram(l),this.setUniforms(i,a),this.drawWebGL(this.METHOD,a)}},{key:"render",value:function(i){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,i.width*i.pixelRatio/i.downSizingRatio,i.height*i.pixelRatio/i.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(_e(_e({},i),{},{pixelRatio:i.pixelRatio/i.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,i.width*i.pixelRatio,i.height*i.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(i,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:"drawWebGL",value:function(i,a){var s=a.gl,l=a.frameBuffer;if(s.bindFramebuffer(s.FRAMEBUFFER,l),!this.isInstanced)s.drawArrays(i,0,this.verticesCount);else if(s instanceof WebGL2RenderingContext)s.drawArraysInstanced(i,0,this.VERTICES,this.capacity);else{var c=s.getExtension("ANGLE_instanced_arrays");c&&c.drawArraysInstancedANGLE(i,0,this.VERTICES,this.capacity)}}}])}(),$h=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"kill",value:function(){$w(n,"kill",this)([])}},{key:"process",value:function(a,s,l){var c=s*this.STRIDE;if(l.hidden){for(var f=c+this.STRIDE;c<f;c++)this.array[c]=0;return}return this.processVisibleItem(Pw(a),c,l)}}])}(Vw),ls=function(r){function n(){var i;At(this,n);for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return i=It(this,n,[].concat(s)),fe(i,"drawLabel",void 0),i}return Yt(n,r),Rt(n,[{key:"kill",value:function(){$w(n,"kill",this)([])}},{key:"process",value:function(a,s,l,c,f){var d=s*this.STRIDE;if(f.hidden||l.hidden||c.hidden){for(var g=d+this.STRIDE;d<g;d++)this.array[d]=0;return}return this.processVisibleItem(Pw(a),d,l,c,f)}}])}(Vw);function Iw(r,n){return function(){function i(a,s,l){At(this,i),fe(this,"drawLabel",n),this.programs=r.map(function(c){return new c(a,s,l)})}return Rt(i,[{key:"reallocate",value:function(s){this.programs.forEach(function(l){return l.reallocate(s)})}},{key:"process",value:function(s,l,c,f,d){this.programs.forEach(function(g){return g.process(s,l,c,f,d)})}},{key:"render",value:function(s){this.programs.forEach(function(l){return l.render(s)})}},{key:"kill",value:function(){this.programs.forEach(function(s){return s.kill()})}}])}()}function aD(r,n,i,a,s){var l=s.edgeLabelSize,c=s.edgeLabelFont,f=s.edgeLabelWeight,d=s.edgeLabelColor.attribute?n[s.edgeLabelColor.attribute]||s.edgeLabelColor.color||"#000":s.edgeLabelColor.color,g=n.label;if(g){r.fillStyle=d,r.font="".concat(f," ").concat(l,"px ").concat(c);var m=i.size,v=a.size,y=i.x,b=i.y,x=a.x,E=a.y,T=(y+x)/2,M=(b+E)/2,N=x-y,L=E-b,C=Math.sqrt(N*N+L*L);if(!(C<m+v)){y+=N*m/C,b+=L*m/C,x-=N*v/C,E-=L*v/C,T=(y+x)/2,M=(b+E)/2,N=x-y,L=E-b,C=Math.sqrt(N*N+L*L);var R=r.measureText(g).width;if(R>C){var B="…";for(g=g+B,R=r.measureText(g).width;R>C&&g.length>1;)g=g.slice(0,-2)+B,R=r.measureText(g).width;if(g.length<4)return}var _;N>0?L>0?_=Math.acos(N/C):_=Math.asin(L/C):L>0?_=Math.acos(N/C)+Math.PI:_=Math.asin(N/C)+Math.PI/2,r.save(),r.translate(T,M),r.rotate(_),r.fillText(g,-R/2,n.size/2+l),r.restore()}}}function Yw(r,n,i){if(n.label){var a=i.labelSize,s=i.labelFont,l=i.labelWeight,c=i.labelColor.attribute?n[i.labelColor.attribute]||i.labelColor.color||"#000":i.labelColor.color;r.fillStyle=c,r.font="".concat(l," ").concat(a,"px ").concat(s),r.fillText(n.label,n.x+n.size+3,n.y+a/3)}}function oD(r,n,i){var a=i.labelSize,s=i.labelFont,l=i.labelWeight;r.font="".concat(l," ").concat(a,"px ").concat(s),r.fillStyle="#FFF",r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=8,r.shadowColor="#000";var c=2;if(typeof n.label=="string"){var f=r.measureText(n.label).width,d=Math.round(f+5),g=Math.round(a+2*c),m=Math.max(n.size,a/2)+c,v=Math.asin(g/2/m),y=Math.sqrt(Math.abs(Math.pow(m,2)-Math.pow(g/2,2)));r.beginPath(),r.moveTo(n.x+y,n.y+g/2),r.lineTo(n.x+m+d,n.y+g/2),r.lineTo(n.x+m+d,n.y-g/2),r.lineTo(n.x+y,n.y-g/2),r.arc(n.x,n.y,m,v,-v),r.closePath(),r.fill()}else r.beginPath(),r.arc(n.x,n.y,n.size+c,0,Math.PI*2),r.closePath(),r.fill();r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=0,Yw(r,n,i)}var sD=`
|
|
precision highp float;
|
|
|
|
varying vec4 v_color;
|
|
varying vec2 v_diffVector;
|
|
varying float v_radius;
|
|
|
|
uniform float u_correctionRatio;
|
|
|
|
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
void main(void) {
|
|
float border = u_correctionRatio * 2.0;
|
|
float dist = length(v_diffVector) - v_radius + border;
|
|
|
|
// No antialiasing for picking mode:
|
|
#ifdef PICKING_MODE
|
|
if (dist > border)
|
|
gl_FragColor = transparent;
|
|
else
|
|
gl_FragColor = v_color;
|
|
|
|
#else
|
|
float t = 0.0;
|
|
if (dist > border)
|
|
t = 1.0;
|
|
else if (dist > 0.0)
|
|
t = dist / border;
|
|
|
|
gl_FragColor = mix(v_color, transparent, t);
|
|
#endif
|
|
}
|
|
`,lD=sD,uD=`
|
|
attribute vec4 a_id;
|
|
attribute vec4 a_color;
|
|
attribute vec2 a_position;
|
|
attribute float a_size;
|
|
attribute float a_angle;
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_correctionRatio;
|
|
|
|
varying vec4 v_color;
|
|
varying vec2 v_diffVector;
|
|
varying float v_radius;
|
|
varying float v_border;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
|
|
void main() {
|
|
float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
|
|
vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
|
|
vec2 position = a_position + diffVector;
|
|
gl_Position = vec4(
|
|
(u_matrix * vec3(position, 1)).xy,
|
|
0,
|
|
1
|
|
);
|
|
|
|
v_diffVector = diffVector;
|
|
v_radius = size / 2.0;
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`,cD=uD,Xw=WebGLRenderingContext,Py=Xw.UNSIGNED_BYTE,ad=Xw.FLOAT,fD=["u_sizeRatio","u_correctionRatio","u_matrix"],us=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:cD,FRAGMENT_SHADER_SOURCE:lD,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:fD,ATTRIBUTES:[{name:"a_position",size:2,type:ad},{name:"a_size",size:1,type:ad},{name:"a_color",size:4,type:Py,normalized:!0},{name:"a_id",size:4,type:Py,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:ad}],CONSTANT_DATA:[[n.ANGLE_1],[n.ANGLE_2],[n.ANGLE_3]]}}},{key:"processVisibleItem",value:function(a,s,l){var c=this.array,f=Xn(l.color);c[s++]=l.x,c[s++]=l.y,c[s++]=l.size,c[s++]=f,c[s++]=a}},{key:"setUniforms",value:function(a,s){var l=s.gl,c=s.uniformLocations,f=c.u_sizeRatio,d=c.u_correctionRatio,g=c.u_matrix;l.uniform1f(d,a.correctionRatio),l.uniform1f(f,a.sizeRatio),l.uniformMatrix3fv(g,!1,a.matrix)}}])}($h);fe(us,"ANGLE_1",0);fe(us,"ANGLE_2",2*Math.PI/3);fe(us,"ANGLE_3",4*Math.PI/3);var dD=`
|
|
precision mediump float;
|
|
|
|
varying vec4 v_color;
|
|
|
|
void main(void) {
|
|
gl_FragColor = v_color;
|
|
}
|
|
`,hD=dD,gD=`
|
|
attribute vec2 a_position;
|
|
attribute vec2 a_normal;
|
|
attribute float a_radius;
|
|
attribute vec3 a_barycentric;
|
|
|
|
#ifdef PICKING_MODE
|
|
attribute vec4 a_id;
|
|
#else
|
|
attribute vec4 a_color;
|
|
#endif
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_correctionRatio;
|
|
uniform float u_minEdgeThickness;
|
|
uniform float u_lengthToThicknessRatio;
|
|
uniform float u_widenessToThicknessRatio;
|
|
|
|
varying vec4 v_color;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
|
|
void main() {
|
|
float minThickness = u_minEdgeThickness;
|
|
|
|
float normalLength = length(a_normal);
|
|
vec2 unitNormal = a_normal / normalLength;
|
|
|
|
// These first computations are taken from edge.vert.glsl and
|
|
// edge.clamped.vert.glsl. Please read it to get better comments on what's
|
|
// happening:
|
|
float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
|
|
float webGLThickness = pixelsThickness * u_correctionRatio;
|
|
float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
|
|
float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
|
|
float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
|
|
|
|
float da = a_barycentric.x;
|
|
float db = a_barycentric.y;
|
|
float dc = a_barycentric.z;
|
|
|
|
vec2 delta = vec2(
|
|
da * (webGLNodeRadius * unitNormal.y)
|
|
+ db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
|
|
+ dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
|
|
|
|
da * (-webGLNodeRadius * unitNormal.x)
|
|
+ db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
|
|
+ dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
|
|
);
|
|
|
|
vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
|
|
|
|
gl_Position = vec4(position, 0, 1);
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`,pD=gD,Zw=WebGLRenderingContext,$y=Zw.UNSIGNED_BYTE,zl=Zw.FLOAT,mD=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],cs={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function ou(r){var n=_e(_e({},cs),r||{});return function(i){function a(){return At(this,a),It(this,a,arguments)}return Yt(a,i),Rt(a,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:pD,FRAGMENT_SHADER_SOURCE:hD,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mD,ATTRIBUTES:[{name:"a_position",size:2,type:zl},{name:"a_normal",size:2,type:zl},{name:"a_radius",size:1,type:zl},{name:"a_color",size:4,type:$y,normalized:!0},{name:"a_id",size:4,type:$y,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:zl}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(l,c,f,d,g){if(n.extremity==="source"){var m=[d,f];f=m[0],d=m[1]}var v=g.size||1,y=d.size||1,b=f.x,x=f.y,E=d.x,T=d.y,M=Xn(g.color),N=E-b,L=T-x,C=N*N+L*L,R=0,B=0;C&&(C=1/Math.sqrt(C),R=-L*C*v,B=N*C*v);var _=this.array;_[c++]=E,_[c++]=T,_[c++]=-R,_[c++]=-B,_[c++]=y,_[c++]=M,_[c++]=l}},{key:"setUniforms",value:function(l,c){var f=c.gl,d=c.uniformLocations,g=d.u_matrix,m=d.u_sizeRatio,v=d.u_correctionRatio,y=d.u_minEdgeThickness,b=d.u_lengthToThicknessRatio,x=d.u_widenessToThicknessRatio;f.uniformMatrix3fv(g,!1,l.matrix),f.uniform1f(m,l.sizeRatio),f.uniform1f(v,l.correctionRatio),f.uniform1f(y,l.minEdgeThickness),f.uniform1f(b,n.lengthToThicknessRatio),f.uniform1f(x,n.widenessToThicknessRatio)}}])}(ls)}ou();var vD=`
|
|
precision mediump float;
|
|
|
|
varying vec4 v_color;
|
|
varying vec2 v_normal;
|
|
varying float v_thickness;
|
|
varying float v_feather;
|
|
|
|
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
void main(void) {
|
|
// We only handle antialiasing for normal mode:
|
|
#ifdef PICKING_MODE
|
|
gl_FragColor = v_color;
|
|
#else
|
|
float dist = length(v_normal) * v_thickness;
|
|
|
|
float t = smoothstep(
|
|
v_thickness - v_feather,
|
|
v_thickness,
|
|
dist
|
|
);
|
|
|
|
gl_FragColor = mix(v_color, transparent, t);
|
|
#endif
|
|
}
|
|
`,qh=vD,yD=`
|
|
attribute vec4 a_id;
|
|
attribute vec4 a_color;
|
|
attribute vec2 a_normal;
|
|
attribute float a_normalCoef;
|
|
attribute vec2 a_positionStart;
|
|
attribute vec2 a_positionEnd;
|
|
attribute float a_positionCoef;
|
|
attribute float a_radius;
|
|
attribute float a_radiusCoef;
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_zoomRatio;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_pixelRatio;
|
|
uniform float u_correctionRatio;
|
|
uniform float u_minEdgeThickness;
|
|
uniform float u_lengthToThicknessRatio;
|
|
uniform float u_feather;
|
|
|
|
varying vec4 v_color;
|
|
varying vec2 v_normal;
|
|
varying float v_thickness;
|
|
varying float v_feather;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
|
|
void main() {
|
|
float minThickness = u_minEdgeThickness;
|
|
|
|
float radius = a_radius * a_radiusCoef;
|
|
vec2 normal = a_normal * a_normalCoef;
|
|
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
|
|
|
|
float normalLength = length(normal);
|
|
vec2 unitNormal = normal / normalLength;
|
|
|
|
// These first computations are taken from edge.vert.glsl. Please read it to
|
|
// get better comments on what's happening:
|
|
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
|
|
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
|
|
|
|
// Here, we move the point to leave space for the arrow head:
|
|
float direction = sign(radius);
|
|
float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
|
|
float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
|
|
|
|
vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
|
|
|
|
// Here is the proper position of the vertex
|
|
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
|
|
|
|
v_thickness = webGLThickness / u_zoomRatio;
|
|
|
|
v_normal = unitNormal;
|
|
|
|
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`,bD=yD,Ww=WebGLRenderingContext,qy=Ww.UNSIGNED_BYTE,Di=Ww.FLOAT,wD=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],ED={lengthToThicknessRatio:cs.lengthToThicknessRatio};function Kw(r){var n=_e(_e({},ED),{});return function(i){function a(){return At(this,a),It(this,a,arguments)}return Yt(a,i),Rt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:bD,FRAGMENT_SHADER_SOURCE:qh,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:wD,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Di},{name:"a_positionEnd",size:2,type:Di},{name:"a_normal",size:2,type:Di},{name:"a_color",size:4,type:qy,normalized:!0},{name:"a_id",size:4,type:qy,normalized:!0},{name:"a_radius",size:1,type:Di}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Di},{name:"a_normalCoef",size:1,type:Di},{name:"a_radiusCoef",size:1,type:Di}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(l,c,f,d,g){var m=g.size||1,v=f.x,y=f.y,b=d.x,x=d.y,E=Xn(g.color),T=b-v,M=x-y,N=d.size||1,L=T*T+M*M,C=0,R=0;L&&(L=1/Math.sqrt(L),C=-M*L*m,R=T*L*m);var B=this.array;B[c++]=v,B[c++]=y,B[c++]=b,B[c++]=x,B[c++]=C,B[c++]=R,B[c++]=E,B[c++]=l,B[c++]=N}},{key:"setUniforms",value:function(l,c){var f=c.gl,d=c.uniformLocations,g=d.u_matrix,m=d.u_zoomRatio,v=d.u_feather,y=d.u_pixelRatio,b=d.u_correctionRatio,x=d.u_sizeRatio,E=d.u_minEdgeThickness,T=d.u_lengthToThicknessRatio;f.uniformMatrix3fv(g,!1,l.matrix),f.uniform1f(m,l.zoomRatio),f.uniform1f(x,l.sizeRatio),f.uniform1f(b,l.correctionRatio),f.uniform1f(y,l.pixelRatio),f.uniform1f(v,l.antiAliasingFeather),f.uniform1f(E,l.minEdgeThickness),f.uniform1f(T,n.lengthToThicknessRatio)}}])}(ls)}Kw();function SD(r){return Iw([Kw(),ou(r)])}var xD=SD(),Qw=xD,_D=`
|
|
attribute vec4 a_id;
|
|
attribute vec4 a_color;
|
|
attribute vec2 a_normal;
|
|
attribute float a_normalCoef;
|
|
attribute vec2 a_positionStart;
|
|
attribute vec2 a_positionEnd;
|
|
attribute float a_positionCoef;
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_zoomRatio;
|
|
uniform float u_pixelRatio;
|
|
uniform float u_correctionRatio;
|
|
uniform float u_minEdgeThickness;
|
|
uniform float u_feather;
|
|
|
|
varying vec4 v_color;
|
|
varying vec2 v_normal;
|
|
varying float v_thickness;
|
|
varying float v_feather;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
|
|
void main() {
|
|
float minThickness = u_minEdgeThickness;
|
|
|
|
vec2 normal = a_normal * a_normalCoef;
|
|
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
|
|
|
|
float normalLength = length(normal);
|
|
vec2 unitNormal = normal / normalLength;
|
|
|
|
// We require edges to be at least "minThickness" pixels thick *on screen*
|
|
// (so we need to compensate the size ratio):
|
|
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
|
|
|
|
// Then, we need to retrieve the normalized thickness of the edge in the WebGL
|
|
// referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
|
|
// ratio:
|
|
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
|
|
|
|
// Here is the proper position of the vertex
|
|
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
|
|
|
|
// For the fragment shader though, we need a thickness that takes the "magic"
|
|
// correction ratio into account (as in webGLThickness), but so that the
|
|
// antialiasing effect does not depend on the zoom level. So here's yet
|
|
// another thickness version:
|
|
v_thickness = webGLThickness / u_zoomRatio;
|
|
|
|
v_normal = unitNormal;
|
|
|
|
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`,TD=_D,Jw=WebGLRenderingContext,Vy=Jw.UNSIGNED_BYTE,Vo=Jw.FLOAT,CD=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],AD=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:TD,FRAGMENT_SHADER_SOURCE:qh,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:CD,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Vo},{name:"a_positionEnd",size:2,type:Vo},{name:"a_normal",size:2,type:Vo},{name:"a_color",size:4,type:Vy,normalized:!0},{name:"a_id",size:4,type:Vy,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Vo},{name:"a_normalCoef",size:1,type:Vo}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(a,s,l,c,f){var d=f.size||1,g=l.x,m=l.y,v=c.x,y=c.y,b=Xn(f.color),x=v-g,E=y-m,T=x*x+E*E,M=0,N=0;T&&(T=1/Math.sqrt(T),M=-E*T*d,N=x*T*d);var L=this.array;L[s++]=g,L[s++]=m,L[s++]=v,L[s++]=y,L[s++]=M,L[s++]=N,L[s++]=b,L[s++]=a}},{key:"setUniforms",value:function(a,s){var l=s.gl,c=s.uniformLocations,f=c.u_matrix,d=c.u_zoomRatio,g=c.u_feather,m=c.u_pixelRatio,v=c.u_correctionRatio,y=c.u_sizeRatio,b=c.u_minEdgeThickness;l.uniformMatrix3fv(f,!1,a.matrix),l.uniform1f(d,a.zoomRatio),l.uniform1f(y,a.sizeRatio),l.uniform1f(v,a.correctionRatio),l.uniform1f(m,a.pixelRatio),l.uniform1f(g,a.antiAliasingFeather),l.uniform1f(b,a.minEdgeThickness)}}])}(ls),Vh=function(r){function n(){var i;return At(this,n),i=It(this,n),i.rawEmitter=i,i}return Yt(n,r),Rt(n)}(xw.EventEmitter),od,Iy;function Zn(){return Iy||(Iy=1,od=function(n){return n!==null&&typeof n=="object"&&typeof n.addUndirectedEdgeWithKey=="function"&&typeof n.dropNode=="function"&&typeof n.multi=="boolean"}),od}var RD=Zn();const DD=on(RD);var OD=function(n){return n},kD=function(n){return n*n},LD=function(n){return n*(2-n)},ND=function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},zD=function(n){return n*n*n},GD=function(n){return--n*n*n+1},MD=function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)},eE={linear:OD,quadraticIn:kD,quadraticOut:LD,quadraticInOut:ND,cubicIn:zD,cubicOut:GD,cubicInOut:MD},tE={easing:"quadraticInOut",duration:150};function jD(r,n,i,a){var s=Object.assign({},tE,i),l=typeof s.easing=="function"?s.easing:eE[s.easing],c=Date.now(),f={};for(var d in n){var g=n[d];f[d]={};for(var m in g)f[d][m]=r.getNodeAttribute(d,m)}var v=null,y=function(){v=null;var x=(Date.now()-c)/s.duration;if(x>=1){for(var E in n){var T=n[E];for(var M in T)r.setNodeAttribute(E,M,T[M])}return}x=l(x);for(var N in n){var L=n[N],C=f[N];for(var R in L)r.setNodeAttribute(N,R,L[R]*x+C[R]*(1-x))}v=requestAnimationFrame(y)};return y(),function(){v&&cancelAnimationFrame(v)}}function Dn(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Gl(r,n,i){return r[0]=n,r[4]=typeof i=="number"?i:n,r}function Yy(r,n){var i=Math.sin(n),a=Math.cos(n);return r[0]=a,r[1]=i,r[3]=-i,r[4]=a,r}function Xy(r,n,i){return r[6]=n,r[7]=i,r}function Vr(r,n){var i=r[0],a=r[1],s=r[2],l=r[3],c=r[4],f=r[5],d=r[6],g=r[7],m=r[8],v=n[0],y=n[1],b=n[2],x=n[3],E=n[4],T=n[5],M=n[6],N=n[7],L=n[8];return r[0]=v*i+y*l+b*d,r[1]=v*a+y*c+b*g,r[2]=v*s+y*f+b*m,r[3]=x*i+E*l+T*d,r[4]=x*a+E*c+T*g,r[5]=x*s+E*f+T*m,r[6]=M*i+N*l+L*d,r[7]=M*a+N*c+L*g,r[8]=M*s+N*f+L*m,r}function rh(r,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=r[0],s=r[1],l=r[3],c=r[4],f=r[6],d=r[7],g=n.x,m=n.y;return{x:g*a+m*l+f*i,y:g*s+m*c+d*i}}function UD(r,n){var i=r.height/r.width,a=n.height/n.width;return i<1&&a>1||i>1&&a<1?1:Math.min(Math.max(a,1/a),Math.max(1/i,i))}function Io(r,n,i,a,s){var l=r.angle,c=r.ratio,f=r.x,d=r.y,g=n.width,m=n.height,v=Dn(),y=Math.min(g,m)-2*a,b=UD(n,i);return s?(Vr(v,Xy(Dn(),f,d)),Vr(v,Gl(Dn(),c)),Vr(v,Yy(Dn(),l)),Vr(v,Gl(Dn(),g/y/2/b,m/y/2/b))):(Vr(v,Gl(Dn(),2*(y/g)*b,2*(y/m)*b)),Vr(v,Yy(Dn(),-l)),Vr(v,Gl(Dn(),1/c)),Vr(v,Xy(Dn(),-f,-d))),v}function BD(r,n,i){var a=rh(r,{x:Math.cos(n.angle),y:Math.sin(n.angle)},0),s=a.x,l=a.y;return 1/Math.sqrt(Math.pow(s,2)+Math.pow(l,2))/i.width}function FD(r){if(!r.order)return{x:[0,1],y:[0,1]};var n=1/0,i=-1/0,a=1/0,s=-1/0;return r.forEachNode(function(l,c){var f=c.x,d=c.y;f<n&&(n=f),f>i&&(i=f),d<a&&(a=d),d>s&&(s=d)}),{x:[n,i],y:[a,s]}}function HD(r){if(!DD(r))throw new Error("Sigma: invalid graph instance.");r.forEachNode(function(n,i){if(!Number.isFinite(i.x)||!Number.isFinite(i.y))throw new Error("Sigma: Coordinates of node ".concat(n," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function PD(r,n,i){var a=document.createElement(r);if(n)for(var s in n)a.style[s]=n[s];if(i)for(var l in i)a.setAttribute(l,i[l]);return a}function Zy(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function Wy(r,n,i){return i.sort(function(a,s){var l=n(a)||0,c=n(s)||0;return l<c?-1:l>c?1:0})}function Ky(r){var n=Na(r.x,2),i=n[0],a=n[1],s=Na(r.y,2),l=s[0],c=s[1],f=Math.max(a-i,c-l),d=(a+i)/2,g=(c+l)/2;(f===0||Math.abs(f)===1/0||isNaN(f))&&(f=1),isNaN(d)&&(d=0),isNaN(g)&&(g=0);var m=function(y){return{x:.5+(y.x-d)/f,y:.5+(y.y-g)/f}};return m.applyTo=function(v){v.x=.5+(v.x-d)/f,v.y=.5+(v.y-g)/f},m.inverse=function(v){return{x:d+f*(v.x-.5),y:g+f*(v.y-.5)}},m.ratio=f,m}function ih(r){"@babel/helpers - typeof";return ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ih(r)}function Qy(r,n){var i=n.size;if(i!==0){var a=r.length;r.length+=i;var s=0;n.forEach(function(l){r[a+s]=l,s++})}}function sd(r){r=r||{};for(var n=0,i=arguments.length<=1?0:arguments.length-1;n<i;n++){var a=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];a&&Object.assign(r,a)}return r}var Ih={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:"#999",defaultNodeType:"circle",defaultEdgeColor:"#ccc",defaultEdgeType:"line",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,defaultDrawEdgeLabel:aD,defaultDrawNodeLabel:Yw,defaultDrawNodeHover:oD,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:"screen",autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},$D={circle:us},qD={arrow:Qw,line:AD};function ld(r){if(typeof r.labelDensity!="number"||r.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var n=r.minCameraRatio,i=r.maxCameraRatio;if(typeof n=="number"&&typeof i=="number"&&i<n)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function VD(r){var n=sd({},Ih,r);return n.nodeProgramClasses=sd({},$D,n.nodeProgramClasses),n.edgeProgramClasses=sd({},qD,n.edgeProgramClasses),n}var Ml=1.5,Jy=function(r){function n(){var i;return At(this,n),i=It(this,n),fe(i,"x",.5),fe(i,"y",.5),fe(i,"angle",0),fe(i,"ratio",1),fe(i,"minRatio",null),fe(i,"maxRatio",null),fe(i,"enabledZooming",!0),fe(i,"enabledPanning",!0),fe(i,"enabledRotation",!0),fe(i,"clean",null),fe(i,"nextFrame",null),fe(i,"previousState",null),fe(i,"enabled",!0),i.previousState=i.getState(),i}return Yt(n,r),Rt(n,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"hasState",value:function(a){return this.x===a.x&&this.y===a.y&&this.ratio===a.ratio&&this.angle===a.angle}},{key:"getPreviousState",value:function(){var a=this.previousState;return a?{x:a.x,y:a.y,angle:a.angle,ratio:a.ratio}:null}},{key:"getBoundedRatio",value:function(a){var s=a;return typeof this.minRatio=="number"&&(s=Math.max(s,this.minRatio)),typeof this.maxRatio=="number"&&(s=Math.min(s,this.maxRatio)),s}},{key:"validateState",value:function(a){var s={};return this.enabledPanning&&typeof a.x=="number"&&(s.x=a.x),this.enabledPanning&&typeof a.y=="number"&&(s.y=a.y),this.enabledZooming&&typeof a.ratio=="number"&&(s.ratio=this.getBoundedRatio(a.ratio)),this.enabledRotation&&typeof a.angle=="number"&&(s.angle=a.angle),this.clean?this.clean(_e(_e({},this.getState()),s)):s}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(a){if(!this.enabled)return this;this.previousState=this.getState();var s=this.validateState(a);return typeof s.x=="number"&&(this.x=s.x),typeof s.y=="number"&&(this.y=s.y),typeof s.ratio=="number"&&(this.ratio=s.ratio),typeof s.angle=="number"&&(this.angle=s.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(a){return this.setState(a(this.getState())),this}},{key:"animate",value:function(a){var s=this,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=arguments.length>2?arguments[2]:void 0;if(!c)return new Promise(function(b){return s.animate(a,l,b)});if(this.enabled){var f=_e(_e({},tE),l),d=this.validateState(a),g=typeof f.easing=="function"?f.easing:eE[f.easing],m=Date.now(),v=this.getState(),y=function(){var x=(Date.now()-m)/f.duration;if(x>=1){s.nextFrame=null,s.setState(d),s.animationCallback&&(s.animationCallback.call(null),s.animationCallback=void 0);return}var E=g(x),T={};typeof d.x=="number"&&(T.x=v.x+(d.x-v.x)*E),typeof d.y=="number"&&(T.y=v.y+(d.y-v.y)*E),s.enabledRotation&&typeof d.angle=="number"&&(T.angle=v.angle+(d.angle-v.angle)*E),typeof d.ratio=="number"&&(T.ratio=v.ratio+(d.ratio-v.ratio)*E),s.setState(T),s.nextFrame=requestAnimationFrame(y)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(y)):y(),this.animationCallback=c}}},{key:"animatedZoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio/a}):this.animate({ratio:this.ratio/(a.factor||Ml)},a):this.animate({ratio:this.ratio/Ml})}},{key:"animatedUnzoom",value:function(a){return a?typeof a=="number"?this.animate({ratio:this.ratio*a}):this.animate({ratio:this.ratio*(a.factor||Ml)},a):this.animate({ratio:this.ratio*Ml})}},{key:"animatedReset",value:function(a){return this.animate({x:.5,y:.5,ratio:1,angle:0},a)}},{key:"copy",value:function(){return n.from(this.getState())}}],[{key:"from",value:function(a){var s=new n;return s.setState(a)}}])}(Vh);function On(r,n){var i=n.getBoundingClientRect();return{x:r.clientX-i.left,y:r.clientY-i.top}}function mr(r,n){var i=_e(_e({},On(r,n)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){i.sigmaDefaultPrevented=!0},original:r});return i}function Yo(r){var n="x"in r?r:_e(_e({},r.touches[0]||r.previousTouches[0]),{},{original:r.original,sigmaDefaultPrevented:r.sigmaDefaultPrevented,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0,n.sigmaDefaultPrevented=!0}});return n}function ID(r,n){return _e(_e({},mr(r,n)),{},{delta:nE(r)})}var YD=2;function Yl(r){for(var n=[],i=0,a=Math.min(r.length,YD);i<a;i++)n.push(r[i]);return n}function Xo(r,n,i){var a={touches:Yl(r.touches).map(function(s){return On(s,i)}),previousTouches:n.map(function(s){return On(s,i)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){a.sigmaDefaultPrevented=!0},original:r};return a}function nE(r){if(typeof r.deltaY<"u")return r.deltaY*-3/360;if(typeof r.detail<"u")return r.detail/-9;throw new Error("Captor: could not extract delta from event.")}var rE=function(r){function n(i,a){var s;return At(this,n),s=It(this,n),s.container=i,s.renderer=a,s}return Yt(n,r),Rt(n)}(Vh),XD=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],ZD=XD.reduce(function(r,n){return _e(_e({},r),{},fe({},n,Ih[n]))},{}),WD=function(r){function n(i,a){var s;return At(this,n),s=It(this,n,[i,a]),fe(s,"enabled",!0),fe(s,"draggedEvents",0),fe(s,"downStartTime",null),fe(s,"lastMouseX",null),fe(s,"lastMouseY",null),fe(s,"isMouseDown",!1),fe(s,"isMoving",!1),fe(s,"movingTimeout",null),fe(s,"startCameraState",null),fe(s,"clicks",0),fe(s,"doubleClickTimeout",null),fe(s,"currentWheelDirection",0),fe(s,"settings",ZD),s.handleClick=s.handleClick.bind(s),s.handleRightClick=s.handleRightClick.bind(s),s.handleDown=s.handleDown.bind(s),s.handleUp=s.handleUp.bind(s),s.handleMove=s.handleMove.bind(s),s.handleWheel=s.handleWheel.bind(s),s.handleLeave=s.handleLeave.bind(s),s.handleEnter=s.handleEnter.bind(s),i.addEventListener("click",s.handleClick,{capture:!1}),i.addEventListener("contextmenu",s.handleRightClick,{capture:!1}),i.addEventListener("mousedown",s.handleDown,{capture:!1}),i.addEventListener("wheel",s.handleWheel,{capture:!1}),i.addEventListener("mouseleave",s.handleLeave,{capture:!1}),i.addEventListener("mouseenter",s.handleEnter,{capture:!1}),document.addEventListener("mousemove",s.handleMove,{capture:!1}),document.addEventListener("mouseup",s.handleUp,{capture:!1}),s}return Yt(n,r),Rt(n,[{key:"kill",value:function(){var a=this.container;a.removeEventListener("click",this.handleClick),a.removeEventListener("contextmenu",this.handleRightClick),a.removeEventListener("mousedown",this.handleDown),a.removeEventListener("wheel",this.handleWheel),a.removeEventListener("mouseleave",this.handleLeave),a.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(a){var s=this;if(this.enabled){if(this.clicks++,this.clicks===2)return this.clicks=0,typeof this.doubleClickTimeout=="number"&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(a);setTimeout(function(){s.clicks=0,s.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",mr(a,this.container))}}},{key:"handleRightClick",value:function(a){this.enabled&&this.emit("rightClick",mr(a,this.container))}},{key:"handleDoubleClick",value:function(a){if(this.enabled){a.preventDefault(),a.stopPropagation();var s=mr(a,this.container);if(this.emit("doubleClick",s),!s.sigmaDefaultPrevented){var l=this.renderer.getCamera(),c=l.getBoundedRatio(l.getState().ratio/this.settings.doubleClickZoomingRatio);l.animate(this.renderer.getViewportZoomedState(On(a,this.container),c),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(a){if(this.enabled){if(a.button===0){this.startCameraState=this.renderer.getCamera().getState();var s=On(a,this.container),l=s.x,c=s.y;this.lastMouseX=l,this.lastMouseY=c,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",mr(a,this.container))}}},{key:"handleUp",value:function(a){var s=this;if(!(!this.enabled||!this.isMouseDown)){var l=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var c=On(a,this.container),f=c.x,d=c.y,g=l.getState(),m=l.getPreviousState()||{x:0,y:0};this.isMoving?l.animate({x:g.x+this.settings.inertiaRatio*(g.x-m.x),y:g.y+this.settings.inertiaRatio*(g.y-m.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==f||this.lastMouseY!==d)&&l.setState({x:g.x,y:g.y}),this.isMoving=!1,setTimeout(function(){var v=s.draggedEvents>0;s.draggedEvents=0,v&&s.renderer.getSetting("hideEdgesOnMove")&&s.renderer.refresh()},0),this.emit("mouseup",mr(a,this.container))}}},{key:"handleMove",value:function(a){var s=this;if(this.enabled){var l=mr(a,this.container);if(this.emit("mousemovebody",l),(a.target===this.container||a.composedPath()[0]===this.container)&&this.emit("mousemove",l),!l.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){s.movingTimeout=null,s.isMoving=!1},this.settings.dragTimeout);var c=this.renderer.getCamera(),f=On(a,this.container),d=f.x,g=f.y,m=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),v=this.renderer.viewportToFramedGraph({x:d,y:g}),y=m.x-v.x,b=m.y-v.y,x=c.getState(),E=x.x+y,T=x.y+b;c.setState({x:E,y:T}),this.lastMouseX=d,this.lastMouseY=g,a.preventDefault(),a.stopPropagation()}}}},{key:"handleLeave",value:function(a){this.emit("mouseleave",mr(a,this.container))}},{key:"handleEnter",value:function(a){this.emit("mouseenter",mr(a,this.container))}},{key:"handleWheel",value:function(a){var s=this,l=this.renderer.getCamera();if(!(!this.enabled||!l.enabledZooming)){var c=nE(a);if(c){var f=ID(a,this.container);if(this.emit("wheel",f),f.sigmaDefaultPrevented){a.preventDefault(),a.stopPropagation();return}var d=l.getState().ratio,g=c>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,m=l.getBoundedRatio(d*g),v=c>0?1:-1,y=Date.now();d!==m&&(a.preventDefault(),a.stopPropagation(),!(this.currentWheelDirection===v&&this.lastWheelTriggerTime&&y-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(l.animate(this.renderer.getViewportZoomedState(On(a,this.container),m),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){s.currentWheelDirection=0}),this.currentWheelDirection=v,this.lastWheelTriggerTime=y))}}}},{key:"setSettings",value:function(a){this.settings=a}}])}(rE),KD=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],QD=KD.reduce(function(r,n){return _e(_e({},r),{},fe({},n,Ih[n]))},{}),JD=function(r){function n(i,a){var s;return At(this,n),s=It(this,n,[i,a]),fe(s,"enabled",!0),fe(s,"isMoving",!1),fe(s,"hasMoved",!1),fe(s,"touchMode",0),fe(s,"startTouchesPositions",[]),fe(s,"lastTouches",[]),fe(s,"lastTap",null),fe(s,"settings",QD),s.handleStart=s.handleStart.bind(s),s.handleLeave=s.handleLeave.bind(s),s.handleMove=s.handleMove.bind(s),i.addEventListener("touchstart",s.handleStart,{capture:!1}),i.addEventListener("touchcancel",s.handleLeave,{capture:!1}),document.addEventListener("touchend",s.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",s.handleMove,{capture:!1,passive:!1}),s}return Yt(n,r),Rt(n,[{key:"kill",value:function(){var a=this.container;a.removeEventListener("touchstart",this.handleStart),a.removeEventListener("touchcancel",this.handleLeave),document.removeEventListener("touchend",this.handleLeave),document.removeEventListener("touchmove",this.handleMove)}},{key:"getDimensions",value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:"handleStart",value:function(a){var s=this;if(this.enabled){a.preventDefault();var l=Yl(a.touches);if(this.touchMode=l.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=l.map(function(b){return On(b,s.container)}),this.touchMode===2){var c=Na(this.startTouchesPositions,2),f=c[0],d=f.x,g=f.y,m=c[1],v=m.x,y=m.y;this.startTouchesAngle=Math.atan2(y-g,v-d),this.startTouchesDistance=Math.sqrt(Math.pow(v-d,2)+Math.pow(y-g,2))}this.emit("touchdown",Xo(a,this.lastTouches,this.container)),this.lastTouches=l,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(a){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(a.cancelable&&a.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(a.touches.length===1){this.handleStart(a),a.preventDefault();break}case 1:if(this.isMoving){var s=this.renderer.getCamera(),l=s.getState(),c=s.getPreviousState()||{x:0,y:0};s.animate({x:l.x+this.settings.inertiaRatio*(l.x-c.x),y:l.y+this.settings.inertiaRatio*(l.y-c.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",Xo(a,this.lastTouches,this.container)),!a.touches.length){var f=On(this.lastTouches[0],this.container),d=this.startTouchesPositions[0],g=Math.pow(f.x-d.x,2)+Math.pow(f.y-d.y,2);if(!a.touches.length&&g<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var m=Xo(a,this.lastTouches,this.container);if(this.emit("doubletap",m),this.lastTap=null,!m.sigmaDefaultPrevented){var v=this.renderer.getCamera(),y=v.getBoundedRatio(v.getState().ratio/this.settings.doubleClickZoomingRatio);v.animate(this.renderer.getViewportZoomedState(f,y),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var b=Xo(a,this.lastTouches,this.container);this.emit("tap",b),this.lastTap={time:Date.now(),position:b.touches[0]||b.previousTouches[0]}}}this.lastTouches=Yl(a.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(a){var s=this;if(!(!this.enabled||!this.startTouchesPositions.length)){a.preventDefault();var l=Yl(a.touches),c=l.map(function(P){return On(P,s.container)}),f=this.lastTouches;this.lastTouches=l,this.lastTouchesPositions=c;var d=Xo(a,f,this.container);if(this.emit("touchmove",d),!d.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=c.some(function(P,k){var V=s.startTouchesPositions[k];return V&&(P.x!==V.x||P.y!==V.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){s.isMoving=!1},this.settings.dragTimeout);var g=this.renderer.getCamera(),m=this.startCameraState,v=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var y=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),b=y.x,x=y.y,E=this.renderer.viewportToFramedGraph(c[0]),T=E.x,M=E.y;g.setState({x:m.x+b-T,y:m.y+x-M});break}case 2:{var N={x:.5,y:.5,angle:0,ratio:1},L=c[0],C=L.x,R=L.y,B=c[1],_=B.x,$=B.y,z=Math.atan2($-R,_-C)-this.startTouchesAngle,F=Math.hypot($-R,_-C)/this.startTouchesDistance,Y=g.getBoundedRatio(m.ratio/F);N.ratio=Y,N.angle=m.angle+z;var I=this.getDimensions(),j=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:m}),J=Math.min(I.width,I.height)-2*v,ae=J/I.width,H=J/I.height,U=Y/J,D=C-J/2/ae,se=R-J/2/H,G=[D*Math.cos(-N.angle)-se*Math.sin(-N.angle),se*Math.cos(-N.angle)+D*Math.sin(-N.angle)];D=G[0],se=G[1],N.x=j.x-D*U,N.y=j.y+se*U,g.setState(N);break}}}}}},{key:"setSettings",value:function(a){this.settings=a}}])}(rE);function eO(r){if(Array.isArray(r))return th(r)}function tO(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function nO(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eb(r){return eO(r)||tO(r)||Uw(r)||nO()}function rO(r,n){if(r==null)return{};var i={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(n.includes(a))continue;i[a]=r[a]}return i}function ud(r,n){if(r==null)return{};var i,a,s=rO(r,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);for(a=0;a<l.length;a++)i=l[a],n.includes(i)||{}.propertyIsEnumerable.call(r,i)&&(s[i]=r[i])}return s}var tb=function(){function r(n,i){At(this,r),this.key=n,this.size=i}return Rt(r,null,[{key:"compare",value:function(i,a){return i.size>a.size?-1:i.size<a.size||i.key>a.key?1:-1}}])}(),nb=function(){function r(){At(this,r),fe(this,"width",0),fe(this,"height",0),fe(this,"cellSize",0),fe(this,"columns",0),fe(this,"rows",0),fe(this,"cells",{})}return Rt(r,[{key:"resizeAndClear",value:function(i,a){this.width=i.width,this.height=i.height,this.cellSize=a,this.columns=Math.ceil(i.width/a),this.rows=Math.ceil(i.height/a),this.cells={}}},{key:"getIndex",value:function(i){var a=Math.floor(i.x/this.cellSize),s=Math.floor(i.y/this.cellSize);return s*this.columns+a}},{key:"add",value:function(i,a,s){var l=new tb(i,a),c=this.getIndex(s),f=this.cells[c];f||(f=[],this.cells[c]=f),f.push(l)}},{key:"organize",value:function(){for(var i in this.cells){var a=this.cells[i];a.sort(tb.compare)}}},{key:"getLabelsToDisplay",value:function(i,a){var s=this.cellSize*this.cellSize,l=s/i/i,c=l*a/s,f=Math.ceil(c),d=[];for(var g in this.cells)for(var m=this.cells[g],v=0;v<Math.min(f,m.length);v++)d.push(m[v].key);return d}}])}();function iO(r){var n=r.graph,i=r.hoveredNode,a=r.highlightedNodes,s=r.displayedNodeLabels,l=[];return n.forEachEdge(function(c,f,d,g){(d===i||g===i||a.has(d)||a.has(g)||s.has(d)&&s.has(g))&&l.push(c)}),l}var aO=150,oO=50,vr=Object.prototype.hasOwnProperty;function sO(r,n,i){if(!vr.call(i,"x")||!vr.call(i,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(n,'". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?'));return i.color||(i.color=r.defaultNodeColor),!i.label&&i.label!==""&&(i.label=null),i.label!==void 0&&i.label!==null?i.label=""+i.label:i.label=null,i.size||(i.size=2),vr.call(i,"hidden")||(i.hidden=!1),vr.call(i,"highlighted")||(i.highlighted=!1),vr.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=r.defaultNodeType),i.zIndex||(i.zIndex=0),i}function lO(r,n,i){return i.color||(i.color=r.defaultEdgeColor),i.label||(i.label=""),i.size||(i.size=.5),vr.call(i,"hidden")||(i.hidden=!1),vr.call(i,"forceLabel")||(i.forceLabel=!1),(!i.type||i.type==="")&&(i.type=r.defaultEdgeType),i.zIndex||(i.zIndex=0),i}var uO=function(r){function n(i,a){var s,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(At(this,n),s=It(this,n),fe(s,"elements",{}),fe(s,"canvasContexts",{}),fe(s,"webGLContexts",{}),fe(s,"pickingLayers",new Set),fe(s,"textures",{}),fe(s,"frameBuffers",{}),fe(s,"activeListeners",{}),fe(s,"labelGrid",new nb),fe(s,"nodeDataCache",{}),fe(s,"edgeDataCache",{}),fe(s,"nodeProgramIndex",{}),fe(s,"edgeProgramIndex",{}),fe(s,"nodesWithForcedLabels",new Set),fe(s,"edgesWithForcedLabels",new Set),fe(s,"nodeExtent",{x:[0,1],y:[0,1]}),fe(s,"nodeZExtent",[1/0,-1/0]),fe(s,"edgeZExtent",[1/0,-1/0]),fe(s,"matrix",Dn()),fe(s,"invMatrix",Dn()),fe(s,"correctionRatio",1),fe(s,"customBBox",null),fe(s,"normalizationFunction",Ky({x:[0,1],y:[0,1]})),fe(s,"graphToViewportRatio",1),fe(s,"itemIDsIndex",{}),fe(s,"nodeIndices",{}),fe(s,"edgeIndices",{}),fe(s,"width",0),fe(s,"height",0),fe(s,"pixelRatio",Zy()),fe(s,"pickingDownSizingRatio",2*s.pixelRatio),fe(s,"displayedNodeLabels",new Set),fe(s,"displayedEdgeLabels",new Set),fe(s,"highlightedNodes",new Set),fe(s,"hoveredNode",null),fe(s,"hoveredEdge",null),fe(s,"renderFrame",null),fe(s,"renderHighlightedNodesFrame",null),fe(s,"needToProcess",!1),fe(s,"checkEdgesEventsFrame",null),fe(s,"nodePrograms",{}),fe(s,"nodeHoverPrograms",{}),fe(s,"edgePrograms",{}),s.settings=VD(l),ld(s.settings),HD(i),!(a instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");s.graph=i,s.container=a,s.createWebGLContext("edges",{picking:l.enableEdgeEvents}),s.createCanvasContext("edgeLabels"),s.createWebGLContext("nodes",{picking:!0}),s.createCanvasContext("labels"),s.createCanvasContext("hovers"),s.createWebGLContext("hoverNodes"),s.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),s.resize();for(var c in s.settings.nodeProgramClasses)s.registerNodeProgram(c,s.settings.nodeProgramClasses[c],s.settings.nodeHoverProgramClasses[c]);for(var f in s.settings.edgeProgramClasses)s.registerEdgeProgram(f,s.settings.edgeProgramClasses[f]);return s.camera=new Jy,s.bindCameraHandlers(),s.mouseCaptor=new WD(s.elements.mouse,s),s.mouseCaptor.setSettings(s.settings),s.touchCaptor=new JD(s.elements.mouse,s),s.touchCaptor.setSettings(s.settings),s.bindEventHandlers(),s.bindGraphHandlers(),s.handleSettingsUpdate(),s.refresh(),s}return Yt(n,r),Rt(n,[{key:"registerNodeProgram",value:function(a,s,l){return this.nodePrograms[a]&&this.nodePrograms[a].kill(),this.nodeHoverPrograms[a]&&this.nodeHoverPrograms[a].kill(),this.nodePrograms[a]=new s(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[a]=new(l||s)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(a,s){return this.edgePrograms[a]&&this.edgePrograms[a].kill(),this.edgePrograms[a]=new s(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(a){if(this.nodePrograms[a]){var s=this.nodePrograms,l=s[a],c=ud(s,[a].map(Qo));l.kill(),this.nodePrograms=c}if(this.nodeHoverPrograms[a]){var f=this.nodeHoverPrograms,d=f[a],g=ud(f,[a].map(Qo));d.kill(),this.nodePrograms=g}return this}},{key:"unregisterEdgeProgram",value:function(a){if(this.edgePrograms[a]){var s=this.edgePrograms,l=s[a],c=ud(s,[a].map(Qo));l.kill(),this.edgePrograms=c}return this}},{key:"resetWebGLTexture",value:function(a){var s=this.webGLContexts[a],l=this.frameBuffers[a],c=this.textures[a];c&&s.deleteTexture(c);var f=s.createTexture();return s.bindFramebuffer(s.FRAMEBUFFER,l),s.bindTexture(s.TEXTURE_2D,f),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,this.width,this.height,0,s.RGBA,s.UNSIGNED_BYTE,null),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,f,0),this.textures[a]=f,this}},{key:"bindCameraHandlers",value:function(){var a=this;return this.activeListeners.camera=function(){a.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(a){var s=a.x,l=a.y,c=jy(this.webGLContexts.nodes,this.frameBuffers.nodes,s,l,this.pixelRatio,this.pickingDownSizingRatio),f=My.apply(void 0,eb(c)),d=this.itemIDsIndex[f];return d&&d.type==="node"?d.id:null}},{key:"bindEventHandlers",value:function(){var a=this;this.activeListeners.handleResize=function(){a.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(l){var c=Yo(l),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}},d=a.getNodeAtPosition(c);if(d&&a.hoveredNode!==d&&!a.nodeDataCache[d].hidden){a.hoveredNode&&a.emit("leaveNode",_e(_e({},f),{},{node:a.hoveredNode})),a.hoveredNode=d,a.emit("enterNode",_e(_e({},f),{},{node:d})),a.scheduleHighlightedNodesRender();return}if(a.hoveredNode&&a.getNodeAtPosition(c)!==a.hoveredNode){var g=a.hoveredNode;a.hoveredNode=null,a.emit("leaveNode",_e(_e({},f),{},{node:g})),a.scheduleHighlightedNodesRender();return}if(a.settings.enableEdgeEvents){var m=a.hoveredNode?null:a.getEdgeAtPoint(f.event.x,f.event.y);m!==a.hoveredEdge&&(a.hoveredEdge&&a.emit("leaveEdge",_e(_e({},f),{},{edge:a.hoveredEdge})),m&&a.emit("enterEdge",_e(_e({},f),{},{edge:m})),a.hoveredEdge=m)}},this.activeListeners.handleMoveBody=function(l){var c=Yo(l);a.emit("moveBody",{event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(l){var c=Yo(l),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.hoveredNode&&(a.emit("leaveNode",_e(_e({},f),{},{node:a.hoveredNode})),a.scheduleHighlightedNodesRender()),a.settings.enableEdgeEvents&&a.hoveredEdge&&(a.emit("leaveEdge",_e(_e({},f),{},{edge:a.hoveredEdge})),a.scheduleHighlightedNodesRender()),a.emit("leaveStage",_e({},f))},this.activeListeners.handleEnter=function(l){var c=Yo(l),f={event:c,preventSigmaDefault:function(){c.preventSigmaDefault()}};a.emit("enterStage",_e({},f))};var s=function(c){return function(f){var d=Yo(f),g={event:d,preventSigmaDefault:function(){d.preventSigmaDefault()}},m=a.getNodeAtPosition(d);if(m)return a.emit("".concat(c,"Node"),_e(_e({},g),{},{node:m}));if(a.settings.enableEdgeEvents){var v=a.getEdgeAtPoint(d.x,d.y);if(v)return a.emit("".concat(c,"Edge"),_e(_e({},g),{},{edge:v}))}return a.emit("".concat(c,"Stage"),g)}};return this.activeListeners.handleClick=s("click"),this.activeListeners.handleRightClick=s("rightClick"),this.activeListeners.handleDoubleClick=s("doubleClick"),this.activeListeners.handleWheel=s("wheel"),this.activeListeners.handleDown=s("down"),this.activeListeners.handleUp=s("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var a=this,s=this.graph,l=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(c){var f,d=(f=c.hints)===null||f===void 0?void 0:f.attributes;a.graph.forEachNode(function(m){return a.updateNode(m)});var g=!d||d.some(function(m){return l.has(m)});a.refresh({partialGraph:{nodes:s.nodes()},skipIndexation:!g,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(c){var f,d=(f=c.hints)===null||f===void 0?void 0:f.attributes;a.graph.forEachEdge(function(m){return a.updateEdge(m)});var g=d&&["zIndex","type"].some(function(m){return d==null?void 0:d.includes(m)});a.refresh({partialGraph:{edges:s.edges()},skipIndexation:!g,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(c){var f=c.key;a.addNode(f),a.refresh({partialGraph:{nodes:[f]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(c){var f=c.key;a.refresh({partialGraph:{nodes:[f]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(c){var f=c.key;a.removeNode(f),a.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(c){var f=c.key;a.addEdge(f),a.refresh({partialGraph:{edges:[f]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(c){var f=c.key;a.refresh({partialGraph:{edges:[f]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(c){var f=c.key;a.removeEdge(f),a.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){a.clearEdgeState(),a.clearEdgeIndices(),a.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){a.clearEdgeState(),a.clearNodeState(),a.clearEdgeIndices(),a.clearNodeIndices(),a.refresh({schedule:!0})},s.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),s.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),s.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),s.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),s.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),s.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),s.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),s.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),s.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),s.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var a=this.graph;a.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),a.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),a.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),a.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),a.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),a.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),a.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),a.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),a.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),a.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(a,s){var l=jy(this.webGLContexts.edges,this.frameBuffers.edges,a,s,this.pixelRatio,this.pickingDownSizingRatio),c=My.apply(void 0,eb(l)),f=this.itemIDsIndex[c];return f&&f.type==="edge"?f.id:null}},{key:"process",value:function(){var a=this;this.emit("beforeProcess");var s=this.graph,l=this.settings,c=this.getDimensions();if(this.nodeExtent=FD(this.graph),!this.settings.autoRescale){var f=c.width,d=c.height,g=this.nodeExtent,m=g.x,v=g.y;this.nodeExtent={x:[(m[0]+m[1])/2-f/2,(m[0]+m[1])/2+f/2],y:[(v[0]+v[1])/2-d/2,(v[0]+v[1])/2+d/2]}}this.normalizationFunction=Ky(this.customBBox||this.nodeExtent);var y=new Jy,b=Io(y.getState(),c,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(c,l.labelGridCellSize);for(var x={},E={},T={},M={},N=1,L=s.nodes(),C=0,R=L.length;C<R;C++){var B=L[C],_=this.nodeDataCache[B],$=s.getNodeAttributes(B);_.x=$.x,_.y=$.y,this.normalizationFunction.applyTo(_),typeof _.label=="string"&&!_.hidden&&this.labelGrid.add(B,_.size,this.framedGraphToViewport(_,{matrix:b})),x[_.type]=(x[_.type]||0)+1}this.labelGrid.organize();for(var z in this.nodePrograms){if(!vr.call(this.nodePrograms,z))throw new Error('Sigma: could not find a suitable program for node type "'.concat(z,'"!'));this.nodePrograms[z].reallocate(x[z]||0),x[z]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(L=Wy(this.nodeZExtent,function(re){return a.nodeDataCache[re].zIndex},L));for(var F=0,Y=L.length;F<Y;F++){var I=L[F];E[I]=N,M[E[I]]={type:"node",id:I},N++;var j=this.nodeDataCache[I];this.addNodeToProgram(I,E[I],x[j.type]++)}for(var J={},ae=s.edges(),H=0,U=ae.length;H<U;H++){var D=ae[H],se=this.edgeDataCache[D];J[se.type]=(J[se.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(ae=Wy(this.edgeZExtent,function(re){return a.edgeDataCache[re].zIndex},ae));for(var G in this.edgePrograms){if(!vr.call(this.edgePrograms,G))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(G,'"!'));this.edgePrograms[G].reallocate(J[G]||0),J[G]=0}for(var P=0,k=ae.length;P<k;P++){var V=ae[P];T[V]=N,M[T[V]]={type:"edge",id:V},N++;var Q=this.edgeDataCache[V];this.addEdgeToProgram(V,T[V],J[Q.type]++)}return this.itemIDsIndex=M,this.nodeIndices=E,this.edgeIndices=T,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(a){var s=this,l=this.settings;if(this.camera.minRatio=l.minCameraRatio,this.camera.maxRatio=l.maxCameraRatio,this.camera.enabledZooming=l.enableCameraZooming,this.camera.enabledPanning=l.enableCameraPanning,this.camera.enabledRotation=l.enableCameraRotation,l.cameraPanBoundaries?this.camera.clean=function(m){return s.cleanCameraState(m,l.cameraPanBoundaries&&ih(l.cameraPanBoundaries)==="object"?l.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),a){if(a.edgeProgramClasses!==l.edgeProgramClasses){for(var c in l.edgeProgramClasses)l.edgeProgramClasses[c]!==a.edgeProgramClasses[c]&&this.registerEdgeProgram(c,l.edgeProgramClasses[c]);for(var f in a.edgeProgramClasses)l.edgeProgramClasses[f]||this.unregisterEdgeProgram(f)}if(a.nodeProgramClasses!==l.nodeProgramClasses||a.nodeHoverProgramClasses!==l.nodeHoverProgramClasses){for(var d in l.nodeProgramClasses)(l.nodeProgramClasses[d]!==a.nodeProgramClasses[d]||l.nodeHoverProgramClasses[d]!==a.nodeHoverProgramClasses[d])&&this.registerNodeProgram(d,l.nodeProgramClasses[d],l.nodeHoverProgramClasses[d]);for(var g in a.nodeProgramClasses)l.nodeProgramClasses[g]||this.unregisterNodeProgram(g)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=s.tolerance,c=l===void 0?0:l,f=s.boundaries,d=_e({},a),g=f||this.nodeExtent,m=Na(g.x,2),v=m[0],y=m[1],b=Na(g.y,2),x=b[0],E=b[1],T=[this.graphToViewport({x:v,y:x},{cameraState:a}),this.graphToViewport({x:y,y:x},{cameraState:a}),this.graphToViewport({x:v,y:E},{cameraState:a}),this.graphToViewport({x:y,y:E},{cameraState:a})],M=1/0,N=-1/0,L=1/0,C=-1/0;T.forEach(function(J){var ae=J.x,H=J.y;M=Math.min(M,ae),N=Math.max(N,ae),L=Math.min(L,H),C=Math.max(C,H)});var R=N-M,B=C-L,_=this.getDimensions(),$=_.width,z=_.height,F=0,Y=0;if(R>=$?N<$-c?F=N-($-c):M>c&&(F=M-c):N>$+c?F=N-($+c):M<-c&&(F=M+c),B>=z?C<z-c?Y=C-(z-c):L>c&&(Y=L-c):C>z+c?Y=C-(z+c):L<-c&&(Y=L+c),F||Y){var I=this.viewportToFramedGraph({x:0,y:0},{cameraState:a}),j=this.viewportToFramedGraph({x:F,y:Y},{cameraState:a});F=j.x-I.x,Y=j.y-I.y,d.x+=F,d.y+=Y}return d}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var a=this.camera.getState(),s=this.labelGrid.getLabelsToDisplay(a.ratio,this.settings.labelDensity);Qy(s,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var l=this.canvasContexts.labels,c=0,f=s.length;c<f;c++){var d=s[c],g=this.nodeDataCache[d];if(!this.displayedNodeLabels.has(d)&&!g.hidden){var m=this.framedGraphToViewport(g),v=m.x,y=m.y,b=this.scaleSize(g.size);if(!(!g.forceLabel&&b<this.settings.labelRenderedSizeThreshold)&&!(v<-150||v>this.width+aO||y<-50||y>this.height+oO)){this.displayedNodeLabels.add(d);var x=this.settings.defaultDrawNodeLabel,E=this.nodePrograms[g.type],T=(E==null?void 0:E.drawLabel)||x;T(l,_e(_e({key:d},g),{},{size:b,x:v,y}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var a=this.canvasContexts.edgeLabels;a.clearRect(0,0,this.width,this.height);var s=iO({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});Qy(s,this.edgesWithForcedLabels);for(var l=new Set,c=0,f=s.length;c<f;c++){var d=s[c],g=this.graph.extremities(d),m=this.nodeDataCache[g[0]],v=this.nodeDataCache[g[1]],y=this.edgeDataCache[d];if(!l.has(d)&&!(y.hidden||m.hidden||v.hidden)){var b=this.settings.defaultDrawEdgeLabel,x=this.edgePrograms[y.type],E=(x==null?void 0:x.drawLabel)||b;E(a,_e(_e({key:d},y),{},{size:this.scaleSize(y.size)}),_e(_e(_e({key:g[0]},m),this.framedGraphToViewport(m)),{},{size:this.scaleSize(m.size)}),_e(_e(_e({key:g[1]},v),this.framedGraphToViewport(v)),{},{size:this.scaleSize(v.size)}),this.settings),l.add(d)}}return this.displayedEdgeLabels=l,this}},{key:"renderHighlightedNodes",value:function(){var a=this,s=this.canvasContexts.hovers;s.clearRect(0,0,this.width,this.height);var l=function(b){var x=a.nodeDataCache[b],E=a.framedGraphToViewport(x),T=E.x,M=E.y,N=a.scaleSize(x.size),L=a.settings.defaultDrawNodeHover,C=a.nodePrograms[x.type],R=(C==null?void 0:C.drawHover)||L;R(s,_e(_e({key:b},x),{},{size:N,x:T,y:M}),a.settings)},c=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&c.push(this.hoveredNode),this.highlightedNodes.forEach(function(y){y!==a.hoveredNode&&c.push(y)}),c.forEach(function(y){return l(y)});var f={};c.forEach(function(y){var b=a.nodeDataCache[y].type;f[b]=(f[b]||0)+1});for(var d in this.nodeHoverPrograms)this.nodeHoverPrograms[d].reallocate(f[d]||0),f[d]=0;c.forEach(function(y){var b=a.nodeDataCache[y];a.nodeHoverPrograms[b.type].process(0,f[b.type]++,b)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var g=this.getRenderParams();for(var m in this.nodeHoverPrograms){var v=this.nodeHoverPrograms[m];v.render(g)}}},{key:"scheduleHighlightedNodesRender",value:function(){var a=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){a.renderHighlightedNodesFrame=null,a.renderHighlightedNodes(),a.renderEdgeLabels()}))}},{key:"render",value:function(){var a=this;this.emit("beforeRender");var s=function(){return a.emit("afterRender"),a};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(T){return a.resetWebGLTexture(T)}),!this.graph.order)return s();var l=this.mouseCaptor,c=this.camera.isAnimated()||l.isMoving||l.draggedEvents||l.currentWheelDirection,f=this.camera.getState(),d=this.getDimensions(),g=this.getGraphDimensions(),m=this.getStagePadding();this.matrix=Io(f,d,g,m),this.invMatrix=Io(f,d,g,m,!0),this.correctionRatio=BD(this.matrix,f,d),this.graphToViewportRatio=this.getGraphToViewportRatio();var v=this.getRenderParams();for(var y in this.nodePrograms){var b=this.nodePrograms[y];b.render(v)}if(!this.settings.hideEdgesOnMove||!c)for(var x in this.edgePrograms){var E=this.edgePrograms[x];E.render(v)}return this.settings.hideLabelsOnMove&&c||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),s()}},{key:"addNode",value:function(a){var s=Object.assign({},this.graph.getNodeAttributes(a));this.settings.nodeReducer&&(s=this.settings.nodeReducer(a,s));var l=sO(this.settings,a,s);this.nodeDataCache[a]=l,this.nodesWithForcedLabels.delete(a),l.forceLabel&&!l.hidden&&this.nodesWithForcedLabels.add(a),this.highlightedNodes.delete(a),l.highlighted&&!l.hidden&&this.highlightedNodes.add(a),this.settings.zIndex&&(l.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=l.zIndex),l.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=l.zIndex))}},{key:"updateNode",value:function(a){this.addNode(a);var s=this.nodeDataCache[a];this.normalizationFunction.applyTo(s)}},{key:"removeNode",value:function(a){delete this.nodeDataCache[a],delete this.nodeProgramIndex[a],this.highlightedNodes.delete(a),this.hoveredNode===a&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(a)}},{key:"addEdge",value:function(a){var s=Object.assign({},this.graph.getEdgeAttributes(a));this.settings.edgeReducer&&(s=this.settings.edgeReducer(a,s));var l=lO(this.settings,a,s);this.edgeDataCache[a]=l,this.edgesWithForcedLabels.delete(a),l.forceLabel&&!l.hidden&&this.edgesWithForcedLabels.add(a),this.settings.zIndex&&(l.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=l.zIndex),l.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=l.zIndex))}},{key:"updateEdge",value:function(a){this.addEdge(a)}},{key:"removeEdge",value:function(a){delete this.edgeDataCache[a],delete this.edgeProgramIndex[a],this.hoveredEdge===a&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(a)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new nb,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(a,s,l){var c=this.nodeDataCache[a],f=this.nodePrograms[c.type];if(!f)throw new Error('Sigma: could not find a suitable program for node type "'.concat(c.type,'"!'));f.process(s,l,c),this.nodeProgramIndex[a]=l}},{key:"addEdgeToProgram",value:function(a,s,l){var c=this.edgeDataCache[a],f=this.edgePrograms[c.type];if(!f)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(c.type,'"!'));var d=this.graph.extremities(a),g=this.nodeDataCache[d[0]],m=this.nodeDataCache[d[1]];f.process(s,l,g,m,c),this.edgeProgramIndex[a]=l}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var a=this.settings,s=a.stagePadding,l=a.autoRescale;return l&&s||0}},{key:"createLayer",value:function(a,s){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[a])throw new Error('Sigma: a layer named "'.concat(a,'" already exists'));var c=PD(s,{position:"absolute"},{class:"sigma-".concat(a)});return l.style&&Object.assign(c.style,l.style),this.elements[a]=c,"beforeLayer"in l&&l.beforeLayer?this.elements[l.beforeLayer].before(c):"afterLayer"in l&&l.afterLayer?this.elements[l.afterLayer].after(c):this.container.appendChild(c),c}},{key:"createCanvas",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(a,"canvas",s)}},{key:"createCanvasContext",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=this.createCanvas(a,s),c={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[a]=l.getContext("2d",c),this}},{key:"createWebGLContext",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=(s==null?void 0:s.canvas)||this.createCanvas(a,s);s.hidden&&l.remove();var c=_e({preserveDrawingBuffer:!1,antialias:!1},s),f;f=l.getContext("webgl2",c),f||(f=l.getContext("webgl",c)),f||(f=l.getContext("experimental-webgl",c));var d=f;if(this.webGLContexts[a]=d,d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA),s.picking){this.pickingLayers.add(a);var g=d.createFramebuffer();if(!g)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(a));this.frameBuffers[a]=g}return d}},{key:"killLayer",value:function(a){var s=this.elements[a];if(!s)throw new Error("Sigma: cannot kill layer ".concat(a,", which does not exist"));if(this.webGLContexts[a]){var l,c=this.webGLContexts[a];(l=c.getExtension("WEBGL_lose_context"))===null||l===void 0||l.loseContext(),delete this.webGLContexts[a]}else this.canvasContexts[a]&&delete this.canvasContexts[a];return s.remove(),delete this.elements[a],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(a){this.unbindCameraHandlers(),this.camera=a,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(a){a!==this.graph&&(this.hoveredNode&&!a.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!a.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=a,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var a=this.customBBox||this.nodeExtent;return{width:a.x[1]-a.x[0]||1,height:a.y[1]-a.y[0]||1}}},{key:"getNodeDisplayData",value:function(a){var s=this.nodeDataCache[a];return s?Object.assign({},s):void 0}},{key:"getEdgeDisplayData",value:function(a){var s=this.edgeDataCache[a];return s?Object.assign({},s):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return _e({},this.settings)}},{key:"getSetting",value:function(a){return this.settings[a]}},{key:"setSetting",value:function(a,s){var l=_e({},this.settings);return this.settings[a]=s,ld(this.settings),this.handleSettingsUpdate(l),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(a,s){return this.setSetting(a,s(this.settings[a])),this}},{key:"setSettings",value:function(a){var s=_e({},this.settings);return this.settings=_e(_e({},this.settings),a),ld(this.settings),this.handleSettingsUpdate(s),this.scheduleRefresh(),this}},{key:"resize",value:function(a){var s=this.width,l=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=Zy(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!a&&s===this.width&&l===this.height)return this;for(var c in this.elements){var f=this.elements[c];f.style.width=this.width+"px",f.style.height=this.height+"px"}for(var d in this.canvasContexts)this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[d].scale(this.pixelRatio,this.pixelRatio);for(var g in this.webGLContexts){this.elements[g].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[g].setAttribute("height",this.height*this.pixelRatio+"px");var m=this.webGLContexts[g];if(m.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(g)){var v=this.textures[g];v&&m.deleteTexture(v)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(a){var s=this,l=(a==null?void 0:a.skipIndexation)!==void 0?a==null?void 0:a.skipIndexation:!1,c=(a==null?void 0:a.schedule)!==void 0?a.schedule:!1,f=!a||!a.partialGraph;if(f)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(C){return s.addNode(C)}),this.graph.forEachEdge(function(C){return s.addEdge(C)});else{for(var d,g,m=((d=a.partialGraph)===null||d===void 0?void 0:d.nodes)||[],v=0,y=(m==null?void 0:m.length)||0;v<y;v++){var b=m[v];if(this.updateNode(b),l){var x=this.nodeProgramIndex[b];if(x===void 0)throw new Error('Sigma: node "'.concat(b,`" can't be repaint`));this.addNodeToProgram(b,this.nodeIndices[b],x)}}for(var E=(a==null||(g=a.partialGraph)===null||g===void 0?void 0:g.edges)||[],T=0,M=E.length;T<M;T++){var N=E[T];if(this.updateEdge(N),l){var L=this.edgeProgramIndex[N];if(L===void 0)throw new Error('Sigma: edge "'.concat(N,`" can't be repaint`));this.addEdgeToProgram(N,this.edgeIndices[N],L)}}}return(f||!l)&&(this.needToProcess=!0),c?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var a=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame(function(){a.render()})),this}},{key:"scheduleRefresh",value:function(a){return this.refresh(_e(_e({},a),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(a,s){var l=this.camera.getState(),c=l.ratio,f=l.angle,d=l.x,g=l.y,m=this.settings,v=m.minCameraRatio,y=m.maxCameraRatio;typeof y=="number"&&(s=Math.min(s,y)),typeof v=="number"&&(s=Math.max(s,v));var b=s/c,x={x:this.width/2,y:this.height/2},E=this.viewportToFramedGraph(a),T=this.viewportToFramedGraph(x);return{angle:f,x:(E.x-T.x)*(1-b)+d,y:(E.y-T.y)*(1-b)+g,ratio:s}}},{key:"viewRectangle",value:function(){var a=this.viewportToFramedGraph({x:0,y:0}),s=this.viewportToFramedGraph({x:this.width,y:0}),l=this.viewportToFramedGraph({x:0,y:this.height});return{x1:a.x,y1:a.y,x2:s.x,y2:s.y,height:s.y-l.y}}},{key:"framedGraphToViewport",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=!!s.cameraState||!!s.viewportDimensions||!!s.graphDimensions,c=s.matrix?s.matrix:l?Io(s.cameraState||this.camera.getState(),s.viewportDimensions||this.getDimensions(),s.graphDimensions||this.getGraphDimensions(),s.padding||this.getStagePadding()):this.matrix,f=rh(c,a);return{x:(1+f.x)*this.width/2,y:(1-f.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=!!s.cameraState||!!s.viewportDimensions||!s.graphDimensions,c=s.matrix?s.matrix:l?Io(s.cameraState||this.camera.getState(),s.viewportDimensions||this.getDimensions(),s.graphDimensions||this.getGraphDimensions(),s.padding||this.getStagePadding(),!0):this.invMatrix,f=rh(c,{x:a.x/this.width*2-1,y:1-a.y/this.height*2});return isNaN(f.x)&&(f.x=0),isNaN(f.y)&&(f.y=0),f}},{key:"viewportToGraph",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(a,s))}},{key:"graphToViewport",value:function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(a),s)}},{key:"getGraphToViewportRatio",value:function(){var a={x:0,y:0},s={x:1,y:1},l=Math.sqrt(Math.pow(a.x-s.x,2)+Math.pow(a.y-s.y,2)),c=this.graphToViewport(a),f=this.graphToViewport(s),d=Math.sqrt(Math.pow(c.x-f.x,2)+Math.pow(c.y-f.y,2));return d/l}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(a){return this.customBBox=a,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var a=this.container;a.firstChild;)a.removeChild(a.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var s in this.nodePrograms)this.nodePrograms[s].kill();for(var l in this.nodeHoverPrograms)this.nodeHoverPrograms[l].kill();for(var c in this.edgePrograms)this.edgePrograms[c].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var f in this.elements)this.killLayer(f)}},{key:"scaleSize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return a/this.settings.zoomToSizeRatioFunction(s)*(this.getSetting("itemSizesReference")==="positions"?s*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var a={};for(var s in this.elements)this.elements[s]instanceof HTMLCanvasElement&&(a[s]=this.elements[s]);return a}}])}(Vh);const iE=S.createContext(null),cO=iE.Provider;function Yh(){const r=S.useContext(iE);if(r==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");return r}function Sn(){return Yh().sigma}function aE(){const{sigma:r}=Yh();return S.useCallback(n=>{r&&Object.keys(n).forEach(i=>{r.setSetting(i,n[i])})},[r])}function xu(r){return new Set(Object.keys(r))}const rb=xu({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),ib=xu({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),ab=xu({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),ob=xu({updated:!0});function oE(){const r=Sn(),n=aE(),[i,a]=S.useState({});return S.useEffect(()=>{if(!r||!i)return;const s=i,l=Object.keys(s);return l.forEach(c=>{const f=s[c];rb.has(c)&&r.on(c,f),ib.has(c)&&r.getMouseCaptor().on(c,f),ab.has(c)&&r.getTouchCaptor().on(c,f),ob.has(c)&&r.getCamera().on(c,f)}),()=>{r&&l.forEach(c=>{const f=s[c];rb.has(c)&&r.off(c,f),ib.has(c)&&r.getMouseCaptor().off(c,f),ab.has(c)&&r.getTouchCaptor().off(c,f),ob.has(c)&&r.getCamera().off(c,f)})}},[r,i,n]),a}function fO(){const r=Sn();return S.useCallback((n,i=!0)=>{r&&n&&(i&&r.getGraph().order>0&&r.getGraph().clear(),r.getGraph().import(n),r.refresh())},[r])}function fs(r,n){if(r===n)return!0;if(typeof r=="object"&&r!=null&&typeof n=="object"&&n!=null){if(Object.keys(r).length!=Object.keys(n).length)return!1;for(const i in r)if(!Object.hasOwn(n,i)||!fs(r[i],n[i]))return!1;return!0}return!1}function sE(r){const n=Sn(),[i,a]=S.useState(r||{});S.useEffect(()=>{a(g=>fs(g,r||{})?g:r||{})},[r]);const s=S.useCallback(g=>{n.getCamera().animatedZoom(Object.assign(Object.assign({},i),g))},[n,i]),l=S.useCallback(g=>{n.getCamera().animatedUnzoom(Object.assign(Object.assign({},i),g))},[n,i]),c=S.useCallback(g=>{n.getCamera().animatedReset(Object.assign(Object.assign({},i),g))},[n,i]),f=S.useCallback((g,m)=>{n.getCamera().animate(g,Object.assign(Object.assign({},i),m))},[n,i]),d=S.useCallback((g,m)=>{const v=n.getNodeDisplayData(g);v?n.getCamera().animate(v,Object.assign(Object.assign({},i),m)):console.warn(`Node ${g} not found`)},[n,i]);return{zoomIn:s,zoomOut:l,reset:c,goto:f,gotoNode:d}}function dO(r){const n=Yh(),[i,a]=S.useState(!1),[s,l]=S.useState(n.container),c=S.useCallback(()=>a(f=>!f),[]);return S.useEffect(()=>(document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)),[c]),S.useEffect(()=>{l(n.container)},[r,n.container]),{toggle:S.useCallback(()=>{var f;f=s,document.fullscreenElement!==f?f.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[s]),isFullScreen:i}}const hO=S.forwardRef(({graph:r,id:n,className:i,style:a,settings:s={},children:l},c)=>{const f=S.useRef(null),d=S.useRef(null),g={className:`react-sigma ${i||""}`,id:n,style:a},[m,v]=S.useState(null),[y,b]=S.useState(s);S.useEffect(()=>{b(T=>fs(T,s)?T:s)},[s]),S.useEffect(()=>{v(T=>{let M=null;if(d.current!==null){let N=new Ke;r&&(N=typeof r=="function"?new r:r);let L=null;T&&(L=T.getCamera().getState(),T.kill()),M=new uO(N,d.current,y),L&&M.getCamera().setState(L)}return M})},[d,r,y]),S.useImperativeHandle(c,()=>m,[m]);const x=S.useMemo(()=>m&&f.current?{sigma:m,container:f.current}:null,[m,f]),E=x!==null?bt.createElement(cO,{value:x},l):null;return bt.createElement("div",Object.assign({},g,{ref:f}),bt.createElement("div",{className:"sigma-container",ref:d}),E)});var gO=`
|
|
precision mediump float;
|
|
|
|
varying vec4 v_color;
|
|
varying float v_border;
|
|
|
|
const float radius = 0.5;
|
|
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
void main(void) {
|
|
vec2 m = gl_PointCoord - vec2(0.5, 0.5);
|
|
float dist = radius - length(m);
|
|
|
|
// No antialiasing for picking mode:
|
|
#ifdef PICKING_MODE
|
|
if (dist > v_border)
|
|
gl_FragColor = v_color;
|
|
else
|
|
gl_FragColor = transparent;
|
|
|
|
#else
|
|
float t = 0.0;
|
|
if (dist > v_border)
|
|
t = 1.0;
|
|
else if (dist > 0.0)
|
|
t = dist / v_border;
|
|
|
|
gl_FragColor = mix(transparent, v_color, t);
|
|
#endif
|
|
}
|
|
`,pO=gO,mO=`
|
|
attribute vec4 a_id;
|
|
attribute vec4 a_color;
|
|
attribute vec2 a_position;
|
|
attribute float a_size;
|
|
|
|
uniform float u_sizeRatio;
|
|
uniform float u_pixelRatio;
|
|
uniform mat3 u_matrix;
|
|
|
|
varying vec4 v_color;
|
|
varying float v_border;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
|
|
void main() {
|
|
gl_Position = vec4(
|
|
(u_matrix * vec3(a_position, 1)).xy,
|
|
0,
|
|
1
|
|
);
|
|
|
|
// Multiply the point size twice:
|
|
// - x SCALING_RATIO to correct the canvas scaling
|
|
// - x 2 to correct the formulae
|
|
gl_PointSize = a_size / u_sizeRatio * u_pixelRatio * 2.0;
|
|
|
|
v_border = (0.5 / a_size) * u_sizeRatio;
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`,vO=mO,lE=WebGLRenderingContext,sb=lE.UNSIGNED_BYTE,lb=lE.FLOAT,yO=["u_sizeRatio","u_pixelRatio","u_matrix"],bO=function(r){function n(){return At(this,n),It(this,n,arguments)}return Yt(n,r),Rt(n,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:vO,FRAGMENT_SHADER_SOURCE:pO,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:yO,ATTRIBUTES:[{name:"a_position",size:2,type:lb},{name:"a_size",size:1,type:lb},{name:"a_color",size:4,type:sb,normalized:!0},{name:"a_id",size:4,type:sb,normalized:!0}]}}},{key:"processVisibleItem",value:function(a,s,l){var c=this.array;c[s++]=l.x,c[s++]=l.y,c[s++]=l.size,c[s++]=Xn(l.color),c[s++]=a}},{key:"setUniforms",value:function(a,s){var l=a.sizeRatio,c=a.pixelRatio,f=a.matrix,d=s.gl,g=s.uniformLocations,m=g.u_sizeRatio,v=g.u_pixelRatio,y=g.u_matrix;d.uniform1f(v,c),d.uniform1f(m,l),d.uniformMatrix3fv(y,!1,f)}}])}($h),wO=`
|
|
attribute vec4 a_id;
|
|
attribute vec4 a_color;
|
|
attribute vec2 a_normal;
|
|
attribute float a_normalCoef;
|
|
attribute vec2 a_positionStart;
|
|
attribute vec2 a_positionEnd;
|
|
attribute float a_positionCoef;
|
|
attribute float a_sourceRadius;
|
|
attribute float a_targetRadius;
|
|
attribute float a_sourceRadiusCoef;
|
|
attribute float a_targetRadiusCoef;
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_zoomRatio;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_pixelRatio;
|
|
uniform float u_correctionRatio;
|
|
uniform float u_minEdgeThickness;
|
|
uniform float u_lengthToThicknessRatio;
|
|
uniform float u_feather;
|
|
|
|
varying vec4 v_color;
|
|
varying vec2 v_normal;
|
|
varying float v_thickness;
|
|
varying float v_feather;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
|
|
void main() {
|
|
float minThickness = u_minEdgeThickness;
|
|
|
|
vec2 normal = a_normal * a_normalCoef;
|
|
vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
|
|
|
|
float normalLength = length(normal);
|
|
vec2 unitNormal = normal / normalLength;
|
|
|
|
// These first computations are taken from edge.vert.glsl. Please read it to
|
|
// get better comments on what's happening:
|
|
float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
|
|
float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
|
|
|
|
// Here, we move the point to leave space for the arrow heads:
|
|
// Source arrow head
|
|
float sourceRadius = a_sourceRadius * a_sourceRadiusCoef;
|
|
float sourceDirection = sign(sourceRadius);
|
|
float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u_correctionRatio / u_sizeRatio;
|
|
float webGLSourceArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
|
|
vec2 sourceCompensationVector =
|
|
vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x)
|
|
* (webGLSourceRadius + webGLSourceArrowHeadLength);
|
|
|
|
// Target arrow head
|
|
float targetRadius = a_targetRadius * a_targetRadiusCoef;
|
|
float targetDirection = sign(targetRadius);
|
|
float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u_correctionRatio / u_sizeRatio;
|
|
float webGLTargetArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
|
|
vec2 targetCompensationVector =
|
|
vec2(-targetDirection * unitNormal.y, targetDirection * unitNormal.x)
|
|
* (webGLTargetRadius + webGLTargetArrowHeadLength);
|
|
|
|
// Here is the proper position of the vertex
|
|
gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector, 1)).xy, 0, 1);
|
|
|
|
v_thickness = webGLThickness / u_zoomRatio;
|
|
|
|
v_normal = unitNormal;
|
|
|
|
v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`,EO=wO,uE=WebGLRenderingContext,ub=uE.UNSIGNED_BYTE,gr=uE.FLOAT,SO=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],xO={lengthToThicknessRatio:cs.lengthToThicknessRatio};function cE(r){var n=_e(_e({},xO),{});return function(i){function a(){return At(this,a),It(this,a,arguments)}return Yt(a,i),Rt(a,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:EO,FRAGMENT_SHADER_SOURCE:qh,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:SO,ATTRIBUTES:[{name:"a_positionStart",size:2,type:gr},{name:"a_positionEnd",size:2,type:gr},{name:"a_normal",size:2,type:gr},{name:"a_color",size:4,type:ub,normalized:!0},{name:"a_id",size:4,type:ub,normalized:!0},{name:"a_sourceRadius",size:1,type:gr},{name:"a_targetRadius",size:1,type:gr}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:gr},{name:"a_normalCoef",size:1,type:gr},{name:"a_sourceRadiusCoef",size:1,type:gr},{name:"a_targetRadiusCoef",size:1,type:gr}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(l,c,f,d,g){var m=g.size||1,v=f.x,y=f.y,b=d.x,x=d.y,E=Xn(g.color),T=b-v,M=x-y,N=f.size||1,L=d.size||1,C=T*T+M*M,R=0,B=0;C&&(C=1/Math.sqrt(C),R=-M*C*m,B=T*C*m);var _=this.array;_[c++]=v,_[c++]=y,_[c++]=b,_[c++]=x,_[c++]=R,_[c++]=B,_[c++]=E,_[c++]=l,_[c++]=N,_[c++]=L}},{key:"setUniforms",value:function(l,c){var f=c.gl,d=c.uniformLocations,g=d.u_matrix,m=d.u_zoomRatio,v=d.u_feather,y=d.u_pixelRatio,b=d.u_correctionRatio,x=d.u_sizeRatio,E=d.u_minEdgeThickness,T=d.u_lengthToThicknessRatio;f.uniformMatrix3fv(g,!1,l.matrix),f.uniform1f(m,l.zoomRatio),f.uniform1f(x,l.sizeRatio),f.uniform1f(b,l.correctionRatio),f.uniform1f(y,l.pixelRatio),f.uniform1f(v,l.antiAliasingFeather),f.uniform1f(E,l.minEdgeThickness),f.uniform1f(T,n.lengthToThicknessRatio)}}])}(ls)}cE();function _O(r){return Iw([cE(),ou(r),ou(_e(_e({},r),{},{extremity:"source"}))])}_O();function TO(r){if(Array.isArray(r))return r}function CO(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var a,s,l,c,f=[],d=!0,g=!1;try{if(l=(i=i.call(r)).next,n!==0)for(;!(d=(a=l.call(i)).done)&&(f.push(a.value),f.length!==n);d=!0);}catch(m){g=!0,s=m}finally{try{if(!d&&i.return!=null&&(c=i.return(),Object(c)!==c))return}finally{if(g)throw s}}return f}}function ah(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=Array(n);i<n;i++)a[i]=r[i];return a}function fE(r,n){if(r){if(typeof r=="string")return ah(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ah(r,n):void 0}}function AO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RO(r,n){return TO(r)||CO(r,n)||fE(r,n)||AO()}function DO(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function OO(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var a=i.call(r,n);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function dE(r){var n=OO(r,"string");return typeof n=="symbol"?n:n+""}function kO(r,n){for(var i=0;i<n.length;i++){var a=n[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,dE(a.key),a)}}function LO(r,n,i){return n&&kO(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function su(r){return su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},su(r)}function hE(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hE=function(){return!!r})()}function oh(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function NO(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oh(r)}function zO(r,n,i){return n=su(n),NO(r,hE()?Reflect.construct(n,i||[],su(r).constructor):n.apply(r,i))}function sh(r,n){return sh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},sh(r,n)}function GO(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&sh(r,n)}function Ta(r,n,i){return(n=dE(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function MO(r){if(Array.isArray(r))return ah(r)}function jO(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function UO(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cd(r){return MO(r)||jO(r)||fE(r)||UO()}function cb(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);n&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),i.push.apply(i,a)}return i}function fb(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?cb(Object(i),!0).forEach(function(a){Ta(r,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):cb(Object(i)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(i,a))})}return r}var BO="relative",FO={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},HO="#000000";function PO(r){var n=r.borders,i=Fy(n.filter(function(s){var l=s.size;return"fill"in l}).length),a=`
|
|
precision highp float;
|
|
|
|
varying vec2 v_diffVector;
|
|
varying float v_radius;
|
|
|
|
#ifdef PICKING_MODE
|
|
varying vec4 v_color;
|
|
#else
|
|
// For normal mode, we use the border colors defined in the program:
|
|
`.concat(n.flatMap(function(s,l){var c=s.size;return"attribute"in c?["varying float v_borderSize_".concat(l+1,";")]:[]}).join(`
|
|
`),`
|
|
`).concat(n.flatMap(function(s,l){var c=s.color;return"attribute"in c?["varying vec4 v_borderColor_".concat(l+1,";")]:"value"in c?["uniform vec4 u_borderColor_".concat(l+1,";")]:[]}).join(`
|
|
`),`
|
|
#endif
|
|
|
|
uniform float u_correctionRatio;
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
void main(void) {
|
|
float dist = length(v_diffVector);
|
|
float aaBorder = 2.0 * u_correctionRatio;
|
|
float v_borderSize_0 = v_radius;
|
|
vec4 v_borderColor_0 = transparent;
|
|
|
|
// No antialiasing for picking mode:
|
|
#ifdef PICKING_MODE
|
|
if (dist > v_radius)
|
|
gl_FragColor = transparent;
|
|
else {
|
|
gl_FragColor = v_color;
|
|
gl_FragColor.a *= bias;
|
|
}
|
|
#else
|
|
// Sizes:
|
|
`).concat(n.flatMap(function(s,l){var c=s.size;if("fill"in c)return[];c=c;var f="attribute"in c?"v_borderSize_".concat(l+1):Fy(c.value),d=(c.mode||BO)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(l+1," = ").concat(d," * ").concat(f,";")]}).join(`
|
|
`),`
|
|
// Now, let's split the remaining space between "fill" borders:
|
|
float fillBorderSize = (v_radius - (`).concat(n.flatMap(function(s,l){var c=s.size;return"fill"in c?[]:["borderSize_".concat(l+1)]}).join(" + "),") ) / ").concat(i,`;
|
|
`).concat(n.flatMap(function(s,l){var c=s.size;return"fill"in c?[" float borderSize_".concat(l+1," = fillBorderSize;")]:[]}).join(`
|
|
`),`
|
|
|
|
// Finally, normalize all border sizes, to start from the full size and to end with the smallest:
|
|
float adjustedBorderSize_0 = v_radius;
|
|
`).concat(n.map(function(s,l){return" float adjustedBorderSize_".concat(l+1," = adjustedBorderSize_").concat(l," - borderSize_").concat(l+1,";")}).join(`
|
|
`),`
|
|
|
|
// Colors:
|
|
vec4 borderColor_0 = transparent;
|
|
`).concat(n.map(function(s,l){var c=s.color,f=[];return"attribute"in c?f.push(" vec4 borderColor_".concat(l+1," = v_borderColor_").concat(l+1,";")):"transparent"in c?f.push(" vec4 borderColor_".concat(l+1," = vec4(0.0, 0.0, 0.0, 0.0);")):f.push(" vec4 borderColor_".concat(l+1," = u_borderColor_").concat(l+1,";")),f.push(" borderColor_".concat(l+1,".a *= bias;")),f.push(" if (borderSize_".concat(l+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(l+1," = borderColor_").concat(l,"; }")),f.join(`
|
|
`)}).join(`
|
|
`),`
|
|
if (dist > adjustedBorderSize_0) {
|
|
gl_FragColor = borderColor_0;
|
|
} else `).concat(n.map(function(s,l){return"if (dist > adjustedBorderSize_".concat(l,` - aaBorder) {
|
|
gl_FragColor = mix(borderColor_`).concat(l+1,", borderColor_").concat(l,", (dist - adjustedBorderSize_").concat(l,` + aaBorder) / aaBorder);
|
|
} else if (dist > adjustedBorderSize_`).concat(l+1,`) {
|
|
gl_FragColor = borderColor_`).concat(l+1,`;
|
|
} else `)}).join(""),` { /* Nothing to add here */ }
|
|
#endif
|
|
}
|
|
`);return a}function $O(r){var n=r.borders,i=`
|
|
attribute vec2 a_position;
|
|
attribute float a_size;
|
|
attribute float a_angle;
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_correctionRatio;
|
|
|
|
varying vec2 v_diffVector;
|
|
varying float v_radius;
|
|
|
|
#ifdef PICKING_MODE
|
|
attribute vec4 a_id;
|
|
varying vec4 v_color;
|
|
#else
|
|
`.concat(n.flatMap(function(a,s){var l=a.size;return"attribute"in l?["attribute float a_borderSize_".concat(s+1,";"),"varying float v_borderSize_".concat(s+1,";")]:[]}).join(`
|
|
`),`
|
|
`).concat(n.flatMap(function(a,s){var l=a.color;return"attribute"in l?["attribute vec4 a_borderColor_".concat(s+1,";"),"varying vec4 v_borderColor_".concat(s+1,";")]:[]}).join(`
|
|
`),`
|
|
#endif
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
void main() {
|
|
float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
|
|
vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
|
|
vec2 position = a_position + diffVector;
|
|
gl_Position = vec4(
|
|
(u_matrix * vec3(position, 1)).xy,
|
|
0,
|
|
1
|
|
);
|
|
|
|
v_radius = size / 2.0;
|
|
v_diffVector = diffVector;
|
|
|
|
#ifdef PICKING_MODE
|
|
v_color = a_id;
|
|
#else
|
|
`).concat(n.flatMap(function(a,s){var l=a.size;return"attribute"in l?[" v_borderSize_".concat(s+1," = a_borderSize_").concat(s+1,";")]:[]}).join(`
|
|
`),`
|
|
`).concat(n.flatMap(function(a,s){var l=a.color;return"attribute"in l?[" v_borderColor_".concat(s+1," = a_borderColor_").concat(s+1,";")]:[]}).join(`
|
|
`),`
|
|
#endif
|
|
}
|
|
`);return i}var gE=WebGLRenderingContext,db=gE.UNSIGNED_BYTE,jl=gE.FLOAT;function qO(r){var n,i=fb(fb({},FO),{}),a=i.borders,s=i.drawLabel,l=i.drawHover,c=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(cd(a.flatMap(function(f,d){var g=f.color;return"value"in g?["u_borderColor_".concat(d+1)]:[]})));return n=function(f){GO(d,f);function d(){var g;DO(this,d);for(var m=arguments.length,v=new Array(m),y=0;y<m;y++)v[y]=arguments[y];return g=zO(this,d,[].concat(v)),Ta(oh(g),"drawLabel",s),Ta(oh(g),"drawHover",l),g}return LO(d,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:$O(i),FRAGMENT_SHADER_SOURCE:PO(i),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:c,ATTRIBUTES:[{name:"a_position",size:2,type:jl},{name:"a_id",size:4,type:db,normalized:!0},{name:"a_size",size:1,type:jl}].concat(cd(a.flatMap(function(m,v){var y=m.color;return"attribute"in y?[{name:"a_borderColor_".concat(v+1),size:4,type:db,normalized:!0}]:[]})),cd(a.flatMap(function(m,v){var y=m.size;return"attribute"in y?[{name:"a_borderSize_".concat(v+1),size:1,type:jl}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:jl}],CONSTANT_DATA:[[d.ANGLE_1],[d.ANGLE_2],[d.ANGLE_3]]}}},{key:"processVisibleItem",value:function(m,v,y){var b=this.array;b[v++]=y.x,b[v++]=y.y,b[v++]=m,b[v++]=y.size,a.forEach(function(x){var E=x.color;"attribute"in E&&(b[v++]=Xn(y[E.attribute]||E.defaultValue||HO))}),a.forEach(function(x){var E=x.size;"attribute"in E&&(b[v++]=y[E.attribute]||E.defaultValue)})}},{key:"setUniforms",value:function(m,v){var y=v.gl,b=v.uniformLocations,x=b.u_sizeRatio,E=b.u_correctionRatio,T=b.u_matrix;y.uniform1f(E,m.correctionRatio),y.uniform1f(x,m.sizeRatio),y.uniformMatrix3fv(T,!1,m.matrix),a.forEach(function(M,N){var L=M.color;if("value"in L){var C=b["u_borderColor_".concat(N+1)],R=QR(L.value),B=RO(R,4),_=B[0],$=B[1],z=B[2],F=B[3];y.uniform4f(C,_/255,$/255,z/255,F/255)}})}}]),d}($h),Ta(n,"ANGLE_1",0),Ta(n,"ANGLE_2",2*Math.PI/3),Ta(n,"ANGLE_3",4*Math.PI/3),n}var VO=qO();function IO(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var a=i.call(r,n);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}function pE(r){var n=IO(r,"string");return typeof n=="symbol"?n:n+""}function mE(r,n,i){return(n=pE(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function hb(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);n&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),i.push.apply(i,a)}return i}function lu(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?hb(Object(i),!0).forEach(function(a){mE(r,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):hb(Object(i)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(i,a))})}return r}function YO(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function XO(r,n){for(var i=0;i<n.length;i++){var a=n[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,pE(a.key),a)}}function ZO(r,n,i){return n&&XO(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function uu(r){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uu(r)}function vE(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vE=function(){return!!r})()}function yE(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function WO(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yE(r)}function KO(r,n,i){return n=uu(n),WO(r,vE()?Reflect.construct(n,i||[],uu(r).constructor):n.apply(r,i))}function lh(r,n){return lh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,a){return i.__proto__=a,i},lh(r,n)}function QO(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&lh(r,n)}function uh(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,a=Array(n);i<n;i++)a[i]=r[i];return a}function JO(r){if(Array.isArray(r))return uh(r)}function ek(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function tk(r,n){if(r){if(typeof r=="string")return uh(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?uh(r,n):void 0}}function nk(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fd(r){return JO(r)||ek(r)||tk(r)||nk()}function bE(r,n,i,a){var s=Math.pow(1-r,2)*n.x+2*(1-r)*r*i.x+Math.pow(r,2)*a.x,l=Math.pow(1-r,2)*n.y+2*(1-r)*r*i.y+Math.pow(r,2)*a.y;return{x:s,y:l}}function rk(r,n,i){for(var a=20,s=0,l=r,c=0;c<a;c++){var f=bE((c+1)/a,r,n,i);s+=Math.sqrt(Math.pow(l.x-f.x,2)+Math.pow(l.y-f.y,2)),l=f}return s}function ik(r){var n=r.curvatureAttribute,i=r.defaultCurvature,a=r.keepLabelUpright,s=a===void 0?!0:a;return function(l,c,f,d,g){var m=g.edgeLabelSize,v=c[n]||i,y=g.edgeLabelFont,b=g.edgeLabelWeight,x=g.edgeLabelColor.attribute?c[g.edgeLabelColor.attribute]||g.edgeLabelColor.color||"#000":g.edgeLabelColor.color,E=c.label;if(E){l.fillStyle=x,l.font="".concat(b," ").concat(m,"px ").concat(y);var T=!s||f.x<d.x,M=T?f.x:d.x,N=T?f.y:d.y,L=T?d.x:f.x,C=T?d.y:f.y,R=(M+L)/2,B=(N+C)/2,_=L-M,$=C-N,z=Math.sqrt(Math.pow(_,2)+Math.pow($,2)),F=T?1:-1,Y=R+$*v*F,I=B-_*v*F,j=c.size*.7+5,J={x:I-N,y:-(Y-M)},ae=Math.sqrt(Math.pow(J.x,2)+Math.pow(J.y,2)),H={x:C-I,y:-(L-Y)},U=Math.sqrt(Math.pow(H.x,2)+Math.pow(H.y,2));M+=j*J.x/ae,N+=j*J.y/ae,L+=j*H.x/U,C+=j*H.y/U,Y+=j*$/z,I-=j*_/z;var D={x:Y,y:I},se={x:M,y:N},G={x:L,y:C},P=rk(se,D,G);if(!(P<f.size+d.size)){var k=l.measureText(E).width,V=P-f.size-d.size;if(k>V){var Q="…";for(E=E+Q,k=l.measureText(E).width;k>V&&E.length>1;)E=E.slice(0,-2)+Q,k=l.measureText(E).width;if(E.length<4)return}for(var re={},de=0,ge=E.length;de<ge;de++){var le=E[de];re[le]||(re[le]=l.measureText(le).width*(1+v*.35))}for(var xe=.5-k/P/2,pe=0,Ae=E.length;pe<Ae;pe++){var Te=E[pe],Le=bE(xe,se,D,G),ve=2*(1-xe)*(Y-M)+2*xe*(L-Y),he=2*(1-xe)*(I-N)+2*xe*(C-I),K=Math.atan2(he,ve);l.save(),l.translate(Le.x,Le.y),l.rotate(K),l.fillText(Te,0,0),l.restore(),xe+=re[Te]/P}}}}}function ak(r){var n=r.arrowHead,i=(n==null?void 0:n.extremity)==="target"||(n==null?void 0:n.extremity)==="both",a=(n==null?void 0:n.extremity)==="source"||(n==null?void 0:n.extremity)==="both",s=`
|
|
precision highp float;
|
|
|
|
varying vec4 v_color;
|
|
varying float v_thickness;
|
|
varying float v_feather;
|
|
varying vec2 v_cpA;
|
|
varying vec2 v_cpB;
|
|
varying vec2 v_cpC;
|
|
`.concat(i?`
|
|
varying float v_targetSize;
|
|
varying vec2 v_targetPoint;`:"",`
|
|
`).concat(a?`
|
|
varying float v_sourceSize;
|
|
varying vec2 v_sourcePoint;`:"",`
|
|
`).concat(n?`
|
|
uniform float u_lengthToThicknessRatio;
|
|
uniform float u_widenessToThicknessRatio;`:"",`
|
|
|
|
float det(vec2 a, vec2 b) {
|
|
return a.x * b.y - b.x * a.y;
|
|
}
|
|
|
|
vec2 getDistanceVector(vec2 b0, vec2 b1, vec2 b2) {
|
|
float a = det(b0, b2), b = 2.0 * det(b1, b0), d = 2.0 * det(b2, b1);
|
|
float f = b * d - a * a;
|
|
vec2 d21 = b2 - b1, d10 = b1 - b0, d20 = b2 - b0;
|
|
vec2 gf = 2.0 * (b * d21 + d * d10 + a * d20);
|
|
gf = vec2(gf.y, -gf.x);
|
|
vec2 pp = -f * gf / dot(gf, gf);
|
|
vec2 d0p = b0 - pp;
|
|
float ap = det(d0p, d20), bp = 2.0 * det(d10, d0p);
|
|
float t = clamp((ap + bp) / (2.0 * a + b + d), 0.0, 1.0);
|
|
return mix(mix(b0, b1, t), mix(b1, b2, t), t);
|
|
}
|
|
|
|
float distToQuadraticBezierCurve(vec2 p, vec2 b0, vec2 b1, vec2 b2) {
|
|
return length(getDistanceVector(b0 - p, b1 - p, b2 - p));
|
|
}
|
|
|
|
const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
|
|
|
|
void main(void) {
|
|
float dist = distToQuadraticBezierCurve(gl_FragCoord.xy, v_cpA, v_cpB, v_cpC);
|
|
float thickness = v_thickness;
|
|
`).concat(i?`
|
|
float distToTarget = length(gl_FragCoord.xy - v_targetPoint);
|
|
float targetArrowLength = v_targetSize + thickness * u_lengthToThicknessRatio;
|
|
if (distToTarget < targetArrowLength) {
|
|
thickness = (distToTarget - v_targetSize) / (targetArrowLength - v_targetSize) * u_widenessToThicknessRatio * thickness;
|
|
}`:"",`
|
|
`).concat(a?`
|
|
float distToSource = length(gl_FragCoord.xy - v_sourcePoint);
|
|
float sourceArrowLength = v_sourceSize + thickness * u_lengthToThicknessRatio;
|
|
if (distToSource < sourceArrowLength) {
|
|
thickness = (distToSource - v_sourceSize) / (sourceArrowLength - v_sourceSize) * u_widenessToThicknessRatio * thickness;
|
|
}`:"",`
|
|
|
|
float halfThickness = thickness / 2.0;
|
|
if (dist < halfThickness) {
|
|
#ifdef PICKING_MODE
|
|
gl_FragColor = v_color;
|
|
#else
|
|
float t = smoothstep(
|
|
halfThickness - v_feather,
|
|
halfThickness,
|
|
dist
|
|
);
|
|
|
|
gl_FragColor = mix(v_color, transparent, t);
|
|
#endif
|
|
} else {
|
|
gl_FragColor = transparent;
|
|
}
|
|
}
|
|
`);return s}function ok(r){var n=r.arrowHead,i=(n==null?void 0:n.extremity)==="target"||(n==null?void 0:n.extremity)==="both",a=(n==null?void 0:n.extremity)==="source"||(n==null?void 0:n.extremity)==="both",s=`
|
|
attribute vec4 a_id;
|
|
attribute vec4 a_color;
|
|
attribute float a_direction;
|
|
attribute float a_thickness;
|
|
attribute vec2 a_source;
|
|
attribute vec2 a_target;
|
|
attribute float a_current;
|
|
attribute float a_curvature;
|
|
`.concat(i?`attribute float a_targetSize;
|
|
`:"",`
|
|
`).concat(a?`attribute float a_sourceSize;
|
|
`:"",`
|
|
|
|
uniform mat3 u_matrix;
|
|
uniform float u_sizeRatio;
|
|
uniform float u_pixelRatio;
|
|
uniform vec2 u_dimensions;
|
|
uniform float u_minEdgeThickness;
|
|
uniform float u_feather;
|
|
|
|
varying vec4 v_color;
|
|
varying float v_thickness;
|
|
varying float v_feather;
|
|
varying vec2 v_cpA;
|
|
varying vec2 v_cpB;
|
|
varying vec2 v_cpC;
|
|
`).concat(i?`
|
|
varying float v_targetSize;
|
|
varying vec2 v_targetPoint;`:"",`
|
|
`).concat(a?`
|
|
varying float v_sourceSize;
|
|
varying vec2 v_sourcePoint;`:"",`
|
|
`).concat(n?`
|
|
uniform float u_widenessToThicknessRatio;`:"",`
|
|
|
|
const float bias = 255.0 / 254.0;
|
|
const float epsilon = 0.7;
|
|
|
|
vec2 clipspaceToViewport(vec2 pos, vec2 dimensions) {
|
|
return vec2(
|
|
(pos.x + 1.0) * dimensions.x / 2.0,
|
|
(pos.y + 1.0) * dimensions.y / 2.0
|
|
);
|
|
}
|
|
|
|
vec2 viewportToClipspace(vec2 pos, vec2 dimensions) {
|
|
return vec2(
|
|
pos.x / dimensions.x * 2.0 - 1.0,
|
|
pos.y / dimensions.y * 2.0 - 1.0
|
|
);
|
|
}
|
|
|
|
void main() {
|
|
float minThickness = u_minEdgeThickness;
|
|
|
|
// Selecting the correct position
|
|
// Branchless "position = a_source if a_current == 1.0 else a_target"
|
|
vec2 position = a_source * max(0.0, a_current) + a_target * max(0.0, 1.0 - a_current);
|
|
position = (u_matrix * vec3(position, 1)).xy;
|
|
|
|
vec2 source = (u_matrix * vec3(a_source, 1)).xy;
|
|
vec2 target = (u_matrix * vec3(a_target, 1)).xy;
|
|
|
|
vec2 viewportPosition = clipspaceToViewport(position, u_dimensions);
|
|
vec2 viewportSource = clipspaceToViewport(source, u_dimensions);
|
|
vec2 viewportTarget = clipspaceToViewport(target, u_dimensions);
|
|
|
|
vec2 delta = viewportTarget.xy - viewportSource.xy;
|
|
float len = length(delta);
|
|
vec2 normal = vec2(-delta.y, delta.x) * a_direction;
|
|
vec2 unitNormal = normal / len;
|
|
float boundingBoxThickness = len * a_curvature;
|
|
|
|
float curveThickness = max(minThickness, a_thickness / u_sizeRatio);
|
|
v_thickness = curveThickness * u_pixelRatio;
|
|
v_feather = u_feather;
|
|
|
|
v_cpA = viewportSource;
|
|
v_cpB = 0.5 * (viewportSource + viewportTarget) + unitNormal * a_direction * boundingBoxThickness;
|
|
v_cpC = viewportTarget;
|
|
|
|
vec2 viewportOffsetPosition = (
|
|
viewportPosition +
|
|
unitNormal * (boundingBoxThickness / 2.0 + sign(boundingBoxThickness) * (`).concat(n?"curveThickness * u_widenessToThicknessRatio":"curveThickness",` + epsilon)) *
|
|
max(0.0, a_direction) // NOTE: cutting the bounding box in half to avoid overdraw
|
|
);
|
|
|
|
position = viewportToClipspace(viewportOffsetPosition, u_dimensions);
|
|
gl_Position = vec4(position, 0, 1);
|
|
|
|
`).concat(i?`
|
|
v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
|
|
v_targetPoint = viewportTarget;
|
|
`:"",`
|
|
`).concat(a?`
|
|
v_sourceSize = a_sourceSize * u_pixelRatio / u_sizeRatio;
|
|
v_sourcePoint = viewportSource;
|
|
`:"",`
|
|
|
|
#ifdef PICKING_MODE
|
|
// For picking mode, we use the ID as the color:
|
|
v_color = a_id;
|
|
#else
|
|
// For normal mode, we use the color:
|
|
v_color = a_color;
|
|
#endif
|
|
|
|
v_color.a *= bias;
|
|
}
|
|
`);return s}var wE=.25,sk={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:wE},EE=WebGLRenderingContext,gb=EE.UNSIGNED_BYTE,Ir=EE.FLOAT;function Xh(r){var n=lu(lu({},sk),r||{}),i=n,a=i.arrowHead,s=i.curvatureAttribute,l=i.drawLabel,c=(a==null?void 0:a.extremity)==="target"||(a==null?void 0:a.extremity)==="both",f=(a==null?void 0:a.extremity)==="source"||(a==null?void 0:a.extremity)==="both",d=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(fd(a?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return function(g){QO(m,g);function m(){var v;YO(this,m);for(var y=arguments.length,b=new Array(y),x=0;x<y;x++)b[x]=arguments[x];return v=KO(this,m,[].concat(b)),mE(yE(v),"drawLabel",l||ik(n)),v}return ZO(m,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:ok(n),FRAGMENT_SHADER_SOURCE:ak(n),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:d,ATTRIBUTES:[{name:"a_source",size:2,type:Ir},{name:"a_target",size:2,type:Ir}].concat(fd(c?[{name:"a_targetSize",size:1,type:Ir}]:[]),fd(f?[{name:"a_sourceSize",size:1,type:Ir}]:[]),[{name:"a_thickness",size:1,type:Ir},{name:"a_curvature",size:1,type:Ir},{name:"a_color",size:4,type:gb,normalized:!0},{name:"a_id",size:4,type:gb,normalized:!0}]),CONSTANT_ATTRIBUTES:[{name:"a_current",size:1,type:Ir},{name:"a_direction",size:1,type:Ir}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[0,-1],[1,1],[1,-1]]}}},{key:"processVisibleItem",value:function(y,b,x,E,T){var M,N=T.size||1,L=x.x,C=x.y,R=E.x,B=E.y,_=Xn(T.color),$=(M=T[s])!==null&&M!==void 0?M:wE,z=this.array;z[b++]=L,z[b++]=C,z[b++]=R,z[b++]=B,c&&(z[b++]=E.size),f&&(z[b++]=x.size),z[b++]=N,z[b++]=$,z[b++]=_,z[b++]=y}},{key:"setUniforms",value:function(y,b){var x=b.gl,E=b.uniformLocations,T=E.u_matrix,M=E.u_pixelRatio,N=E.u_feather,L=E.u_sizeRatio,C=E.u_dimensions,R=E.u_minEdgeThickness;if(x.uniformMatrix3fv(T,!1,y.matrix),x.uniform1f(M,y.pixelRatio),x.uniform1f(L,y.sizeRatio),x.uniform1f(N,y.antiAliasingFeather),x.uniform2f(C,y.width*y.pixelRatio,y.height*y.pixelRatio),x.uniform1f(R,y.minEdgeThickness),a){var B=E.u_lengthToThicknessRatio,_=E.u_widenessToThicknessRatio;x.uniform1f(B,a.lengthToThicknessRatio),x.uniform1f(_,a.widenessToThicknessRatio)}}}]),m}(ls)}var lk=Xh(),uk=Xh({arrowHead:cs});Xh({arrowHead:lu(lu({},cs),{},{extremity:"both"})});class ck{constructor(){hr(this,"nodes",[]);hr(this,"edges",[]);hr(this,"nodeIdMap",{});hr(this,"edgeIdMap",{});hr(this,"edgeDynamicIdMap",{});hr(this,"getNode",n=>{const i=this.nodeIdMap[n];if(i!==void 0)return this.nodes[i]});hr(this,"getEdge",(n,i=!0)=>{const a=i?this.edgeDynamicIdMap[n]:this.edgeIdMap[n];if(a!==void 0)return this.edges[a]});hr(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let n=0;n<this.edges.length;n++){const i=this.edges[n];this.edgeDynamicIdMap[i.dynamicId]=n}})}}const fk=yh()(r=>({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(n,i)=>r({selectedNode:n,moveToSelectedNode:i}),setFocusedNode:n=>r({focusedNode:n}),setSelectedEdge:n=>r({selectedEdge:n}),setFocusedEdge:n=>r({focusedEdge:n}),clearSelection:()=>r({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>r({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:n=>r({rawGraph:n}),setSigmaGraph:n=>r({sigmaGraph:n}),setMoveToSelectedNode:n=>r({moveToSelectedNode:n})})),Ye=Eh(fk),dk=({node:r,move:n})=>{const i=Sn(),{gotoNode:a}=sE();return S.useEffect(()=>{if(r)return i.getGraph().setNodeAttribute(r,"highlighted",!0),n&&(a(r),Ye.getState().setMoveToSelectedNode(!1)),()=>{i.getGraph().setNodeAttribute(r,"highlighted",!1)}},[r,n,i,a]),null};function Pa(r,n){const i=Sn(),a=S.useRef(n);return fs(a.current,n)||(a.current=n),{positions:S.useCallback(()=>a.current?r(i.getGraph(),a.current):{},[i,a,r]),assign:S.useCallback(()=>{a.current&&r.assign(i.getGraph(),a.current)},[i,a,r])}}function Zh(r,n){const i=Sn(),[a,s]=S.useState(!1),[l,c]=S.useState(null),f=S.useRef(n);return fs(f.current,n)||(f.current=n),S.useEffect(()=>{s(!1);let d=null;return f.current&&(d=new r(i.getGraph(),f.current)),c(d),()=>{d!==null&&d.kill()}},[i,f,c,s,r]),{stop:S.useCallback(()=>{l&&(l.stop(),s(!1))},[l,s]),start:S.useCallback(()=>{l&&(l.start(),s(!0))},[l,s]),kill:S.useCallback(()=>{l&&l.kill(),s(!1)},[l,s]),isRunning:a}}var dd,pb;function ds(){if(pb)return dd;pb=1;function r(i){return!i||typeof i!="object"||typeof i=="function"||Array.isArray(i)||i instanceof Set||i instanceof Map||i instanceof RegExp||i instanceof Date}function n(i,a){i=i||{};var s={};for(var l in a){var c=i[l],f=a[l];if(!r(f)){s[l]=n(c,f);continue}c===void 0?s[l]=f:s[l]=c}return s}return dd=n,dd}var hd,mb;function hk(){if(mb)return hd;mb=1;function r(i){return function(a,s){return a+Math.floor(i()*(s-a+1))}}var n=r(Math.random);return n.createRandom=r,hd=n,hd}var gd,vb;function gk(){if(vb)return gd;vb=1;var r=hk().createRandom;function n(a){var s=r(a);return function(l){for(var c=l.length,f=c-1,d=-1;++d<c;){var g=s(d,f),m=l[g];l[g]=l[d],l[d]=m}}}var i=n(Math.random);return i.createShuffleInPlace=n,gd=i,gd}var pd,yb;function pk(){if(yb)return pd;yb=1;var r=ds(),n=Zn(),i=gk(),a={attributes:{x:"x",y:"y"},center:0,hierarchyAttributes:[],rng:Math.random,scale:1};function s(_,$,z,F,Y){this.wrappedCircle=Y||null,this.children={},this.countChildren=0,this.id=_||null,this.next=null,this.previous=null,this.x=$||null,this.y=z||null,Y?this.r=1010101:this.r=F||999}s.prototype.hasChildren=function(){return this.countChildren>0},s.prototype.addChild=function(_,$){this.children[_]=$,++this.countChildren},s.prototype.getChild=function(_){if(!this.children.hasOwnProperty(_)){var $=new s;this.children[_]=$,++this.countChildren}return this.children[_]},s.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var _=this;for(var $ in _.children){var z=_.children[$];z.x+=_.x,z.y+=_.y,z.applyPositionToChildren()}}};function l(_,$,z){for(var F in $.children){var Y=$.children[F];Y.hasChildren()?l(_,Y,z):z[Y.id]={x:Y.x,y:Y.y}}}function c(_,$){var z=_.r-$.r,F=$.x-_.x,Y=$.y-_.y;return z<0||z*z<F*F+Y*Y}function f(_,$){var z=_.r-$.r+1e-6,F=$.x-_.x,Y=$.y-_.y;return z>0&&z*z>F*F+Y*Y}function d(_,$){for(var z=0;z<$.length;++z)if(!f(_,$[z]))return!1;return!0}function g(_){return new s(null,_.x,_.y,_.r)}function m(_,$){var z=_.x,F=_.y,Y=_.r,I=$.x,j=$.y,J=$.r,ae=I-z,H=j-F,U=J-Y,D=Math.sqrt(ae*ae+H*H);return new s(null,(z+I+ae/D*U)/2,(F+j+H/D*U)/2,(D+Y+J)/2)}function v(_,$,z){var F=_.x,Y=_.y,I=_.r,j=$.x,J=$.y,ae=$.r,H=z.x,U=z.y,D=z.r,se=F-j,G=F-H,P=Y-J,k=Y-U,V=ae-I,Q=D-I,re=F*F+Y*Y-I*I,de=re-j*j-J*J+ae*ae,ge=re-H*H-U*U+D*D,le=G*P-se*k,xe=(P*ge-k*de)/(le*2)-F,pe=(k*V-P*Q)/le,Ae=(G*de-se*ge)/(le*2)-Y,Te=(se*Q-G*V)/le,Le=pe*pe+Te*Te-1,ve=2*(I+xe*pe+Ae*Te),he=xe*xe+Ae*Ae-I*I,K=-(Le?(ve+Math.sqrt(ve*ve-4*Le*he))/(2*Le):he/ve);return new s(null,F+xe+pe*K,Y+Ae+Te*K,K)}function y(_){switch(_.length){case 1:return g(_[0]);case 2:return m(_[0],_[1]);case 3:return v(_[0],_[1],_[2]);default:throw new Error("graphology-layout/circlepack: Invalid basis length "+_.length)}}function b(_,$){var z,F;if(d($,_))return[$];for(z=0;z<_.length;++z)if(c($,_[z])&&d(m(_[z],$),_))return[_[z],$];for(z=0;z<_.length-1;++z)for(F=z+1;F<_.length;++F)if(c(m(_[z],_[F]),$)&&c(m(_[z],$),_[F])&&c(m(_[F],$),_[z])&&d(v(_[z],_[F],$),_))return[_[z],_[F],$];throw new Error("graphology-layout/circlepack: extendBasis failure !")}function x(_){var $=_.wrappedCircle,z=_.next.wrappedCircle,F=$.r+z.r,Y=($.x*z.r+z.x*$.r)/F,I=($.y*z.r+z.y*$.r)/F;return Y*Y+I*I}function E(_,$){var z=0,F=_.slice(),Y=_.length,I=[],j,J;for($(F);z<Y;)j=F[z],J&&f(J,j)?++z:(I=b(I,j),J=y(I),z=0);return J}function T(_,$,z){var F=_.x-$.x,Y,I,j=_.y-$.y,J,ae,H=F*F+j*j;H?(I=$.r+z.r,I*=I,ae=_.r+z.r,ae*=ae,I>ae?(Y=(H+ae-I)/(2*H),J=Math.sqrt(Math.max(0,ae/H-Y*Y)),z.x=_.x-Y*F-J*j,z.y=_.y-Y*j+J*F):(Y=(H+I-ae)/(2*H),J=Math.sqrt(Math.max(0,I/H-Y*Y)),z.x=$.x+Y*F-J*j,z.y=$.y+Y*j+J*F)):(z.x=$.x+z.r,z.y=$.y)}function M(_,$){var z=_.r+$.r-1e-6,F=$.x-_.x,Y=$.y-_.y;return z>0&&z*z>F*F+Y*Y}function N(_,$){var z=_.length;if(z===0)return 0;var F,Y,I,j,J,ae,H,U,D,se;if(F=_[0],F.x=0,F.y=0,z<=1)return F.r;if(Y=_[1],F.x=-Y.r,Y.x=F.r,Y.y=0,z<=2)return F.r+Y.r;I=_[2],T(Y,F,I),F=new s(null,null,null,null,F),Y=new s(null,null,null,null,Y),I=new s(null,null,null,null,I),F.next=I.previous=Y,Y.next=F.previous=I,I.next=Y.previous=F;e:for(ae=3;ae<z;++ae){I=_[ae],T(F.wrappedCircle,Y.wrappedCircle,I),I=new s(null,null,null,null,I),H=Y.next,U=F.previous,D=Y.wrappedCircle.r,se=F.wrappedCircle.r;do if(D<=se){if(M(H.wrappedCircle,I.wrappedCircle)){Y=H,F.next=Y,Y.previous=F,--ae;continue e}D+=H.wrappedCircle.r,H=H.next}else{if(M(U.wrappedCircle,I.wrappedCircle)){F=U,F.next=Y,Y.previous=F,--ae;continue e}se+=U.wrappedCircle.r,U=U.previous}while(H!==U.next);for(I.previous=F,I.next=Y,F.next=Y.previous=Y=I,j=x(F);(I=I.next)!==Y;)(J=x(I))<j&&(F=I,j=J);Y=F.next}F=[Y.wrappedCircle],I=Y;for(var G=1e4;(I=I.next)!==Y&&--G!==0;)F.push(I.wrappedCircle);for(I=E(F,$),ae=0;ae<z;++ae)F=_[ae],F.x-=I.x,F.y-=I.y;return I.r}function L(_,$){var z=0;if(_.hasChildren()){for(var F in _.children){var Y=_.children[F];Y.hasChildren()&&(Y.r=L(Y,$))}z=N(Object.values(_.children),$)}return z}function C(_,$){L(_,$);for(var z in _.children){var F=_.children[z];F.applyPositionToChildren()}}function R(_,$,z){if(!n($))throw new Error("graphology-layout/circlepack: the given graph is not a valid graphology instance.");z=r(z,a);var F={},Y={},I=$.nodes(),j=z.center,J=z.hierarchyAttributes,ae=i.createShuffleInPlace(z.rng),H=z.scale,U=new s;$.forEachNode(function(V,Q){var re=Q.size?Q.size:1,de=new s(V,null,null,re),ge=U;J.forEach(function(le){var xe=Q[le];ge=ge.getChild(xe)}),ge.addChild(V,de)}),C(U,ae),l($,U,F);var D=I.length,se,G,P;for(P=0;P<D;P++){var k=I[P];se=j+H*F[k].x,G=j+H*F[k].y,Y[k]={x:se,y:G},_&&($.setNodeAttribute(k,z.attributes.x,se),$.setNodeAttribute(k,z.attributes.y,G))}return Y}var B=R.bind(null,!1);return B.assign=R.bind(null,!0),pd=B,pd}var mk=pk();const vk=on(mk);function yk(r={}){return Pa(vk,r)}var md,bb;function bk(){if(bb)return md;bb=1;var r=ds(),n=Zn(),i={dimensions:["x","y"],center:.5,scale:1};function a(l,c,f){if(!n(c))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");f=r(f,i);var d=f.dimensions;if(!Array.isArray(d)||d.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var g=f.center,m=f.scale,v=Math.PI*2,y=(g-.5)*m,b=c.order,x=d[0],E=d[1];function T(L,C){return C[x]=m*Math.cos(L*v/b)+y,C[E]=m*Math.sin(L*v/b)+y,C}var M=0;if(!l){var N={};return c.forEachNode(function(L){N[L]=T(M++,{})}),N}c.updateEachNodeAttributes(function(L,C){return T(M++,C),C},{attributes:d})}var s=a.bind(null,!1);return s.assign=a.bind(null,!0),md=s,md}var wk=bk();const Ek=on(wk);function Sk(r={}){return Pa(Ek,r)}var Zo={},wb;function Wh(){if(wb)return Zo;wb=1;function r(a){return typeof a!="number"||isNaN(a)?1:a}function n(a,s){var l={},c=function(g){return typeof g>"u"?s:g};typeof s=="function"&&(c=s);var f=function(g){return c(g[a])},d=function(){return c(void 0)};return typeof a=="string"?(l.fromAttributes=f,l.fromGraph=function(g,m){return f(g.getNodeAttributes(m))},l.fromEntry=function(g,m){return f(m)}):typeof a=="function"?(l.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},l.fromGraph=function(g,m){return c(a(m,g.getNodeAttributes(m)))},l.fromEntry=function(g,m){return c(a(g,m))}):(l.fromAttributes=d,l.fromGraph=d,l.fromEntry=d),l}function i(a,s){var l={},c=function(g){return typeof g>"u"?s:g};typeof s=="function"&&(c=s);var f=function(g){return c(g[a])},d=function(){return c(void 0)};return typeof a=="string"?(l.fromAttributes=f,l.fromGraph=function(g,m){return f(g.getEdgeAttributes(m))},l.fromEntry=function(g,m){return f(m)},l.fromPartialEntry=l.fromEntry,l.fromMinimalEntry=l.fromEntry):typeof a=="function"?(l.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},l.fromGraph=function(g,m){var v=g.extremities(m);return c(a(m,g.getEdgeAttributes(m),v[0],v[1],g.getNodeAttributes(v[0]),g.getNodeAttributes(v[1]),g.isUndirected(m)))},l.fromEntry=function(g,m,v,y,b,x,E){return c(a(g,m,v,y,b,x,E))},l.fromPartialEntry=function(g,m,v,y){return c(a(g,m,v,y))},l.fromMinimalEntry=function(g,m){return c(a(g,m))}):(l.fromAttributes=d,l.fromGraph=d,l.fromEntry=d,l.fromMinimalEntry=d),l}return Zo.createNodeValueGetter=n,Zo.createEdgeValueGetter=i,Zo.createEdgeWeightGetter=function(a){return i(a,r)},Zo}var vd,Eb;function SE(){if(Eb)return vd;Eb=1;const{createNodeValueGetter:r,createEdgeValueGetter:n}=Wh();return vd=function(a,s,l){const{nodeXAttribute:c,nodeYAttribute:f}=l,{attraction:d,repulsion:g,gravity:m,inertia:v,maxMove:y}=l.settings;let{shouldSkipNode:b,shouldSkipEdge:x,isNodeFixed:E}=l;E=r(E),b=r(b,!1),x=n(x,!1);const T=a.filterNodes((L,C)=>!b.fromEntry(L,C)),M=T.length;for(let L=0;L<M;L++){const C=T[L],R=a.getNodeAttributes(C),B=s[C];B?s[C]={dx:B.dx*v,dy:B.dy*v,x:R[c]||0,y:R[f]||0}:s[C]={dx:0,dy:0,x:R[c]||0,y:R[f]||0}}if(g)for(let L=0;L<M;L++){const C=T[L],R=s[C];for(let B=L+1;B<M;B++){const _=T[B],$=s[_],z=$.x-R.x,F=$.y-R.y,Y=Math.sqrt(z*z+F*F)||1,I=g/Y*z,j=g/Y*F;R.dx-=I,R.dy-=j,$.dx+=I,$.dy+=j}}if(d&&a.forEachEdge((L,C,R,B,_,$,z)=>{if(R===B||b.fromEntry(R,_)||b.fromEntry(B,$)||x.fromEntry(L,C,R,B,_,$,z))return;const F=s[R],Y=s[B],I=Y.x-F.x,j=Y.y-F.y,J=Math.sqrt(I*I+j*j)||1,ae=d*J*I,H=d*J*j;F.dx+=ae,F.dy+=H,Y.dx-=ae,Y.dy-=H}),m)for(let L=0;L<M;L++){const C=T[L],R=s[C],{x:B,y:_}=R,$=Math.sqrt(B*B+_*_)||1;s[C].dx-=B*m*$,s[C].dy-=_*m*$}const N=!1;for(let L=0;L<M;L++){const C=T[L],R=s[C],B=Math.sqrt(R.dx*R.dx+R.dy*R.dy);B>y&&(R.dx*=y/B,R.dy*=y/B),E.fromGraph(a,C)?R.fixed=!0:(R.x+=R.dx,R.y+=R.dy,R.fixed=!1)}return{converged:N}},vd}var Ul={},Sb;function xE(){return Sb||(Sb=1,Ul.assignLayoutChanges=function(r,n,i){const{nodeXAttribute:a,nodeYAttribute:s}=i;r.updateEachNodeAttributes((l,c)=>{const f=n[l];return!f||f.fixed||(c[a]=f.x,c[s]=f.y),c},{attributes:["x","y"]})},Ul.collectLayoutChanges=function(r){const n={};for(const i in r){const a=r[i];n[i]={x:a.x,y:a.y}}return n}),Ul}var yd,xb;function _E(){return xb||(xb=1,yd={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),yd}var bd,_b;function xk(){if(_b)return bd;_b=1;const r=Zn(),n=ds(),i=SE(),a=xE(),s=_E();function l(f,d,g){if(!r(d))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof g=="number"?g={maxIterations:g}:g=g||{};const m=g.maxIterations;if(g=n(g,s),typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const v={};let y=null,b;for(b=0;b<m&&(y=i(d,v,g),!y.converged);b++);if(f){a.assignLayoutChanges(d,v,g);return}return a.collectLayoutChanges(v)}const c=l.bind(null,!1);return c.assign=l.bind(null,!0),bd=c,bd}var _k=xk();const Tk=on(_k);var wd,Tb;function Ck(){if(Tb)return wd;Tb=1;const r=Zn(),n=ds(),i=SE(),a=xE(),s=_E();function l(c,f){if(!r(c))throw new Error("graphology-layout-force/worker: the given graph is not a valid graphology instance.");f=n(f,s),this.callbacks={},f.onConverged&&(this.callbacks.onConverged=f.onConverged),this.graph=c,this.params=f,this.nodeStates={},this.frameID=null,this.running=!1,this.killed=!1}return l.prototype.isRunning=function(){return this.running},l.prototype.runFrame=function(){let{converged:c}=i(this.graph,this.nodeStates,this.params);a.assignLayoutChanges(this.graph,this.nodeStates,this.params),c=!1,c?(this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop()):this.frameID=window.requestAnimationFrame(()=>this.runFrame())},l.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},l.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},l.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},wd=l,wd}var Ak=Ck();const Rk=on(Ak);function Dk(r={maxIterations:100}){return Pa(Tk,r)}function Ok(r={}){return Zh(Rk,r)}var Ed,Cb;function kk(){if(Cb)return Ed;Cb=1;var r=0,n=1,i=2,a=3,s=4,l=5,c=6,f=7,d=8,g=9,m=0,v=1,y=2,b=0,x=1,E=2,T=3,M=4,N=5,L=6,C=7,R=8,B=3,_=10,$=3,z=9,F=10;return Ed=function(I,j,J){var ae,H,U,D,se,G,P,k,V,Q,re=j.length,de=J.length,ge=I.adjustSizes,le=I.barnesHutTheta*I.barnesHutTheta,xe,pe,Ae,Te,Le,ve,he,K=[];for(U=0;U<re;U+=_)j[U+s]=j[U+i],j[U+l]=j[U+a],j[U+i]=0,j[U+a]=0;if(I.outboundAttractionDistribution){for(xe=0,U=0;U<re;U+=_)xe+=j[U+c];xe/=re/_}if(I.barnesHutOptimize){var Re=1/0,Ve=-1/0,be=1/0,Se=-1/0,ne,et,ut;for(U=0;U<re;U+=_)Re=Math.min(Re,j[U+r]),Ve=Math.max(Ve,j[U+r]),be=Math.min(be,j[U+n]),Se=Math.max(Se,j[U+n]);var Ie=Ve-Re,Et=Se-be;for(Ie>Et?(be-=(Ie-Et)/2,Se=be+Ie):(Re-=(Et-Ie)/2,Ve=Re+Et),K[0+b]=-1,K[0+x]=(Re+Ve)/2,K[0+E]=(be+Se)/2,K[0+T]=Math.max(Ve-Re,Se-be),K[0+M]=-1,K[0+N]=-1,K[0+L]=0,K[0+C]=0,K[0+R]=0,ae=1,U=0;U<re;U+=_)for(H=0,ut=B;;)if(K[H+N]>=0){j[U+r]<K[H+x]?j[U+n]<K[H+E]?ne=K[H+N]:ne=K[H+N]+z:j[U+n]<K[H+E]?ne=K[H+N]+z*2:ne=K[H+N]+z*3,K[H+C]=(K[H+C]*K[H+L]+j[U+r]*j[U+c])/(K[H+L]+j[U+c]),K[H+R]=(K[H+R]*K[H+L]+j[U+n]*j[U+c])/(K[H+L]+j[U+c]),K[H+L]+=j[U+c],H=ne;continue}else if(K[H+b]<0){K[H+b]=U;break}else{if(K[H+N]=ae*z,k=K[H+T]/2,V=K[H+N],K[V+b]=-1,K[V+x]=K[H+x]-k,K[V+E]=K[H+E]-k,K[V+T]=k,K[V+M]=V+z,K[V+N]=-1,K[V+L]=0,K[V+C]=0,K[V+R]=0,V+=z,K[V+b]=-1,K[V+x]=K[H+x]-k,K[V+E]=K[H+E]+k,K[V+T]=k,K[V+M]=V+z,K[V+N]=-1,K[V+L]=0,K[V+C]=0,K[V+R]=0,V+=z,K[V+b]=-1,K[V+x]=K[H+x]+k,K[V+E]=K[H+E]-k,K[V+T]=k,K[V+M]=V+z,K[V+N]=-1,K[V+L]=0,K[V+C]=0,K[V+R]=0,V+=z,K[V+b]=-1,K[V+x]=K[H+x]+k,K[V+E]=K[H+E]+k,K[V+T]=k,K[V+M]=K[H+M],K[V+N]=-1,K[V+L]=0,K[V+C]=0,K[V+R]=0,ae+=4,j[K[H+b]+r]<K[H+x]?j[K[H+b]+n]<K[H+E]?ne=K[H+N]:ne=K[H+N]+z:j[K[H+b]+n]<K[H+E]?ne=K[H+N]+z*2:ne=K[H+N]+z*3,K[H+L]=j[K[H+b]+c],K[H+C]=j[K[H+b]+r],K[H+R]=j[K[H+b]+n],K[ne+b]=K[H+b],K[H+b]=-1,j[U+r]<K[H+x]?j[U+n]<K[H+E]?et=K[H+N]:et=K[H+N]+z:j[U+n]<K[H+E]?et=K[H+N]+z*2:et=K[H+N]+z*3,ne===et)if(ut--){H=ne;continue}else{ut=B;break}K[et+b]=U;break}}if(I.barnesHutOptimize)for(pe=I.scalingRatio,U=0;U<re;U+=_)for(H=0;;)if(K[H+N]>=0)if(ve=Math.pow(j[U+r]-K[H+C],2)+Math.pow(j[U+n]-K[H+R],2),Q=K[H+T],4*Q*Q/ve<le){if(Ae=j[U+r]-K[H+C],Te=j[U+n]-K[H+R],ge===!0?ve>0?(he=pe*j[U+c]*K[H+L]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he):ve<0&&(he=-pe*j[U+c]*K[H+L]/Math.sqrt(ve),j[U+i]+=Ae*he,j[U+a]+=Te*he):ve>0&&(he=pe*j[U+c]*K[H+L]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he),H=K[H+M],H<0)break;continue}else{H=K[H+N];continue}else{if(G=K[H+b],G>=0&&G!==U&&(Ae=j[U+r]-j[G+r],Te=j[U+n]-j[G+n],ve=Ae*Ae+Te*Te,ge===!0?ve>0?(he=pe*j[U+c]*j[G+c]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he):ve<0&&(he=-pe*j[U+c]*j[G+c]/Math.sqrt(ve),j[U+i]+=Ae*he,j[U+a]+=Te*he):ve>0&&(he=pe*j[U+c]*j[G+c]/ve,j[U+i]+=Ae*he,j[U+a]+=Te*he)),H=K[H+M],H<0)break;continue}else for(pe=I.scalingRatio,D=0;D<re;D+=_)for(se=0;se<D;se+=_)Ae=j[D+r]-j[se+r],Te=j[D+n]-j[se+n],ge===!0?(ve=Math.sqrt(Ae*Ae+Te*Te)-j[D+d]-j[se+d],ve>0?(he=pe*j[D+c]*j[se+c]/ve/ve,j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he):ve<0&&(he=100*pe*j[D+c]*j[se+c],j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he)):(ve=Math.sqrt(Ae*Ae+Te*Te),ve>0&&(he=pe*j[D+c]*j[se+c]/ve/ve,j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he));for(V=I.gravity/I.scalingRatio,pe=I.scalingRatio,U=0;U<re;U+=_)he=0,Ae=j[U+r],Te=j[U+n],ve=Math.sqrt(Math.pow(Ae,2)+Math.pow(Te,2)),I.strongGravityMode?ve>0&&(he=pe*j[U+c]*V):ve>0&&(he=pe*j[U+c]*V/ve),j[U+i]-=Ae*he,j[U+a]-=Te*he;for(pe=1*(I.outboundAttractionDistribution?xe:1),P=0;P<de;P+=$)D=J[P+m],se=J[P+v],k=J[P+y],Le=Math.pow(k,I.edgeWeightInfluence),Ae=j[D+r]-j[se+r],Te=j[D+n]-j[se+n],ge===!0?(ve=Math.sqrt(Ae*Ae+Te*Te)-j[D+d]-j[se+d],I.linLogMode?I.outboundAttractionDistribution?ve>0&&(he=-pe*Le*Math.log(1+ve)/ve/j[D+c]):ve>0&&(he=-pe*Le*Math.log(1+ve)/ve):I.outboundAttractionDistribution?ve>0&&(he=-pe*Le/j[D+c]):ve>0&&(he=-pe*Le)):(ve=Math.sqrt(Math.pow(Ae,2)+Math.pow(Te,2)),I.linLogMode?I.outboundAttractionDistribution?ve>0&&(he=-pe*Le*Math.log(1+ve)/ve/j[D+c]):ve>0&&(he=-pe*Le*Math.log(1+ve)/ve):I.outboundAttractionDistribution?(ve=1,he=-pe*Le/j[D+c]):(ve=1,he=-pe*Le)),ve>0&&(j[D+i]+=Ae*he,j[D+a]+=Te*he,j[se+i]-=Ae*he,j[se+a]-=Te*he);var rt,ct,Gt,Ht,sn,xn;if(ge===!0)for(U=0;U<re;U+=_)j[U+g]!==1&&(rt=Math.sqrt(Math.pow(j[U+i],2)+Math.pow(j[U+a],2)),rt>F&&(j[U+i]=j[U+i]*F/rt,j[U+a]=j[U+a]*F/rt),ct=j[U+c]*Math.sqrt((j[U+s]-j[U+i])*(j[U+s]-j[U+i])+(j[U+l]-j[U+a])*(j[U+l]-j[U+a])),Gt=Math.sqrt((j[U+s]+j[U+i])*(j[U+s]+j[U+i])+(j[U+l]+j[U+a])*(j[U+l]+j[U+a]))/2,Ht=.1*Math.log(1+Gt)/(1+Math.sqrt(ct)),sn=j[U+r]+j[U+i]*(Ht/I.slowDown),j[U+r]=sn,xn=j[U+n]+j[U+a]*(Ht/I.slowDown),j[U+n]=xn);else for(U=0;U<re;U+=_)j[U+g]!==1&&(ct=j[U+c]*Math.sqrt((j[U+s]-j[U+i])*(j[U+s]-j[U+i])+(j[U+l]-j[U+a])*(j[U+l]-j[U+a])),Gt=Math.sqrt((j[U+s]+j[U+i])*(j[U+s]+j[U+i])+(j[U+l]+j[U+a])*(j[U+l]+j[U+a]))/2,Ht=j[U+f]*Math.log(1+Gt)/(1+Math.sqrt(ct)),j[U+f]=Math.min(1,Math.sqrt(Ht*(Math.pow(j[U+i],2)+Math.pow(j[U+a],2))/(1+Math.sqrt(ct)))),sn=j[U+r]+j[U+i]*(Ht/I.slowDown),j[U+r]=sn,xn=j[U+n]+j[U+a]*(Ht/I.slowDown),j[U+n]=xn);return{}},Ed}var pr={},Ab;function TE(){if(Ab)return pr;Ab=1;var r=10,n=3;return pr.assign=function(i){i=i||{};var a=Array.prototype.slice.call(arguments).slice(1),s,l,c;for(s=0,c=a.length;s<c;s++)if(a[s])for(l in a[s])i[l]=a[s][l];return i},pr.validateSettings=function(i){return"linLogMode"in i&&typeof i.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in i&&typeof i.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in i&&typeof i.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in i&&typeof i.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in i&&!(typeof i.scalingRatio=="number"&&i.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in i&&typeof i.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in i&&!(typeof i.gravity=="number"&&i.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in i&&!(typeof i.slowDown=="number"||i.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in i&&typeof i.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in i&&!(typeof i.barnesHutTheta=="number"&&i.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},pr.graphToByteArrays=function(i,a){var s=i.order,l=i.size,c={},f,d=new Float32Array(s*r),g=new Float32Array(l*n);return f=0,i.forEachNode(function(m,v){c[m]=f,d[f]=v.x,d[f+1]=v.y,d[f+2]=0,d[f+3]=0,d[f+4]=0,d[f+5]=0,d[f+6]=1,d[f+7]=1,d[f+8]=v.size||1,d[f+9]=v.fixed?1:0,f+=r}),f=0,i.forEachEdge(function(m,v,y,b,x,E,T){var M=c[y],N=c[b],L=a(m,v,y,b,x,E,T);d[M+6]+=L,d[N+6]+=L,g[f]=M,g[f+1]=N,g[f+2]=L,f+=n}),{nodes:d,edges:g}},pr.assignLayoutChanges=function(i,a,s){var l=0;i.updateEachNodeAttributes(function(c,f){return f.x=a[l],f.y=a[l+1],l+=r,s?s(c,f):f})},pr.readGraphPositions=function(i,a){var s=0;i.forEachNode(function(l,c){a[s]=c.x,a[s+1]=c.y,s+=r})},pr.collectLayoutChanges=function(i,a,s){for(var l=i.nodes(),c={},f=0,d=0,g=a.length;f<g;f+=r){if(s){var m=Object.assign({},i.getNodeAttributes(l[d]));m.x=a[f],m.y=a[f+1],m=s(l[d],m),c[l[d]]={x:m.x,y:m.y}}else c[l[d]]={x:a[f],y:a[f+1]};d++}return c},pr.createWorker=function(a){var s=window.URL||window.webkitURL,l=a.toString(),c=s.createObjectURL(new Blob(["("+l+").call(this);"],{type:"text/javascript"})),f=new Worker(c);return s.revokeObjectURL(c),f},pr}var Sd,Rb;function CE(){return Rb||(Rb=1,Sd={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),Sd}var xd,Db;function Lk(){if(Db)return xd;Db=1;var r=Zn(),n=Wh().createEdgeWeightGetter,i=kk(),a=TE(),s=CE();function l(d,g,m){if(!r(g))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof m=="number"&&(m={iterations:m});var v=m.iterations;if(typeof v!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(v<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var y=n("getEdgeWeight"in m?m.getEdgeWeight:"weight").fromEntry,b=typeof m.outputReducer=="function"?m.outputReducer:null,x=a.assign({},s,m.settings),E=a.validateSettings(x);if(E)throw new Error("graphology-layout-forceatlas2: "+E.message);var T=a.graphToByteArrays(g,y),M;for(M=0;M<v;M++)i(x,T.nodes,T.edges);if(d){a.assignLayoutChanges(g,T.nodes,b);return}return a.collectLayoutChanges(g,T.nodes)}function c(d){var g=typeof d=="number"?d:d.order;return{barnesHutOptimize:g>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(g)}}var f=l.bind(null,!1);return f.assign=l.bind(null,!0),f.inferSettings=c,xd=f,xd}var Nk=Lk();const zk=on(Nk);var _d,Ob;function Gk(){return Ob||(Ob=1,_d=function(){var n,i,a={};(function(){var l=0,c=1,f=2,d=3,g=4,m=5,v=6,y=7,b=8,x=9,E=0,T=1,M=2,N=0,L=1,C=2,R=3,B=4,_=5,$=6,z=7,F=8,Y=3,I=10,j=3,J=9,ae=10;a.exports=function(U,D,se){var G,P,k,V,Q,re,de,ge,le,xe,pe=D.length,Ae=se.length,Te=U.adjustSizes,Le=U.barnesHutTheta*U.barnesHutTheta,ve,he,K,Re,Ve,be,Se,ne=[];for(k=0;k<pe;k+=I)D[k+g]=D[k+f],D[k+m]=D[k+d],D[k+f]=0,D[k+d]=0;if(U.outboundAttractionDistribution){for(ve=0,k=0;k<pe;k+=I)ve+=D[k+v];ve/=pe/I}if(U.barnesHutOptimize){var et=1/0,ut=-1/0,Ie=1/0,Et=-1/0,rt,ct,Gt;for(k=0;k<pe;k+=I)et=Math.min(et,D[k+l]),ut=Math.max(ut,D[k+l]),Ie=Math.min(Ie,D[k+c]),Et=Math.max(Et,D[k+c]);var Ht=ut-et,sn=Et-Ie;for(Ht>sn?(Ie-=(Ht-sn)/2,Et=Ie+Ht):(et-=(sn-Ht)/2,ut=et+sn),ne[0+N]=-1,ne[0+L]=(et+ut)/2,ne[0+C]=(Ie+Et)/2,ne[0+R]=Math.max(ut-et,Et-Ie),ne[0+B]=-1,ne[0+_]=-1,ne[0+$]=0,ne[0+z]=0,ne[0+F]=0,G=1,k=0;k<pe;k+=I)for(P=0,Gt=Y;;)if(ne[P+_]>=0){D[k+l]<ne[P+L]?D[k+c]<ne[P+C]?rt=ne[P+_]:rt=ne[P+_]+J:D[k+c]<ne[P+C]?rt=ne[P+_]+J*2:rt=ne[P+_]+J*3,ne[P+z]=(ne[P+z]*ne[P+$]+D[k+l]*D[k+v])/(ne[P+$]+D[k+v]),ne[P+F]=(ne[P+F]*ne[P+$]+D[k+c]*D[k+v])/(ne[P+$]+D[k+v]),ne[P+$]+=D[k+v],P=rt;continue}else if(ne[P+N]<0){ne[P+N]=k;break}else{if(ne[P+_]=G*J,ge=ne[P+R]/2,le=ne[P+_],ne[le+N]=-1,ne[le+L]=ne[P+L]-ge,ne[le+C]=ne[P+C]-ge,ne[le+R]=ge,ne[le+B]=le+J,ne[le+_]=-1,ne[le+$]=0,ne[le+z]=0,ne[le+F]=0,le+=J,ne[le+N]=-1,ne[le+L]=ne[P+L]-ge,ne[le+C]=ne[P+C]+ge,ne[le+R]=ge,ne[le+B]=le+J,ne[le+_]=-1,ne[le+$]=0,ne[le+z]=0,ne[le+F]=0,le+=J,ne[le+N]=-1,ne[le+L]=ne[P+L]+ge,ne[le+C]=ne[P+C]-ge,ne[le+R]=ge,ne[le+B]=le+J,ne[le+_]=-1,ne[le+$]=0,ne[le+z]=0,ne[le+F]=0,le+=J,ne[le+N]=-1,ne[le+L]=ne[P+L]+ge,ne[le+C]=ne[P+C]+ge,ne[le+R]=ge,ne[le+B]=ne[P+B],ne[le+_]=-1,ne[le+$]=0,ne[le+z]=0,ne[le+F]=0,G+=4,D[ne[P+N]+l]<ne[P+L]?D[ne[P+N]+c]<ne[P+C]?rt=ne[P+_]:rt=ne[P+_]+J:D[ne[P+N]+c]<ne[P+C]?rt=ne[P+_]+J*2:rt=ne[P+_]+J*3,ne[P+$]=D[ne[P+N]+v],ne[P+z]=D[ne[P+N]+l],ne[P+F]=D[ne[P+N]+c],ne[rt+N]=ne[P+N],ne[P+N]=-1,D[k+l]<ne[P+L]?D[k+c]<ne[P+C]?ct=ne[P+_]:ct=ne[P+_]+J:D[k+c]<ne[P+C]?ct=ne[P+_]+J*2:ct=ne[P+_]+J*3,rt===ct)if(Gt--){P=rt;continue}else{Gt=Y;break}ne[ct+N]=k;break}}if(U.barnesHutOptimize)for(he=U.scalingRatio,k=0;k<pe;k+=I)for(P=0;;)if(ne[P+_]>=0)if(be=Math.pow(D[k+l]-ne[P+z],2)+Math.pow(D[k+c]-ne[P+F],2),xe=ne[P+R],4*xe*xe/be<Le){if(K=D[k+l]-ne[P+z],Re=D[k+c]-ne[P+F],Te===!0?be>0?(Se=he*D[k+v]*ne[P+$]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se):be<0&&(Se=-he*D[k+v]*ne[P+$]/Math.sqrt(be),D[k+f]+=K*Se,D[k+d]+=Re*Se):be>0&&(Se=he*D[k+v]*ne[P+$]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se),P=ne[P+B],P<0)break;continue}else{P=ne[P+_];continue}else{if(re=ne[P+N],re>=0&&re!==k&&(K=D[k+l]-D[re+l],Re=D[k+c]-D[re+c],be=K*K+Re*Re,Te===!0?be>0?(Se=he*D[k+v]*D[re+v]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se):be<0&&(Se=-he*D[k+v]*D[re+v]/Math.sqrt(be),D[k+f]+=K*Se,D[k+d]+=Re*Se):be>0&&(Se=he*D[k+v]*D[re+v]/be,D[k+f]+=K*Se,D[k+d]+=Re*Se)),P=ne[P+B],P<0)break;continue}else for(he=U.scalingRatio,V=0;V<pe;V+=I)for(Q=0;Q<V;Q+=I)K=D[V+l]-D[Q+l],Re=D[V+c]-D[Q+c],Te===!0?(be=Math.sqrt(K*K+Re*Re)-D[V+b]-D[Q+b],be>0?(Se=he*D[V+v]*D[Q+v]/be/be,D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se):be<0&&(Se=100*he*D[V+v]*D[Q+v],D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se)):(be=Math.sqrt(K*K+Re*Re),be>0&&(Se=he*D[V+v]*D[Q+v]/be/be,D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se));for(le=U.gravity/U.scalingRatio,he=U.scalingRatio,k=0;k<pe;k+=I)Se=0,K=D[k+l],Re=D[k+c],be=Math.sqrt(Math.pow(K,2)+Math.pow(Re,2)),U.strongGravityMode?be>0&&(Se=he*D[k+v]*le):be>0&&(Se=he*D[k+v]*le/be),D[k+f]-=K*Se,D[k+d]-=Re*Se;for(he=1*(U.outboundAttractionDistribution?ve:1),de=0;de<Ae;de+=j)V=se[de+E],Q=se[de+T],ge=se[de+M],Ve=Math.pow(ge,U.edgeWeightInfluence),K=D[V+l]-D[Q+l],Re=D[V+c]-D[Q+c],Te===!0?(be=Math.sqrt(K*K+Re*Re)-D[V+b]-D[Q+b],U.linLogMode?U.outboundAttractionDistribution?be>0&&(Se=-he*Ve*Math.log(1+be)/be/D[V+v]):be>0&&(Se=-he*Ve*Math.log(1+be)/be):U.outboundAttractionDistribution?be>0&&(Se=-he*Ve/D[V+v]):be>0&&(Se=-he*Ve)):(be=Math.sqrt(Math.pow(K,2)+Math.pow(Re,2)),U.linLogMode?U.outboundAttractionDistribution?be>0&&(Se=-he*Ve*Math.log(1+be)/be/D[V+v]):be>0&&(Se=-he*Ve*Math.log(1+be)/be):U.outboundAttractionDistribution?(be=1,Se=-he*Ve/D[V+v]):(be=1,Se=-he*Ve)),be>0&&(D[V+f]+=K*Se,D[V+d]+=Re*Se,D[Q+f]-=K*Se,D[Q+d]-=Re*Se);var xn,ii,Mn,ft,ji,Zt;if(Te===!0)for(k=0;k<pe;k+=I)D[k+x]!==1&&(xn=Math.sqrt(Math.pow(D[k+f],2)+Math.pow(D[k+d],2)),xn>ae&&(D[k+f]=D[k+f]*ae/xn,D[k+d]=D[k+d]*ae/xn),ii=D[k+v]*Math.sqrt((D[k+g]-D[k+f])*(D[k+g]-D[k+f])+(D[k+m]-D[k+d])*(D[k+m]-D[k+d])),Mn=Math.sqrt((D[k+g]+D[k+f])*(D[k+g]+D[k+f])+(D[k+m]+D[k+d])*(D[k+m]+D[k+d]))/2,ft=.1*Math.log(1+Mn)/(1+Math.sqrt(ii)),ji=D[k+l]+D[k+f]*(ft/U.slowDown),D[k+l]=ji,Zt=D[k+c]+D[k+d]*(ft/U.slowDown),D[k+c]=Zt);else for(k=0;k<pe;k+=I)D[k+x]!==1&&(ii=D[k+v]*Math.sqrt((D[k+g]-D[k+f])*(D[k+g]-D[k+f])+(D[k+m]-D[k+d])*(D[k+m]-D[k+d])),Mn=Math.sqrt((D[k+g]+D[k+f])*(D[k+g]+D[k+f])+(D[k+m]+D[k+d])*(D[k+m]+D[k+d]))/2,ft=D[k+y]*Math.log(1+Mn)/(1+Math.sqrt(ii)),D[k+y]=Math.min(1,Math.sqrt(ft*(Math.pow(D[k+f],2)+Math.pow(D[k+d],2))/(1+Math.sqrt(ii)))),ji=D[k+l]+D[k+f]*(ft/U.slowDown),D[k+l]=ji,Zt=D[k+c]+D[k+d]*(ft/U.slowDown),D[k+c]=Zt);return{}}})();var s=a.exports;self.addEventListener("message",function(l){var c=l.data;n=new Float32Array(c.nodes),c.edges&&(i=new Float32Array(c.edges)),s(c.settings,n,i),self.postMessage({nodes:n.buffer},[n.buffer])})}),_d}var Td,kb;function Mk(){if(kb)return Td;kb=1;var r=Gk(),n=Zn(),i=Wh().createEdgeWeightGetter,a=TE(),s=CE();function l(c,f){if(f=f||{},!n(c))throw new Error("graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.");var d=i("getEdgeWeight"in f?f.getEdgeWeight:"weight").fromEntry,g=a.assign({},s,f.settings),m=a.validateSettings(g);if(m)throw new Error("graphology-layout-forceatlas2/worker: "+m.message);this.worker=null,this.graph=c,this.settings=g,this.getEdgeWeight=d,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof f.outputReducer=="function"?f.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var v=void 0,y=this;this.handleGraphUpdate=function(){y.worker&&y.worker.terminate(),v&&clearTimeout(v),v=setTimeout(function(){v=void 0,y.spawnWorker()},0)},c.on("nodeAdded",this.handleGraphUpdate),c.on("edgeAdded",this.handleGraphUpdate),c.on("nodeDropped",this.handleGraphUpdate),c.on("edgeDropped",this.handleGraphUpdate),this.spawnWorker()}return l.prototype.isRunning=function(){return this.running},l.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(r),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},l.prototype.handleMessage=function(c){if(this.running){var f=new Float32Array(c.data.nodes);a.assignLayoutChanges(this.graph,f,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,f),this.matrices.nodes=f,this.askForIterations()}},l.prototype.askForIterations=function(c){var f=this.matrices,d={settings:this.settings,nodes:f.nodes.buffer},g=[f.nodes.buffer];return c&&(d.edges=f.edges.buffer,g.push(f.edges.buffer)),this.worker.postMessage(d,g),this},l.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-forceatlas2/worker.start: layout was killed.");return this.running?this:(this.matrices=a.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0),this)},l.prototype.stop=function(){return this.running=!1,this},l.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener("nodeAdded",this.handleGraphUpdate),this.graph.removeListener("edgeAdded",this.handleGraphUpdate),this.graph.removeListener("nodeDropped",this.handleGraphUpdate),this.graph.removeListener("edgeDropped",this.handleGraphUpdate)},Td=l,Td}var jk=Mk();const Uk=on(jk);function AE(r={iterations:100}){return Pa(zk,r)}function Bk(r={}){return Zh(Uk,r)}var Cd,Lb;function Fk(){if(Lb)return Cd;Lb=1;var r=0,n=1,i=2,a=3;function s(c,f){return c+"§"+f}function l(){return .01*(.5-Math.random())}return Cd=function(f,d){var g=f.margin,m=f.ratio,v=f.expansion,y=f.gridSize,b=f.speed,x,E,T,M,N,L,C=!0,R=d.length,B=R/a|0,_=new Float32Array(B),$=new Float32Array(B),z=1/0,F=1/0,Y=-1/0,I=-1/0;for(x=0;x<R;x+=a)T=d[x+r],M=d[x+n],L=d[x+i]*m+g,z=Math.min(z,T-L),Y=Math.max(Y,T+L),F=Math.min(F,M-L),I=Math.max(I,M+L);var j=Y-z,J=I-F,ae=(z+Y)/2,H=(F+I)/2;z=ae-v*j/2,Y=ae+v*j/2,F=H-v*J/2,I=H+v*J/2;var U=new Array(y*y),D=U.length,se;for(se=0;se<D;se++)U[se]=[];var G,P,k,V,Q,re,de,ge,le,xe;for(x=0;x<R;x+=a)for(T=d[x+r],M=d[x+n],L=d[x+i]*m+g,G=T-L,P=T+L,k=M-L,V=M+L,Q=Math.floor(y*(G-z)/(Y-z)),re=Math.floor(y*(P-z)/(Y-z)),de=Math.floor(y*(k-F)/(I-F)),ge=Math.floor(y*(V-F)/(I-F)),le=Q;le<=re;le++)for(xe=de;xe<=ge;xe++)U[le*y+xe].push(x);var pe,Ae=new Set,Te,Le,ve,he,K,Re,Ve,be,Se,ne,et,ut,Ie;for(se=0;se<D;se++)for(pe=U[se],x=0,N=pe.length;x<N;x++)for(Te=pe[x],ve=d[Te+r],K=d[Te+n],Ve=d[Te+i],E=x+1;E<N;E++)Le=pe[E],Se=s(Te,Le),!(D>1&&Ae.has(Se))&&(D>1&&Ae.add(Se),he=d[Le+r],Re=d[Le+n],be=d[Le+i],ne=he-ve,et=Re-K,ut=Math.sqrt(ne*ne+et*et),Ie=ut<Ve*m+g+(be*m+g),Ie&&(C=!1,Le=Le/a|0,ut>0?(_[Le]+=ne/ut*(1+Ve),$[Le]+=et/ut*(1+Ve)):(_[Le]+=j*l(),$[Le]+=J*l())));for(x=0,E=0;x<R;x+=a,E++)d[x+r]+=_[E]*.1*b,d[x+n]+=$[E]*.1*b;return{converged:C}},Cd}var Oi={},Nb;function RE(){if(Nb)return Oi;Nb=1;var r=3;return Oi.validateSettings=function(n){return"gridSize"in n&&typeof n.gridSize!="number"||n.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in n&&typeof n.margin!="number"||n.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in n&&typeof n.expansion!="number"||n.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in n&&typeof n.ratio!="number"||n.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in n&&typeof n.speed!="number"||n.speed<=0?{message:"the `speed` setting should be a positive number."}:null},Oi.graphToByteArray=function(n,i){var a=n.order,s=new Float32Array(a*r),l=0;return n.forEachNode(function(c,f){typeof i=="function"&&(f=i(c,f)),s[l]=f.x,s[l+1]=f.y,s[l+2]=f.size||1,l+=r}),s},Oi.assignLayoutChanges=function(n,i,a){var s=0;n.forEachNode(function(l){var c={x:i[s],y:i[s+1]};typeof a=="function"&&(c=a(l,c)),n.mergeNodeAttributes(l,c),s+=r})},Oi.collectLayoutChanges=function(n,i,a){var s={},l=0;return n.forEachNode(function(c){var f={x:i[l],y:i[l+1]};typeof a=="function"&&(f=a(c,f)),s[c]=f,l+=r}),s},Oi.createWorker=function(i){var a=window.URL||window.webkitURL,s=i.toString(),l=a.createObjectURL(new Blob(["("+s+").call(this);"],{type:"text/javascript"})),c=new Worker(l);return a.revokeObjectURL(l),c},Oi}var Ad,zb;function DE(){return zb||(zb=1,Ad={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),Ad}var Rd,Gb;function Hk(){if(Gb)return Rd;Gb=1;var r=Zn(),n=Fk(),i=RE(),a=DE(),s=500;function l(f,d,g){if(!r(d))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof g=="number"?g={maxIterations:g}:g=g||{};var m=g.maxIterations||s;if(typeof m!="number"||m<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var v=Object.assign({},a,g.settings),y=i.validateSettings(v);if(y)throw new Error("graphology-layout-noverlap: "+y.message);var b=i.graphToByteArray(d,g.inputReducer),x=!1,E;for(E=0;E<m&&!x;E++)x=n(v,b).converged;if(f){i.assignLayoutChanges(d,b,g.outputReducer);return}return i.collectLayoutChanges(d,b,g.outputReducer)}var c=l.bind(null,!1);return c.assign=l.bind(null,!0),Rd=c,Rd}var Pk=Hk();const $k=on(Pk);var Dd,Mb;function qk(){return Mb||(Mb=1,Dd=function(){var n,i={};(function(){var s=0,l=1,c=2,f=3;function d(m,v){return m+"§"+v}function g(){return .01*(.5-Math.random())}i.exports=function(v,y){var b=v.margin,x=v.ratio,E=v.expansion,T=v.gridSize,M=v.speed,N,L,C,R,B,_,$=!0,z=y.length,F=z/f|0,Y=new Float32Array(F),I=new Float32Array(F),j=1/0,J=1/0,ae=-1/0,H=-1/0;for(N=0;N<z;N+=f)C=y[N+s],R=y[N+l],_=y[N+c]*x+b,j=Math.min(j,C-_),ae=Math.max(ae,C+_),J=Math.min(J,R-_),H=Math.max(H,R+_);var U=ae-j,D=H-J,se=(j+ae)/2,G=(J+H)/2;j=se-E*U/2,ae=se+E*U/2,J=G-E*D/2,H=G+E*D/2;var P=new Array(T*T),k=P.length,V;for(V=0;V<k;V++)P[V]=[];var Q,re,de,ge,le,xe,pe,Ae,Te,Le;for(N=0;N<z;N+=f)for(C=y[N+s],R=y[N+l],_=y[N+c]*x+b,Q=C-_,re=C+_,de=R-_,ge=R+_,le=Math.floor(T*(Q-j)/(ae-j)),xe=Math.floor(T*(re-j)/(ae-j)),pe=Math.floor(T*(de-J)/(H-J)),Ae=Math.floor(T*(ge-J)/(H-J)),Te=le;Te<=xe;Te++)for(Le=pe;Le<=Ae;Le++)P[Te*T+Le].push(N);var ve,he=new Set,K,Re,Ve,be,Se,ne,et,ut,Ie,Et,rt,ct,Gt;for(V=0;V<k;V++)for(ve=P[V],N=0,B=ve.length;N<B;N++)for(K=ve[N],Ve=y[K+s],Se=y[K+l],et=y[K+c],L=N+1;L<B;L++)Re=ve[L],Ie=d(K,Re),!(k>1&&he.has(Ie))&&(k>1&&he.add(Ie),be=y[Re+s],ne=y[Re+l],ut=y[Re+c],Et=be-Ve,rt=ne-Se,ct=Math.sqrt(Et*Et+rt*rt),Gt=ct<et*x+b+(ut*x+b),Gt&&($=!1,Re=Re/f|0,ct>0?(Y[Re]+=Et/ct*(1+et),I[Re]+=rt/ct*(1+et)):(Y[Re]+=U*g(),I[Re]+=D*g())));for(N=0,L=0;N<z;N+=f,L++)y[N+s]+=Y[L]*.1*M,y[N+l]+=I[L]*.1*M;return{converged:$}}})();var a=i.exports;self.addEventListener("message",function(s){var l=s.data;n=new Float32Array(l.nodes);var c=a(l.settings,n);self.postMessage({result:c,nodes:n.buffer},[n.buffer])})}),Dd}var Od,jb;function Vk(){if(jb)return Od;jb=1;var r=qk(),n=Zn(),i=RE(),a=DE();function s(l,c){if(c=c||{},!n(l))throw new Error("graphology-layout-noverlap/worker: the given graph is not a valid graphology instance.");var f=Object.assign({},a,c.settings),d=i.validateSettings(f);if(d)throw new Error("graphology-layout-noverlap/worker: "+d.message);this.worker=null,this.graph=l,this.settings=f,this.matrices=null,this.running=!1,this.killed=!1,this.inputReducer=c.inputReducer,this.outputReducer=c.outputReducer,this.callbacks={onConverged:typeof c.onConverged=="function"?c.onConverged:null},this.handleMessage=this.handleMessage.bind(this);var g=!1,m=this;this.handleAddition=function(){g||(g=!0,m.spawnWorker(),setTimeout(function(){g=!1},0))},l.on("nodeAdded",this.handleAddition),l.on("edgeAdded",this.handleAddition),this.spawnWorker()}return s.prototype.isRunning=function(){return this.running},s.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=i.createWorker(r),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},s.prototype.handleMessage=function(l){if(this.running){var c=new Float32Array(l.data.nodes);if(i.assignLayoutChanges(this.graph,c,this.outputReducer),this.matrices.nodes=c,l.data.result.converged){this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop();return}this.askForIterations()}},s.prototype.askForIterations=function(){var l=this.matrices,c={settings:this.settings,nodes:l.nodes.buffer},f=[l.nodes.buffer];return this.worker.postMessage(c,f),this},s.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-noverlap/worker.start: layout was killed.");return this.running?this:(this.matrices={nodes:i.graphToByteArray(this.graph,this.inputReducer)},this.running=!0,this.askForIterations(),this)},s.prototype.stop=function(){return this.running=!1,this},s.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener("nodeAdded",this.handleAddition),this.graph.removeListener("edgeAdded",this.handleAddition)},Od=s,Od}var Ik=Vk();const Yk=on(Ik);function Xk(r={}){return Pa($k,r)}function Zk(r={}){return Zh(Yk,r)}var kd,Ub;function Wk(){if(Ub)return kd;Ub=1;var r=ds(),n=Zn(),i={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function a(l,c,f){if(!n(c))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");f=r(f,i);var d=f.dimensions;if(!Array.isArray(d)||d.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var g=d.length,m=f.center,v=f.rng,y=f.scale,b=(m-.5)*y;function x(T){for(var M=0;M<g;M++)T[d[M]]=v()*y+b;return T}if(!l){var E={};return c.forEachNode(function(T){E[T]=x({})}),E}c.updateEachNodeAttributes(function(T,M){return x(M),M},{attributes:d})}var s=a.bind(null,!1);return s.assign=a.bind(null,!0),kd=s,kd}var Kk=Wk();const Qk=on(Kk);function Jk(r={}){return Pa(Qk,r)}var eL="VisuallyHidden",OE=S.forwardRef((r,n)=>A.jsx(Je.span,{...r,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...r.style}}));OE.displayName=eL;var tL=OE,[_u,Rz]=rs("Tooltip",[vu]),Tu=vu(),kE="TooltipProvider",nL=700,ch="tooltip.open",[rL,Kh]=_u(kE),LE=r=>{const{__scopeTooltip:n,delayDuration:i=nL,skipDelayDuration:a=300,disableHoverableContent:s=!1,children:l}=r,[c,f]=S.useState(!0),d=S.useRef(!1),g=S.useRef(0);return S.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),A.jsx(rL,{scope:n,isOpenDelayed:c,delayDuration:i,onOpen:S.useCallback(()=>{window.clearTimeout(g.current),f(!1)},[]),onClose:S.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>f(!0),a)},[a]),isPointerInTransitRef:d,onPointerInTransitChange:S.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};LE.displayName=kE;var Cu="Tooltip",[iL,Au]=_u(Cu),NE=r=>{const{__scopeTooltip:n,children:i,open:a,defaultOpen:s=!1,onOpenChange:l,disableHoverableContent:c,delayDuration:f}=r,d=Kh(Cu,r.__scopeTooltip),g=Tu(n),[m,v]=S.useState(null),y=Ln(),b=S.useRef(0),x=c??d.disableHoverableContent,E=f??d.delayDuration,T=S.useRef(!1),[M=!1,N]=yu({prop:a,defaultProp:s,onChange:_=>{_?(d.onOpen(),document.dispatchEvent(new CustomEvent(ch))):d.onClose(),l==null||l(_)}}),L=S.useMemo(()=>M?T.current?"delayed-open":"instant-open":"closed",[M]),C=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T.current=!1,N(!0)},[N]),R=S.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),B=S.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{T.current=!0,N(!0),b.current=0},E)},[E,N]);return S.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),A.jsx(ew,{...g,children:A.jsx(iL,{scope:n,contentId:y,open:M,stateAttribute:L,trigger:m,onTriggerChange:v,onTriggerEnter:S.useCallback(()=>{d.isOpenDelayed?B():C()},[d.isOpenDelayed,B,C]),onTriggerLeave:S.useCallback(()=>{x?R():(window.clearTimeout(b.current),b.current=0)},[R,x]),onOpen:C,onClose:R,disableHoverableContent:x,children:i})})};NE.displayName=Cu;var fh="TooltipTrigger",zE=S.forwardRef((r,n)=>{const{__scopeTooltip:i,...a}=r,s=Au(fh,i),l=Kh(fh,i),c=Tu(i),f=S.useRef(null),d=Vt(n,f,s.onTriggerChange),g=S.useRef(!1),m=S.useRef(!1),v=S.useCallback(()=>g.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),A.jsx(zh,{asChild:!0,...c,children:A.jsx(Je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...a,ref:d,onPointerMove:ht(r.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:ht(r.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:ht(r.onPointerDown,()=>{g.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:ht(r.onFocus,()=>{g.current||s.onOpen()}),onBlur:ht(r.onBlur,s.onClose),onClick:ht(r.onClick,s.onClose)})})});zE.displayName=fh;var aL="TooltipPortal",[Dz,oL]=_u(aL,{forceMount:void 0}),za="TooltipContent",GE=S.forwardRef((r,n)=>{const i=oL(za,r.__scopeTooltip),{forceMount:a=i.forceMount,side:s="top",...l}=r,c=Au(za,r.__scopeTooltip);return A.jsx(ni,{present:a||c.open,children:c.disableHoverableContent?A.jsx(ME,{side:s,...l,ref:n}):A.jsx(sL,{side:s,...l,ref:n})})}),sL=S.forwardRef((r,n)=>{const i=Au(za,r.__scopeTooltip),a=Kh(za,r.__scopeTooltip),s=S.useRef(null),l=Vt(n,s),[c,f]=S.useState(null),{trigger:d,onClose:g}=i,m=s.current,{onPointerInTransitChange:v}=a,y=S.useCallback(()=>{f(null),v(!1)},[v]),b=S.useCallback((x,E)=>{const T=x.currentTarget,M={x:x.clientX,y:x.clientY},N=fL(M,T.getBoundingClientRect()),L=dL(M,N),C=hL(E.getBoundingClientRect()),R=pL([...L,...C]);f(R),v(!0)},[v]);return S.useEffect(()=>()=>y(),[y]),S.useEffect(()=>{if(d&&m){const x=T=>b(T,m),E=T=>b(T,d);return d.addEventListener("pointerleave",x),m.addEventListener("pointerleave",E),()=>{d.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",E)}}},[d,m,b,y]),S.useEffect(()=>{if(c){const x=E=>{const T=E.target,M={x:E.clientX,y:E.clientY},N=(d==null?void 0:d.contains(T))||(m==null?void 0:m.contains(T)),L=!gL(M,c);N?y():L&&(y(),g())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,m,c,g,y]),A.jsx(ME,{...r,ref:l})}),[lL,uL]=_u(Cu,{isInside:!1}),ME=S.forwardRef((r,n)=>{const{__scopeTooltip:i,children:a,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...f}=r,d=Au(za,i),g=Tu(i),{onClose:m}=d;return S.useEffect(()=>(document.addEventListener(ch,m),()=>document.removeEventListener(ch,m)),[m]),S.useEffect(()=>{if(d.trigger){const v=y=>{const b=y.target;b!=null&&b.contains(d.trigger)&&m()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[d.trigger,m]),A.jsx(hu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:m,children:A.jsxs(tw,{"data-state":d.stateAttribute,...g,...f,ref:n,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[A.jsx(R0,{children:a}),A.jsx(lL,{scope:i,isInside:!0,children:A.jsx(tL,{id:d.contentId,role:"tooltip",children:s||a})})]})})});GE.displayName=za;var jE="TooltipArrow",cL=S.forwardRef((r,n)=>{const{__scopeTooltip:i,...a}=r,s=Tu(i);return uL(jE,i).isInside?null:A.jsx(nw,{...s,...a,ref:n})});cL.displayName=jE;function fL(r,n){const i=Math.abs(n.top-r.y),a=Math.abs(n.bottom-r.y),s=Math.abs(n.right-r.x),l=Math.abs(n.left-r.x);switch(Math.min(i,a,s,l)){case l:return"left";case s:return"right";case i:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function dL(r,n,i=5){const a=[];switch(n){case"top":a.push({x:r.x-i,y:r.y+i},{x:r.x+i,y:r.y+i});break;case"bottom":a.push({x:r.x-i,y:r.y-i},{x:r.x+i,y:r.y-i});break;case"left":a.push({x:r.x+i,y:r.y-i},{x:r.x+i,y:r.y+i});break;case"right":a.push({x:r.x-i,y:r.y-i},{x:r.x-i,y:r.y+i});break}return a}function hL(r){const{top:n,right:i,bottom:a,left:s}=r;return[{x:s,y:n},{x:i,y:n},{x:i,y:a},{x:s,y:a}]}function gL(r,n){const{x:i,y:a}=r;let s=!1;for(let l=0,c=n.length-1;l<n.length;c=l++){const f=n[l].x,d=n[l].y,g=n[c].x,m=n[c].y;d>a!=m>a&&i<(g-f)*(a-d)/(m-d)+f&&(s=!s)}return s}function pL(r){const n=r.slice();return n.sort((i,a)=>i.x<a.x?-1:i.x>a.x?1:i.y<a.y?-1:i.y>a.y?1:0),mL(n)}function mL(r){if(r.length<=1)return r.slice();const n=[];for(let a=0;a<r.length;a++){const s=r[a];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}n.pop();const i=[];for(let a=r.length-1;a>=0;a--){const s=r[a];for(;i.length>=2;){const l=i[i.length-1],c=i[i.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))i.pop();else break}i.push(s)}return i.pop(),n.length===1&&i.length===1&&n[0].x===i[0].x&&n[0].y===i[0].y?n:n.concat(i)}var vL=LE,yL=NE,bL=zE,UE=GE;const BE=vL,FE=yL,HE=bL,Qh=S.forwardRef(({className:r,sideOffset:n=4,...i},a)=>A.jsx(UE,{ref:a,sideOffset:n,className:Xe("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md border px-3 py-1.5 text-sm shadow-md",r),...i}));Qh.displayName=UE.displayName;const Bb=w0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),an=S.forwardRef(({className:r,variant:n,tooltip:i,size:a,side:s="right",asChild:l=!1,...c},f)=>{const d=l?is:"button";return i?A.jsx(BE,{children:A.jsxs(FE,{children:[A.jsx(HE,{asChild:!0,children:A.jsx(d,{className:Xe(Bb({variant:n,size:a,className:r}),"cursor-pointer"),ref:f,...c})}),A.jsx(Qh,{side:s,children:i})]})}):A.jsx(d,{className:Xe(Bb({variant:n,size:a,className:r}),"cursor-pointer"),ref:f,...c})});an.displayName="Button";var Fb=1,wL=.9,EL=.8,SL=.17,Ld=.1,Nd=.999,xL=.9999,_L=.99,TL=/[\\\/_+.#"@\[\(\{&]/,CL=/[\\\/_+.#"@\[\(\{&]/g,AL=/[\s-]/,PE=/[\s-]/g;function dh(r,n,i,a,s,l,c){if(l===n.length)return s===r.length?Fb:_L;var f=`${s},${l}`;if(c[f]!==void 0)return c[f];for(var d=a.charAt(l),g=i.indexOf(d,s),m=0,v,y,b,x;g>=0;)v=dh(r,n,i,a,g+1,l+1,c),v>m&&(g===s?v*=Fb:TL.test(r.charAt(g-1))?(v*=EL,b=r.slice(s,g-1).match(CL),b&&s>0&&(v*=Math.pow(Nd,b.length))):AL.test(r.charAt(g-1))?(v*=wL,x=r.slice(s,g-1).match(PE),x&&s>0&&(v*=Math.pow(Nd,x.length))):(v*=SL,s>0&&(v*=Math.pow(Nd,g-s))),r.charAt(g)!==n.charAt(l)&&(v*=xL)),(v<Ld&&i.charAt(g-1)===a.charAt(l+1)||a.charAt(l+1)===a.charAt(l)&&i.charAt(g-1)!==a.charAt(l))&&(y=dh(r,n,i,a,g+1,l+2,c),y*Ld>v&&(v=y*Ld)),v>m&&(m=v),g=i.indexOf(d,g+1);return c[f]=m,m}function Hb(r){return r.toLowerCase().replace(PE," ")}function RL(r,n,i){return r=i&&i.length>0?`${r+" "+i.join(" ")}`:r,dh(r,n,Hb(r),Hb(n),0,0,{})}var Jh="Dialog",[$E,Oz]=rs(Jh),[DL,Gn]=$E(Jh),qE=r=>{const{__scopeDialog:n,children:i,open:a,defaultOpen:s,onOpenChange:l,modal:c=!0}=r,f=S.useRef(null),d=S.useRef(null),[g=!1,m]=yu({prop:a,defaultProp:s,onChange:l});return A.jsx(DL,{scope:n,triggerRef:f,contentRef:d,contentId:Ln(),titleId:Ln(),descriptionId:Ln(),open:g,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(v=>!v),[m]),modal:c,children:i})};qE.displayName=Jh;var VE="DialogTrigger",OL=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(VE,i),l=Vt(n,s.triggerRef);return A.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ng(s.open),...a,ref:l,onClick:ht(r.onClick,s.onOpenToggle)})});OL.displayName=VE;var eg="DialogPortal",[kL,IE]=$E(eg,{forceMount:void 0}),YE=r=>{const{__scopeDialog:n,forceMount:i,children:a,container:s}=r,l=Gn(eg,n);return A.jsx(kL,{scope:n,forceMount:i,children:S.Children.map(a,c=>A.jsx(ni,{present:i||l.open,children:A.jsx(Gh,{asChild:!0,container:s,children:c})}))})};YE.displayName=eg;var cu="DialogOverlay",XE=S.forwardRef((r,n)=>{const i=IE(cu,r.__scopeDialog),{forceMount:a=i.forceMount,...s}=r,l=Gn(cu,r.__scopeDialog);return l.modal?A.jsx(ni,{present:a||l.open,children:A.jsx(LL,{...s,ref:n})}):null});XE.displayName=cu;var LL=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(cu,i);return A.jsx(Mh,{as:is,allowPinchZoom:!0,shards:[s.contentRef],children:A.jsx(Je.div,{"data-state":ng(s.open),...a,ref:n,style:{pointerEvents:"auto",...a.style}})})}),zi="DialogContent",ZE=S.forwardRef((r,n)=>{const i=IE(zi,r.__scopeDialog),{forceMount:a=i.forceMount,...s}=r,l=Gn(zi,r.__scopeDialog);return A.jsx(ni,{present:a||l.open,children:l.modal?A.jsx(NL,{...s,ref:n}):A.jsx(zL,{...s,ref:n})})});ZE.displayName=zi;var NL=S.forwardRef((r,n)=>{const i=Gn(zi,r.__scopeDialog),a=S.useRef(null),s=Vt(n,i.contentRef,a);return S.useEffect(()=>{const l=a.current;if(l)return iw(l)},[]),A.jsx(WE,{...r,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(r.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ht(r.onPointerDownOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&l.preventDefault()}),onFocusOutside:ht(r.onFocusOutside,l=>l.preventDefault())})}),zL=S.forwardRef((r,n)=>{const i=Gn(zi,r.__scopeDialog),a=S.useRef(!1),s=S.useRef(!1);return A.jsx(WE,{...r,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,f;(c=r.onCloseAutoFocus)==null||c.call(r,l),l.defaultPrevented||(a.current||(f=i.triggerRef.current)==null||f.focus(),l.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:l=>{var d,g;(d=r.onInteractOutside)==null||d.call(r,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((g=i.triggerRef.current)==null?void 0:g.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),WE=S.forwardRef((r,n)=>{const{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=r,f=Gn(zi,i),d=S.useRef(null),g=Vt(n,d);return k0(),A.jsxs(A.Fragment,{children:[A.jsx(_h,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:l,children:A.jsx(hu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":ng(f.open),...c,ref:g,onDismiss:()=>f.onOpenChange(!1)})}),A.jsxs(A.Fragment,{children:[A.jsx(GL,{titleId:f.titleId}),A.jsx(jL,{contentRef:d,descriptionId:f.descriptionId})]})]})}),tg="DialogTitle",KE=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(tg,i);return A.jsx(Je.h2,{id:s.titleId,...a,ref:n})});KE.displayName=tg;var QE="DialogDescription",JE=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(QE,i);return A.jsx(Je.p,{id:s.descriptionId,...a,ref:n})});JE.displayName=QE;var e1="DialogClose",t1=S.forwardRef((r,n)=>{const{__scopeDialog:i,...a}=r,s=Gn(e1,i);return A.jsx(Je.button,{type:"button",...a,ref:n,onClick:ht(r.onClick,()=>s.onOpenChange(!1))})});t1.displayName=e1;function ng(r){return r?"open":"closed"}var n1="DialogTitleWarning",[kz,r1]=rC(n1,{contentName:zi,titleName:tg,docsSlug:"dialog"}),GL=({titleId:r})=>{const n=r1(n1),i=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
|
|
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
|
|
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return S.useEffect(()=>{r&&(document.getElementById(r)||console.error(i))},[i,r]),null},ML="DialogDescriptionWarning",jL=({contentRef:r,descriptionId:n})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r1(ML).contentName}}.`;return S.useEffect(()=>{var l;const s=(l=r.current)==null?void 0:l.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(a))},[a,r,n]),null},UL=qE,i1=YE,rg=XE,ig=ZE,a1=KE,o1=JE,BL=t1,zd={exports:{}},Gd={};/**
|
|
* @license React
|
|
* use-sync-external-store-shim.production.js
|
|
*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var Pb;function FL(){if(Pb)return Gd;Pb=1;var r=du();function n(v,y){return v===y&&(v!==0||1/v===1/y)||v!==v&&y!==y}var i=typeof Object.is=="function"?Object.is:n,a=r.useState,s=r.useEffect,l=r.useLayoutEffect,c=r.useDebugValue;function f(v,y){var b=y(),x=a({inst:{value:b,getSnapshot:y}}),E=x[0].inst,T=x[1];return l(function(){E.value=b,E.getSnapshot=y,d(E)&&T({inst:E})},[v,b,y]),s(function(){return d(E)&&T({inst:E}),v(function(){d(E)&&T({inst:E})})},[v]),c(b),b}function d(v){var y=v.getSnapshot;v=v.value;try{var b=y();return!i(v,b)}catch{return!0}}function g(v,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:f;return Gd.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,Gd}var $b;function HL(){return $b||($b=1,zd.exports=FL()),zd.exports}var PL=HL(),Wo='[cmdk-group=""]',Md='[cmdk-group-items=""]',$L='[cmdk-group-heading=""]',ag='[cmdk-item=""]',qb=`${ag}:not([aria-disabled="true"])`,hh="cmdk-item-select",ki="data-value",qL=(r,n,i)=>RL(r,n,i),s1=S.createContext(void 0),hs=()=>S.useContext(s1),l1=S.createContext(void 0),og=()=>S.useContext(l1),u1=S.createContext(void 0),c1=S.forwardRef((r,n)=>{let i=Ca(()=>{var k,V;return{search:"",value:(V=(k=r.value)!=null?k:r.defaultValue)!=null?V:"",filtered:{count:0,items:new Map,groups:new Set}}}),a=Ca(()=>new Set),s=Ca(()=>new Map),l=Ca(()=>new Map),c=Ca(()=>new Set),f=f1(r),{label:d,children:g,value:m,onValueChange:v,filter:y,shouldFilter:b,loop:x,disablePointerSelection:E=!1,vimBindings:T=!0,...M}=r,N=Ln(),L=Ln(),C=Ln(),R=S.useRef(null),B=tN();Gi(()=>{if(m!==void 0){let k=m.trim();i.current.value=k,_.emit()}},[m]),Gi(()=>{B(6,j)},[]);let _=S.useMemo(()=>({subscribe:k=>(c.current.add(k),()=>c.current.delete(k)),snapshot:()=>i.current,setState:(k,V,Q)=>{var re,de,ge;if(!Object.is(i.current[k],V)){if(i.current[k]=V,k==="search")I(),F(),B(1,Y);else if(k==="value"&&(Q||B(5,j),((re=f.current)==null?void 0:re.value)!==void 0)){let le=V??"";(ge=(de=f.current).onValueChange)==null||ge.call(de,le);return}_.emit()}},emit:()=>{c.current.forEach(k=>k())}}),[]),$=S.useMemo(()=>({value:(k,V,Q)=>{var re;V!==((re=l.current.get(k))==null?void 0:re.value)&&(l.current.set(k,{value:V,keywords:Q}),i.current.filtered.items.set(k,z(V,Q)),B(2,()=>{F(),_.emit()}))},item:(k,V)=>(a.current.add(k),V&&(s.current.has(V)?s.current.get(V).add(k):s.current.set(V,new Set([k]))),B(3,()=>{I(),F(),i.current.value||Y(),_.emit()}),()=>{l.current.delete(k),a.current.delete(k),i.current.filtered.items.delete(k);let Q=J();B(4,()=>{I(),(Q==null?void 0:Q.getAttribute("id"))===k&&Y(),_.emit()})}),group:k=>(s.current.has(k)||s.current.set(k,new Set),()=>{l.current.delete(k),s.current.delete(k)}),filter:()=>f.current.shouldFilter,label:d||r["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:N,inputId:C,labelId:L,listInnerRef:R}),[]);function z(k,V){var Q,re;let de=(re=(Q=f.current)==null?void 0:Q.filter)!=null?re:qL;return k?de(k,i.current.search,V):0}function F(){if(!i.current.search||f.current.shouldFilter===!1)return;let k=i.current.filtered.items,V=[];i.current.filtered.groups.forEach(re=>{let de=s.current.get(re),ge=0;de.forEach(le=>{let xe=k.get(le);ge=Math.max(xe,ge)}),V.push([re,ge])});let Q=R.current;ae().sort((re,de)=>{var ge,le;let xe=re.getAttribute("id"),pe=de.getAttribute("id");return((ge=k.get(pe))!=null?ge:0)-((le=k.get(xe))!=null?le:0)}).forEach(re=>{let de=re.closest(Md);de?de.appendChild(re.parentElement===de?re:re.closest(`${Md} > *`)):Q.appendChild(re.parentElement===Q?re:re.closest(`${Md} > *`))}),V.sort((re,de)=>de[1]-re[1]).forEach(re=>{var de;let ge=(de=R.current)==null?void 0:de.querySelector(`${Wo}[${ki}="${encodeURIComponent(re[0])}"]`);ge==null||ge.parentElement.appendChild(ge)})}function Y(){let k=ae().find(Q=>Q.getAttribute("aria-disabled")!=="true"),V=k==null?void 0:k.getAttribute(ki);_.setState("value",V||void 0)}function I(){var k,V,Q,re;if(!i.current.search||f.current.shouldFilter===!1){i.current.filtered.count=a.current.size;return}i.current.filtered.groups=new Set;let de=0;for(let ge of a.current){let le=(V=(k=l.current.get(ge))==null?void 0:k.value)!=null?V:"",xe=(re=(Q=l.current.get(ge))==null?void 0:Q.keywords)!=null?re:[],pe=z(le,xe);i.current.filtered.items.set(ge,pe),pe>0&&de++}for(let[ge,le]of s.current)for(let xe of le)if(i.current.filtered.items.get(xe)>0){i.current.filtered.groups.add(ge);break}i.current.filtered.count=de}function j(){var k,V,Q;let re=J();re&&(((k=re.parentElement)==null?void 0:k.firstChild)===re&&((Q=(V=re.closest(Wo))==null?void 0:V.querySelector($L))==null||Q.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function J(){var k;return(k=R.current)==null?void 0:k.querySelector(`${ag}[aria-selected="true"]`)}function ae(){var k;return Array.from(((k=R.current)==null?void 0:k.querySelectorAll(qb))||[])}function H(k){let V=ae()[k];V&&_.setState("value",V.getAttribute(ki))}function U(k){var V;let Q=J(),re=ae(),de=re.findIndex(le=>le===Q),ge=re[de+k];(V=f.current)!=null&&V.loop&&(ge=de+k<0?re[re.length-1]:de+k===re.length?re[0]:re[de+k]),ge&&_.setState("value",ge.getAttribute(ki))}function D(k){let V=J(),Q=V==null?void 0:V.closest(Wo),re;for(;Q&&!re;)Q=k>0?JL(Q,Wo):eN(Q,Wo),re=Q==null?void 0:Q.querySelector(qb);re?_.setState("value",re.getAttribute(ki)):U(k)}let se=()=>H(ae().length-1),G=k=>{k.preventDefault(),k.metaKey?se():k.altKey?D(1):U(1)},P=k=>{k.preventDefault(),k.metaKey?H(0):k.altKey?D(-1):U(-1)};return S.createElement(Je.div,{ref:n,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:k=>{var V;if((V=M.onKeyDown)==null||V.call(M,k),!k.defaultPrevented)switch(k.key){case"n":case"j":{T&&k.ctrlKey&&G(k);break}case"ArrowDown":{G(k);break}case"p":case"k":{T&&k.ctrlKey&&P(k);break}case"ArrowUp":{P(k);break}case"Home":{k.preventDefault(),H(0);break}case"End":{k.preventDefault(),se();break}case"Enter":if(!k.nativeEvent.isComposing&&k.keyCode!==229){k.preventDefault();let Q=J();if(Q){let re=new Event(hh);Q.dispatchEvent(re)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:rN},d),Ru(r,k=>S.createElement(l1.Provider,{value:_},S.createElement(s1.Provider,{value:$},k))))}),VL=S.forwardRef((r,n)=>{var i,a;let s=Ln(),l=S.useRef(null),c=S.useContext(u1),f=hs(),d=f1(r),g=(a=(i=d.current)==null?void 0:i.forceMount)!=null?a:c==null?void 0:c.forceMount;Gi(()=>{if(!g)return f.item(s,c==null?void 0:c.id)},[g]);let m=d1(s,l,[r.value,r.children,l],r.keywords),v=og(),y=Mi(B=>B.value&&B.value===m.current),b=Mi(B=>g||f.filter()===!1?!0:B.search?B.filtered.items.get(s)>0:!0);S.useEffect(()=>{let B=l.current;if(!(!B||r.disabled))return B.addEventListener(hh,x),()=>B.removeEventListener(hh,x)},[b,r.onSelect,r.disabled]);function x(){var B,_;E(),(_=(B=d.current).onSelect)==null||_.call(B,m.current)}function E(){v.setState("value",m.current,!0)}if(!b)return null;let{disabled:T,value:M,onSelect:N,forceMount:L,keywords:C,...R}=r;return S.createElement(Je.div,{ref:ns([l,n]),...R,id:s,"cmdk-item":"",role:"option","aria-disabled":!!T,"aria-selected":!!y,"data-disabled":!!T,"data-selected":!!y,onPointerMove:T||f.getDisablePointerSelection()?void 0:E,onClick:T?void 0:x},r.children)}),IL=S.forwardRef((r,n)=>{let{heading:i,children:a,forceMount:s,...l}=r,c=Ln(),f=S.useRef(null),d=S.useRef(null),g=Ln(),m=hs(),v=Mi(b=>s||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Gi(()=>m.group(c),[]),d1(c,f,[r.value,r.heading,d]);let y=S.useMemo(()=>({id:c,forceMount:s}),[s]);return S.createElement(Je.div,{ref:ns([f,n]),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},i&&S.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:g},i),Ru(r,b=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?g:void 0},S.createElement(u1.Provider,{value:y},b))))}),YL=S.forwardRef((r,n)=>{let{alwaysRender:i,...a}=r,s=S.useRef(null),l=Mi(c=>!c.search);return!i&&!l?null:S.createElement(Je.div,{ref:ns([s,n]),...a,"cmdk-separator":"",role:"separator"})}),XL=S.forwardRef((r,n)=>{let{onValueChange:i,...a}=r,s=r.value!=null,l=og(),c=Mi(m=>m.search),f=Mi(m=>m.value),d=hs(),g=S.useMemo(()=>{var m;let v=(m=d.listInnerRef.current)==null?void 0:m.querySelector(`${ag}[${ki}="${encodeURIComponent(f)}"]`);return v==null?void 0:v.getAttribute("id")},[]);return S.useEffect(()=>{r.value!=null&&l.setState("search",r.value)},[r.value]),S.createElement(Je.input,{ref:n,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":g,id:d.inputId,type:"text",value:s?r.value:c,onChange:m=>{s||l.setState("search",m.target.value),i==null||i(m.target.value)}})}),ZL=S.forwardRef((r,n)=>{let{children:i,label:a="Suggestions",...s}=r,l=S.useRef(null),c=S.useRef(null),f=hs();return S.useEffect(()=>{if(c.current&&l.current){let d=c.current,g=l.current,m,v=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let y=d.offsetHeight;g.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return v.observe(d),()=>{cancelAnimationFrame(m),v.unobserve(d)}}},[]),S.createElement(Je.div,{ref:ns([l,n]),...s,"cmdk-list":"",role:"listbox","aria-label":a,id:f.listId},Ru(r,d=>S.createElement("div",{ref:ns([c,f.listInnerRef]),"cmdk-list-sizer":""},d)))}),WL=S.forwardRef((r,n)=>{let{open:i,onOpenChange:a,overlayClassName:s,contentClassName:l,container:c,...f}=r;return S.createElement(UL,{open:i,onOpenChange:a},S.createElement(i1,{container:c},S.createElement(rg,{"cmdk-overlay":"",className:s}),S.createElement(ig,{"aria-label":r.label,"cmdk-dialog":"",className:l},S.createElement(c1,{ref:n,...f}))))}),KL=S.forwardRef((r,n)=>Mi(i=>i.filtered.count===0)?S.createElement(Je.div,{ref:n,...r,"cmdk-empty":"",role:"presentation"}):null),QL=S.forwardRef((r,n)=>{let{progress:i,children:a,label:s="Loading...",...l}=r;return S.createElement(Je.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ru(r,c=>S.createElement("div",{"aria-hidden":!0},c)))}),Xt=Object.assign(c1,{List:ZL,Item:VL,Input:XL,Group:IL,Separator:YL,Dialog:WL,Empty:KL,Loading:QL});function JL(r,n){let i=r.nextElementSibling;for(;i;){if(i.matches(n))return i;i=i.nextElementSibling}}function eN(r,n){let i=r.previousElementSibling;for(;i;){if(i.matches(n))return i;i=i.previousElementSibling}}function f1(r){let n=S.useRef(r);return Gi(()=>{n.current=r}),n}var Gi=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Ca(r){let n=S.useRef();return n.current===void 0&&(n.current=r()),n}function ns(r){return n=>{r.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}function Mi(r){let n=og(),i=()=>r(n.snapshot());return PL.useSyncExternalStore(n.subscribe,i,i)}function d1(r,n,i,a=[]){let s=S.useRef(),l=hs();return Gi(()=>{var c;let f=(()=>{var g;for(let m of i){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(g=m.current.textContent)==null?void 0:g.trim():s.current}})(),d=a.map(g=>g.trim());l.value(r,f,d),(c=n.current)==null||c.setAttribute(ki,f),s.current=f}),s}var tN=()=>{let[r,n]=S.useState(),i=Ca(()=>new Map);return Gi(()=>{i.current.forEach(a=>a()),i.current=new Map},[r]),(a,s)=>{i.current.set(a,s),n({})}};function nN(r){let n=r.type;return typeof n=="function"?n(r.props):"render"in n?n.render(r.props):r}function Ru({asChild:r,children:n},i){return r&&S.isValidElement(n)?S.cloneElement(nN(n),{ref:n.ref},i(n.props.children)):i(n)}var rN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const iN=i1,h1=S.forwardRef(({className:r,...n},i)=>A.jsx(rg,{ref:i,className:Xe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",r),...n}));h1.displayName=rg.displayName;const aN=S.forwardRef(({className:r,children:n,...i},a)=>A.jsxs(iN,{children:[A.jsx(h1,{}),A.jsxs(ig,{ref:a,className:Xe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",r),...i,children:[n,A.jsxs(BL,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[A.jsx(KT,{className:"h-4 w-4"}),A.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));aN.displayName=ig.displayName;const oN=S.forwardRef(({className:r,...n},i)=>A.jsx(a1,{ref:i,className:Xe("text-lg leading-none font-semibold tracking-tight",r),...n}));oN.displayName=a1.displayName;const sN=S.forwardRef(({className:r,...n},i)=>A.jsx(o1,{ref:i,className:Xe("text-muted-foreground text-sm",r),...n}));sN.displayName=o1.displayName;const Du=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt,{ref:i,className:Xe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",r),...n}));Du.displayName=Xt.displayName;const sg=S.forwardRef(({className:r,...n},i)=>A.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[A.jsx(VT,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),A.jsx(Xt.Input,{ref:i,className:Xe("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",r),...n})]}));sg.displayName=Xt.Input.displayName;const Ou=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.List,{ref:i,className:Xe("max-h-[300px] overflow-x-hidden overflow-y-auto",r),...n}));Ou.displayName=Xt.List.displayName;const lg=S.forwardRef((r,n)=>A.jsx(Xt.Empty,{ref:n,className:"py-6 text-center text-sm",...r}));lg.displayName=Xt.Empty.displayName;const $a=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.Group,{ref:i,className:Xe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",r),...n}));$a.displayName=Xt.Group.displayName;const lN=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.Separator,{ref:i,className:Xe("bg-border -mx-1 h-px",r),...n}));lN.displayName=Xt.Separator.displayName;const qa=S.forwardRef(({className:r,...n},i)=>A.jsx(Xt.Item,{ref:i,className:Xe("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r),...n}));qa.displayName=Xt.Item.displayName;const uN=({layout:r,autoRunFor:n})=>{const i=Sn(),{stop:a,start:s,isRunning:l}=r;return S.useEffect(()=>{if(!i)return;let c=null;return n!==void 0&&n>-1&&i.getGraph().order>0&&(s(),c=n>0?window.setTimeout(()=>{a()},n):null),()=>{a(),c&&clearTimeout(c)}},[n,s,a,i]),A.jsx(an,{size:"icon",onClick:()=>l?a():s(),tooltip:l?"Stop the layout animation":"Start the layout animation",variant:qn,children:l?A.jsx(HT,{}):A.jsx($T,{})})},cN=()=>{const r=Sn(),[n,i]=S.useState("Circular"),[a,s]=S.useState(!1),l=Sk(),c=yk(),f=Jk(),d=Xk({settings:{margin:1}}),g=Dk({maxIterations:20}),m=AE({iterations:20}),v=Zk(),y=Ok(),b=Bk(),x=S.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:c},Random:{layout:f},Noverlaps:{layout:d,worker:v},"Force Directed":{layout:g,worker:y},"Force Atlas":{layout:m,worker:b}}),[c,l,g,m,d,f,y,v,b]),E=S.useCallback(T=>{console.debug(T);const{positions:M}=x[T].layout;jD(r.getGraph(),M(),{duration:500}),i(T)},[x,r]);return A.jsxs(A.Fragment,{children:[A.jsx("div",{children:x[n]&&"worker"in x[n]&&A.jsx(uN,{layout:x[n].worker})}),A.jsx("div",{children:A.jsxs(wu,{open:a,onOpenChange:s,children:[A.jsx(Eu,{asChild:!0,children:A.jsx(an,{size:"icon",variant:qn,onClick:()=>s(T=>!T),tooltip:"Layout Graph",children:A.jsx(LT,{})})}),A.jsx(ss,{side:"right",align:"center",className:"p-1",children:A.jsx(Du,{children:A.jsx(Ou,{children:A.jsx($a,{children:Object.keys(x).map(T=>A.jsx(qa,{onSelect:()=>{E(T)},className:"cursor-pointer text-xs",children:T},T))})})})})]})})]})};var Xl={exports:{}},fN=Xl.exports,Vb;function dN(){return Vb||(Vb=1,function(r){(function(n,i,a){function s(d){var g=this,m=f();g.next=function(){var v=2091639*g.s0+g.c*23283064365386963e-26;return g.s0=g.s1,g.s1=g.s2,g.s2=v-(g.c=v|0)},g.c=1,g.s0=m(" "),g.s1=m(" "),g.s2=m(" "),g.s0-=m(d),g.s0<0&&(g.s0+=1),g.s1-=m(d),g.s1<0&&(g.s1+=1),g.s2-=m(d),g.s2<0&&(g.s2+=1),m=null}function l(d,g){return g.c=d.c,g.s0=d.s0,g.s1=d.s1,g.s2=d.s2,g}function c(d,g){var m=new s(d),v=g&&g.state,y=m.next;return y.int32=function(){return m.next()*4294967296|0},y.double=function(){return y()+(y()*2097152|0)*11102230246251565e-32},y.quick=y,v&&(typeof v=="object"&&l(v,m),y.state=function(){return l(m,{})}),y}function f(){var d=4022871197,g=function(m){m=String(m);for(var v=0;v<m.length;v++){d+=m.charCodeAt(v);var y=.02519603282416938*d;d=y>>>0,y-=d,y*=d,d=y>>>0,y-=d,d+=y*4294967296}return(d>>>0)*23283064365386963e-26};return g}i&&i.exports?i.exports=c:this.alea=c})(fN,r)}(Xl)),Xl.exports}var Zl={exports:{}},hN=Zl.exports,Ib;function gN(){return Ib||(Ib=1,function(r){(function(n,i,a){function s(f){var d=this,g="";d.x=0,d.y=0,d.z=0,d.w=0,d.next=function(){var v=d.x^d.x<<11;return d.x=d.y,d.y=d.z,d.z=d.w,d.w^=d.w>>>19^v^v>>>8},f===(f|0)?d.x=f:g+=f;for(var m=0;m<g.length+64;m++)d.x^=g.charCodeAt(m)|0,d.next()}function l(f,d){return d.x=f.x,d.y=f.y,d.z=f.z,d.w=f.w,d}function c(f,d){var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(typeof m=="object"&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xor128=c})(hN,r)}(Zl)),Zl.exports}var Wl={exports:{}},pN=Wl.exports,Yb;function mN(){return Yb||(Yb=1,function(r){(function(n,i,a){function s(f){var d=this,g="";d.next=function(){var v=d.x^d.x>>>2;return d.x=d.y,d.y=d.z,d.z=d.w,d.w=d.v,(d.d=d.d+362437|0)+(d.v=d.v^d.v<<4^(v^v<<1))|0},d.x=0,d.y=0,d.z=0,d.w=0,d.v=0,f===(f|0)?d.x=f:g+=f;for(var m=0;m<g.length+64;m++)d.x^=g.charCodeAt(m)|0,m==g.length&&(d.d=d.x<<10^d.x>>>4),d.next()}function l(f,d){return d.x=f.x,d.y=f.y,d.z=f.z,d.w=f.w,d.v=f.v,d.d=f.d,d}function c(f,d){var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(typeof m=="object"&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xorwow=c})(pN,r)}(Wl)),Wl.exports}var Kl={exports:{}},vN=Kl.exports,Xb;function yN(){return Xb||(Xb=1,function(r){(function(n,i,a){function s(f){var d=this;d.next=function(){var m=d.x,v=d.i,y,b;return y=m[v],y^=y>>>7,b=y^y<<24,y=m[v+1&7],b^=y^y>>>10,y=m[v+3&7],b^=y^y>>>3,y=m[v+4&7],b^=y^y<<7,y=m[v+7&7],y=y^y<<13,b^=y^y<<9,m[v]=b,d.i=v+1&7,b};function g(m,v){var y,b=[];if(v===(v|0))b[0]=v;else for(v=""+v,y=0;y<v.length;++y)b[y&7]=b[y&7]<<15^v.charCodeAt(y)+b[y+1&7]<<13;for(;b.length<8;)b.push(0);for(y=0;y<8&&b[y]===0;++y);for(y==8?b[7]=-1:b[y],m.x=b,m.i=0,y=256;y>0;--y)m.next()}g(d,f)}function l(f,d){return d.x=f.x.slice(),d.i=f.i,d}function c(f,d){f==null&&(f=+new Date);var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(m.x&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xorshift7=c})(vN,r)}(Kl)),Kl.exports}var Ql={exports:{}},bN=Ql.exports,Zb;function wN(){return Zb||(Zb=1,function(r){(function(n,i,a){function s(f){var d=this;d.next=function(){var m=d.w,v=d.X,y=d.i,b,x;return d.w=m=m+1640531527|0,x=v[y+34&127],b=v[y=y+1&127],x^=x<<13,b^=b<<17,x^=x>>>15,b^=b>>>12,x=v[y]=x^b,d.i=y,x+(m^m>>>16)|0};function g(m,v){var y,b,x,E,T,M=[],N=128;for(v===(v|0)?(b=v,v=null):(v=v+"\0",b=0,N=Math.max(N,v.length)),x=0,E=-32;E<N;++E)v&&(b^=v.charCodeAt((E+32)%v.length)),E===0&&(T=b),b^=b<<10,b^=b>>>15,b^=b<<4,b^=b>>>13,E>=0&&(T=T+1640531527|0,y=M[E&127]^=b+T,x=y==0?x+1:0);for(x>=128&&(M[(v&&v.length||0)&127]=-1),x=127,E=4*128;E>0;--E)b=M[x+34&127],y=M[x=x+1&127],b^=b<<13,y^=y<<17,b^=b>>>15,y^=y>>>12,M[x]=b^y;m.w=T,m.X=M,m.i=x}g(d,f)}function l(f,d){return d.i=f.i,d.w=f.w,d.X=f.X.slice(),d}function c(f,d){f==null&&(f=+new Date);var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(m.X&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.xor4096=c})(bN,r)}(Ql)),Ql.exports}var Jl={exports:{}},EN=Jl.exports,Wb;function SN(){return Wb||(Wb=1,function(r){(function(n,i,a){function s(f){var d=this,g="";d.next=function(){var v=d.b,y=d.c,b=d.d,x=d.a;return v=v<<25^v>>>7^y,y=y-b|0,b=b<<24^b>>>8^x,x=x-v|0,d.b=v=v<<20^v>>>12^y,d.c=y=y-b|0,d.d=b<<16^y>>>16^x,d.a=x-v|0},d.a=0,d.b=0,d.c=-1640531527,d.d=1367130551,f===Math.floor(f)?(d.a=f/4294967296|0,d.b=f|0):g+=f;for(var m=0;m<g.length+20;m++)d.b^=g.charCodeAt(m)|0,d.next()}function l(f,d){return d.a=f.a,d.b=f.b,d.c=f.c,d.d=f.d,d}function c(f,d){var g=new s(f),m=d&&d.state,v=function(){return(g.next()>>>0)/4294967296};return v.double=function(){do var y=g.next()>>>11,b=(g.next()>>>0)/4294967296,x=(y+b)/(1<<21);while(x===0);return x},v.int32=g.next,v.quick=v,m&&(typeof m=="object"&&l(m,g),v.state=function(){return l(g,{})}),v}i&&i.exports?i.exports=c:this.tychei=c})(EN,r)}(Jl)),Jl.exports}var eu={exports:{}};const xN={},_N=Object.freeze(Object.defineProperty({__proto__:null,default:xN},Symbol.toStringTag,{value:"Module"})),TN=Kx(_N);var CN=eu.exports,Kb;function AN(){return Kb||(Kb=1,function(r){(function(n,i,a){var s=256,l=6,c=52,f="random",d=a.pow(s,l),g=a.pow(2,c),m=g*2,v=s-1,y;function b(C,R,B){var _=[];R=R==!0?{entropy:!0}:R||{};var $=M(T(R.entropy?[C,L(i)]:C??N(),3),_),z=new x(_),F=function(){for(var Y=z.g(l),I=d,j=0;Y<g;)Y=(Y+j)*s,I*=s,j=z.g(1);for(;Y>=m;)Y/=2,I/=2,j>>>=1;return(Y+j)/I};return F.int32=function(){return z.g(4)|0},F.quick=function(){return z.g(4)/4294967296},F.double=F,M(L(z.S),i),(R.pass||B||function(Y,I,j,J){return J&&(J.S&&E(J,z),Y.state=function(){return E(z,{})}),j?(a[f]=Y,I):Y})(F,$,"global"in R?R.global:this==a,R.state)}function x(C){var R,B=C.length,_=this,$=0,z=_.i=_.j=0,F=_.S=[];for(B||(C=[B++]);$<s;)F[$]=$++;for($=0;$<s;$++)F[$]=F[z=v&z+C[$%B]+(R=F[$])],F[z]=R;(_.g=function(Y){for(var I,j=0,J=_.i,ae=_.j,H=_.S;Y--;)I=H[J=v&J+1],j=j*s+H[v&(H[J]=H[ae=v&ae+I])+(H[ae]=I)];return _.i=J,_.j=ae,j})(s)}function E(C,R){return R.i=C.i,R.j=C.j,R.S=C.S.slice(),R}function T(C,R){var B=[],_=typeof C,$;if(R&&_=="object")for($ in C)try{B.push(T(C[$],R-1))}catch{}return B.length?B:_=="string"?C:C+"\0"}function M(C,R){for(var B=C+"",_,$=0;$<B.length;)R[v&$]=v&(_^=R[v&$]*19)+B.charCodeAt($++);return L(R)}function N(){try{var C;return y&&(C=y.randomBytes)?C=C(s):(C=new Uint8Array(s),(n.crypto||n.msCrypto).getRandomValues(C)),L(C)}catch{var R=n.navigator,B=R&&R.plugins;return[+new Date,n,B,n.screen,L(i)]}}function L(C){return String.fromCharCode.apply(0,C)}if(M(a.random(),i),r.exports){r.exports=b;try{y=TN}catch{}}else a["seed"+f]=b})(typeof self<"u"?self:CN,[],Math)}(eu)),eu.exports}var jd,Qb;function RN(){if(Qb)return jd;Qb=1;var r=dN(),n=gN(),i=mN(),a=yN(),s=wN(),l=SN(),c=AN();return c.alea=r,c.xor128=n,c.xorwow=i,c.xorshift7=a,c.xor4096=s,c.tychei=l,jd=c,jd}var DN=RN();const ON=on(DN),kN=r=>{if(!r||!Array.isArray(r.nodes)||!Array.isArray(r.edges))return!1;for(const n of r.nodes)if(!n.id||!n.labels||!n.properties)return!1;for(const n of r.edges)if(!n.id||!n.source||!n.target||!n.type||!n.properties)return!1;for(const n of r.edges){const i=r.getNode(n.source),a=r.getNode(n.target);if(i==null||a==null)return!1}return!0},LN=async r=>{let n=null;try{n=await vT(r)}catch(a){return kn.getState().setErrorMessage(y0(a),"Query Graphs Error!"),null}let i=null;if(n){const a={},s={};for(let d=0;d<n.nodes.length;d++){const g=n.nodes[d];a[g.id]=d,ON(g.id,{global:!0}),g.color=tT(),g.x=Math.random(),g.y=Math.random(),g.degree=0,g.size=10}for(let d=0;d<n.edges.length;d++){const g=n.edges[d];s[g.id]=d;const m=a[g.source],v=a[g.target];if(m!==void 0&&m!==void 0){const y=n.nodes[m],b=n.nodes[v];y.degree+=1,b.degree+=1}}let l=Number.MAX_SAFE_INTEGER,c=0;for(const d of n.nodes)l=Math.min(l,d.degree),c=Math.max(c,d.degree);const f=c-l;if(f>0){const d=cT-oy;for(const g of n.nodes)g.size=Math.round(oy+d*Math.pow((g.degree-l)/f,.5))}i=new ck,i.nodes=n.nodes,i.edges=n.edges,i.nodeIdMap=a,i.edgeIdMap=s,kN(i)||(i=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return i},NN=r=>{const n=new ts;for(const i of(r==null?void 0:r.nodes)??[])n.addNode(i.id,{label:i.labels.join(", "),color:i.color,x:i.x,y:i.y,size:i.size,borderColor:oT,borderSize:.2});for(const i of(r==null?void 0:r.edges)??[])i.dynamicId=n.addDirectedEdge(i.source,i.target,{label:i.type});return n},Jb={label:""},g1=()=>{const r=Pe.use.queryLabel(),n=Ye.use.rawGraph(),i=Ye.use.sigmaGraph(),a=S.useCallback(c=>(n==null?void 0:n.getNode(c))||null,[n]),s=S.useCallback((c,f=!0)=>(n==null?void 0:n.getEdge(c,f))||null,[n]);return S.useEffect(()=>{if(r){if(Jb.label!==r){Jb.label=r;const c=Ye.getState();c.reset(),LN(r).then(f=>{c.setSigmaGraph(NN(f)),f==null||f.buildDynamicMap(),c.setRawGraph(f)})}}else{const c=Ye.getState();c.reset(),c.setSigmaGraph(new ts)}},[r]),{lightrageGraph:S.useCallback(()=>{if(i)return i;const c=new ts;return Ye.getState().setSigmaGraph(c),c},[i]),getNode:a,getEdge:s}},p1=()=>{const r=S.useContext(b0);if(r===void 0)throw new Error("useTheme must be used within a ThemeProvider");return r},Bl=r=>!!(r.type.startsWith("mouse")&&r.buttons!==0),zN=({disableHoverEffect:r})=>{const{lightrageGraph:n}=g1(),i=Sn(),a=oE(),s=aE(),l=fO(),{assign:c}=AE({iterations:20}),{theme:f}=p1(),d=Pe.use.enableHideUnselectedEdges(),g=Ye.use.selectedNode(),m=Ye.use.focusedNode(),v=Ye.use.selectedEdge(),y=Ye.use.focusedEdge();return S.useEffect(()=>{const b=n();l(b),b.__force_applied||(c(),Object.assign(b,{__force_applied:!0}));const{setFocusedNode:x,setSelectedNode:E,setFocusedEdge:T,setSelectedEdge:M,clearSelection:N}=Ye.getState();a({enterNode:L=>{Bl(L.event.original)||x(L.node)},leaveNode:L=>{Bl(L.event.original)||x(null)},clickNode:L=>{E(L.node),M(null)},clickEdge:L=>{M(L.edge),E(null)},enterEdge:L=>{Bl(L.event.original)||T(L.edge)},leaveEdge:L=>{Bl(L.event.original)||T(null)},clickStage:()=>N()})},[c,l,a,n]),S.useEffect(()=>{const b=f==="dark",x=b?rT:void 0,E=b?lT:void 0;s({nodeReducer:(T,M)=>{const N=i.getGraph(),L={...M,highlighted:M.highlighted||!1,labelColor:x};if(!r){L.highlighted=!1;const C=m||g,R=y||v;if(C)(T===C||N.neighbors(C).includes(T))&&(L.highlighted=!0,T===g&&(L.borderColor=sT));else if(R)N.extremities(R).includes(T)&&(L.highlighted=!0,L.size=3);else return L;L.highlighted?b&&(L.labelColor=iT):L.color=aT}return L},edgeReducer:(T,M)=>{const N=i.getGraph(),L={...M,hidden:!1,labelColor:x,color:E};if(!r){const C=m||g;C?d?N.extremities(T).includes(C)||(L.hidden=!0):N.extremities(T).includes(C)&&(L.color=ay):(y||v)&&(T===v?L.color=uT:T===y?L.color=ay:d&&(L.hidden=!0))}return L}})},[g,m,v,y,s,i,r,f,d]),null};function GN(){const{theme:r,setTheme:n}=p1(),i=S.useCallback(()=>n("light"),[n]),a=S.useCallback(()=>n("dark"),[n]);return r==="dark"?A.jsx(an,{onClick:i,variant:qn,tooltip:"Switch to light theme",size:"icon",children:A.jsx(BT,{})}):A.jsx(an,{onClick:a,variant:qn,tooltip:"Switch to dark theme",size:"icon",children:A.jsx(ZT,{})})}const MN=()=>{const{zoomIn:r,zoomOut:n,reset:i}=sE({duration:200,factor:1.5}),a=S.useCallback(()=>r(),[r]),s=S.useCallback(()=>n(),[n]),l=S.useCallback(()=>i(),[i]);return A.jsxs(A.Fragment,{children:[A.jsx(an,{variant:qn,onClick:a,tooltip:"Zoom In",size:"icon",children:A.jsx(JT,{})}),A.jsx(an,{variant:qn,onClick:s,tooltip:"Zoom Out",size:"icon",children:A.jsx(tC,{})}),A.jsx(an,{variant:qn,onClick:l,tooltip:"Reset Zoom",size:"icon",children:A.jsx(OT,{})})]})},jN=()=>{const{isFullScreen:r,toggle:n}=dO();return A.jsx(A.Fragment,{children:r?A.jsx(an,{variant:qn,onClick:n,tooltip:"Windowed",size:"icon",children:A.jsx(jT,{})}):A.jsx(an,{variant:qn,onClick:n,tooltip:"Full Screen",size:"icon",children:A.jsx(GT,{})})})};function UN(r){const n=S.useRef({value:r,previous:r});return S.useMemo(()=>(n.current.value!==r&&(n.current.previous=n.current.value,n.current.value=r),n.current.previous),[r])}var ug="Checkbox",[BN,Lz]=rs(ug),[FN,HN]=BN(ug),m1=S.forwardRef((r,n)=>{const{__scopeCheckbox:i,name:a,checked:s,defaultChecked:l,required:c,disabled:f,value:d="on",onCheckedChange:g,form:m,...v}=r,[y,b]=S.useState(null),x=Vt(n,C=>b(C)),E=S.useRef(!1),T=y?m||!!y.closest("form"):!0,[M=!1,N]=yu({prop:s,defaultProp:l,onChange:g}),L=S.useRef(M);return S.useEffect(()=>{const C=y==null?void 0:y.form;if(C){const R=()=>N(L.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[y,N]),A.jsxs(FN,{scope:i,state:M,disabled:f,children:[A.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":Wr(M)?"mixed":M,"aria-required":c,"data-state":b1(M),"data-disabled":f?"":void 0,disabled:f,value:d,...v,ref:x,onKeyDown:ht(r.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:ht(r.onClick,C=>{N(R=>Wr(R)?!0:!R),T&&(E.current=C.isPropagationStopped(),E.current||C.stopPropagation())})}),T&&A.jsx(PN,{control:y,bubbles:!E.current,name:a,value:d,checked:M,required:c,disabled:f,form:m,style:{transform:"translateX(-100%)"},defaultChecked:Wr(l)?!1:l})]})});m1.displayName=ug;var v1="CheckboxIndicator",y1=S.forwardRef((r,n)=>{const{__scopeCheckbox:i,forceMount:a,...s}=r,l=HN(v1,i);return A.jsx(ni,{present:a||Wr(l.state)||l.state===!0,children:A.jsx(Je.span,{"data-state":b1(l.state),"data-disabled":l.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...r.style}})})});y1.displayName=v1;var PN=r=>{const{control:n,checked:i,bubbles:a=!0,defaultChecked:s,...l}=r,c=S.useRef(null),f=UN(i),d=q0(n);S.useEffect(()=>{const m=c.current,v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(f!==i&&b){const x=new Event("click",{bubbles:a});m.indeterminate=Wr(i),b.call(m,Wr(i)?!1:i),m.dispatchEvent(x)}},[f,i,a]);const g=S.useRef(Wr(i)?!1:i);return A.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??g.current,...l,tabIndex:-1,ref:c,style:{...r.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Wr(r){return r==="indeterminate"}function b1(r){return Wr(r)?"indeterminate":r?"checked":"unchecked"}var w1=m1,$N=y1;const E1=S.forwardRef(({className:r,...n},i)=>A.jsx(w1,{ref:i,className:Xe("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",r),...n,children:A.jsx($N,{className:Xe("flex items-center justify-center text-current"),children:A.jsx(T0,{className:"h-4 w-4"})})}));E1.displayName=w1.displayName;var qN="Separator",e0="horizontal",VN=["horizontal","vertical"],S1=S.forwardRef((r,n)=>{const{decorative:i,orientation:a=e0,...s}=r,l=IN(a)?a:e0,f=i?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return A.jsx(Je.div,{"data-orientation":l,...f,...s,ref:n})});S1.displayName=qN;function IN(r){return VN.includes(r)}var x1=S1;const Ko=S.forwardRef(({className:r,orientation:n="horizontal",decorative:i=!0,...a},s)=>A.jsx(x1,{ref:s,decorative:i,orientation:n,className:Xe("bg-border shrink-0",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",r),...a}));Ko.displayName=x1.displayName;const _1=S.forwardRef(({className:r,type:n,...i},a)=>A.jsx("input",{type:n,className:Xe("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:a,...i}));_1.displayName="Input";const Yr=({checked:r,onCheckedChange:n,label:i})=>A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx(E1,{checked:r,onCheckedChange:n}),A.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i})]});function YN(){const[r,n]=S.useState(!1),[i,a]=S.useState(""),s=Pe.use.showPropertyPanel(),l=Pe.use.showNodeSearchBar(),c=Pe.use.showNodeLabel(),f=Pe.use.enableEdgeEvents(),d=Pe.use.enableNodeDrag(),g=Pe.use.enableHideUnselectedEdges(),m=Pe.use.showEdgeLabel(),v=Pe.use.enableHealthCheck(),y=Pe.use.apiKey();S.useEffect(()=>{a(y||"")},[y,r]);const b=S.useCallback(()=>Pe.setState(_=>({enableNodeDrag:!_.enableNodeDrag})),[]),x=S.useCallback(()=>Pe.setState(_=>({enableEdgeEvents:!_.enableEdgeEvents})),[]),E=S.useCallback(()=>Pe.setState(_=>({enableHideUnselectedEdges:!_.enableHideUnselectedEdges})),[]),T=S.useCallback(()=>Pe.setState(_=>({showEdgeLabel:!_.showEdgeLabel})),[]),M=S.useCallback(()=>Pe.setState(_=>({showPropertyPanel:!_.showPropertyPanel})),[]),N=S.useCallback(()=>Pe.setState(_=>({showNodeSearchBar:!_.showNodeSearchBar})),[]),L=S.useCallback(()=>Pe.setState(_=>({showNodeLabel:!_.showNodeLabel})),[]),C=S.useCallback(()=>Pe.setState(_=>({enableHealthCheck:!_.enableHealthCheck})),[]),R=S.useCallback(async()=>{Pe.setState({apiKey:i||null}),await kn.getState().check(),n(!1)},[i]),B=S.useCallback(_=>{a(_.target.value)},[a]);return A.jsxs(wu,{open:r,onOpenChange:n,children:[A.jsx(Eu,{asChild:!0,children:A.jsx(an,{variant:qn,tooltip:"Settings",size:"icon",children:A.jsx(YT,{})})}),A.jsx(ss,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:_=>_.preventDefault(),children:A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx(Yr,{checked:s,onCheckedChange:M,label:"Show Property Panel"}),A.jsx(Yr,{checked:l,onCheckedChange:N,label:"Show Search Bar"}),A.jsx(Ko,{}),A.jsx(Yr,{checked:c,onCheckedChange:L,label:"Show Node Label"}),A.jsx(Yr,{checked:d,onCheckedChange:b,label:"Node Draggable"}),A.jsx(Ko,{}),A.jsx(Yr,{checked:m,onCheckedChange:T,label:"Show Edge Label"}),A.jsx(Yr,{checked:g,onCheckedChange:E,label:"Hide Unselected Edges"}),A.jsx(Yr,{checked:f,onCheckedChange:x,label:"Edge Events"}),A.jsx(Ko,{}),A.jsx(Yr,{checked:v,onCheckedChange:C,label:"Health Check"}),A.jsx(Ko,{}),A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("label",{className:"text-sm font-medium",children:"API Key"}),A.jsxs("form",{className:"flex h-6 gap-2",onSubmit:_=>_.preventDefault(),children:[A.jsx("div",{className:"w-0 flex-1",children:A.jsx(_1,{type:"password",value:i,onChange:B,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),A.jsx(an,{onClick:R,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function tu(r,n,i,a){function s(l){return l instanceof i?l:new i(function(c){c(l)})}return new(i||(i=Promise))(function(l,c){function f(m){try{g(a.next(m))}catch(v){c(v)}}function d(m){try{g(a.throw(m))}catch(v){c(v)}}function g(m){m.done?l(m.value):s(m.value).then(f,d)}g((a=a.apply(r,[])).next())})}const XN="ENTRIES",T1="KEYS",C1="VALUES",Lt="";class Ud{constructor(n,i){const a=n._tree,s=Array.from(a.keys());this.set=n,this._type=i,this._path=s.length>0?[{node:a,keys:s}]:[]}next(){const n=this.dive();return this.backtrack(),n}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:n,keys:i}=_a(this._path);if(_a(i)===Lt)return{done:!1,value:this.result()};const a=n.get(_a(i));return this._path.push({node:a,keys:Array.from(a.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const n=_a(this._path).keys;n.pop(),!(n.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:n})=>_a(n)).filter(n=>n!==Lt).join("")}value(){return _a(this._path).node.get(Lt)}result(){switch(this._type){case C1:return this.value();case T1:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const _a=r=>r[r.length-1],ZN=(r,n,i)=>{const a=new Map;if(n===void 0)return a;const s=n.length+1,l=s+i,c=new Uint8Array(l*s).fill(i+1);for(let f=0;f<s;++f)c[f]=f;for(let f=1;f<l;++f)c[f*s]=f;return A1(r,n,i,a,c,1,s,""),a},A1=(r,n,i,a,s,l,c,f)=>{const d=l*c;e:for(const g of r.keys())if(g===Lt){const m=s[d-1];m<=i&&a.set(f,[r.get(g),m])}else{let m=l;for(let v=0;v<g.length;++v,++m){const y=g[v],b=c*m,x=b-c;let E=s[b];const T=Math.max(0,m-i-1),M=Math.min(c-1,m+i);for(let N=T;N<M;++N){const L=y!==n[N],C=s[x+N]+ +L,R=s[x+N+1]+1,B=s[b+N]+1,_=s[b+N+1]=Math.min(C,R,B);_<E&&(E=_)}if(E>i)continue e}A1(r.get(g),n,i,a,s,m,c,f+g)}};class Zr{constructor(n=new Map,i=""){this._size=void 0,this._tree=n,this._prefix=i}atPrefix(n){if(!n.startsWith(this._prefix))throw new Error("Mismatched prefix");const[i,a]=fu(this._tree,n.slice(this._prefix.length));if(i===void 0){const[s,l]=cg(a);for(const c of s.keys())if(c!==Lt&&c.startsWith(l)){const f=new Map;return f.set(c.slice(l.length),s.get(c)),new Zr(f,n)}}return new Zr(i,n)}clear(){this._size=void 0,this._tree.clear()}delete(n){return this._size=void 0,WN(this._tree,n)}entries(){return new Ud(this,XN)}forEach(n){for(const[i,a]of this)n(i,a,this)}fuzzyGet(n,i){return ZN(this._tree,n,i)}get(n){const i=gh(this._tree,n);return i!==void 0?i.get(Lt):void 0}has(n){const i=gh(this._tree,n);return i!==void 0&&i.has(Lt)}keys(){return new Ud(this,T1)}set(n,i){if(typeof n!="string")throw new Error("key must be a string");return this._size=void 0,Bd(this._tree,n).set(Lt,i),this}get size(){if(this._size)return this._size;this._size=0;const n=this.entries();for(;!n.next().done;)this._size+=1;return this._size}update(n,i){if(typeof n!="string")throw new Error("key must be a string");this._size=void 0;const a=Bd(this._tree,n);return a.set(Lt,i(a.get(Lt))),this}fetch(n,i){if(typeof n!="string")throw new Error("key must be a string");this._size=void 0;const a=Bd(this._tree,n);let s=a.get(Lt);return s===void 0&&a.set(Lt,s=i()),s}values(){return new Ud(this,C1)}[Symbol.iterator](){return this.entries()}static from(n){const i=new Zr;for(const[a,s]of n)i.set(a,s);return i}static fromObject(n){return Zr.from(Object.entries(n))}}const fu=(r,n,i=[])=>{if(n.length===0||r==null)return[r,i];for(const a of r.keys())if(a!==Lt&&n.startsWith(a))return i.push([r,a]),fu(r.get(a),n.slice(a.length),i);return i.push([r,n]),fu(void 0,"",i)},gh=(r,n)=>{if(n.length===0||r==null)return r;for(const i of r.keys())if(i!==Lt&&n.startsWith(i))return gh(r.get(i),n.slice(i.length))},Bd=(r,n)=>{const i=n.length;e:for(let a=0;r&&a<i;){for(const l of r.keys())if(l!==Lt&&n[a]===l[0]){const c=Math.min(i-a,l.length);let f=1;for(;f<c&&n[a+f]===l[f];)++f;const d=r.get(l);if(f===l.length)r=d;else{const g=new Map;g.set(l.slice(f),d),r.set(n.slice(a,a+f),g),r.delete(l),r=g}a+=f;continue e}const s=new Map;return r.set(n.slice(a),s),s}return r},WN=(r,n)=>{const[i,a]=fu(r,n);if(i!==void 0){if(i.delete(Lt),i.size===0)R1(a);else if(i.size===1){const[s,l]=i.entries().next().value;D1(a,s,l)}}},R1=r=>{if(r.length===0)return;const[n,i]=cg(r);if(n.delete(i),n.size===0)R1(r.slice(0,-1));else if(n.size===1){const[a,s]=n.entries().next().value;a!==Lt&&D1(r.slice(0,-1),a,s)}},D1=(r,n,i)=>{if(r.length===0)return;const[a,s]=cg(r);a.set(s+n,i),a.delete(s)},cg=r=>r[r.length-1],fg="or",O1="and",KN="and_not";class Kr{constructor(n){if((n==null?void 0:n.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const i=n.autoVacuum==null||n.autoVacuum===!0?Pd:n.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Hd),n),{autoVacuum:i,searchOptions:Object.assign(Object.assign({},t0),n.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},nz),n.autoSuggestOptions||{})}),this._index=new Zr,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=mh,this.addFields(this._options.fields)}add(n){const{extractField:i,tokenize:a,processTerm:s,fields:l,idField:c}=this._options,f=i(n,c);if(f==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);if(this._idToShortId.has(f))throw new Error(`MiniSearch: duplicate ID ${f}`);const d=this.addDocumentId(f);this.saveStoredFields(d,n);for(const g of l){const m=i(n,g);if(m==null)continue;const v=a(m.toString(),g),y=this._fieldIds[g],b=new Set(v).size;this.addFieldLength(d,y,this._documentCount-1,b);for(const x of v){const E=s(x,g);if(Array.isArray(E))for(const T of E)this.addTerm(y,d,T);else E&&this.addTerm(y,d,E)}}}addAll(n){for(const i of n)this.add(i)}addAllAsync(n,i={}){const{chunkSize:a=10}=i,s={chunk:[],promise:Promise.resolve()},{chunk:l,promise:c}=n.reduce(({chunk:f,promise:d},g,m)=>(f.push(g),(m+1)%a===0?{chunk:[],promise:d.then(()=>new Promise(v=>setTimeout(v,0))).then(()=>this.addAll(f))}:{chunk:f,promise:d}),s);return c.then(()=>this.addAll(l))}remove(n){const{tokenize:i,processTerm:a,extractField:s,fields:l,idField:c}=this._options,f=s(n,c);if(f==null)throw new Error(`MiniSearch: document does not have ID field "${c}"`);const d=this._idToShortId.get(f);if(d==null)throw new Error(`MiniSearch: cannot remove document with ID ${f}: it is not in the index`);for(const g of l){const m=s(n,g);if(m==null)continue;const v=i(m.toString(),g),y=this._fieldIds[g],b=new Set(v).size;this.removeFieldLength(d,y,this._documentCount,b);for(const x of v){const E=a(x,g);if(Array.isArray(E))for(const T of E)this.removeTerm(y,d,T);else E&&this.removeTerm(y,d,E)}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(f),this._fieldLength.delete(d),this._documentCount-=1}removeAll(n){if(n)for(const i of n)this.remove(i);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Zr,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(n){const i=this._idToShortId.get(n);if(i==null)throw new Error(`MiniSearch: cannot discard document with ID ${n}: it is not in the index`);this._idToShortId.delete(n),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach((a,s)=>{this.removeFieldLength(i,s,this._documentCount,a)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:n,minDirtCount:i,batchSize:a,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:a,batchWait:s},{minDirtCount:i,minDirtFactor:n})}discardAll(n){const i=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const a of n)this.discard(a)}finally{this._options.autoVacuum=i}this.maybeAutoVacuum()}replace(n){const{idField:i,extractField:a}=this._options,s=a(n,i);this.discard(s),this.add(n)}vacuum(n={}){return this.conditionalVacuum(n)}conditionalVacuum(n,i){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&i,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const a=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=mh,this.performVacuuming(n,a)}),this._enqueuedVacuum)):this.vacuumConditionsMet(i)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(n),this._currentVacuum)}performVacuuming(n,i){return tu(this,void 0,void 0,function*(){const a=this._dirtCount;if(this.vacuumConditionsMet(i)){const s=n.batchSize||ph.batchSize,l=n.batchWait||ph.batchWait;let c=1;for(const[f,d]of this._index){for(const[g,m]of d)for(const[v]of m)this._documentIds.has(v)||(m.size<=1?d.delete(g):m.delete(v));this._index.get(f).size===0&&this._index.delete(f),c%s===0&&(yield new Promise(g=>setTimeout(g,l))),c+=1}this._dirtCount-=a}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(n){if(n==null)return!0;let{minDirtCount:i,minDirtFactor:a}=n;return i=i||Pd.minDirtCount,a=a||Pd.minDirtFactor,this.dirtCount>=i&&this.dirtFactor>=a}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(n){return this._idToShortId.has(n)}getStoredFields(n){const i=this._idToShortId.get(n);if(i!=null)return this._storedFields.get(i)}search(n,i={}){const{searchOptions:a}=this._options,s=Object.assign(Object.assign({},a),i),l=this.executeQuery(n,i),c=[];for(const[f,{score:d,terms:g,match:m}]of l){const v=g.length||1,y={id:this._documentIds.get(f),score:d*v,terms:Object.keys(m),queryTerms:g,match:m};Object.assign(y,this._storedFields.get(f)),(s.filter==null||s.filter(y))&&c.push(y)}return n===Kr.wildcard&&s.boostDocument==null||c.sort(r0),c}autoSuggest(n,i={}){i=Object.assign(Object.assign({},this._options.autoSuggestOptions),i);const a=new Map;for(const{score:l,terms:c}of this.search(n,i)){const f=c.join(" "),d=a.get(f);d!=null?(d.score+=l,d.count+=1):a.set(f,{score:l,terms:c,count:1})}const s=[];for(const[l,{score:c,terms:f,count:d}]of a)s.push({suggestion:l,terms:f,score:c/d});return s.sort(r0),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(n,i){if(i==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(n),i)}static loadJSONAsync(n,i){return tu(this,void 0,void 0,function*(){if(i==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(n),i)})}static getDefault(n){if(Hd.hasOwnProperty(n))return Fd(Hd,n);throw new Error(`MiniSearch: unknown option "${n}"`)}static loadJS(n,i){const{index:a,documentIds:s,fieldLength:l,storedFields:c,serializationVersion:f}=n,d=this.instantiateMiniSearch(n,i);d._documentIds=Fl(s),d._fieldLength=Fl(l),d._storedFields=Fl(c);for(const[g,m]of d._documentIds)d._idToShortId.set(m,g);for(const[g,m]of a){const v=new Map;for(const y of Object.keys(m)){let b=m[y];f===1&&(b=b.ds),v.set(parseInt(y,10),Fl(b))}d._index.set(g,v)}return d}static loadJSAsync(n,i){return tu(this,void 0,void 0,function*(){const{index:a,documentIds:s,fieldLength:l,storedFields:c,serializationVersion:f}=n,d=this.instantiateMiniSearch(n,i);d._documentIds=yield Hl(s),d._fieldLength=yield Hl(l),d._storedFields=yield Hl(c);for(const[m,v]of d._documentIds)d._idToShortId.set(v,m);let g=0;for(const[m,v]of a){const y=new Map;for(const b of Object.keys(v)){let x=v[b];f===1&&(x=x.ds),y.set(parseInt(b,10),yield Hl(x))}++g%1e3===0&&(yield k1(0)),d._index.set(m,y)}return d})}static instantiateMiniSearch(n,i){const{documentCount:a,nextId:s,fieldIds:l,averageFieldLength:c,dirtCount:f,serializationVersion:d}=n;if(d!==1&&d!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const g=new Kr(i);return g._documentCount=a,g._nextId=s,g._idToShortId=new Map,g._fieldIds=l,g._avgFieldLength=c,g._dirtCount=f||0,g._index=new Zr,g}executeQuery(n,i={}){if(n===Kr.wildcard)return this.executeWildcardQuery(i);if(typeof n!="string"){const y=Object.assign(Object.assign(Object.assign({},i),n),{queries:void 0}),b=n.queries.map(x=>this.executeQuery(x,y));return this.combineResults(b,y.combineWith)}const{tokenize:a,processTerm:s,searchOptions:l}=this._options,c=Object.assign(Object.assign({tokenize:a,processTerm:s},l),i),{tokenize:f,processTerm:d}=c,v=f(n).flatMap(y=>d(y)).filter(y=>!!y).map(tz(c)).map(y=>this.executeQuerySpec(y,c));return this.combineResults(v,c.combineWith)}executeQuerySpec(n,i){const a=Object.assign(Object.assign({},this._options.searchOptions),i),s=(a.fields||this._options.fields).reduce((E,T)=>Object.assign(Object.assign({},E),{[T]:Fd(a.boost,T)||1}),{}),{boostDocument:l,weights:c,maxFuzzy:f,bm25:d}=a,{fuzzy:g,prefix:m}=Object.assign(Object.assign({},t0.weights),c),v=this._index.get(n.term),y=this.termResults(n.term,n.term,1,n.termBoost,v,s,l,d);let b,x;if(n.prefix&&(b=this._index.atPrefix(n.term)),n.fuzzy){const E=n.fuzzy===!0?.2:n.fuzzy,T=E<1?Math.min(f,Math.round(n.term.length*E)):E;T&&(x=this._index.fuzzyGet(n.term,T))}if(b)for(const[E,T]of b){const M=E.length-n.term.length;if(!M)continue;x==null||x.delete(E);const N=m*E.length/(E.length+.3*M);this.termResults(n.term,E,N,n.termBoost,T,s,l,d,y)}if(x)for(const E of x.keys()){const[T,M]=x.get(E);if(!M)continue;const N=g*E.length/(E.length+M);this.termResults(n.term,E,N,n.termBoost,T,s,l,d,y)}return y}executeWildcardQuery(n){const i=new Map,a=Object.assign(Object.assign({},this._options.searchOptions),n);for(const[s,l]of this._documentIds){const c=a.boostDocument?a.boostDocument(l,"",this._storedFields.get(s)):1;i.set(s,{score:c,terms:[],match:{}})}return i}combineResults(n,i=fg){if(n.length===0)return new Map;const a=i.toLowerCase(),s=QN[a];if(!s)throw new Error(`Invalid combination operator: ${i}`);return n.reduce(s)||new Map}toJSON(){const n=[];for(const[i,a]of this._index){const s={};for(const[l,c]of a)s[l]=Object.fromEntries(c);n.push([i,s])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:n,serializationVersion:2}}termResults(n,i,a,s,l,c,f,d,g=new Map){if(l==null)return g;for(const m of Object.keys(c)){const v=c[m],y=this._fieldIds[m],b=l.get(y);if(b==null)continue;let x=b.size;const E=this._avgFieldLength[y];for(const T of b.keys()){if(!this._documentIds.has(T)){this.removeTerm(y,T,i),x-=1;continue}const M=f?f(this._documentIds.get(T),i,this._storedFields.get(T)):1;if(!M)continue;const N=b.get(T),L=this._fieldLength.get(T)[y],C=ez(N,x,this._documentCount,L,E,d),R=a*s*v*M*C,B=g.get(T);if(B){B.score+=R,rz(B.terms,n);const _=Fd(B.match,i);_?_.push(m):B.match[i]=[m]}else g.set(T,{score:R,terms:[n],match:{[i]:[m]}})}}return g}addTerm(n,i,a){const s=this._index.fetch(a,i0);let l=s.get(n);if(l==null)l=new Map,l.set(i,1),s.set(n,l);else{const c=l.get(i);l.set(i,(c||0)+1)}}removeTerm(n,i,a){if(!this._index.has(a)){this.warnDocumentChanged(i,n,a);return}const s=this._index.fetch(a,i0),l=s.get(n);l==null||l.get(i)==null?this.warnDocumentChanged(i,n,a):l.get(i)<=1?l.size<=1?s.delete(n):l.delete(i):l.set(i,l.get(i)-1),this._index.get(a).size===0&&this._index.delete(a)}warnDocumentChanged(n,i,a){for(const s of Object.keys(this._fieldIds))if(this._fieldIds[s]===i){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(n)} has changed before removal: term "${a}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(n){const i=this._nextId;return this._idToShortId.set(n,i),this._documentIds.set(i,n),this._documentCount+=1,this._nextId+=1,i}addFields(n){for(let i=0;i<n.length;i++)this._fieldIds[n[i]]=i}addFieldLength(n,i,a,s){let l=this._fieldLength.get(n);l==null&&this._fieldLength.set(n,l=[]),l[i]=s;const f=(this._avgFieldLength[i]||0)*a+s;this._avgFieldLength[i]=f/(a+1)}removeFieldLength(n,i,a,s){if(a===1){this._avgFieldLength[i]=0;return}const l=this._avgFieldLength[i]*a-s;this._avgFieldLength[i]=l/(a-1)}saveStoredFields(n,i){const{storeFields:a,extractField:s}=this._options;if(a==null||a.length===0)return;let l=this._storedFields.get(n);l==null&&this._storedFields.set(n,l={});for(const c of a){const f=s(i,c);f!==void 0&&(l[c]=f)}}}Kr.wildcard=Symbol("*");const Fd=(r,n)=>Object.prototype.hasOwnProperty.call(r,n)?r[n]:void 0,QN={[fg]:(r,n)=>{for(const i of n.keys()){const a=r.get(i);if(a==null)r.set(i,n.get(i));else{const{score:s,terms:l,match:c}=n.get(i);a.score=a.score+s,a.match=Object.assign(a.match,c),n0(a.terms,l)}}return r},[O1]:(r,n)=>{const i=new Map;for(const a of n.keys()){const s=r.get(a);if(s==null)continue;const{score:l,terms:c,match:f}=n.get(a);n0(s.terms,c),i.set(a,{score:s.score+l,terms:s.terms,match:Object.assign(s.match,f)})}return i},[KN]:(r,n)=>{for(const i of n.keys())r.delete(i);return r}},JN={k:1.2,b:.7,d:.5},ez=(r,n,i,a,s,l)=>{const{k:c,b:f,d}=l;return Math.log(1+(i-n+.5)/(n+.5))*(d+r*(c+1)/(r+c*(1-f+f*a/s)))},tz=r=>(n,i,a)=>{const s=typeof r.fuzzy=="function"?r.fuzzy(n,i,a):r.fuzzy||!1,l=typeof r.prefix=="function"?r.prefix(n,i,a):r.prefix===!0,c=typeof r.boostTerm=="function"?r.boostTerm(n,i,a):1;return{term:n,fuzzy:s,prefix:l,termBoost:c}},Hd={idField:"id",extractField:(r,n)=>r[n],tokenize:r=>r.split(iz),processTerm:r=>r.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(r,n)=>{typeof(console==null?void 0:console[r])=="function"&&console[r](n)},autoVacuum:!0},t0={combineWith:fg,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:JN},nz={combineWith:O1,prefix:(r,n,i)=>n===i.length-1},ph={batchSize:1e3,batchWait:10},mh={minDirtFactor:.1,minDirtCount:20},Pd=Object.assign(Object.assign({},ph),mh),rz=(r,n)=>{r.includes(n)||r.push(n)},n0=(r,n)=>{for(const i of n)r.includes(i)||r.push(i)},r0=({score:r},{score:n})=>n-r,i0=()=>new Map,Fl=r=>{const n=new Map;for(const i of Object.keys(r))n.set(parseInt(i,10),r[i]);return n},Hl=r=>tu(void 0,void 0,void 0,function*(){const n=new Map;let i=0;for(const a of Object.keys(r))n.set(parseInt(a,10),r[a]),++i%1e3===0&&(yield k1(0));return n}),k1=r=>new Promise(n=>setTimeout(n,r)),iz=/[\n\r\p{Z}\p{P}]+/u,az={index:new Kr({fields:[]})};S.createContext(az);const vh=({label:r,color:n,hidden:i,labels:a={}})=>bt.createElement("div",{className:"node"},bt.createElement("span",{className:"render "+(i?"circle":"disc"),style:{backgroundColor:n||"#000"}}),bt.createElement("span",{className:`label ${i?"text-muted":""} ${r?"":"text-italic"}`},r||a.no_label||"No label")),oz=({id:r,labels:n})=>{const i=Sn(),a=S.useMemo(()=>{const s=i.getGraph().getNodeAttributes(r),l=i.getSetting("nodeReducer");return Object.assign(Object.assign({color:i.getSetting("defaultNodeColor")},s),l?l(r,s):{})},[i,r]);return bt.createElement(vh,Object.assign({},a,{labels:n}))},sz=({label:r,color:n,source:i,target:a,hidden:s,directed:l,labels:c={}})=>bt.createElement("div",{className:"edge"},bt.createElement(vh,Object.assign({},i,{labels:c})),bt.createElement("div",{className:"body"},bt.createElement("div",{className:"render"},bt.createElement("span",{className:s?"dotted":"dash",style:{borderColor:n||"#000"}})," ",l&&bt.createElement("span",{className:"arrow",style:{borderTopColor:n||"#000"}})),bt.createElement("span",{className:`label ${s?"text-muted":""} ${r?"":"fst-italic"}`},r||c.no_label||"No label")),bt.createElement(vh,Object.assign({},a,{labels:c}))),lz=({id:r,labels:n})=>{const i=Sn(),a=S.useMemo(()=>{const s=i.getGraph().getEdgeAttributes(r),l=i.getSetting("nodeReducer"),c=i.getSetting("edgeReducer"),f=i.getGraph().getNodeAttributes(i.getGraph().source(r)),d=i.getGraph().getNodeAttributes(i.getGraph().target(r));return Object.assign(Object.assign(Object.assign({color:i.getSetting("defaultEdgeColor"),directed:i.getGraph().isDirected(r)},s),c?c(r,s):{}),{source:Object.assign(Object.assign({color:i.getSetting("defaultNodeColor")},f),l?l(r,f):{}),target:Object.assign(Object.assign({color:i.getSetting("defaultNodeColor")},d),l?l(r,d):{})})},[i,r]);return bt.createElement(sz,Object.assign({},a,{labels:n}))};function L1(r,n){const[i,a]=S.useState(r);return S.useEffect(()=>{const s=setTimeout(()=>{a(r)},n);return()=>{clearTimeout(s)}},[r,n]),i}function uz({fetcher:r,preload:n,filterFn:i,renderOption:a,getOptionValue:s,notFound:l,loadingSkeleton:c,label:f,placeholder:d="Select...",value:g,onChange:m,onFocus:v,disabled:y=!1,className:b,noResultsMessage:x}){const[E,T]=S.useState(!1),[M,N]=S.useState(!1),[L,C]=S.useState([]),[R,B]=S.useState(!1),[_,$]=S.useState(null),[z,F]=S.useState(g),[Y,I]=S.useState(null),[j,J]=S.useState(""),ae=L1(j,n?0:150),[H,U]=S.useState([]);S.useEffect(()=>{T(!0),F(g)},[g]),S.useEffect(()=>{E||(async()=>{try{B(!0),$(null);const P=g!==null?await r(g):[];U(P),C(P)}catch(P){$(P instanceof Error?P.message:"Failed to fetch options")}finally{B(!1)}})()},[E,r,g]),S.useEffect(()=>{const G=async()=>{try{B(!0),$(null);const P=await r(ae);U(P),C(P)}catch(P){$(P instanceof Error?P.message:"Failed to fetch options")}finally{B(!1)}};E&&n?n&&C(ae?H.filter(P=>i?i(P,ae):!0):H):G()},[r,ae,E,n,i]);const D=S.useCallback(G=>{G!==z&&(F(G),m(G)),N(!1)},[z,F,N,m]),se=S.useCallback(G=>{G!==Y&&(I(G),v(G))},[Y,I,v]);return A.jsx("div",{className:Xe(y&&"cursor-not-allowed opacity-50",b),onFocus:()=>{N(!0)},onBlur:()=>N(!1),children:A.jsxs(Du,{shouldFilter:!1,className:"bg-transparent",children:[A.jsxs("div",{children:[A.jsx(sg,{placeholder:d,value:j,className:"max-h-8",onValueChange:G=>{J(G),G&&!M&&N(!0)}}),R&&L.length>0&&A.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:A.jsx(C0,{className:"h-4 w-4 animate-spin"})})]}),A.jsxs(Ou,{className:"max-h-auto",hidden:!M||ae.length===0,children:[_&&A.jsx("div",{className:"text-destructive p-4 text-center",children:_}),R&&L.length===0&&(c||A.jsx(cz,{})),!R&&!_&&L.length===0&&(l||A.jsx(lg,{children:x??`No ${f.toLowerCase()} found.`})),A.jsx($a,{children:L.map((G,P)=>A.jsxs(A.Fragment,{children:[A.jsx(qa,{value:s(G),onSelect:D,onMouseEnter:()=>se(s(G)),className:"truncate",children:a(G)},s(G)+`${P}`),P!==L.length-1&&A.jsx("div",{className:"bg-foreground/10 h-[1px]"},P)]}))})]})]})})}function cz(){return A.jsx($a,{children:A.jsx(qa,{disabled:!0,children:A.jsxs("div",{className:"flex w-full items-center gap-2",children:[A.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),A.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[A.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),A.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function fz(r){return A.jsxs("div",{children:[r.type==="nodes"&&A.jsx(oz,{id:r.id}),r.type==="edges"&&A.jsx(lz,{id:r.id}),r.type==="message"&&A.jsx("div",{children:r.message})]})}const $d="__message_item",Pl={graph:null,searchEngine:null},dz=({onChange:r,onFocus:n,value:i})=>{const a=Ye.use.sigmaGraph(),s=S.useMemo(()=>{if(Pl.graph==a)return Pl.searchEngine;if(!a||a.nodes().length==0)return;Pl.graph=a;const c=new Kr({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),f=a.nodes().map(d=>({id:d,label:a.getNodeAttribute(d,"label")}));return c.addAll(f),Pl.searchEngine=c,c},[a]),l=S.useCallback(async c=>{if(n&&n(null),!c||!s)return[];const f=s.search(c).map(d=>({id:d.id,type:"nodes"}));return f.length<=qf?f:[...f.slice(0,qf),{type:"message",id:$d,message:`And ${f.length-qf} others`}]},[s,n]);return A.jsx(uz,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:l,renderOption:fz,getOptionValue:c=>c.id,value:i&&i.type!=="message"?i.id:null,onChange:c=>{c!==$d&&r(c?{id:c,type:"nodes"}:null)},onFocus:c=>{c!==$d&&n&&n(c?{id:c,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},hz=({...r})=>A.jsx(dz,{...r});function gz({fetcher:r,preload:n,filterFn:i,renderOption:a,getOptionValue:s,getDisplayValue:l,notFound:c,loadingSkeleton:f,label:d,placeholder:g="Select...",value:m,onChange:v,disabled:y=!1,className:b,triggerClassName:x,searchInputClassName:E,noResultsMessage:T,triggerTooltip:M,clearable:N=!0}){const[L,C]=S.useState(!1),[R,B]=S.useState(!1),[_,$]=S.useState([]),[z,F]=S.useState(!1),[Y,I]=S.useState(null),[j,J]=S.useState(m),[ae,H]=S.useState(null),[U,D]=S.useState(""),se=L1(U,n?0:150),[G,P]=S.useState([]);S.useEffect(()=>{C(!0),J(m)},[m]),S.useEffect(()=>{if(m&&_.length>0){const V=_.find(Q=>s(Q)===m);V&&H(V)}},[m,_,s]),S.useEffect(()=>{L||(async()=>{try{F(!0),I(null);const Q=await r(m);P(Q),$(Q)}catch(Q){I(Q instanceof Error?Q.message:"Failed to fetch options")}finally{F(!1)}})()},[L,r,m]),S.useEffect(()=>{const V=async()=>{try{F(!0),I(null);const Q=await r(se);P(Q),$(Q)}catch(Q){I(Q instanceof Error?Q.message:"Failed to fetch options")}finally{F(!1)}};L&&n?n&&$(se?G.filter(Q=>i?i(Q,se):!0):G):V()},[r,se,L,n,i]);const k=S.useCallback(V=>{const Q=N&&V===j?"":V;J(Q),H(_.find(re=>s(re)===Q)||null),v(Q),B(!1)},[j,v,N,_,s]);return A.jsxs(wu,{open:R,onOpenChange:B,children:[A.jsx(Eu,{asChild:!0,children:A.jsxs(an,{variant:"outline",role:"combobox","aria-expanded":R,className:Xe("justify-between",y&&"cursor-not-allowed opacity-50",x),disabled:y,tooltip:M,side:"bottom",children:[ae?l(ae):g,A.jsx(CT,{className:"opacity-50",size:10})]})}),A.jsx(ss,{className:Xe("p-0",b),onCloseAutoFocus:V=>V.preventDefault(),children:A.jsxs(Du,{shouldFilter:!1,children:[A.jsxs("div",{className:"relative w-full border-b",children:[A.jsx(sg,{placeholder:`Search ${d.toLowerCase()}...`,value:U,onValueChange:V=>{D(V)},className:E}),z&&_.length>0&&A.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:A.jsx(C0,{className:"h-4 w-4 animate-spin"})})]}),A.jsxs(Ou,{children:[Y&&A.jsx("div",{className:"text-destructive p-4 text-center",children:Y}),z&&_.length===0&&(f||A.jsx(pz,{})),!z&&!Y&&_.length===0&&(c||A.jsx(lg,{children:T??`No ${d.toLowerCase()} found.`})),A.jsx($a,{children:_.map(V=>A.jsxs(qa,{value:s(V),onSelect:k,className:"truncate",children:[a(V),A.jsx(T0,{className:Xe("ml-auto h-3 w-3",j===s(V)?"opacity-100":"opacity-0")})]},s(V)))})]})]})})]})}function pz(){return A.jsx($a,{children:A.jsx(qa,{disabled:!0,children:A.jsxs("div",{className:"flex w-full items-center gap-2",children:[A.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),A.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[A.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),A.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const mz=()=>{const r=Pe.use.queryLabel(),[n,i]=S.useState({labels:[],searchEngine:null}),[a,s]=S.useState(!1),l=S.useCallback(async f=>{let d=n.labels,g=n.searchEngine;if(!a||!g){d=["*"].concat(await yT()),d.includes(Pe.getState().queryLabel)||Pe.getState().setQueryLabel(d[0]),g=new Kr({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const m=d.map((v,y)=>({id:y,value:v}));g.addAll(m),i({labels:d,searchEngine:g}),s(!0)}return f?g.search(f).map(m=>d[m.id]):d},[n,a,i,s]),c=S.useCallback(f=>{Pe.getState().setQueryLabel(f)},[]);return A.jsx(gz,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:l,renderOption:f=>A.jsx("div",{children:f}),getOptionValue:f=>f,getDisplayValue:f=>A.jsx("div",{children:f}),notFound:A.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:r!==null?r:"",onChange:c})},vz=({text:r,className:n,tooltipClassName:i,tooltip:a,side:s,onClick:l})=>a?A.jsx(BE,{delayDuration:200,children:A.jsxs(FE,{children:[A.jsx(HE,{asChild:!0,children:A.jsx("label",{className:Xe(n,l!==void 0?"cursor-pointer":void 0),onClick:l,children:r})}),A.jsx(Qh,{side:s,className:i,children:a})]})}):A.jsx("label",{className:Xe(n,l!==void 0?"cursor-pointer":void 0),onClick:l,children:r}),yz=()=>{const{getNode:r,getEdge:n}=g1(),i=Ye.use.selectedNode(),a=Ye.use.focusedNode(),s=Ye.use.selectedEdge(),l=Ye.use.focusedEdge(),[c,f]=S.useState(null),[d,g]=S.useState(null);return S.useEffect(()=>{let m=null,v=null;a?(m="node",v=r(a)):i?(m="node",v=r(i)):l?(m="edge",v=n(l,!0)):s&&(m="edge",v=n(s,!0)),v?(m=="node"?f(bz(v)):f(wz(v)),g(m)):(f(null),g(null))},[a,i,l,s,f,g,r,n]),c?A.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:d=="node"?A.jsx(Ez,{node:c}):A.jsx(Sz,{edge:c})}):A.jsx(A.Fragment,{})},bz=r=>{const n=Ye.getState(),i=[];if(n.sigmaGraph&&n.rawGraph)for(const a of n.sigmaGraph.edges(r.id)){const s=n.rawGraph.getEdge(a,!0);if(s){const l=r.id===s.source,c=l?s.target:s.source,f=n.rawGraph.getNode(c);f&&i.push({type:l?"Target":"Source",id:c,label:f.labels.join(", ")})}}return{...r,relationships:i}},wz=r=>{var s,l;const n=Ye.getState(),i=(s=n.rawGraph)==null?void 0:s.getNode(r.source),a=(l=n.rawGraph)==null?void 0:l.getNode(r.target);return{...r,sourceNode:i,targetNode:a}},$n=({name:r,value:n,onClick:i,tooltip:a})=>A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("label",{className:"text-primary/60 tracking-wide",children:r}),":",A.jsx(vz,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:n,tooltip:a||n,side:"left",onClick:i})]}),Ez=({node:r})=>A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),A.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[A.jsx($n,{name:"Id",value:r.id}),A.jsx($n,{name:"Labels",value:r.labels.join(", "),onClick:()=>{Ye.getState().setSelectedNode(r.id,!0)}}),A.jsx($n,{name:"Degree",value:r.degree})]}),A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),A.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(r.properties).sort().map(n=>A.jsx($n,{name:n,value:r.properties[n]},n))}),r.relationships.length>0&&A.jsxs(A.Fragment,{children:[A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),A.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:r.relationships.map(({type:n,id:i,label:a})=>A.jsx($n,{name:n,value:a,onClick:()=>{Ye.getState().setSelectedNode(i,!0)}},i))})]})]}),Sz=({edge:r})=>A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),A.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[A.jsx($n,{name:"Id",value:r.id}),A.jsx($n,{name:"Type",value:r.type}),A.jsx($n,{name:"Source",value:r.sourceNode?r.sourceNode.labels.join(", "):r.source,onClick:()=>{Ye.getState().setSelectedNode(r.source,!0)}}),A.jsx($n,{name:"Target",value:r.targetNode?r.targetNode.labels.join(", "):r.target,onClick:()=>{Ye.getState().setSelectedNode(r.target,!0)}})]}),A.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),A.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(r.properties).sort().map(n=>A.jsx($n,{name:n,value:r.properties[n]},n))})]}),a0={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:Qw,curvedArrow:uk,curvedNoArrow:lk},nodeProgramClasses:{default:VO,circel:us,point:bO},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},xz=()=>{const r=oE(),n=Sn(),[i,a]=S.useState(null);return S.useEffect(()=>{r({downNode:s=>{a(s.node),n.getGraph().setNodeAttribute(s.node,"highlighted",!0)},mousemovebody:s=>{if(!i)return;const l=n.viewportToGraph(s);n.getGraph().setNodeAttribute(i,"x",l.x),n.getGraph().setNodeAttribute(i,"y",l.y),s.preventSigmaDefault(),s.original.preventDefault(),s.original.stopPropagation()},mouseup:()=>{i&&(a(null),n.getGraph().removeNodeAttribute(i,"highlighted"))},mousedown:()=>{n.getCustomBBox()||n.setCustomBBox(n.getBBox())}})},[r,n,i]),null},_z=()=>{const[r,n]=S.useState(a0),i=Ye.use.selectedNode(),a=Ye.use.focusedNode(),s=Ye.use.moveToSelectedNode(),l=Pe.use.showPropertyPanel(),c=Pe.use.showNodeSearchBar(),f=Pe.use.showNodeLabel(),d=Pe.use.enableEdgeEvents(),g=Pe.use.enableNodeDrag(),m=Pe.use.showEdgeLabel();S.useEffect(()=>{n({...a0,enableEdgeEvents:d,renderEdgeLabels:m,renderLabels:f})},[f,d,m]);const v=S.useCallback(E=>{E===null?Ye.getState().setFocusedNode(null):E.type==="nodes"&&Ye.getState().setFocusedNode(E.id)},[]),y=S.useCallback(E=>{E===null?Ye.getState().setSelectedNode(null):E.type==="nodes"&&Ye.getState().setSelectedNode(E.id,!0)},[]),b=S.useMemo(()=>a??i,[a,i]),x=S.useMemo(()=>i?{type:"nodes",id:i}:null,[i]);return A.jsxs(hO,{settings:r,className:"!bg-background !size-full overflow-hidden",children:[A.jsx(zN,{}),g&&A.jsx(xz,{}),A.jsx(dk,{node:b,move:s}),A.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[A.jsx(mz,{}),c&&A.jsx(hz,{value:x,onFocus:v,onChange:y})]}),A.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[A.jsx(YN,{}),A.jsx(MN,{}),A.jsx(cN,{}),A.jsx(jN,{}),A.jsx(GN,{})]}),l&&A.jsx("div",{className:"absolute top-2 right-2",children:A.jsx(yz,{})})]})};function Tz(){const r=kn.use.message(),n=Pe.use.enableHealthCheck();return S.useEffect(()=>{if(!n)return;kn.getState().check();const i=setInterval(async()=>{await kn.getState().check()},fT*1e3);return()=>clearInterval(i)},[n]),A.jsxs(gT,{children:[A.jsx("div",{className:"h-screen w-screen",children:A.jsx(_z,{})}),n&&A.jsx(MA,{}),r!==null&&A.jsx(nC,{})]})}s_.createRoot(document.getElementById("root")).render(A.jsx(S.StrictMode,{children:A.jsx(Tz,{})}));
|