1098 lines
971 KiB
JavaScript
1098 lines
971 KiB
JavaScript
var iL=Object.defineProperty;var aL=(e,t,n)=>t in e?iL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mi=(e,t,n)=>aL(e,typeof t!="symbol"?t+"":t,n);function oL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lL(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Pp={exports:{}},_s={};/**
|
||
* @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 Pw;function sL(){if(Pw)return _s;Pw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var s=null;if(o!==void 0&&(s=""+o),i.key!==void 0&&(s=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:s,ref:i!==void 0?i:null,props:o}}return _s.Fragment=t,_s.jsx=n,_s.jsxs=n,_s}var Fw;function uL(){return Fw||(Fw=1,Pp.exports=sL()),Pp.exports}var S=uL(),Fp={exports:{}},nt={};/**
|
||
* @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 Iw;function cL(){if(Iw)return nt;Iw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(A){return A===null||typeof A!="object"?null:(A=m&&A[m]||A["@@iterator"],typeof A=="function"?A:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function k(A,$,M){this.props=A,this.context=$,this.refs=x,this.updater=M||g}k.prototype.isReactComponent={},k.prototype.setState=function(A,$){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,$,"setState")},k.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(A,$,M){this.props=A,this.context=$,this.refs=x,this.updater=M||g}var T=_.prototype=new C;T.constructor=_,w(T,k.prototype),T.isPureReactComponent=!0;var N=Array.isArray,D={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function R(A,$,M,O,X,re){return M=re.ref,{$$typeof:e,type:A,key:$,ref:M!==void 0?M:null,props:re}}function B(A,$){return R(A.type,$,void 0,void 0,void 0,A.props)}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function j(A){var $={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(M){return $[M]})}var V=/\/+/g;function q(A,$){return typeof A=="object"&&A!==null&&A.key!=null?j(""+A.key):$.toString(36)}function I(){}function Y(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(I,I):(A.status="pending",A.then(function($){A.status==="pending"&&(A.status="fulfilled",A.value=$)},function($){A.status==="pending"&&(A.status="rejected",A.reason=$)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function Z(A,$,M,O,X){var re=typeof A;(re==="undefined"||re==="boolean")&&(A=null);var ue=!1;if(A===null)ue=!0;else switch(re){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(A.$$typeof){case e:case t:ue=!0;break;case p:return ue=A._init,Z(ue(A._payload),$,M,O,X)}}if(ue)return X=X(A),ue=O===""?"."+q(A,0):O,N(X)?(M="",ue!=null&&(M=ue.replace(V,"$&/")+"/"),Z(X,$,M,"",function(Ce){return Ce})):X!=null&&(P(X)&&(X=B(X,M+(X.key==null||A&&A.key===X.key?"":(""+X.key).replace(V,"$&/")+"/")+ue)),$.push(X)),1;ue=0;var ae=O===""?".":O+":";if(N(A))for(var oe=0;oe<A.length;oe++)O=A[oe],re=ae+q(O,oe),ue+=Z(O,$,M,re,X);else if(oe=v(A),typeof oe=="function")for(A=oe.call(A),oe=0;!(O=A.next()).done;)O=O.value,re=ae+q(O,oe++),ue+=Z(O,$,M,re,X);else if(re==="object"){if(typeof A.then=="function")return Z(Y(A),$,M,O,X);throw $=String(A),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ue}function U(A,$,M){if(A==null)return A;var O=[],X=0;return Z(A,O,"","",function(re){return $.call(M,re,X++)}),O}function G(A){if(A._status===-1){var $=A._result;$=$(),$.then(function(M){(A._status===0||A._status===-1)&&(A._status=1,A._result=M)},function(M){(A._status===0||A._status===-1)&&(A._status=2,A._result=M)}),A._status===-1&&(A._status=0,A._result=$)}if(A._status===1)return A._result.default;throw A._result}var F=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function K(){}return nt.Children={map:U,forEach:function(A,$,M){U(A,function(){$.apply(this,arguments)},M)},count:function(A){var $=0;return U(A,function(){$++}),$},toArray:function(A){return U(A,function($){return $})||[]},only:function(A){if(!P(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},nt.Component=k,nt.Fragment=n,nt.Profiler=i,nt.PureComponent=_,nt.StrictMode=r,nt.Suspense=f,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,nt.act=function(){throw Error("act(...) is not supported in production builds of React.")},nt.cache=function(A){return function(){return A.apply(null,arguments)}},nt.cloneElement=function(A,$,M){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var O=w({},A.props),X=A.key,re=void 0;if($!=null)for(ue in $.ref!==void 0&&(re=void 0),$.key!==void 0&&(X=""+$.key),$)!z.call($,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&$.ref===void 0||(O[ue]=$[ue]);var ue=arguments.length-2;if(ue===1)O.children=M;else if(1<ue){for(var ae=Array(ue),oe=0;oe<ue;oe++)ae[oe]=arguments[oe+2];O.children=ae}return R(A.type,X,void 0,void 0,re,O)},nt.createContext=function(A){return A={$$typeof:s,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:o,_context:A},A},nt.createElement=function(A,$,M){var O,X={},re=null;if($!=null)for(O in $.key!==void 0&&(re=""+$.key),$)z.call($,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(X[O]=$[O]);var ue=arguments.length-2;if(ue===1)X.children=M;else if(1<ue){for(var ae=Array(ue),oe=0;oe<ue;oe++)ae[oe]=arguments[oe+2];X.children=ae}if(A&&A.defaultProps)for(O in ue=A.defaultProps,ue)X[O]===void 0&&(X[O]=ue[O]);return R(A,re,void 0,void 0,null,X)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(A){return{$$typeof:u,render:A}},nt.isValidElement=P,nt.lazy=function(A){return{$$typeof:p,_payload:{_status:-1,_result:A},_init:G}},nt.memo=function(A,$){return{$$typeof:d,type:A,compare:$===void 0?null:$}},nt.startTransition=function(A){var $=D.T,M={};D.T=M;try{var O=A(),X=D.S;X!==null&&X(M,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(K,F)}catch(re){F(re)}finally{D.T=$}},nt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},nt.use=function(A){return D.H.use(A)},nt.useActionState=function(A,$,M){return D.H.useActionState(A,$,M)},nt.useCallback=function(A,$){return D.H.useCallback(A,$)},nt.useContext=function(A){return D.H.useContext(A)},nt.useDebugValue=function(){},nt.useDeferredValue=function(A,$){return D.H.useDeferredValue(A,$)},nt.useEffect=function(A,$){return D.H.useEffect(A,$)},nt.useId=function(){return D.H.useId()},nt.useImperativeHandle=function(A,$,M){return D.H.useImperativeHandle(A,$,M)},nt.useInsertionEffect=function(A,$){return D.H.useInsertionEffect(A,$)},nt.useLayoutEffect=function(A,$){return D.H.useLayoutEffect(A,$)},nt.useMemo=function(A,$){return D.H.useMemo(A,$)},nt.useOptimistic=function(A,$){return D.H.useOptimistic(A,$)},nt.useReducer=function(A,$,M){return D.H.useReducer(A,$,M)},nt.useRef=function(A){return D.H.useRef(A)},nt.useState=function(A){return D.H.useState(A)},nt.useSyncExternalStore=function(A,$,M){return D.H.useSyncExternalStore(A,$,M)},nt.useTransition=function(){return D.H.useTransition()},nt.version="19.0.0",nt}var Gw;function $f(){return Gw||(Gw=1,Fp.exports=cL()),Fp.exports}var E=$f();const be=fn(E),fL=oL({__proto__:null,default:be},[E]);var Ip={exports:{}},ks={},Gp={exports:{}},Bp={};/**
|
||
* @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 Bw;function dL(){return Bw||(Bw=1,function(e){function t(U,G){var F=U.length;U.push(G);e:for(;0<F;){var K=F-1>>>1,A=U[K];if(0<i(A,G))U[K]=G,U[F]=A,F=K;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var G=U[0],F=U.pop();if(F!==G){U[0]=F;e:for(var K=0,A=U.length,$=A>>>1;K<$;){var M=2*(K+1)-1,O=U[M],X=M+1,re=U[X];if(0>i(O,F))X<A&&0>i(re,O)?(U[K]=re,U[X]=F,K=X):(U[K]=O,U[M]=F,K=M);else if(X<A&&0>i(re,F))U[K]=re,U[X]=F,K=X;else break e}}return G}function i(U,G){var F=U.sortIndex-G.sortIndex;return F!==0?F:U.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var f=[],d=[],p=1,m=null,v=3,g=!1,w=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function T(U){for(var G=n(d);G!==null;){if(G.callback===null)r(d);else if(G.startTime<=U)r(d),G.sortIndex=G.expirationTime,t(f,G);else break;G=n(d)}}function N(U){if(x=!1,T(U),!w)if(n(f)!==null)w=!0,Y();else{var G=n(d);G!==null&&Z(N,G.startTime-U)}}var D=!1,z=-1,R=5,B=-1;function P(){return!(e.unstable_now()-B<R)}function j(){if(D){var U=e.unstable_now();B=U;var G=!0;try{e:{w=!1,x&&(x=!1,C(z),z=-1),g=!0;var F=v;try{t:{for(T(U),m=n(f);m!==null&&!(m.expirationTime>U&&P());){var K=m.callback;if(typeof K=="function"){m.callback=null,v=m.priorityLevel;var A=K(m.expirationTime<=U);if(U=e.unstable_now(),typeof A=="function"){m.callback=A,T(U),G=!0;break t}m===n(f)&&r(f),T(U)}else r(f);m=n(f)}if(m!==null)G=!0;else{var $=n(d);$!==null&&Z(N,$.startTime-U),G=!1}}break e}finally{m=null,v=F,g=!1}G=void 0}}finally{G?V():D=!1}}}var V;if(typeof _=="function")V=function(){_(j)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,I=q.port2;q.port1.onmessage=j,V=function(){I.postMessage(null)}}else V=function(){k(j,0)};function Y(){D||(D=!0,V())}function Z(U,G){z=k(function(){U(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_continueExecution=function(){w||g||(w=!0,Y())},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(f)},e.unstable_next=function(U){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var F=v;v=G;try{return U()}finally{v=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,G){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var F=v;v=U;try{return G()}finally{v=F}},e.unstable_scheduleCallback=function(U,G,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,U){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=F+A,U={id:p++,callback:G,priorityLevel:U,startTime:F,expirationTime:A,sortIndex:-1},F>K?(U.sortIndex=F,t(d,U),n(f)===null&&U===n(d)&&(x?(C(z),z=-1):x=!0,Z(N,F-K))):(U.sortIndex=A,t(f,U),w||g||(w=!0,Y())),U},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(U){var G=v;return function(){var F=v;v=G;try{return U.apply(this,arguments)}finally{v=F}}}}(Bp)),Bp}var Uw;function hL(){return Uw||(Uw=1,Gp.exports=dL()),Gp.exports}var Up={exports:{}},mn={};/**
|
||
* @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 Hw;function pL(){if(Hw)return mn;Hw=1;var e=$f();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:f,containerInfo:d,implementation:p}}var s=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mn.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,p)},mn.flushSync=function(f){var d=s.T,p=r.p;try{if(s.T=null,r.p=2,f)return f()}finally{s.T=d,r.p=p,r.d.f()}},mn.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},mn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},mn.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:v,fetchPriority:g}):p==="script"&&r.d.X(f,{crossOrigin:m,integrity:v,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},mn.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=u(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},mn.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},mn.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=u(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},mn.requestFormReset=function(f){r.d.r(f)},mn.unstable_batchedUpdates=function(f,d){return f(d)},mn.useFormState=function(f,d,p){return s.H.useFormState(f,d,p)},mn.useFormStatus=function(){return s.H.useHostTransitionStatus()},mn.version="19.0.0",mn}var $w;function A_(){if($w)return Up.exports;$w=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Up.exports=pL(),Up.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 Vw;function mL(){if(Vw)return ks;Vw=1;var e=hL(),t=$f(),n=A_();function r(a){var l="https://react.dev/errors/"+a;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)l+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}var o=Symbol.for("react.element"),s=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),v=Symbol.for("react.consumer"),g=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),N=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function z(a){return a===null||typeof a!="object"?null:(a=D&&a[D]||a["@@iterator"],typeof a=="function"?a:null)}var R=Symbol.for("react.client.reference");function B(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===R?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case f:return"Fragment";case u:return"Portal";case p:return"Profiler";case d:return"StrictMode";case x:return"Suspense";case k:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case g:return(a.displayName||"Context")+".Provider";case v:return(a._context.displayName||"Context")+".Consumer";case w:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case C:return l=a.displayName||null,l!==null?l:B(a.type)||"Memo";case _:l=a._payload,a=a._init;try{return B(a(l))}catch{}}return null}var P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.assign,V,q;function I(a){if(V===void 0)try{throw Error()}catch(c){var l=c.stack.trim().match(/\n( *(at )?)/);V=l&&l[1]||"",q=-1<c.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+V+a+q}var Y=!1;function Z(a,l){if(!a||Y)return"";Y=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(pe){var se=pe}Reflect.construct(a,[],_e)}else{try{_e.call()}catch(pe){se=pe}a.call(_e.prototype)}}else{try{throw Error()}catch(pe){se=pe}(_e=a())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(pe){if(pe&&se&&typeof pe.stack=="string")return[pe.stack,se.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=h.DetermineComponentFrameRoot(),L=b[0],H=b[1];if(L&&H){var W=L.split(`
|
||
`),J=H.split(`
|
||
`);for(y=h=0;h<W.length&&!W[h].includes("DetermineComponentFrameRoot");)h++;for(;y<J.length&&!J[y].includes("DetermineComponentFrameRoot");)y++;if(h===W.length||y===J.length)for(h=W.length-1,y=J.length-1;1<=h&&0<=y&&W[h]!==J[y];)y--;for(;1<=h&&0<=y;h--,y--)if(W[h]!==J[y]){if(h!==1||y!==1)do if(h--,y--,0>y||W[h]!==J[y]){var me=`
|
||
`+W[h].replace(" at new "," at ");return a.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",a.displayName)),me}while(1<=h&&0<=y);break}}}finally{Y=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?I(c):""}function U(a){switch(a.tag){case 26:case 27:case 5:return I(a.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return a=Z(a.type,!1),a;case 11:return a=Z(a.type.render,!1),a;case 1:return a=Z(a.type,!0),a;default:return""}}function G(a){try{var l="";do l+=U(a),a=a.return;while(a);return l}catch(c){return`
|
||
Error generating stack: `+c.message+`
|
||
`+c.stack}}function F(a){var l=a,c=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(c=l.return),a=l.return;while(a)}return l.tag===3?c:null}function K(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function A(a){if(F(a)!==a)throw Error(r(188))}function $(a){var l=a.alternate;if(!l){if(l=F(a),l===null)throw Error(r(188));return l!==a?null:a}for(var c=a,h=l;;){var y=c.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){c=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===c)return A(y),a;if(b===h)return A(y),l;b=b.sibling}throw Error(r(188))}if(c.return!==h.return)c=y,h=b;else{for(var L=!1,H=y.child;H;){if(H===c){L=!0,c=y,h=b;break}if(H===h){L=!0,h=y,c=b;break}H=H.sibling}if(!L){for(H=b.child;H;){if(H===c){L=!0,c=b,h=y;break}if(H===h){L=!0,h=b,c=y;break}H=H.sibling}if(!L)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?a:l}function M(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a;for(a=a.child;a!==null;){if(l=M(a),l!==null)return l;a=a.sibling}return null}var O=Array.isArray,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ue=[],ae=-1;function oe(a){return{current:a}}function Ce(a){0>ae||(a.current=ue[ae],ue[ae]=null,ae--)}function he(a,l){ae++,ue[ae]=a.current,a.current=l}var Ee=oe(null),we=oe(null),Pe=oe(null),Ae=oe(null);function xe(a,l){switch(he(Pe,l),he(we,a),he(Ee,null),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)&&(l=l.namespaceURI)?dw(l):0;break;default:if(a=a===8?l.parentNode:l,l=a.tagName,a=a.namespaceURI)a=dw(a),l=hw(a,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}Ce(Ee),he(Ee,l)}function ee(){Ce(Ee),Ce(we),Ce(Pe)}function ce(a){a.memoizedState!==null&&he(Ae,a);var l=Ee.current,c=hw(l,a.type);l!==c&&(he(we,a),he(Ee,c))}function Te(a){we.current===a&&(Ce(Ee),Ce(we)),Ae.current===a&&(Ce(Ae),bs._currentValue=re)}var ge=Object.prototype.hasOwnProperty,Se=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,He=e.unstable_shouldYield,Ge=e.unstable_requestPaint,ve=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,vt=e.log,Mt=e.unstable_setDisableYieldValue,bt=null,rt=null;function qt(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(bt,a,void 0,(a.current.flags&128)===128)}catch{}}function at(a){if(typeof vt=="function"&&Mt(a),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(bt,a)}catch{}}var At=Math.clz32?Math.clz32:xu,rn=Math.log,io=Math.LN2;function xu(a){return a>>>=0,a===0?32:31-(rn(a)/io|0)|0}var ao=128,Di=4194304;function dn(a){var l=a&42;if(l!==0)return l;switch(a&-a){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 a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function oo(a,l){var c=a.pendingLanes;if(c===0)return 0;var h=0,y=a.suspendedLanes,b=a.pingedLanes,L=a.warmLanes;a=a.finishedLanes!==0;var H=c&134217727;return H!==0?(c=H&~y,c!==0?h=dn(c):(b&=H,b!==0?h=dn(b):a||(L=H&~L,L!==0&&(h=dn(L))))):(H=c&~y,H!==0?h=dn(H):b!==0?h=dn(b):a||(L=c&~L,L!==0&&(h=dn(L)))),h===0?0:l!==0&&l!==h&&!(l&y)&&(y=h&-h,L=l&-l,y>=L||y===32&&(L&4194176)!==0)?l:h}function Ze(a,l){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&l)===0}function gt(a,l){switch(a){case 1:case 2:case 4:case 8:return l+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 l+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 _t(){var a=ao;return ao<<=1,!(ao&4194176)&&(ao=128),a}function Cn(){var a=Di;return Di<<=1,!(Di&62914560)&&(Di=4194304),a}function Sn(a){for(var l=[],c=0;31>c;c++)l.push(a);return l}function Tn(a,l){a.pendingLanes|=l,l!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Zr(a,l,c,h,y,b){var L=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var H=a.entanglements,W=a.expirationTimes,J=a.hiddenUpdates;for(c=L&~c;0<c;){var me=31-At(c),_e=1<<me;H[me]=0,W[me]=-1;var se=J[me];if(se!==null)for(J[me]=null,me=0;me<se.length;me++){var pe=se[me];pe!==null&&(pe.lane&=-536870913)}c&=~_e}h!==0&&An(a,h,0),b!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=b&~(L&~l))}function An(a,l,c){a.pendingLanes|=l,a.suspendedLanes&=~l;var h=31-At(l);a.entangledLanes|=l,a.entanglements[h]=a.entanglements[h]|1073741824|c&4194218}function gr(a,l){var c=a.entangledLanes|=l;for(a=a.entanglements;c;){var h=31-At(c),y=1<<h;y&l|a[h]&l&&(a[h]|=l),c&=~y}}function sb(a){return a&=-a,2<a?8<a?a&134217727?32:268435456:8:2}function ub(){var a=X.p;return a!==0?a:(a=window.event,a===void 0?32:Nw(a.type))}function WD(a,l){var c=X.p;try{return X.p=a,l()}finally{X.p=c}}var Ni=Math.random().toString(36).slice(2),hn="__reactFiber$"+Ni,Rn="__reactProps$"+Ni,lo="__reactContainer$"+Ni,Ld="__reactEvents$"+Ni,XD="__reactListeners$"+Ni,KD="__reactHandles$"+Ni,cb="__reactResources$"+Ni,Nl="__reactMarker$"+Ni;function zd(a){delete a[hn],delete a[Rn],delete a[Ld],delete a[XD],delete a[KD]}function va(a){var l=a[hn];if(l)return l;for(var c=a.parentNode;c;){if(l=c[lo]||c[hn]){if(c=l.alternate,l.child!==null||c!==null&&c.child!==null)for(a=gw(a);a!==null;){if(c=a[hn])return c;a=gw(a)}return l}a=c,c=a.parentNode}return null}function so(a){if(a=a[hn]||a[lo]){var l=a.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return a}return null}function Ol(a){var l=a.tag;if(l===5||l===26||l===27||l===6)return a.stateNode;throw Error(r(33))}function uo(a){var l=a[cb];return l||(l=a[cb]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Kt(a){a[Nl]=!0}var fb=new Set,db={};function ya(a,l){co(a,l),co(a+"Capture",l)}function co(a,l){for(db[a]=l,a=0;a<l.length;a++)fb.add(l[a])}var Qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ZD=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]*$"),hb={},pb={};function QD(a){return ge.call(pb,a)?!0:ge.call(hb,a)?!1:ZD.test(a)?pb[a]=!0:(hb[a]=!0,!1)}function wu(a,l,c){if(QD(l))if(c===null)a.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(l);return}}a.setAttribute(l,""+c)}}function Su(a,l,c){if(c===null)a.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttribute(l,""+c)}}function Jr(a,l,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(l,c,""+h)}}function Qn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function mb(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function JD(a){var l=mb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),h=""+a[l];if(!a.hasOwnProperty(l)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var y=c.get,b=c.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return y.call(this)},set:function(L){h=""+L,b.call(this,L)}}),Object.defineProperty(a,l,{enumerable:c.enumerable}),{getValue:function(){return h},setValue:function(L){h=""+L},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Eu(a){a._valueTracker||(a._valueTracker=JD(a))}function gb(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var c=l.getValue(),h="";return a&&(h=mb(a)?a.checked?"true":"false":a.value),a=h,a!==c?(l.setValue(a),!0):!1}function _u(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var eN=/[\n"\\]/g;function Jn(a){return a.replace(eN,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function jd(a,l,c,h,y,b,L,H){a.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.type=L:a.removeAttribute("type"),l!=null?L==="number"?(l===0&&a.value===""||a.value!=l)&&(a.value=""+Qn(l)):a.value!==""+Qn(l)&&(a.value=""+Qn(l)):L!=="submit"&&L!=="reset"||a.removeAttribute("value"),l!=null?Md(a,L,Qn(l)):c!=null?Md(a,L,Qn(c)):h!=null&&a.removeAttribute("value"),y==null&&b!=null&&(a.defaultChecked=!!b),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?a.name=""+Qn(H):a.removeAttribute("name")}function vb(a,l,c,h,y,b,L,H){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(a.type=b),l!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||l!=null))return;c=c!=null?""+Qn(c):"",l=l!=null?""+Qn(l):c,H||l===a.value||(a.value=l),a.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=H?a.checked:!!h,a.defaultChecked=!!h,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(a.name=L)}function Md(a,l,c){l==="number"&&_u(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function fo(a,l,c,h){if(a=a.options,l){l={};for(var y=0;y<c.length;y++)l["$"+c[y]]=!0;for(c=0;c<a.length;c++)y=l.hasOwnProperty("$"+a[c].value),a[c].selected!==y&&(a[c].selected=y),y&&h&&(a[c].defaultSelected=!0)}else{for(c=""+Qn(c),l=null,y=0;y<a.length;y++){if(a[y].value===c){a[y].selected=!0,h&&(a[y].defaultSelected=!0);return}l!==null||a[y].disabled||(l=a[y])}l!==null&&(l.selected=!0)}}function yb(a,l,c){if(l!=null&&(l=""+Qn(l),l!==a.value&&(a.value=l),c==null)){a.defaultValue!==l&&(a.defaultValue=l);return}a.defaultValue=c!=null?""+Qn(c):""}function bb(a,l,c,h){if(l==null){if(h!=null){if(c!=null)throw Error(r(92));if(O(h)){if(1<h.length)throw Error(r(93));h=h[0]}c=h}c==null&&(c=""),l=c}c=Qn(l),a.defaultValue=c,h=a.textContent,h===c&&h!==""&&h!==null&&(a.value=h)}function ho(a,l){if(l){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=l;return}}a.textContent=l}var tN=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 xb(a,l,c){var h=l.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?a.setProperty(l,""):l==="float"?a.cssFloat="":a[l]="":h?a.setProperty(l,c):typeof c!="number"||c===0||tN.has(l)?l==="float"?a.cssFloat=c:a[l]=(""+c).trim():a[l]=c+"px"}function wb(a,l,c){if(l!=null&&typeof l!="object")throw Error(r(62));if(a=a.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&c[y]!==h&&xb(a,y,h)}else for(var b in l)l.hasOwnProperty(b)&&xb(a,b,l[b])}function Pd(a){if(a.indexOf("-")===-1)return!1;switch(a){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 nN=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"]]),rN=/^[\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 ku(a){return rN.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var Fd=null;function Id(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var po=null,mo=null;function Sb(a){var l=so(a);if(l&&(a=l.stateNode)){var c=a[Rn]||null;e:switch(a=l.stateNode,l.type){case"input":if(jd(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),l=c.name,c.type==="radio"&&l!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Jn(""+l)+'"][type="radio"]'),l=0;l<c.length;l++){var h=c[l];if(h!==a&&h.form===a.form){var y=h[Rn]||null;if(!y)throw Error(r(90));jd(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<c.length;l++)h=c[l],h.form===a.form&&gb(h)}break e;case"textarea":yb(a,c.value,c.defaultValue);break e;case"select":l=c.value,l!=null&&fo(a,!!c.multiple,l,!1)}}}var Gd=!1;function Eb(a,l,c){if(Gd)return a(l,c);Gd=!0;try{var h=a(l);return h}finally{if(Gd=!1,(po!==null||mo!==null)&&(sc(),po&&(l=po,a=mo,mo=po=null,Sb(l),a)))for(l=0;l<a.length;l++)Sb(a[l])}}function Ll(a,l){var c=a.stateNode;if(c===null)return null;var h=c[Rn]||null;if(h===null)return null;c=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(r(231,l,typeof c));return c}var Bd=!1;if(Qr)try{var zl={};Object.defineProperty(zl,"passive",{get:function(){Bd=!0}}),window.addEventListener("test",zl,zl),window.removeEventListener("test",zl,zl)}catch{Bd=!1}var Oi=null,Ud=null,Cu=null;function _b(){if(Cu)return Cu;var a,l=Ud,c=l.length,h,y="value"in Oi?Oi.value:Oi.textContent,b=y.length;for(a=0;a<c&&l[a]===y[a];a++);var L=c-a;for(h=1;h<=L&&l[c-h]===y[b-h];h++);return Cu=y.slice(a,1<h?1-h:void 0)}function Tu(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Au(){return!0}function kb(){return!1}function Dn(a){function l(c,h,y,b,L){this._reactName=c,this._targetInst=y,this.type=h,this.nativeEvent=b,this.target=L,this.currentTarget=null;for(var H in a)a.hasOwnProperty(H)&&(c=a[H],this[H]=c?c(b):b[H]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Au:kb,this.isPropagationStopped=kb,this}return j(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),l}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ru=Dn(ba),jl=j({},ba,{view:0,detail:0}),iN=Dn(jl),Hd,$d,Ml,Du=j({},jl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Ml&&(Ml&&a.type==="mousemove"?(Hd=a.screenX-Ml.screenX,$d=a.screenY-Ml.screenY):$d=Hd=0,Ml=a),Hd)},movementY:function(a){return"movementY"in a?a.movementY:$d}}),Cb=Dn(Du),aN=j({},Du,{dataTransfer:0}),oN=Dn(aN),lN=j({},jl,{relatedTarget:0}),Vd=Dn(lN),sN=j({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),uN=Dn(sN),cN=j({},ba,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),fN=Dn(cN),dN=j({},ba,{data:0}),Tb=Dn(dN),hN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pN={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"},mN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gN(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=mN[a])?!!l[a]:!1}function qd(){return gN}var vN=j({},jl,{key:function(a){if(a.key){var l=hN[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Tu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?pN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qd,charCode:function(a){return a.type==="keypress"?Tu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Tu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),yN=Dn(vN),bN=j({},Du,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ab=Dn(bN),xN=j({},jl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qd}),wN=Dn(xN),SN=j({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),EN=Dn(SN),_N=j({},Du,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),kN=Dn(_N),CN=j({},ba,{newState:0,oldState:0}),TN=Dn(CN),AN=[9,13,27,32],Yd=Qr&&"CompositionEvent"in window,Pl=null;Qr&&"documentMode"in document&&(Pl=document.documentMode);var RN=Qr&&"TextEvent"in window&&!Pl,Rb=Qr&&(!Yd||Pl&&8<Pl&&11>=Pl),Db=" ",Nb=!1;function Ob(a,l){switch(a){case"keyup":return AN.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var go=!1;function DN(a,l){switch(a){case"compositionend":return Lb(l);case"keypress":return l.which!==32?null:(Nb=!0,Db);case"textInput":return a=l.data,a===Db&&Nb?null:a;default:return null}}function NN(a,l){if(go)return a==="compositionend"||!Yd&&Ob(a,l)?(a=_b(),Cu=Ud=Oi=null,go=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Rb&&l.locale!=="ko"?null:l.data;default:return null}}var ON={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 zb(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!ON[a.type]:l==="textarea"}function jb(a,l,c,h){po?mo?mo.push(h):mo=[h]:po=h,l=hc(l,"onChange"),0<l.length&&(c=new Ru("onChange","change",null,c,h),a.push({event:c,listeners:l}))}var Fl=null,Il=null;function LN(a){lw(a,0)}function Nu(a){var l=Ol(a);if(gb(l))return a}function Mb(a,l){if(a==="change")return l}var Pb=!1;if(Qr){var Wd;if(Qr){var Xd="oninput"in document;if(!Xd){var Fb=document.createElement("div");Fb.setAttribute("oninput","return;"),Xd=typeof Fb.oninput=="function"}Wd=Xd}else Wd=!1;Pb=Wd&&(!document.documentMode||9<document.documentMode)}function Ib(){Fl&&(Fl.detachEvent("onpropertychange",Gb),Il=Fl=null)}function Gb(a){if(a.propertyName==="value"&&Nu(Il)){var l=[];jb(l,Il,a,Id(a)),Eb(LN,l)}}function zN(a,l,c){a==="focusin"?(Ib(),Fl=l,Il=c,Fl.attachEvent("onpropertychange",Gb)):a==="focusout"&&Ib()}function jN(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Nu(Il)}function MN(a,l){if(a==="click")return Nu(l)}function PN(a,l){if(a==="input"||a==="change")return Nu(l)}function FN(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Bn=typeof Object.is=="function"?Object.is:FN;function Gl(a,l){if(Bn(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var c=Object.keys(a),h=Object.keys(l);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var y=c[h];if(!ge.call(l,y)||!Bn(a[y],l[y]))return!1}return!0}function Bb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ub(a,l){var c=Bb(a);a=0;for(var h;c;){if(c.nodeType===3){if(h=a+c.textContent.length,a<=l&&h>=l)return{node:c,offset:l-a};a=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Bb(c)}}function Hb(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?Hb(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function $b(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var l=_u(a.document);l instanceof a.HTMLIFrameElement;){try{var c=typeof l.contentWindow.location.href=="string"}catch{c=!1}if(c)a=l.contentWindow;else break;l=_u(a.document)}return l}function Kd(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function IN(a,l){var c=$b(l);l=a.focusedElem;var h=a.selectionRange;if(c!==l&&l&&l.ownerDocument&&Hb(l.ownerDocument.documentElement,l)){if(h!==null&&Kd(l)){if(a=h.start,c=h.end,c===void 0&&(c=a),"selectionStart"in l)l.selectionStart=a,l.selectionEnd=Math.min(c,l.value.length);else if(c=(a=l.ownerDocument||document)&&a.defaultView||window,c.getSelection){c=c.getSelection();var y=l.textContent.length,b=Math.min(h.start,y);h=h.end===void 0?b:Math.min(h.end,y),!c.extend&&b>h&&(y=h,h=b,b=y),y=Ub(l,b);var L=Ub(l,h);y&&L&&(c.rangeCount!==1||c.anchorNode!==y.node||c.anchorOffset!==y.offset||c.focusNode!==L.node||c.focusOffset!==L.offset)&&(a=a.createRange(),a.setStart(y.node,y.offset),c.removeAllRanges(),b>h?(c.addRange(a),c.extend(L.node,L.offset)):(a.setEnd(L.node,L.offset),c.addRange(a)))}}for(a=[],c=l;c=c.parentNode;)c.nodeType===1&&a.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<a.length;l++)c=a[l],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var GN=Qr&&"documentMode"in document&&11>=document.documentMode,vo=null,Zd=null,Bl=null,Qd=!1;function Vb(a,l,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Qd||vo==null||vo!==_u(h)||(h=vo,"selectionStart"in h&&Kd(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Bl&&Gl(Bl,h)||(Bl=h,h=hc(Zd,"onSelect"),0<h.length&&(l=new Ru("onSelect","select",null,l,c),a.push({event:l,listeners:h}),l.target=vo)))}function xa(a,l){var c={};return c[a.toLowerCase()]=l.toLowerCase(),c["Webkit"+a]="webkit"+l,c["Moz"+a]="moz"+l,c}var yo={animationend:xa("Animation","AnimationEnd"),animationiteration:xa("Animation","AnimationIteration"),animationstart:xa("Animation","AnimationStart"),transitionrun:xa("Transition","TransitionRun"),transitionstart:xa("Transition","TransitionStart"),transitioncancel:xa("Transition","TransitionCancel"),transitionend:xa("Transition","TransitionEnd")},Jd={},qb={};Qr&&(qb=document.createElement("div").style,"AnimationEvent"in window||(delete yo.animationend.animation,delete yo.animationiteration.animation,delete yo.animationstart.animation),"TransitionEvent"in window||delete yo.transitionend.transition);function wa(a){if(Jd[a])return Jd[a];if(!yo[a])return a;var l=yo[a],c;for(c in l)if(l.hasOwnProperty(c)&&c in qb)return Jd[a]=l[c];return a}var Yb=wa("animationend"),Wb=wa("animationiteration"),Xb=wa("animationstart"),BN=wa("transitionrun"),UN=wa("transitionstart"),HN=wa("transitioncancel"),Kb=wa("transitionend"),Zb=new Map,Qb="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 vr(a,l){Zb.set(a,l),ya(l,[a])}var er=[],bo=0,eh=0;function Ou(){for(var a=bo,l=eh=bo=0;l<a;){var c=er[l];er[l++]=null;var h=er[l];er[l++]=null;var y=er[l];er[l++]=null;var b=er[l];if(er[l++]=null,h!==null&&y!==null){var L=h.pending;L===null?y.next=y:(y.next=L.next,L.next=y),h.pending=y}b!==0&&Jb(c,y,b)}}function Lu(a,l,c,h){er[bo++]=a,er[bo++]=l,er[bo++]=c,er[bo++]=h,eh|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function th(a,l,c,h){return Lu(a,l,c,h),zu(a)}function Li(a,l){return Lu(a,null,null,l),zu(a)}function Jb(a,l,c){a.lanes|=c;var h=a.alternate;h!==null&&(h.lanes|=c);for(var y=!1,b=a.return;b!==null;)b.childLanes|=c,h=b.alternate,h!==null&&(h.childLanes|=c),b.tag===22&&(a=b.stateNode,a===null||a._visibility&1||(y=!0)),a=b,b=b.return;y&&l!==null&&a.tag===3&&(b=a.stateNode,y=31-At(c),b=b.hiddenUpdates,a=b[y],a===null?b[y]=[l]:a.push(l),l.lane=c|536870912)}function zu(a){if(50<ds)throw ds=0,lp=null,Error(r(185));for(var l=a.return;l!==null;)a=l,l=a.return;return a.tag===3?a.stateNode:null}var xo={},ex=new WeakMap;function tr(a,l){if(typeof a=="object"&&a!==null){var c=ex.get(a);return c!==void 0?c:(l={value:a,source:l,stack:G(l)},ex.set(a,l),l)}return{value:a,source:l,stack:G(l)}}var wo=[],So=0,ju=null,Mu=0,nr=[],rr=0,Sa=null,ei=1,ti="";function Ea(a,l){wo[So++]=Mu,wo[So++]=ju,ju=a,Mu=l}function tx(a,l,c){nr[rr++]=ei,nr[rr++]=ti,nr[rr++]=Sa,Sa=a;var h=ei;a=ti;var y=32-At(h)-1;h&=~(1<<y),c+=1;var b=32-At(l)+y;if(30<b){var L=y-y%5;b=(h&(1<<L)-1).toString(32),h>>=L,y-=L,ei=1<<32-At(l)+y|c<<y|h,ti=b+a}else ei=1<<b|c<<y|h,ti=a}function nh(a){a.return!==null&&(Ea(a,1),tx(a,1,0))}function rh(a){for(;a===ju;)ju=wo[--So],wo[So]=null,Mu=wo[--So],wo[So]=null;for(;a===Sa;)Sa=nr[--rr],nr[rr]=null,ti=nr[--rr],nr[rr]=null,ei=nr[--rr],nr[rr]=null}var En=null,an=null,pt=!1,yr=null,Lr=!1,ih=Error(r(519));function _a(a){var l=Error(r(418,""));throw $l(tr(l,a)),ih}function nx(a){var l=a.stateNode,c=a.type,h=a.memoizedProps;switch(l[hn]=a,l[Rn]=h,c){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(c=0;c<ps.length;c++)ft(ps[c],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":ft("invalid",l),vb(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Eu(l);break;case"select":ft("invalid",l);break;case"textarea":ft("invalid",l),bb(l,h.value,h.defaultValue,h.children),Eu(l)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||l.textContent===""+c||h.suppressHydrationWarning===!0||fw(l.textContent,c)?(h.popover!=null&&(ft("beforetoggle",l),ft("toggle",l)),h.onScroll!=null&&ft("scroll",l),h.onScrollEnd!=null&&ft("scrollend",l),h.onClick!=null&&(l.onclick=pc),l=!0):l=!1,l||_a(a)}function rx(a){for(En=a.return;En;)switch(En.tag){case 3:case 27:Lr=!0;return;case 5:case 13:Lr=!1;return;default:En=En.return}}function Ul(a){if(a!==En)return!1;if(!pt)return rx(a),pt=!0,!1;var l=!1,c;if((c=a.tag!==3&&a.tag!==27)&&((c=a.tag===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||_p(a.type,a.memoizedProps)),c=!c),c&&(l=!0),l&&an&&_a(a),rx(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8)if(c=a.data,c==="/$"){if(l===0){an=xr(a.nextSibling);break e}l--}else c!=="$"&&c!=="$!"&&c!=="$?"||l++;a=a.nextSibling}an=null}}else an=En?xr(a.stateNode.nextSibling):null;return!0}function Hl(){an=En=null,pt=!1}function $l(a){yr===null?yr=[a]:yr.push(a)}var Vl=Error(r(460)),ix=Error(r(474)),ah={then:function(){}};function ax(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Pu(){}function ox(a,l,c){switch(c=a[c],c===void 0?a.push(l):c!==l&&(l.then(Pu,Pu),l=c),l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,a===Vl?Error(r(483)):a;default:if(typeof l.status=="string")l.then(Pu,Pu);else{if(a=Rt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=l,a.status="pending",a.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw a=l.reason,a===Vl?Error(r(483)):a}throw ql=l,Vl}}var ql=null;function lx(){if(ql===null)throw Error(r(459));var a=ql;return ql=null,a}var Eo=null,Yl=0;function Fu(a){var l=Yl;return Yl+=1,Eo===null&&(Eo=[]),ox(Eo,a,l)}function Wl(a,l){l=l.props.ref,a.ref=l!==void 0?l:null}function Iu(a,l){throw l.$$typeof===o?Error(r(525)):(a=Object.prototype.toString.call(l),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a)))}function sx(a){var l=a._init;return l(a._payload)}function ux(a){function l(ne,Q){if(a){var le=ne.deletions;le===null?(ne.deletions=[Q],ne.flags|=16):le.push(Q)}}function c(ne,Q){if(!a)return null;for(;Q!==null;)l(ne,Q),Q=Q.sibling;return null}function h(ne){for(var Q=new Map;ne!==null;)ne.key!==null?Q.set(ne.key,ne):Q.set(ne.index,ne),ne=ne.sibling;return Q}function y(ne,Q){return ne=Vi(ne,Q),ne.index=0,ne.sibling=null,ne}function b(ne,Q,le){return ne.index=le,a?(le=ne.alternate,le!==null?(le=le.index,le<Q?(ne.flags|=33554434,Q):le):(ne.flags|=33554434,Q)):(ne.flags|=1048576,Q)}function L(ne){return a&&ne.alternate===null&&(ne.flags|=33554434),ne}function H(ne,Q,le,ye){return Q===null||Q.tag!==6?(Q=Jh(le,ne.mode,ye),Q.return=ne,Q):(Q=y(Q,le),Q.return=ne,Q)}function W(ne,Q,le,ye){var Ie=le.type;return Ie===f?me(ne,Q,le.props.children,ye,le.key):Q!==null&&(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===_&&sx(Ie)===Q.type)?(Q=y(Q,le.props),Wl(Q,le),Q.return=ne,Q):(Q=rc(le.type,le.key,le.props,null,ne.mode,ye),Wl(Q,le),Q.return=ne,Q)}function J(ne,Q,le,ye){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==le.containerInfo||Q.stateNode.implementation!==le.implementation?(Q=ep(le,ne.mode,ye),Q.return=ne,Q):(Q=y(Q,le.children||[]),Q.return=ne,Q)}function me(ne,Q,le,ye,Ie){return Q===null||Q.tag!==7?(Q=za(le,ne.mode,ye,Ie),Q.return=ne,Q):(Q=y(Q,le),Q.return=ne,Q)}function _e(ne,Q,le){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Jh(""+Q,ne.mode,le),Q.return=ne,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case s:return le=rc(Q.type,Q.key,Q.props,null,ne.mode,le),Wl(le,Q),le.return=ne,le;case u:return Q=ep(Q,ne.mode,le),Q.return=ne,Q;case _:var ye=Q._init;return Q=ye(Q._payload),_e(ne,Q,le)}if(O(Q)||z(Q))return Q=za(Q,ne.mode,le,null),Q.return=ne,Q;if(typeof Q.then=="function")return _e(ne,Fu(Q),le);if(Q.$$typeof===g)return _e(ne,ec(ne,Q),le);Iu(ne,Q)}return null}function se(ne,Q,le,ye){var Ie=Q!==null?Q.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Ie!==null?null:H(ne,Q,""+le,ye);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case s:return le.key===Ie?W(ne,Q,le,ye):null;case u:return le.key===Ie?J(ne,Q,le,ye):null;case _:return Ie=le._init,le=Ie(le._payload),se(ne,Q,le,ye)}if(O(le)||z(le))return Ie!==null?null:me(ne,Q,le,ye,null);if(typeof le.then=="function")return se(ne,Q,Fu(le),ye);if(le.$$typeof===g)return se(ne,Q,ec(ne,le),ye);Iu(ne,le)}return null}function pe(ne,Q,le,ye,Ie){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ne=ne.get(le)||null,H(Q,ne,""+ye,Ie);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case s:return ne=ne.get(ye.key===null?le:ye.key)||null,W(Q,ne,ye,Ie);case u:return ne=ne.get(ye.key===null?le:ye.key)||null,J(Q,ne,ye,Ie);case _:var ot=ye._init;return ye=ot(ye._payload),pe(ne,Q,le,ye,Ie)}if(O(ye)||z(ye))return ne=ne.get(le)||null,me(Q,ne,ye,Ie,null);if(typeof ye.then=="function")return pe(ne,Q,le,Fu(ye),Ie);if(ye.$$typeof===g)return pe(ne,Q,le,ec(Q,ye),Ie);Iu(Q,ye)}return null}function Be(ne,Q,le,ye){for(var Ie=null,ot=null,Ve=Q,Ke=Q=0,Jt=null;Ve!==null&&Ke<le.length;Ke++){Ve.index>Ke?(Jt=Ve,Ve=null):Jt=Ve.sibling;var mt=se(ne,Ve,le[Ke],ye);if(mt===null){Ve===null&&(Ve=Jt);break}a&&Ve&&mt.alternate===null&&l(ne,Ve),Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt,Ve=Jt}if(Ke===le.length)return c(ne,Ve),pt&&Ea(ne,Ke),Ie;if(Ve===null){for(;Ke<le.length;Ke++)Ve=_e(ne,le[Ke],ye),Ve!==null&&(Q=b(Ve,Q,Ke),ot===null?Ie=Ve:ot.sibling=Ve,ot=Ve);return pt&&Ea(ne,Ke),Ie}for(Ve=h(Ve);Ke<le.length;Ke++)Jt=pe(Ve,ne,Ke,le[Ke],ye),Jt!==null&&(a&&Jt.alternate!==null&&Ve.delete(Jt.key===null?Ke:Jt.key),Q=b(Jt,Q,Ke),ot===null?Ie=Jt:ot.sibling=Jt,ot=Jt);return a&&Ve.forEach(function(Qi){return l(ne,Qi)}),pt&&Ea(ne,Ke),Ie}function Je(ne,Q,le,ye){if(le==null)throw Error(r(151));for(var Ie=null,ot=null,Ve=Q,Ke=Q=0,Jt=null,mt=le.next();Ve!==null&&!mt.done;Ke++,mt=le.next()){Ve.index>Ke?(Jt=Ve,Ve=null):Jt=Ve.sibling;var Qi=se(ne,Ve,mt.value,ye);if(Qi===null){Ve===null&&(Ve=Jt);break}a&&Ve&&Qi.alternate===null&&l(ne,Ve),Q=b(Qi,Q,Ke),ot===null?Ie=Qi:ot.sibling=Qi,ot=Qi,Ve=Jt}if(mt.done)return c(ne,Ve),pt&&Ea(ne,Ke),Ie;if(Ve===null){for(;!mt.done;Ke++,mt=le.next())mt=_e(ne,mt.value,ye),mt!==null&&(Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt);return pt&&Ea(ne,Ke),Ie}for(Ve=h(Ve);!mt.done;Ke++,mt=le.next())mt=pe(Ve,ne,Ke,mt.value,ye),mt!==null&&(a&&mt.alternate!==null&&Ve.delete(mt.key===null?Ke:mt.key),Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt);return a&&Ve.forEach(function(rL){return l(ne,rL)}),pt&&Ea(ne,Ke),Ie}function It(ne,Q,le,ye){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case s:e:{for(var Ie=le.key;Q!==null;){if(Q.key===Ie){if(Ie=le.type,Ie===f){if(Q.tag===7){c(ne,Q.sibling),ye=y(Q,le.props.children),ye.return=ne,ne=ye;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===_&&sx(Ie)===Q.type){c(ne,Q.sibling),ye=y(Q,le.props),Wl(ye,le),ye.return=ne,ne=ye;break e}c(ne,Q);break}else l(ne,Q);Q=Q.sibling}le.type===f?(ye=za(le.props.children,ne.mode,ye,le.key),ye.return=ne,ne=ye):(ye=rc(le.type,le.key,le.props,null,ne.mode,ye),Wl(ye,le),ye.return=ne,ne=ye)}return L(ne);case u:e:{for(Ie=le.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===le.containerInfo&&Q.stateNode.implementation===le.implementation){c(ne,Q.sibling),ye=y(Q,le.children||[]),ye.return=ne,ne=ye;break e}else{c(ne,Q);break}else l(ne,Q);Q=Q.sibling}ye=ep(le,ne.mode,ye),ye.return=ne,ne=ye}return L(ne);case _:return Ie=le._init,le=Ie(le._payload),It(ne,Q,le,ye)}if(O(le))return Be(ne,Q,le,ye);if(z(le)){if(Ie=z(le),typeof Ie!="function")throw Error(r(150));return le=Ie.call(le),Je(ne,Q,le,ye)}if(typeof le.then=="function")return It(ne,Q,Fu(le),ye);if(le.$$typeof===g)return It(ne,Q,ec(ne,le),ye);Iu(ne,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,Q!==null&&Q.tag===6?(c(ne,Q.sibling),ye=y(Q,le),ye.return=ne,ne=ye):(c(ne,Q),ye=Jh(le,ne.mode,ye),ye.return=ne,ne=ye),L(ne)):c(ne,Q)}return function(ne,Q,le,ye){try{Yl=0;var Ie=It(ne,Q,le,ye);return Eo=null,Ie}catch(Ve){if(Ve===Vl)throw Ve;var ot=lr(29,Ve,null,ne.mode);return ot.lanes=ye,ot.return=ne,ot}finally{}}}var ka=ux(!0),cx=ux(!1),_o=oe(null),Gu=oe(0);function fx(a,l){a=di,he(Gu,a),he(_o,l),di=a|l.baseLanes}function oh(){he(Gu,di),he(_o,_o.current)}function lh(){di=Gu.current,Ce(_o),Ce(Gu)}var ir=oe(null),zr=null;function zi(a){var l=a.alternate;he(Yt,Yt.current&1),he(ir,a),zr===null&&(l===null||_o.current!==null||l.memoizedState!==null)&&(zr=a)}function dx(a){if(a.tag===22){if(he(Yt,Yt.current),he(ir,a),zr===null){var l=a.alternate;l!==null&&l.memoizedState!==null&&(zr=a)}}else ji()}function ji(){he(Yt,Yt.current),he(ir,ir.current)}function ni(a){Ce(ir),zr===a&&(zr=null),Ce(Yt)}var Yt=oe(0);function Bu(a){for(var l=a;l!==null;){if(l.tag===13){var c=l.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var $N=typeof AbortController<"u"?AbortController:function(){var a=[],l=this.signal={aborted:!1,addEventListener:function(c,h){a.push(h)}};this.abort=function(){l.aborted=!0,a.forEach(function(c){return c()})}},VN=e.unstable_scheduleCallback,qN=e.unstable_NormalPriority,Wt={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sh(){return{controller:new $N,data:new Map,refCount:0}}function Xl(a){a.refCount--,a.refCount===0&&VN(qN,function(){a.controller.abort()})}var Kl=null,uh=0,ko=0,Co=null;function YN(a,l){if(Kl===null){var c=Kl=[];uh=0,ko=mp(),Co={status:"pending",value:void 0,then:function(h){c.push(h)}}}return uh++,l.then(hx,hx),l}function hx(){if(--uh===0&&Kl!==null){Co!==null&&(Co.status="fulfilled");var a=Kl;Kl=null,ko=0,Co=null;for(var l=0;l<a.length;l++)(0,a[l])()}}function WN(a,l){var c=[],h={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return a.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<c.length;y++)(0,c[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),h}var px=P.S;P.S=function(a,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&YN(a,l),px!==null&&px(a,l)};var Ca=oe(null);function ch(){var a=Ca.current;return a!==null?a:Rt.pooledCache}function Uu(a,l){l===null?he(Ca,Ca.current):he(Ca,l.pool)}function mx(){var a=ch();return a===null?null:{parent:Wt._currentValue,pool:a}}var Mi=0,it=null,xt=null,Ut=null,Hu=!1,To=!1,Ta=!1,$u=0,Zl=0,Ao=null,XN=0;function Gt(){throw Error(r(321))}function fh(a,l){if(l===null)return!1;for(var c=0;c<l.length&&c<a.length;c++)if(!Bn(a[c],l[c]))return!1;return!0}function dh(a,l,c,h,y,b){return Mi=b,it=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=a===null||a.memoizedState===null?Aa:Pi,Ta=!1,b=c(h,y),Ta=!1,To&&(b=vx(l,c,h,y)),gx(a),b}function gx(a){P.H=jr;var l=xt!==null&&xt.next!==null;if(Mi=0,Ut=xt=it=null,Hu=!1,Zl=0,Ao=null,l)throw Error(r(300));a===null||Zt||(a=a.dependencies,a!==null&&Ju(a)&&(Zt=!0))}function vx(a,l,c,h){it=a;var y=0;do{if(To&&(Ao=null),Zl=0,To=!1,25<=y)throw Error(r(301));if(y+=1,Ut=xt=null,a.updateQueue!=null){var b=a.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}P.H=Ra,b=l(c,h)}while(To);return b}function KN(){var a=P.H,l=a.useState()[0];return l=typeof l.then=="function"?Ql(l):l,a=a.useState()[0],(xt!==null?xt.memoizedState:null)!==a&&(it.flags|=1024),l}function hh(){var a=$u!==0;return $u=0,a}function ph(a,l,c){l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~c}function mh(a){if(Hu){for(a=a.memoizedState;a!==null;){var l=a.queue;l!==null&&(l.pending=null),a=a.next}Hu=!1}Mi=0,Ut=xt=it=null,To=!1,Zl=$u=0,Ao=null}function Nn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?it.memoizedState=Ut=a:Ut=Ut.next=a,Ut}function Ht(){if(xt===null){var a=it.alternate;a=a!==null?a.memoizedState:null}else a=xt.next;var l=Ut===null?it.memoizedState:Ut.next;if(l!==null)Ut=l,xt=a;else{if(a===null)throw it.alternate===null?Error(r(467)):Error(r(310));xt=a,a={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Ut===null?it.memoizedState=Ut=a:Ut=Ut.next=a}return Ut}var Vu;Vu=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function Ql(a){var l=Zl;return Zl+=1,Ao===null&&(Ao=[]),a=ox(Ao,a,l),l=it,(Ut===null?l.memoizedState:Ut.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?Aa:Pi),a}function qu(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ql(a);if(a.$$typeof===g)return pn(a)}throw Error(r(438,String(a)))}function gh(a){var l=null,c=it.updateQueue;if(c!==null&&(l=c.memoCache),l==null){var h=it.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),c===null&&(c=Vu(),it.updateQueue=c),c.memoCache=l,c=l.data[l.index],c===void 0)for(c=l.data[l.index]=Array(a),h=0;h<a;h++)c[h]=N;return l.index++,c}function ri(a,l){return typeof l=="function"?l(a):l}function Yu(a){var l=Ht();return vh(l,xt,a)}function vh(a,l,c){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=c;var y=a.baseQueue,b=h.pending;if(b!==null){if(y!==null){var L=y.next;y.next=b.next,b.next=L}l.baseQueue=y=b,h.pending=null}if(b=a.baseState,y===null)a.memoizedState=b;else{l=y.next;var H=L=null,W=null,J=l,me=!1;do{var _e=J.lane&-536870913;if(_e!==J.lane?(ht&_e)===_e:(Mi&_e)===_e){var se=J.revertLane;if(se===0)W!==null&&(W=W.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),_e===ko&&(me=!0);else if((Mi&se)===se){J=J.next,se===ko&&(me=!0);continue}else _e={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},W===null?(H=W=_e,L=b):W=W.next=_e,it.lanes|=se,qi|=se;_e=J.action,Ta&&c(b,_e),b=J.hasEagerState?J.eagerState:c(b,_e)}else se={lane:_e,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},W===null?(H=W=se,L=b):W=W.next=se,it.lanes|=_e,qi|=_e;J=J.next}while(J!==null&&J!==l);if(W===null?L=b:W.next=H,!Bn(b,a.memoizedState)&&(Zt=!0,me&&(c=Co,c!==null)))throw c;a.memoizedState=b,a.baseState=L,a.baseQueue=W,h.lastRenderedState=b}return y===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function yh(a){var l=Ht(),c=l.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var h=c.dispatch,y=c.pending,b=l.memoizedState;if(y!==null){c.pending=null;var L=y=y.next;do b=a(b,L.action),L=L.next;while(L!==y);Bn(b,l.memoizedState)||(Zt=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),c.lastRenderedState=b}return[b,h]}function yx(a,l,c){var h=it,y=Ht(),b=pt;if(b){if(c===void 0)throw Error(r(407));c=c()}else c=l();var L=!Bn((xt||y).memoizedState,c);if(L&&(y.memoizedState=c,Zt=!0),y=y.queue,wh(wx.bind(null,h,y,a),[a]),y.getSnapshot!==l||L||Ut!==null&&Ut.memoizedState.tag&1){if(h.flags|=2048,Ro(9,xx.bind(null,h,y,c,l),{destroy:void 0},null),Rt===null)throw Error(r(349));b||Mi&60||bx(h,l,c)}return c}function bx(a,l,c){a.flags|=16384,a={getSnapshot:l,value:c},l=it.updateQueue,l===null?(l=Vu(),it.updateQueue=l,l.stores=[a]):(c=l.stores,c===null?l.stores=[a]:c.push(a))}function xx(a,l,c,h){l.value=c,l.getSnapshot=h,Sx(l)&&Ex(a)}function wx(a,l,c){return c(function(){Sx(l)&&Ex(a)})}function Sx(a){var l=a.getSnapshot;a=a.value;try{var c=l();return!Bn(a,c)}catch{return!0}}function Ex(a){var l=Li(a,2);l!==null&&_n(l,a,2)}function bh(a){var l=Nn();if(typeof a=="function"){var c=a;if(a=c(),Ta){at(!0);try{c()}finally{at(!1)}}}return l.memoizedState=l.baseState=a,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:a},l}function _x(a,l,c,h){return a.baseState=c,vh(a,xt,typeof h=="function"?h:ri)}function ZN(a,l,c,h,y){if(Ku(a))throw Error(r(485));if(a=l.action,a!==null){var b={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){b.listeners.push(L)}};P.T!==null?c(!0):b.isTransition=!1,h(b),c=l.pending,c===null?(b.next=l.pending=b,kx(l,b)):(b.next=c.next,l.pending=c.next=b)}}function kx(a,l){var c=l.action,h=l.payload,y=a.state;if(l.isTransition){var b=P.T,L={};P.T=L;try{var H=c(y,h),W=P.S;W!==null&&W(L,H),Cx(a,l,H)}catch(J){xh(a,l,J)}finally{P.T=b}}else try{b=c(y,h),Cx(a,l,b)}catch(J){xh(a,l,J)}}function Cx(a,l,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){Tx(a,l,h)},function(h){return xh(a,l,h)}):Tx(a,l,c)}function Tx(a,l,c){l.status="fulfilled",l.value=c,Ax(l),a.state=c,l=a.pending,l!==null&&(c=l.next,c===l?a.pending=null:(c=c.next,l.next=c,kx(a,c)))}function xh(a,l,c){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=c,Ax(l),l=l.next;while(l!==h)}a.action=null}function Ax(a){a=a.listeners;for(var l=0;l<a.length;l++)(0,a[l])()}function Rx(a,l){return l}function Dx(a,l){if(pt){var c=Rt.formState;if(c!==null){e:{var h=it;if(pt){if(an){t:{for(var y=an,b=Lr;y.nodeType!==8;){if(!b){y=null;break t}if(y=xr(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){an=xr(y.nextSibling),h=y.data==="F!";break e}}_a(h)}h=!1}h&&(l=c[0])}}return c=Nn(),c.memoizedState=c.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rx,lastRenderedState:l},c.queue=h,c=Wx.bind(null,it,h),h.dispatch=c,h=bh(!1),b=Ch.bind(null,it,!1,h.queue),h=Nn(),y={state:l,dispatch:null,action:a,pending:null},h.queue=y,c=ZN.bind(null,it,y,b,c),y.dispatch=c,h.memoizedState=a,[l,c,!1]}function Nx(a){var l=Ht();return Ox(l,xt,a)}function Ox(a,l,c){l=vh(a,l,Rx)[0],a=Yu(ri)[0],l=typeof l=="object"&&l!==null&&typeof l.then=="function"?Ql(l):l;var h=Ht(),y=h.queue,b=y.dispatch;return c!==h.memoizedState&&(it.flags|=2048,Ro(9,QN.bind(null,y,c),{destroy:void 0},null)),[l,b,a]}function QN(a,l){a.action=l}function Lx(a){var l=Ht(),c=xt;if(c!==null)return Ox(l,c,a);Ht(),l=l.memoizedState,c=Ht();var h=c.queue.dispatch;return c.memoizedState=a,[l,h,!1]}function Ro(a,l,c,h){return a={tag:a,create:l,inst:c,deps:h,next:null},l=it.updateQueue,l===null&&(l=Vu(),it.updateQueue=l),c=l.lastEffect,c===null?l.lastEffect=a.next=a:(h=c.next,c.next=a,a.next=h,l.lastEffect=a),a}function zx(){return Ht().memoizedState}function Wu(a,l,c,h){var y=Nn();it.flags|=a,y.memoizedState=Ro(1|l,c,{destroy:void 0},h===void 0?null:h)}function Xu(a,l,c,h){var y=Ht();h=h===void 0?null:h;var b=y.memoizedState.inst;xt!==null&&h!==null&&fh(h,xt.memoizedState.deps)?y.memoizedState=Ro(l,c,b,h):(it.flags|=a,y.memoizedState=Ro(1|l,c,b,h))}function jx(a,l){Wu(8390656,8,a,l)}function wh(a,l){Xu(2048,8,a,l)}function Mx(a,l){return Xu(4,2,a,l)}function Px(a,l){return Xu(4,4,a,l)}function Fx(a,l){if(typeof l=="function"){a=a();var c=l(a);return function(){typeof c=="function"?c():l(null)}}if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function Ix(a,l,c){c=c!=null?c.concat([a]):null,Xu(4,4,Fx.bind(null,l,a),c)}function Sh(){}function Gx(a,l){var c=Ht();l=l===void 0?null:l;var h=c.memoizedState;return l!==null&&fh(l,h[1])?h[0]:(c.memoizedState=[a,l],a)}function Bx(a,l){var c=Ht();l=l===void 0?null:l;var h=c.memoizedState;if(l!==null&&fh(l,h[1]))return h[0];if(h=a(),Ta){at(!0);try{a()}finally{at(!1)}}return c.memoizedState=[h,l],h}function Eh(a,l,c){return c===void 0||Mi&1073741824?a.memoizedState=l:(a.memoizedState=c,a=H0(),it.lanes|=a,qi|=a,c)}function Ux(a,l,c,h){return Bn(c,l)?c:_o.current!==null?(a=Eh(a,c,h),Bn(a,l)||(Zt=!0),a):Mi&42?(a=H0(),it.lanes|=a,qi|=a,l):(Zt=!0,a.memoizedState=c)}function Hx(a,l,c,h,y){var b=X.p;X.p=b!==0&&8>b?b:8;var L=P.T,H={};P.T=H,Ch(a,!1,l,c);try{var W=y(),J=P.S;if(J!==null&&J(H,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var me=WN(W,h);Jl(a,l,me,Vn(a))}else Jl(a,l,h,Vn(a))}catch(_e){Jl(a,l,{then:function(){},status:"rejected",reason:_e},Vn())}finally{X.p=b,P.T=L}}function JN(){}function _h(a,l,c,h){if(a.tag!==5)throw Error(r(476));var y=$x(a).queue;Hx(a,y,l,re,c===null?JN:function(){return Vx(a),c(h)})}function $x(a){var l=a.memoizedState;if(l!==null)return l;l={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:re},next:null};var c={};return l.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:c},next:null},a.memoizedState=l,a=a.alternate,a!==null&&(a.memoizedState=l),l}function Vx(a){var l=$x(a).next.queue;Jl(a,l,{},Vn())}function kh(){return pn(bs)}function qx(){return Ht().memoizedState}function Yx(){return Ht().memoizedState}function eO(a){for(var l=a.return;l!==null;){switch(l.tag){case 24:case 3:var c=Vn();a=Gi(c);var h=Bi(l,a,c);h!==null&&(_n(h,l,c),ns(h,l,c)),l={cache:sh()},a.payload=l;return}l=l.return}}function tO(a,l,c){var h=Vn();c={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Ku(a)?Xx(l,c):(c=th(a,l,c,h),c!==null&&(_n(c,a,h),Kx(c,l,h)))}function Wx(a,l,c){var h=Vn();Jl(a,l,c,h)}function Jl(a,l,c,h){var y={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ku(a))Xx(l,y);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var L=l.lastRenderedState,H=b(L,c);if(y.hasEagerState=!0,y.eagerState=H,Bn(H,L))return Lu(a,l,y,0),Rt===null&&Ou(),!1}catch{}finally{}if(c=th(a,l,y,h),c!==null)return _n(c,a,h),Kx(c,l,h),!0}return!1}function Ch(a,l,c,h){if(h={lane:2,revertLane:mp(),action:h,hasEagerState:!1,eagerState:null,next:null},Ku(a)){if(l)throw Error(r(479))}else l=th(a,c,h,2),l!==null&&_n(l,a,2)}function Ku(a){var l=a.alternate;return a===it||l!==null&&l===it}function Xx(a,l){To=Hu=!0;var c=a.pending;c===null?l.next=l:(l.next=c.next,c.next=l),a.pending=l}function Kx(a,l,c){if(c&4194176){var h=l.lanes;h&=a.pendingLanes,c|=h,l.lanes=c,gr(a,c)}}var jr={readContext:pn,use:qu,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt};jr.useCacheRefresh=Gt,jr.useMemoCache=Gt,jr.useHostTransitionStatus=Gt,jr.useFormState=Gt,jr.useActionState=Gt,jr.useOptimistic=Gt;var Aa={readContext:pn,use:qu,useCallback:function(a,l){return Nn().memoizedState=[a,l===void 0?null:l],a},useContext:pn,useEffect:jx,useImperativeHandle:function(a,l,c){c=c!=null?c.concat([a]):null,Wu(4194308,4,Fx.bind(null,l,a),c)},useLayoutEffect:function(a,l){return Wu(4194308,4,a,l)},useInsertionEffect:function(a,l){Wu(4,2,a,l)},useMemo:function(a,l){var c=Nn();l=l===void 0?null:l;var h=a();if(Ta){at(!0);try{a()}finally{at(!1)}}return c.memoizedState=[h,l],h},useReducer:function(a,l,c){var h=Nn();if(c!==void 0){var y=c(l);if(Ta){at(!0);try{c(l)}finally{at(!1)}}}else y=l;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=tO.bind(null,it,a),[h.memoizedState,a]},useRef:function(a){var l=Nn();return a={current:a},l.memoizedState=a},useState:function(a){a=bh(a);var l=a.queue,c=Wx.bind(null,it,l);return l.dispatch=c,[a.memoizedState,c]},useDebugValue:Sh,useDeferredValue:function(a,l){var c=Nn();return Eh(c,a,l)},useTransition:function(){var a=bh(!1);return a=Hx.bind(null,it,a.queue,!0,!1),Nn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,l,c){var h=it,y=Nn();if(pt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=l(),Rt===null)throw Error(r(349));ht&60||bx(h,l,c)}y.memoizedState=c;var b={value:c,getSnapshot:l};return y.queue=b,jx(wx.bind(null,h,b,a),[a]),h.flags|=2048,Ro(9,xx.bind(null,h,b,c,l),{destroy:void 0},null),c},useId:function(){var a=Nn(),l=Rt.identifierPrefix;if(pt){var c=ti,h=ei;c=(h&~(1<<32-At(h)-1)).toString(32)+c,l=":"+l+"R"+c,c=$u++,0<c&&(l+="H"+c.toString(32)),l+=":"}else c=XN++,l=":"+l+"r"+c.toString(32)+":";return a.memoizedState=l},useCacheRefresh:function(){return Nn().memoizedState=eO.bind(null,it)}};Aa.useMemoCache=gh,Aa.useHostTransitionStatus=kh,Aa.useFormState=Dx,Aa.useActionState=Dx,Aa.useOptimistic=function(a){var l=Nn();l.memoizedState=l.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=c,l=Ch.bind(null,it,!0,c),c.dispatch=l,[a,l]};var Pi={readContext:pn,use:qu,useCallback:Gx,useContext:pn,useEffect:wh,useImperativeHandle:Ix,useInsertionEffect:Mx,useLayoutEffect:Px,useMemo:Bx,useReducer:Yu,useRef:zx,useState:function(){return Yu(ri)},useDebugValue:Sh,useDeferredValue:function(a,l){var c=Ht();return Ux(c,xt.memoizedState,a,l)},useTransition:function(){var a=Yu(ri)[0],l=Ht().memoizedState;return[typeof a=="boolean"?a:Ql(a),l]},useSyncExternalStore:yx,useId:qx};Pi.useCacheRefresh=Yx,Pi.useMemoCache=gh,Pi.useHostTransitionStatus=kh,Pi.useFormState=Nx,Pi.useActionState=Nx,Pi.useOptimistic=function(a,l){var c=Ht();return _x(c,xt,a,l)};var Ra={readContext:pn,use:qu,useCallback:Gx,useContext:pn,useEffect:wh,useImperativeHandle:Ix,useInsertionEffect:Mx,useLayoutEffect:Px,useMemo:Bx,useReducer:yh,useRef:zx,useState:function(){return yh(ri)},useDebugValue:Sh,useDeferredValue:function(a,l){var c=Ht();return xt===null?Eh(c,a,l):Ux(c,xt.memoizedState,a,l)},useTransition:function(){var a=yh(ri)[0],l=Ht().memoizedState;return[typeof a=="boolean"?a:Ql(a),l]},useSyncExternalStore:yx,useId:qx};Ra.useCacheRefresh=Yx,Ra.useMemoCache=gh,Ra.useHostTransitionStatus=kh,Ra.useFormState=Lx,Ra.useActionState=Lx,Ra.useOptimistic=function(a,l){var c=Ht();return xt!==null?_x(c,xt,a,l):(c.baseState=a,[a,c.queue.dispatch])};function Th(a,l,c,h){l=a.memoizedState,c=c(h,l),c=c==null?l:j({},l,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var Ah={isMounted:function(a){return(a=a._reactInternals)?F(a)===a:!1},enqueueSetState:function(a,l,c){a=a._reactInternals;var h=Vn(),y=Gi(h);y.payload=l,c!=null&&(y.callback=c),l=Bi(a,y,h),l!==null&&(_n(l,a,h),ns(l,a,h))},enqueueReplaceState:function(a,l,c){a=a._reactInternals;var h=Vn(),y=Gi(h);y.tag=1,y.payload=l,c!=null&&(y.callback=c),l=Bi(a,y,h),l!==null&&(_n(l,a,h),ns(l,a,h))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var c=Vn(),h=Gi(c);h.tag=2,l!=null&&(h.callback=l),l=Bi(a,h,c),l!==null&&(_n(l,a,c),ns(l,a,c))}};function Zx(a,l,c,h,y,b,L){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,b,L):l.prototype&&l.prototype.isPureReactComponent?!Gl(c,h)||!Gl(y,b):!0}function Qx(a,l,c,h){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(c,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(c,h),l.state!==a&&Ah.enqueueReplaceState(l,l.state,null)}function Da(a,l){var c=l;if("ref"in l){c={};for(var h in l)h!=="ref"&&(c[h]=l[h])}if(a=a.defaultProps){c===l&&(c=j({},c));for(var y in a)c[y]===void 0&&(c[y]=a[y])}return c}var Zu=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function Jx(a){Zu(a)}function e0(a){console.error(a)}function t0(a){Zu(a)}function Qu(a,l){try{var c=a.onUncaughtError;c(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function n0(a,l,c){try{var h=a.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Rh(a,l,c){return c=Gi(c),c.tag=3,c.payload={element:null},c.callback=function(){Qu(a,l)},c}function r0(a){return a=Gi(a),a.tag=3,a}function i0(a,l,c,h){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var b=h.value;a.payload=function(){return y(b)},a.callback=function(){n0(l,c,h)}}var L=c.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(a.callback=function(){n0(l,c,h),typeof y!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var H=h.stack;this.componentDidCatch(h.value,{componentStack:H!==null?H:""})})}function nO(a,l,c,h,y){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=c.alternate,l!==null&&ts(l,c,y,!0),c=ir.current,c!==null){switch(c.tag){case 13:return zr===null?cp():c.alternate===null&&Ft===0&&(Ft=3),c.flags&=-257,c.flags|=65536,c.lanes=y,h===ah?c.flags|=16384:(l=c.updateQueue,l===null?c.updateQueue=new Set([h]):l.add(h),dp(a,h,y)),!1;case 22:return c.flags|=65536,h===ah?c.flags|=16384:(l=c.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=l):(c=l.retryQueue,c===null?l.retryQueue=new Set([h]):c.add(h)),dp(a,h,y)),!1}throw Error(r(435,c.tag))}return dp(a,h,y),cp(),!1}if(pt)return l=ir.current,l!==null?(!(l.flags&65536)&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==ih&&(a=Error(r(422),{cause:h}),$l(tr(a,c)))):(h!==ih&&(l=Error(r(423),{cause:h}),$l(tr(l,c))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,h=tr(h,c),y=Rh(a.stateNode,h,y),$h(a,y),Ft!==4&&(Ft=2)),!1;var b=Error(r(520),{cause:h});if(b=tr(b,c),cs===null?cs=[b]:cs.push(b),Ft!==4&&(Ft=2),l===null)return!0;h=tr(h,c),c=l;do{switch(c.tag){case 3:return c.flags|=65536,a=y&-y,c.lanes|=a,a=Rh(c.stateNode,h,a),$h(c,a),!1;case 1:if(l=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Yi===null||!Yi.has(b))))return c.flags|=65536,y&=-y,c.lanes|=y,y=r0(y),i0(y,a,c,h),$h(c,y),!1}c=c.return}while(c!==null);return!1}var a0=Error(r(461)),Zt=!1;function on(a,l,c,h){l.child=a===null?cx(l,null,c,h):ka(l,a.child,c,h)}function o0(a,l,c,h,y){c=c.render;var b=l.ref;if("ref"in h){var L={};for(var H in h)H!=="ref"&&(L[H]=h[H])}else L=h;return Oa(l),h=dh(a,l,c,L,b,y),H=hh(),a!==null&&!Zt?(ph(a,l,y),ii(a,l,y)):(pt&&H&&nh(l),l.flags|=1,on(a,l,h,y),l.child)}function l0(a,l,c,h,y){if(a===null){var b=c.type;return typeof b=="function"&&!Qh(b)&&b.defaultProps===void 0&&c.compare===null?(l.tag=15,l.type=b,s0(a,l,b,h,y)):(a=rc(c.type,null,h,l,l.mode,y),a.ref=l.ref,a.return=l,l.child=a)}if(b=a.child,!Fh(a,y)){var L=b.memoizedProps;if(c=c.compare,c=c!==null?c:Gl,c(L,h)&&a.ref===l.ref)return ii(a,l,y)}return l.flags|=1,a=Vi(b,h),a.ref=l.ref,a.return=l,l.child=a}function s0(a,l,c,h,y){if(a!==null){var b=a.memoizedProps;if(Gl(b,h)&&a.ref===l.ref)if(Zt=!1,l.pendingProps=h=b,Fh(a,y))a.flags&131072&&(Zt=!0);else return l.lanes=a.lanes,ii(a,l,y)}return Dh(a,l,c,h,y)}function u0(a,l,c){var h=l.pendingProps,y=h.children,b=(l.stateNode._pendingVisibility&2)!==0,L=a!==null?a.memoizedState:null;if(es(a,l),h.mode==="hidden"||b){if(l.flags&128){if(h=L!==null?L.baseLanes|c:c,a!==null){for(y=l.child=a.child,b=0;y!==null;)b=b|y.lanes|y.childLanes,y=y.sibling;l.childLanes=b&~h}else l.childLanes=0,l.child=null;return c0(a,l,h,c)}if(c&536870912)l.memoizedState={baseLanes:0,cachePool:null},a!==null&&Uu(l,L!==null?L.cachePool:null),L!==null?fx(l,L):oh(),dx(l);else return l.lanes=l.childLanes=536870912,c0(a,l,L!==null?L.baseLanes|c:c,c)}else L!==null?(Uu(l,L.cachePool),fx(l,L),ji(),l.memoizedState=null):(a!==null&&Uu(l,null),oh(),ji());return on(a,l,y,c),l.child}function c0(a,l,c,h){var y=ch();return y=y===null?null:{parent:Wt._currentValue,pool:y},l.memoizedState={baseLanes:c,cachePool:y},a!==null&&Uu(l,null),oh(),dx(l),a!==null&&ts(a,l,h,!0),null}function es(a,l){var c=l.ref;if(c===null)a!==null&&a.ref!==null&&(l.flags|=2097664);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(a===null||a.ref!==c)&&(l.flags|=2097664)}}function Dh(a,l,c,h,y){return Oa(l),c=dh(a,l,c,h,void 0,y),h=hh(),a!==null&&!Zt?(ph(a,l,y),ii(a,l,y)):(pt&&h&&nh(l),l.flags|=1,on(a,l,c,y),l.child)}function f0(a,l,c,h,y,b){return Oa(l),l.updateQueue=null,c=vx(l,h,c,y),gx(a),h=hh(),a!==null&&!Zt?(ph(a,l,b),ii(a,l,b)):(pt&&h&&nh(l),l.flags|=1,on(a,l,c,b),l.child)}function d0(a,l,c,h,y){if(Oa(l),l.stateNode===null){var b=xo,L=c.contextType;typeof L=="object"&&L!==null&&(b=pn(L)),b=new c(h,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Ah,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=h,b.state=l.memoizedState,b.refs={},Uh(l),L=c.contextType,b.context=typeof L=="object"&&L!==null?pn(L):xo,b.state=l.memoizedState,L=c.getDerivedStateFromProps,typeof L=="function"&&(Th(l,c,L,h),b.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(L=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),L!==b.state&&Ah.enqueueReplaceState(b,b.state,null),is(l,h,b,y),rs(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(a===null){b=l.stateNode;var H=l.memoizedProps,W=Da(c,H);b.props=W;var J=b.context,me=c.contextType;L=xo,typeof me=="object"&&me!==null&&(L=pn(me));var _e=c.getDerivedStateFromProps;me=typeof _e=="function"||typeof b.getSnapshotBeforeUpdate=="function",H=l.pendingProps!==H,me||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(H||J!==L)&&Qx(l,b,h,L),Ii=!1;var se=l.memoizedState;b.state=se,is(l,h,b,y),rs(),J=l.memoizedState,H||se!==J||Ii?(typeof _e=="function"&&(Th(l,c,_e,h),J=l.memoizedState),(W=Ii||Zx(l,c,W,h,se,J,L))?(me||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=J),b.props=h,b.state=J,b.context=L,h=W):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{b=l.stateNode,Hh(a,l),L=l.memoizedProps,me=Da(c,L),b.props=me,_e=l.pendingProps,se=b.context,J=c.contextType,W=xo,typeof J=="object"&&J!==null&&(W=pn(J)),H=c.getDerivedStateFromProps,(J=typeof H=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(L!==_e||se!==W)&&Qx(l,b,h,W),Ii=!1,se=l.memoizedState,b.state=se,is(l,h,b,y),rs();var pe=l.memoizedState;L!==_e||se!==pe||Ii||a!==null&&a.dependencies!==null&&Ju(a.dependencies)?(typeof H=="function"&&(Th(l,c,H,h),pe=l.memoizedState),(me=Ii||Zx(l,c,me,h,se,pe,W)||a!==null&&a.dependencies!==null&&Ju(a.dependencies))?(J||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(h,pe,W),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(h,pe,W)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=pe),b.props=h,b.state=pe,b.context=W,h=me):(typeof b.componentDidUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||L===a.memoizedProps&&se===a.memoizedState||(l.flags|=1024),h=!1)}return b=h,es(a,l),h=(l.flags&128)!==0,b||h?(b=l.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,a!==null&&h?(l.child=ka(l,a.child,null,y),l.child=ka(l,null,c,y)):on(a,l,c,y),l.memoizedState=b.state,a=l.child):a=ii(a,l,y),a}function h0(a,l,c,h){return Hl(),l.flags|=256,on(a,l,c,h),l.child}var Nh={dehydrated:null,treeContext:null,retryLane:0};function Oh(a){return{baseLanes:a,cachePool:mx()}}function Lh(a,l,c){return a=a!==null?a.childLanes&~c:0,l&&(a|=sr),a}function p0(a,l,c){var h=l.pendingProps,y=!1,b=(l.flags&128)!==0,L;if((L=b)||(L=a!==null&&a.memoizedState===null?!1:(Yt.current&2)!==0),L&&(y=!0,l.flags&=-129),L=(l.flags&32)!==0,l.flags&=-33,a===null){if(pt){if(y?zi(l):ji(),pt){var H=an,W;if(W=H){e:{for(W=H,H=Lr;W.nodeType!==8;){if(!H){H=null;break e}if(W=xr(W.nextSibling),W===null){H=null;break e}}H=W}H!==null?(l.memoizedState={dehydrated:H,treeContext:Sa!==null?{id:ei,overflow:ti}:null,retryLane:536870912},W=lr(18,null,null,0),W.stateNode=H,W.return=l,l.child=W,En=l,an=null,W=!0):W=!1}W||_a(l)}if(H=l.memoizedState,H!==null&&(H=H.dehydrated,H!==null))return H.data==="$!"?l.lanes=16:l.lanes=536870912,null;ni(l)}return H=h.children,h=h.fallback,y?(ji(),y=l.mode,H=jh({mode:"hidden",children:H},y),h=za(h,y,c,null),H.return=l,h.return=l,H.sibling=h,l.child=H,y=l.child,y.memoizedState=Oh(c),y.childLanes=Lh(a,L,c),l.memoizedState=Nh,h):(zi(l),zh(l,H))}if(W=a.memoizedState,W!==null&&(H=W.dehydrated,H!==null)){if(b)l.flags&256?(zi(l),l.flags&=-257,l=Mh(a,l,c)):l.memoizedState!==null?(ji(),l.child=a.child,l.flags|=128,l=null):(ji(),y=h.fallback,H=l.mode,h=jh({mode:"visible",children:h.children},H),y=za(y,H,c,null),y.flags|=2,h.return=l,y.return=l,h.sibling=y,l.child=h,ka(l,a.child,null,c),h=l.child,h.memoizedState=Oh(c),h.childLanes=Lh(a,L,c),l.memoizedState=Nh,l=y);else if(zi(l),H.data==="$!"){if(L=H.nextSibling&&H.nextSibling.dataset,L)var J=L.dgst;L=J,h=Error(r(419)),h.stack="",h.digest=L,$l({value:h,source:null,stack:null}),l=Mh(a,l,c)}else if(Zt||ts(a,l,c,!1),L=(c&a.childLanes)!==0,Zt||L){if(L=Rt,L!==null){if(h=c&-c,h&42)h=1;else switch(h){case 2:h=1;break;case 8:h=4;break;case 32:h=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:h=64;break;case 268435456:h=134217728;break;default:h=0}if(h=h&(L.suspendedLanes|c)?0:h,h!==0&&h!==W.retryLane)throw W.retryLane=h,Li(a,h),_n(L,a,h),a0}H.data==="$?"||cp(),l=Mh(a,l,c)}else H.data==="$?"?(l.flags|=128,l.child=a.child,l=vO.bind(null,a),H._reactRetry=l,l=null):(a=W.treeContext,an=xr(H.nextSibling),En=l,pt=!0,yr=null,Lr=!1,a!==null&&(nr[rr++]=ei,nr[rr++]=ti,nr[rr++]=Sa,ei=a.id,ti=a.overflow,Sa=l),l=zh(l,h.children),l.flags|=4096);return l}return y?(ji(),y=h.fallback,H=l.mode,W=a.child,J=W.sibling,h=Vi(W,{mode:"hidden",children:h.children}),h.subtreeFlags=W.subtreeFlags&31457280,J!==null?y=Vi(J,y):(y=za(y,H,c,null),y.flags|=2),y.return=l,h.return=l,h.sibling=y,l.child=h,h=y,y=l.child,H=a.child.memoizedState,H===null?H=Oh(c):(W=H.cachePool,W!==null?(J=Wt._currentValue,W=W.parent!==J?{parent:J,pool:J}:W):W=mx(),H={baseLanes:H.baseLanes|c,cachePool:W}),y.memoizedState=H,y.childLanes=Lh(a,L,c),l.memoizedState=Nh,h):(zi(l),c=a.child,a=c.sibling,c=Vi(c,{mode:"visible",children:h.children}),c.return=l,c.sibling=null,a!==null&&(L=l.deletions,L===null?(l.deletions=[a],l.flags|=16):L.push(a)),l.child=c,l.memoizedState=null,c)}function zh(a,l){return l=jh({mode:"visible",children:l},a.mode),l.return=a,a.child=l}function jh(a,l){return G0(a,l,0,null)}function Mh(a,l,c){return ka(l,a.child,null,c),a=zh(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function m0(a,l,c){a.lanes|=l;var h=a.alternate;h!==null&&(h.lanes|=l),Gh(a.return,l,c)}function Ph(a,l,c,h,y){var b=a.memoizedState;b===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:y}:(b.isBackwards=l,b.rendering=null,b.renderingStartTime=0,b.last=h,b.tail=c,b.tailMode=y)}function g0(a,l,c){var h=l.pendingProps,y=h.revealOrder,b=h.tail;if(on(a,l,h.children,c),h=Yt.current,h&2)h=h&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&m0(a,c,l);else if(a.tag===19)m0(a,c,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}h&=1}switch(he(Yt,h),y){case"forwards":for(c=l.child,y=null;c!==null;)a=c.alternate,a!==null&&Bu(a)===null&&(y=c),c=c.sibling;c=y,c===null?(y=l.child,l.child=null):(y=c.sibling,c.sibling=null),Ph(l,!1,y,c,b);break;case"backwards":for(c=null,y=l.child,l.child=null;y!==null;){if(a=y.alternate,a!==null&&Bu(a)===null){l.child=y;break}a=y.sibling,y.sibling=c,c=y,y=a}Ph(l,!0,c,null,b);break;case"together":Ph(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ii(a,l,c){if(a!==null&&(l.dependencies=a.dependencies),qi|=l.lanes,!(c&l.childLanes))if(a!==null){if(ts(a,l,c,!1),(c&l.childLanes)===0)return null}else return null;if(a!==null&&l.child!==a.child)throw Error(r(153));if(l.child!==null){for(a=l.child,c=Vi(a,a.pendingProps),l.child=c,c.return=l;a.sibling!==null;)a=a.sibling,c=c.sibling=Vi(a,a.pendingProps),c.return=l;c.sibling=null}return l.child}function Fh(a,l){return a.lanes&l?!0:(a=a.dependencies,!!(a!==null&&Ju(a)))}function rO(a,l,c){switch(l.tag){case 3:xe(l,l.stateNode.containerInfo),Fi(l,Wt,a.memoizedState.cache),Hl();break;case 27:case 5:ce(l);break;case 4:xe(l,l.stateNode.containerInfo);break;case 10:Fi(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(zi(l),l.flags|=128,null):c&l.child.childLanes?p0(a,l,c):(zi(l),a=ii(a,l,c),a!==null?a.sibling:null);zi(l);break;case 19:var y=(a.flags&128)!==0;if(h=(c&l.childLanes)!==0,h||(ts(a,l,c,!1),h=(c&l.childLanes)!==0),y){if(h)return g0(a,l,c);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),he(Yt,Yt.current),h)break;return null;case 22:case 23:return l.lanes=0,u0(a,l,c);case 24:Fi(l,Wt,a.memoizedState.cache)}return ii(a,l,c)}function v0(a,l,c){if(a!==null)if(a.memoizedProps!==l.pendingProps)Zt=!0;else{if(!Fh(a,c)&&!(l.flags&128))return Zt=!1,rO(a,l,c);Zt=!!(a.flags&131072)}else Zt=!1,pt&&l.flags&1048576&&tx(l,Mu,l.index);switch(l.lanes=0,l.tag){case 16:e:{a=l.pendingProps;var h=l.elementType,y=h._init;if(h=y(h._payload),l.type=h,typeof h=="function")Qh(h)?(a=Da(h,a),l.tag=1,l=d0(null,l,h,a,c)):(l.tag=0,l=Dh(null,l,h,a,c));else{if(h!=null){if(y=h.$$typeof,y===w){l.tag=11,l=o0(null,l,h,a,c);break e}else if(y===C){l.tag=14,l=l0(null,l,h,a,c);break e}}throw l=B(h)||h,Error(r(306,l,""))}}return l;case 0:return Dh(a,l,l.type,l.pendingProps,c);case 1:return h=l.type,y=Da(h,l.pendingProps),d0(a,l,h,y,c);case 3:e:{if(xe(l,l.stateNode.containerInfo),a===null)throw Error(r(387));var b=l.pendingProps;y=l.memoizedState,h=y.element,Hh(a,l),is(l,b,null,c);var L=l.memoizedState;if(b=L.cache,Fi(l,Wt,b),b!==y.cache&&Bh(l,[Wt],c,!0),rs(),b=L.element,y.isDehydrated)if(y={element:b,isDehydrated:!1,cache:L.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=h0(a,l,b,c);break e}else if(b!==h){h=tr(Error(r(424)),l),$l(h),l=h0(a,l,b,c);break e}else for(an=xr(l.stateNode.containerInfo.firstChild),En=l,pt=!0,yr=null,Lr=!0,c=cx(l,null,b,c),l.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Hl(),b===h){l=ii(a,l,c);break e}on(a,l,b,c)}l=l.child}return l;case 26:return es(a,l),a===null?(c=xw(l.type,null,l.pendingProps,null))?l.memoizedState=c:pt||(c=l.type,a=l.pendingProps,h=mc(Pe.current).createElement(c),h[hn]=l,h[Rn]=a,ln(h,c,a),Kt(h),l.stateNode=h):l.memoizedState=xw(l.type,a.memoizedProps,l.pendingProps,a.memoizedState),null;case 27:return ce(l),a===null&&pt&&(h=l.stateNode=vw(l.type,l.pendingProps,Pe.current),En=l,Lr=!0,an=xr(h.firstChild)),h=l.pendingProps.children,a!==null||pt?on(a,l,h,c):l.child=ka(l,null,h,c),es(a,l),l.child;case 5:return a===null&&pt&&((y=h=an)&&(h=LO(h,l.type,l.pendingProps,Lr),h!==null?(l.stateNode=h,En=l,an=xr(h.firstChild),Lr=!1,y=!0):y=!1),y||_a(l)),ce(l),y=l.type,b=l.pendingProps,L=a!==null?a.memoizedProps:null,h=b.children,_p(y,b)?h=null:L!==null&&_p(y,L)&&(l.flags|=32),l.memoizedState!==null&&(y=dh(a,l,KN,null,null,c),bs._currentValue=y),es(a,l),on(a,l,h,c),l.child;case 6:return a===null&&pt&&((a=c=an)&&(c=zO(c,l.pendingProps,Lr),c!==null?(l.stateNode=c,En=l,an=null,a=!0):a=!1),a||_a(l)),null;case 13:return p0(a,l,c);case 4:return xe(l,l.stateNode.containerInfo),h=l.pendingProps,a===null?l.child=ka(l,null,h,c):on(a,l,h,c),l.child;case 11:return o0(a,l,l.type,l.pendingProps,c);case 7:return on(a,l,l.pendingProps,c),l.child;case 8:return on(a,l,l.pendingProps.children,c),l.child;case 12:return on(a,l,l.pendingProps.children,c),l.child;case 10:return h=l.pendingProps,Fi(l,l.type,h.value),on(a,l,h.children,c),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,Oa(l),y=pn(y),h=h(y),l.flags|=1,on(a,l,h,c),l.child;case 14:return l0(a,l,l.type,l.pendingProps,c);case 15:return s0(a,l,l.type,l.pendingProps,c);case 19:return g0(a,l,c);case 22:return u0(a,l,c);case 24:return Oa(l),h=pn(Wt),a===null?(y=ch(),y===null&&(y=Rt,b=sh(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=c),y=b),l.memoizedState={parent:h,cache:y},Uh(l),Fi(l,Wt,y)):(a.lanes&c&&(Hh(a,l),is(l,null,null,c),rs()),y=a.memoizedState,b=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),Fi(l,Wt,h)):(h=b.cache,Fi(l,Wt,h),h!==y.cache&&Bh(l,[Wt],c,!0))),on(a,l,l.pendingProps.children,c),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}var Ih=oe(null),Na=null,ai=null;function Fi(a,l,c){he(Ih,l._currentValue),l._currentValue=c}function oi(a){a._currentValue=Ih.current,Ce(Ih)}function Gh(a,l,c){for(;a!==null;){var h=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),a===c)break;a=a.return}}function Bh(a,l,c,h){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var b=y.dependencies;if(b!==null){var L=y.child;b=b.firstContext;e:for(;b!==null;){var H=b;b=y;for(var W=0;W<l.length;W++)if(H.context===l[W]){b.lanes|=c,H=b.alternate,H!==null&&(H.lanes|=c),Gh(b.return,c,a),h||(L=null);break e}b=H.next}}else if(y.tag===18){if(L=y.return,L===null)throw Error(r(341));L.lanes|=c,b=L.alternate,b!==null&&(b.lanes|=c),Gh(L,c,a),L=null}else L=y.child;if(L!==null)L.return=y;else for(L=y;L!==null;){if(L===a){L=null;break}if(y=L.sibling,y!==null){y.return=L.return,L=y;break}L=L.return}y=L}}function ts(a,l,c,h){a=null;for(var y=l,b=!1;y!==null;){if(!b){if(y.flags&524288)b=!0;else if(y.flags&262144)break}if(y.tag===10){var L=y.alternate;if(L===null)throw Error(r(387));if(L=L.memoizedProps,L!==null){var H=y.type;Bn(y.pendingProps.value,L.value)||(a!==null?a.push(H):a=[H])}}else if(y===Ae.current){if(L=y.alternate,L===null)throw Error(r(387));L.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(bs):a=[bs])}y=y.return}a!==null&&Bh(l,a,c,h),l.flags|=262144}function Ju(a){for(a=a.firstContext;a!==null;){if(!Bn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Oa(a){Na=a,ai=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function pn(a){return y0(Na,a)}function ec(a,l){return Na===null&&Oa(a),y0(a,l)}function y0(a,l){var c=l._currentValue;if(l={context:l,memoizedValue:c,next:null},ai===null){if(a===null)throw Error(r(308));ai=l,a.dependencies={lanes:0,firstContext:l},a.flags|=524288}else ai=ai.next=l;return c}var Ii=!1;function Uh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hh(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Gi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Bi(a,l,c){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,zt&2){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=zu(a),Jb(a,null,c),l}return Lu(a,h,l,c),zu(a)}function ns(a,l,c){if(l=l.updateQueue,l!==null&&(l=l.shared,(c&4194176)!==0)){var h=l.lanes;h&=a.pendingLanes,c|=h,l.lanes=c,gr(a,c)}}function $h(a,l){var c=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var y=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var L={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?y=b=L:b=b.next=L,c=c.next}while(c!==null);b===null?y=b=l:b=b.next=l}else y=b=l;c={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:h.shared,callbacks:h.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=l:a.next=l,c.lastBaseUpdate=l}var Vh=!1;function rs(){if(Vh){var a=Co;if(a!==null)throw a}}function is(a,l,c,h){Vh=!1;var y=a.updateQueue;Ii=!1;var b=y.firstBaseUpdate,L=y.lastBaseUpdate,H=y.shared.pending;if(H!==null){y.shared.pending=null;var W=H,J=W.next;W.next=null,L===null?b=J:L.next=J,L=W;var me=a.alternate;me!==null&&(me=me.updateQueue,H=me.lastBaseUpdate,H!==L&&(H===null?me.firstBaseUpdate=J:H.next=J,me.lastBaseUpdate=W))}if(b!==null){var _e=y.baseState;L=0,me=J=W=null,H=b;do{var se=H.lane&-536870913,pe=se!==H.lane;if(pe?(ht&se)===se:(h&se)===se){se!==0&&se===ko&&(Vh=!0),me!==null&&(me=me.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var Be=a,Je=H;se=l;var It=c;switch(Je.tag){case 1:if(Be=Je.payload,typeof Be=="function"){_e=Be.call(It,_e,se);break e}_e=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=Je.payload,se=typeof Be=="function"?Be.call(It,_e,se):Be,se==null)break e;_e=j({},_e,se);break e;case 2:Ii=!0}}se=H.callback,se!==null&&(a.flags|=64,pe&&(a.flags|=8192),pe=y.callbacks,pe===null?y.callbacks=[se]:pe.push(se))}else pe={lane:se,tag:H.tag,payload:H.payload,callback:H.callback,next:null},me===null?(J=me=pe,W=_e):me=me.next=pe,L|=se;if(H=H.next,H===null){if(H=y.shared.pending,H===null)break;pe=H,H=pe.next,pe.next=null,y.lastBaseUpdate=pe,y.shared.pending=null}}while(!0);me===null&&(W=_e),y.baseState=W,y.firstBaseUpdate=J,y.lastBaseUpdate=me,b===null&&(y.shared.lanes=0),qi|=L,a.lanes=L,a.memoizedState=_e}}function b0(a,l){if(typeof a!="function")throw Error(r(191,a));a.call(l)}function x0(a,l){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)b0(c[a],l)}function as(a,l){try{var c=l.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var y=h.next;c=y;do{if((c.tag&a)===a){h=void 0;var b=c.create,L=c.inst;h=b(),L.destroy=h}c=c.next}while(c!==y)}}catch(H){kt(l,l.return,H)}}function Ui(a,l,c){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var b=y.next;h=b;do{if((h.tag&a)===a){var L=h.inst,H=L.destroy;if(H!==void 0){L.destroy=void 0,y=l;var W=c;try{H()}catch(J){kt(y,W,J)}}}h=h.next}while(h!==b)}}catch(J){kt(l,l.return,J)}}function w0(a){var l=a.updateQueue;if(l!==null){var c=a.stateNode;try{x0(l,c)}catch(h){kt(a,a.return,h)}}}function S0(a,l,c){c.props=Da(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(h){kt(a,l,h)}}function La(a,l){try{var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 26:case 27:case 5:var y=h;break;default:y=h}typeof c=="function"?a.refCleanup=c(y):c.current=y}}catch(b){kt(a,l,b)}}function Un(a,l){var c=a.ref,h=a.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(y){kt(a,l,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){kt(a,l,y)}else c.current=null}function E0(a){var l=a.type,c=a.memoizedProps,h=a.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(y){kt(a,a.return,y)}}function _0(a,l,c){try{var h=a.stateNode;AO(h,a.type,c,l),h[Rn]=l}catch(y){kt(a,a.return,y)}}function k0(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27||a.tag===4}function qh(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||k0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==27&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Yh(a,l,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,l?c.nodeType===8?c.parentNode.insertBefore(a,l):c.insertBefore(a,l):(c.nodeType===8?(l=c.parentNode,l.insertBefore(a,c)):(l=c,l.appendChild(a)),c=c._reactRootContainer,c!=null||l.onclick!==null||(l.onclick=pc));else if(h!==4&&h!==27&&(a=a.child,a!==null))for(Yh(a,l,c),a=a.sibling;a!==null;)Yh(a,l,c),a=a.sibling}function tc(a,l,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,l?c.insertBefore(a,l):c.appendChild(a);else if(h!==4&&h!==27&&(a=a.child,a!==null))for(tc(a,l,c),a=a.sibling;a!==null;)tc(a,l,c),a=a.sibling}var li=!1,Pt=!1,Wh=!1,C0=typeof WeakSet=="function"?WeakSet:Set,Qt=null,T0=!1;function iO(a,l){if(a=a.containerInfo,Sp=wc,a=$b(a),Kd(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var y=h.anchorOffset,b=h.focusNode;h=h.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var L=0,H=-1,W=-1,J=0,me=0,_e=a,se=null;t:for(;;){for(var pe;_e!==c||y!==0&&_e.nodeType!==3||(H=L+y),_e!==b||h!==0&&_e.nodeType!==3||(W=L+h),_e.nodeType===3&&(L+=_e.nodeValue.length),(pe=_e.firstChild)!==null;)se=_e,_e=pe;for(;;){if(_e===a)break t;if(se===c&&++J===y&&(H=L),se===b&&++me===h&&(W=L),(pe=_e.nextSibling)!==null)break;_e=se,se=_e.parentNode}_e=pe}c=H===-1||W===-1?null:{start:H,end:W}}else c=null}c=c||{start:0,end:0}}else c=null;for(Ep={focusedElem:a,selectionRange:c},wc=!1,Qt=l;Qt!==null;)if(l=Qt,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Qt=a;else for(;Qt!==null;){switch(l=Qt,b=l.alternate,a=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if(a&1024&&b!==null){a=void 0,c=l,y=b.memoizedProps,b=b.memoizedState,h=c.stateNode;try{var Be=Da(c.type,y,c.elementType===c.type);a=h.getSnapshotBeforeUpdate(Be,b),h.__reactInternalSnapshotBeforeUpdate=a}catch(Je){kt(c,c.return,Je)}}break;case 3:if(a&1024){if(a=l.stateNode.containerInfo,c=a.nodeType,c===9)Tp(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Tp(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(a&1024)throw Error(r(163))}if(a=l.sibling,a!==null){a.return=l.return,Qt=a;break}Qt=l.return}return Be=T0,T0=!1,Be}function A0(a,l,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:ui(a,c),h&4&&as(5,c);break;case 1:if(ui(a,c),h&4)if(a=c.stateNode,l===null)try{a.componentDidMount()}catch(H){kt(c,c.return,H)}else{var y=Da(c.type,l.memoizedProps);l=l.memoizedState;try{a.componentDidUpdate(y,l,a.__reactInternalSnapshotBeforeUpdate)}catch(H){kt(c,c.return,H)}}h&64&&w0(c),h&512&&La(c,c.return);break;case 3:if(ui(a,c),h&64&&(h=c.updateQueue,h!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{x0(h,a)}catch(H){kt(c,c.return,H)}}break;case 26:ui(a,c),h&512&&La(c,c.return);break;case 27:case 5:ui(a,c),l===null&&h&4&&E0(c),h&512&&La(c,c.return);break;case 12:ui(a,c);break;case 13:ui(a,c),h&4&&N0(a,c);break;case 22:if(y=c.memoizedState!==null||li,!y){l=l!==null&&l.memoizedState!==null||Pt;var b=li,L=Pt;li=y,(Pt=l)&&!L?Hi(a,c,(c.subtreeFlags&8772)!==0):ui(a,c),li=b,Pt=L}h&512&&(c.memoizedProps.mode==="manual"?La(c,c.return):Un(c,c.return));break;default:ui(a,c)}}function R0(a){var l=a.alternate;l!==null&&(a.alternate=null,R0(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&zd(l)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var $t=null,Hn=!1;function si(a,l,c){for(c=c.child;c!==null;)D0(a,l,c),c=c.sibling}function D0(a,l,c){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(bt,c)}catch{}switch(c.tag){case 26:Pt||Un(c,l),si(a,l,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Pt||Un(c,l);var h=$t,y=Hn;for($t=c.stateNode,si(a,l,c),c=c.stateNode,l=c.attributes;l.length;)c.removeAttributeNode(l[0]);zd(c),$t=h,Hn=y;break;case 5:Pt||Un(c,l);case 6:y=$t;var b=Hn;if($t=null,si(a,l,c),$t=y,Hn=b,$t!==null)if(Hn)try{a=$t,h=c.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)}catch(L){kt(c,l,L)}else try{$t.removeChild(c.stateNode)}catch(L){kt(c,l,L)}break;case 18:$t!==null&&(Hn?(l=$t,c=c.stateNode,l.nodeType===8?Cp(l.parentNode,c):l.nodeType===1&&Cp(l,c),Es(l)):Cp($t,c.stateNode));break;case 4:h=$t,y=Hn,$t=c.stateNode.containerInfo,Hn=!0,si(a,l,c),$t=h,Hn=y;break;case 0:case 11:case 14:case 15:Pt||Ui(2,c,l),Pt||Ui(4,c,l),si(a,l,c);break;case 1:Pt||(Un(c,l),h=c.stateNode,typeof h.componentWillUnmount=="function"&&S0(c,l,h)),si(a,l,c);break;case 21:si(a,l,c);break;case 22:Pt||Un(c,l),Pt=(h=Pt)||c.memoizedState!==null,si(a,l,c),Pt=h;break;default:si(a,l,c)}}function N0(a,l){if(l.memoizedState===null&&(a=l.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Es(a)}catch(c){kt(l,l.return,c)}}function aO(a){switch(a.tag){case 13:case 19:var l=a.stateNode;return l===null&&(l=a.stateNode=new C0),l;case 22:return a=a.stateNode,l=a._retryCache,l===null&&(l=a._retryCache=new C0),l;default:throw Error(r(435,a.tag))}}function Xh(a,l){var c=aO(a);l.forEach(function(h){var y=yO.bind(null,a,h);c.has(h)||(c.add(h),h.then(y,y))})}function ar(a,l){var c=l.deletions;if(c!==null)for(var h=0;h<c.length;h++){var y=c[h],b=a,L=l,H=L;e:for(;H!==null;){switch(H.tag){case 27:case 5:$t=H.stateNode,Hn=!1;break e;case 3:$t=H.stateNode.containerInfo,Hn=!0;break e;case 4:$t=H.stateNode.containerInfo,Hn=!0;break e}H=H.return}if($t===null)throw Error(r(160));D0(b,L,y),$t=null,Hn=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)O0(l,a),l=l.sibling}var br=null;function O0(a,l){var c=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ar(l,a),or(a),h&4&&(Ui(3,a,a.return),as(3,a),Ui(5,a,a.return));break;case 1:ar(l,a),or(a),h&512&&(Pt||c===null||Un(c,c.return)),h&64&&li&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var y=br;if(ar(l,a),or(a),h&512&&(Pt||c===null||Un(c,c.return)),h&4){var b=c!==null?c.memoizedState:null;if(h=a.memoizedState,c===null)if(h===null)if(a.stateNode===null){e:{h=a.type,c=a.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":b=y.getElementsByTagName("title")[0],(!b||b[Nl]||b[hn]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(h),y.head.insertBefore(b,y.querySelector("head > title"))),ln(b,h,c),b[hn]=a,Kt(b),h=b;break e;case"link":var L=Ew("link","href",y).get(h+(c.href||""));if(L){for(var H=0;H<L.length;H++)if(b=L[H],b.getAttribute("href")===(c.href==null?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){L.splice(H,1);break t}}b=y.createElement(h),ln(b,h,c),y.head.appendChild(b);break;case"meta":if(L=Ew("meta","content",y).get(h+(c.content||""))){for(H=0;H<L.length;H++)if(b=L[H],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){L.splice(H,1);break t}}b=y.createElement(h),ln(b,h,c),y.head.appendChild(b);break;default:throw Error(r(468,h))}b[hn]=a,Kt(b),h=b}a.stateNode=h}else _w(y,a.type,a.stateNode);else a.stateNode=Sw(y,h,a.memoizedProps);else b!==h?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,h===null?_w(y,a.type,a.stateNode):Sw(y,h,a.memoizedProps)):h===null&&a.stateNode!==null&&_0(a,a.memoizedProps,c.memoizedProps)}break;case 27:if(h&4&&a.alternate===null){y=a.stateNode,b=a.memoizedProps;try{for(var W=y.firstChild;W;){var J=W.nextSibling,me=W.nodeName;W[Nl]||me==="HEAD"||me==="BODY"||me==="SCRIPT"||me==="STYLE"||me==="LINK"&&W.rel.toLowerCase()==="stylesheet"||y.removeChild(W),W=J}for(var _e=a.type,se=y.attributes;se.length;)y.removeAttributeNode(se[0]);ln(y,_e,b),y[hn]=a,y[Rn]=b}catch(Be){kt(a,a.return,Be)}}case 5:if(ar(l,a),or(a),h&512&&(Pt||c===null||Un(c,c.return)),a.flags&32){y=a.stateNode;try{ho(y,"")}catch(Be){kt(a,a.return,Be)}}h&4&&a.stateNode!=null&&(y=a.memoizedProps,_0(a,y,c!==null?c.memoizedProps:y)),h&1024&&(Wh=!0);break;case 6:if(ar(l,a),or(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,c=a.stateNode;try{c.nodeValue=h}catch(Be){kt(a,a.return,Be)}}break;case 3:if(yc=null,y=br,br=gc(l.containerInfo),ar(l,a),br=y,or(a),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Es(l.containerInfo)}catch(Be){kt(a,a.return,Be)}Wh&&(Wh=!1,L0(a));break;case 4:h=br,br=gc(a.stateNode.containerInfo),ar(l,a),or(a),br=h;break;case 12:ar(l,a),or(a);break;case 13:ar(l,a),or(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(ip=ve()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Xh(a,h)));break;case 22:if(h&512&&(Pt||c===null||Un(c,c.return)),W=a.memoizedState!==null,J=c!==null&&c.memoizedState!==null,me=li,_e=Pt,li=me||W,Pt=_e||J,ar(l,a),Pt=_e,li=me,or(a),l=a.stateNode,l._current=a,l._visibility&=-3,l._visibility|=l._pendingVisibility&2,h&8192&&(l._visibility=W?l._visibility&-2:l._visibility|1,W&&(l=li||Pt,c===null||J||l||Do(a)),a.memoizedProps===null||a.memoizedProps.mode!=="manual"))e:for(c=null,l=a;;){if(l.tag===5||l.tag===26||l.tag===27){if(c===null){J=c=l;try{if(y=J.stateNode,W)b=y.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{L=J.stateNode,H=J.memoizedProps.style;var pe=H!=null&&H.hasOwnProperty("display")?H.display:null;L.style.display=pe==null||typeof pe=="boolean"?"":(""+pe).trim()}}catch(Be){kt(J,J.return,Be)}}}else if(l.tag===6){if(c===null){J=l;try{J.stateNode.nodeValue=W?"":J.memoizedProps}catch(Be){kt(J,J.return,Be)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===a)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;c===l&&(c=null),l=l.return}c===l&&(c=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=a.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Xh(a,c))));break;case 19:ar(l,a),or(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Xh(a,h)));break;case 21:break;default:ar(l,a),or(a)}}function or(a){var l=a.flags;if(l&2){try{if(a.tag!==27){e:{for(var c=a.return;c!==null;){if(k0(c)){var h=c;break e}c=c.return}throw Error(r(160))}switch(h.tag){case 27:var y=h.stateNode,b=qh(a);tc(a,b,y);break;case 5:var L=h.stateNode;h.flags&32&&(ho(L,""),h.flags&=-33);var H=qh(a);tc(a,H,L);break;case 3:case 4:var W=h.stateNode.containerInfo,J=qh(a);Yh(a,J,W);break;default:throw Error(r(161))}}}catch(me){kt(a,a.return,me)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function L0(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var l=a;L0(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),a=a.sibling}}function ui(a,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)A0(a,l.alternate,l),l=l.sibling}function Do(a){for(a=a.child;a!==null;){var l=a;switch(l.tag){case 0:case 11:case 14:case 15:Ui(4,l,l.return),Do(l);break;case 1:Un(l,l.return);var c=l.stateNode;typeof c.componentWillUnmount=="function"&&S0(l,l.return,c),Do(l);break;case 26:case 27:case 5:Un(l,l.return),Do(l);break;case 22:Un(l,l.return),l.memoizedState===null&&Do(l);break;default:Do(l)}a=a.sibling}}function Hi(a,l,c){for(c=c&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=a,b=l,L=b.flags;switch(b.tag){case 0:case 11:case 15:Hi(y,b,c),as(4,b);break;case 1:if(Hi(y,b,c),h=b,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(J){kt(h,h.return,J)}if(h=b,y=h.updateQueue,y!==null){var H=h.stateNode;try{var W=y.shared.hiddenCallbacks;if(W!==null)for(y.shared.hiddenCallbacks=null,y=0;y<W.length;y++)b0(W[y],H)}catch(J){kt(h,h.return,J)}}c&&L&64&&w0(b),La(b,b.return);break;case 26:case 27:case 5:Hi(y,b,c),c&&h===null&&L&4&&E0(b),La(b,b.return);break;case 12:Hi(y,b,c);break;case 13:Hi(y,b,c),c&&L&4&&N0(y,b);break;case 22:b.memoizedState===null&&Hi(y,b,c),La(b,b.return);break;default:Hi(y,b,c)}l=l.sibling}}function Kh(a,l){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Xl(c))}function Zh(a,l){a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&Xl(a))}function $i(a,l,c,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)z0(a,l,c,h),l=l.sibling}function z0(a,l,c,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:$i(a,l,c,h),y&2048&&as(9,l);break;case 3:$i(a,l,c,h),y&2048&&(a=null,l.alternate!==null&&(a=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==a&&(l.refCount++,a!=null&&Xl(a)));break;case 12:if(y&2048){$i(a,l,c,h),a=l.stateNode;try{var b=l.memoizedProps,L=b.id,H=b.onPostCommit;typeof H=="function"&&H(L,l.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){kt(l,l.return,W)}}else $i(a,l,c,h);break;case 23:break;case 22:b=l.stateNode,l.memoizedState!==null?b._visibility&4?$i(a,l,c,h):os(a,l):b._visibility&4?$i(a,l,c,h):(b._visibility|=4,No(a,l,c,h,(l.subtreeFlags&10256)!==0)),y&2048&&Kh(l.alternate,l);break;case 24:$i(a,l,c,h),y&2048&&Zh(l.alternate,l);break;default:$i(a,l,c,h)}}function No(a,l,c,h,y){for(y=y&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var b=a,L=l,H=c,W=h,J=L.flags;switch(L.tag){case 0:case 11:case 15:No(b,L,H,W,y),as(8,L);break;case 23:break;case 22:var me=L.stateNode;L.memoizedState!==null?me._visibility&4?No(b,L,H,W,y):os(b,L):(me._visibility|=4,No(b,L,H,W,y)),y&&J&2048&&Kh(L.alternate,L);break;case 24:No(b,L,H,W,y),y&&J&2048&&Zh(L.alternate,L);break;default:No(b,L,H,W,y)}l=l.sibling}}function os(a,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var c=a,h=l,y=h.flags;switch(h.tag){case 22:os(c,h),y&2048&&Kh(h.alternate,h);break;case 24:os(c,h),y&2048&&Zh(h.alternate,h);break;default:os(c,h)}l=l.sibling}}var ls=8192;function Oo(a){if(a.subtreeFlags&ls)for(a=a.child;a!==null;)j0(a),a=a.sibling}function j0(a){switch(a.tag){case 26:Oo(a),a.flags&ls&&a.memoizedState!==null&&YO(br,a.memoizedState,a.memoizedProps);break;case 5:Oo(a);break;case 3:case 4:var l=br;br=gc(a.stateNode.containerInfo),Oo(a),br=l;break;case 22:a.memoizedState===null&&(l=a.alternate,l!==null&&l.memoizedState!==null?(l=ls,ls=16777216,Oo(a),ls=l):Oo(a));break;default:Oo(a)}}function M0(a){var l=a.alternate;if(l!==null&&(a=l.child,a!==null)){l.child=null;do l=a.sibling,a.sibling=null,a=l;while(a!==null)}}function ss(a){var l=a.deletions;if(a.flags&16){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Qt=h,F0(h,a)}M0(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)P0(a),a=a.sibling}function P0(a){switch(a.tag){case 0:case 11:case 15:ss(a),a.flags&2048&&Ui(9,a,a.return);break;case 3:ss(a);break;case 12:ss(a);break;case 22:var l=a.stateNode;a.memoizedState!==null&&l._visibility&4&&(a.return===null||a.return.tag!==13)?(l._visibility&=-5,nc(a)):ss(a);break;default:ss(a)}}function nc(a){var l=a.deletions;if(a.flags&16){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Qt=h,F0(h,a)}M0(a)}for(a=a.child;a!==null;){switch(l=a,l.tag){case 0:case 11:case 15:Ui(8,l,l.return),nc(l);break;case 22:c=l.stateNode,c._visibility&4&&(c._visibility&=-5,nc(l));break;default:nc(l)}a=a.sibling}}function F0(a,l){for(;Qt!==null;){var c=Qt;switch(c.tag){case 0:case 11:case 15:Ui(8,c,l);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Xl(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Qt=h;else e:for(c=a;Qt!==null;){h=Qt;var y=h.sibling,b=h.return;if(R0(h),h===c){Qt=null;break e}if(y!==null){y.return=b,Qt=y;break e}Qt=b}}}function oO(a,l,c,h){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lr(a,l,c,h){return new oO(a,l,c,h)}function Qh(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Vi(a,l){var c=a.alternate;return c===null?(c=lr(a.tag,l,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=l,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&31457280,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,l=a.dependencies,c.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function I0(a,l){a.flags&=31457282;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=l,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,l=c.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),a}function rc(a,l,c,h,y,b){var L=0;if(h=a,typeof a=="function")Qh(a)&&(L=1);else if(typeof a=="string")L=VO(a,c,Ee.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case f:return za(c.children,y,b,l);case d:L=8,y|=24;break;case p:return a=lr(12,c,l,y|2),a.elementType=p,a.lanes=b,a;case x:return a=lr(13,c,l,y),a.elementType=x,a.lanes=b,a;case k:return a=lr(19,c,l,y),a.elementType=k,a.lanes=b,a;case T:return G0(c,y,b,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case m:case g:L=10;break e;case v:L=9;break e;case w:L=11;break e;case C:L=14;break e;case _:L=16,h=null;break e}L=29,c=Error(r(130,a===null?"null":typeof a,"")),h=null}return l=lr(L,c,l,y),l.elementType=a,l.type=h,l.lanes=b,l}function za(a,l,c,h){return a=lr(7,a,h,l),a.lanes=c,a}function G0(a,l,c,h){a=lr(22,a,h,l),a.elementType=T,a.lanes=c;var y={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var b=y._current;if(b===null)throw Error(r(456));if(!(y._pendingVisibility&2)){var L=Li(b,2);L!==null&&(y._pendingVisibility|=2,_n(L,b,2))}},attach:function(){var b=y._current;if(b===null)throw Error(r(456));if(y._pendingVisibility&2){var L=Li(b,2);L!==null&&(y._pendingVisibility&=-3,_n(L,b,2))}}};return a.stateNode=y,a}function Jh(a,l,c){return a=lr(6,a,null,l),a.lanes=c,a}function ep(a,l,c){return l=lr(4,a.children!==null?a.children:[],a.key,l),l.lanes=c,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function ci(a){a.flags|=4}function B0(a,l){if(l.type!=="stylesheet"||l.state.loading&4)a.flags&=-16777217;else if(a.flags|=16777216,!kw(l)){if(l=ir.current,l!==null&&((ht&4194176)===ht?zr!==null:(ht&62914560)!==ht&&!(ht&536870912)||l!==zr))throw ql=ah,ix;a.flags|=8192}}function ic(a,l){l!==null&&(a.flags|=4),a.flags&16384&&(l=a.tag!==22?Cn():536870912,a.lanes|=l,zo|=l)}function us(a,l){if(!pt)switch(a.tailMode){case"hidden":l=a.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function Lt(a){var l=a.alternate!==null&&a.alternate.child===a.child,c=0,h=0;if(l)for(var y=a.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags&31457280,h|=y.flags&31457280,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=h,a.childLanes=c,l}function lO(a,l,c){var h=l.pendingProps;switch(rh(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(l),null;case 1:return Lt(l),null;case 3:return c=l.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),oi(Wt),ee(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Ul(l)?ci(l):a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,yr!==null&&(sp(yr),yr=null))),Lt(l),null;case 26:return c=l.memoizedState,a===null?(ci(l),c!==null?(Lt(l),B0(l,c)):(Lt(l),l.flags&=-16777217)):c?c!==a.memoizedState?(ci(l),Lt(l),B0(l,c)):(Lt(l),l.flags&=-16777217):(a.memoizedProps!==h&&ci(l),Lt(l),l.flags&=-16777217),null;case 27:Te(l),c=Pe.current;var y=l.type;if(a!==null&&l.stateNode!=null)a.memoizedProps!==h&&ci(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Lt(l),null}a=Ee.current,Ul(l)?nx(l):(a=vw(y,h,c),l.stateNode=a,ci(l))}return Lt(l),null;case 5:if(Te(l),c=l.type,a!==null&&l.stateNode!=null)a.memoizedProps!==h&&ci(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Lt(l),null}if(a=Ee.current,Ul(l))nx(l);else{switch(y=mc(Pe.current),a){case 1:a=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:a=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":a=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":a=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":a=y.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?y.createElement(c,{is:h.is}):y.createElement(c)}}a[hn]=l,a[Rn]=h;e:for(y=l.child;y!==null;){if(y.tag===5||y.tag===6)a.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===l)break e;for(;y.sibling===null;){if(y.return===null||y.return===l)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}l.stateNode=a;e:switch(ln(a,c,h),c){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ci(l)}}return Lt(l),l.flags&=-16777217,null;case 6:if(a&&l.stateNode!=null)a.memoizedProps!==h&&ci(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(a=Pe.current,Ul(l)){if(a=l.stateNode,c=l.memoizedProps,h=null,y=En,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[hn]=l,a=!!(a.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||fw(a.nodeValue,c)),a||_a(l)}else a=mc(a).createTextNode(h),a[hn]=l,l.stateNode=a}return Lt(l),null;case 13:if(h=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Ul(l),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=l}else Hl(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;Lt(l),y=!1}else yr!==null&&(sp(yr),yr=null),y=!0;if(!y)return l.flags&256?(ni(l),l):(ni(l),null)}if(ni(l),l.flags&128)return l.lanes=c,l;if(c=h!==null,a=a!==null&&a.memoizedState!==null,c){h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var b=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)}return c!==a&&c&&(l.child.flags|=8192),ic(l,l.updateQueue),Lt(l),null;case 4:return ee(),a===null&&bp(l.stateNode.containerInfo),Lt(l),null;case 10:return oi(l.type),Lt(l),null;case 19:if(Ce(Yt),y=l.memoizedState,y===null)return Lt(l),null;if(h=(l.flags&128)!==0,b=y.rendering,b===null)if(h)us(y,!1);else{if(Ft!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(b=Bu(a),b!==null){for(l.flags|=128,us(y,!1),a=b.updateQueue,l.updateQueue=a,ic(l,a),l.subtreeFlags=0,a=c,c=l.child;c!==null;)I0(c,a),c=c.sibling;return he(Yt,Yt.current&1|2),l.child}a=a.sibling}y.tail!==null&&ve()>ac&&(l.flags|=128,h=!0,us(y,!1),l.lanes=4194304)}else{if(!h)if(a=Bu(b),a!==null){if(l.flags|=128,h=!0,a=a.updateQueue,l.updateQueue=a,ic(l,a),us(y,!0),y.tail===null&&y.tailMode==="hidden"&&!b.alternate&&!pt)return Lt(l),null}else 2*ve()-y.renderingStartTime>ac&&c!==536870912&&(l.flags|=128,h=!0,us(y,!1),l.lanes=4194304);y.isBackwards?(b.sibling=l.child,l.child=b):(a=y.last,a!==null?a.sibling=b:l.child=b,y.last=b)}return y.tail!==null?(l=y.tail,y.rendering=l,y.tail=l.sibling,y.renderingStartTime=ve(),l.sibling=null,a=Yt.current,he(Yt,h?a&1|2:a&1),l):(Lt(l),null);case 22:case 23:return ni(l),lh(),h=l.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?c&536870912&&!(l.flags&128)&&(Lt(l),l.subtreeFlags&6&&(l.flags|=8192)):Lt(l),c=l.updateQueue,c!==null&&ic(l,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==c&&(l.flags|=2048),a!==null&&Ce(Ca),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),oi(Wt),Lt(l),null;case 25:return null}throw Error(r(156,l.tag))}function sO(a,l){switch(rh(l),l.tag){case 1:return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return oi(Wt),ee(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 26:case 27:case 5:return Te(l),null;case 13:if(ni(l),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Hl()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Ce(Yt),null;case 4:return ee(),null;case 10:return oi(l.type),null;case 22:case 23:return ni(l),lh(),a!==null&&Ce(Ca),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 24:return oi(Wt),null;case 25:return null;default:return null}}function U0(a,l){switch(rh(l),l.tag){case 3:oi(Wt),ee();break;case 26:case 27:case 5:Te(l);break;case 4:ee();break;case 13:ni(l);break;case 19:Ce(Yt);break;case 10:oi(l.type);break;case 22:case 23:ni(l),lh(),a!==null&&Ce(Ca);break;case 24:oi(Wt)}}var uO={getCacheForType:function(a){var l=pn(Wt),c=l.data.get(a);return c===void 0&&(c=a(),l.data.set(a,c)),c}},cO=typeof WeakMap=="function"?WeakMap:Map,zt=0,Rt=null,st=null,ht=0,Dt=0,$n=null,fi=!1,Lo=!1,tp=!1,di=0,Ft=0,qi=0,ja=0,np=0,sr=0,zo=0,cs=null,Mr=null,rp=!1,ip=0,ac=1/0,oc=null,Yi=null,lc=!1,Ma=null,fs=0,ap=0,op=null,ds=0,lp=null;function Vn(){if(zt&2&&ht!==0)return ht&-ht;if(P.T!==null){var a=ko;return a!==0?a:mp()}return ub()}function H0(){sr===0&&(sr=!(ht&536870912)||pt?_t():536870912);var a=ir.current;return a!==null&&(a.flags|=32),sr}function _n(a,l,c){(a===Rt&&Dt===2||a.cancelPendingCommit!==null)&&(jo(a,0),hi(a,ht,sr,!1)),Tn(a,c),(!(zt&2)||a!==Rt)&&(a===Rt&&(!(zt&2)&&(ja|=c),Ft===4&&hi(a,ht,sr,!1)),Pr(a))}function $0(a,l,c){if(zt&6)throw Error(r(327));var h=!c&&(l&60)===0&&(l&a.expiredLanes)===0||Ze(a,l),y=h?hO(a,l):fp(a,l,!0),b=h;do{if(y===0){Lo&&!h&&hi(a,l,0,!1);break}else if(y===6)hi(a,l,0,!fi);else{if(c=a.current.alternate,b&&!fO(c)){y=fp(a,l,!1),b=!1;continue}if(y===2){if(b=l,a.errorRecoveryDisabledLanes&b)var L=0;else L=a.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){l=L;e:{var H=a;y=cs;var W=H.current.memoizedState.isDehydrated;if(W&&(jo(H,L).flags|=256),L=fp(H,L,!1),L!==2){if(tp&&!W){H.errorRecoveryDisabledLanes|=b,ja|=b,y=4;break e}b=Mr,Mr=y,b!==null&&sp(b)}y=L}if(b=!1,y!==2)continue}}if(y===1){jo(a,0),hi(a,l,0,!0);break}e:{switch(h=a,y){case 0:case 1:throw Error(r(345));case 4:if((l&4194176)===l){hi(h,l,sr,!fi);break e}break;case 2:Mr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=c,h.finishedLanes=l,(l&62914560)===l&&(b=ip+300-ve(),10<b)){if(hi(h,l,sr,!fi),oo(h,0)!==0)break e;h.timeoutHandle=pw(V0.bind(null,h,c,Mr,oc,rp,l,sr,ja,zo,fi,2,-0,0),b);break e}V0(h,c,Mr,oc,rp,l,sr,ja,zo,fi,0,-0,0)}}break}while(!0);Pr(a)}function sp(a){Mr===null?Mr=a:Mr.push.apply(Mr,a)}function V0(a,l,c,h,y,b,L,H,W,J,me,_e,se){var pe=l.subtreeFlags;if((pe&8192||(pe&16785408)===16785408)&&(ys={stylesheets:null,count:0,unsuspend:qO},j0(l),l=WO(),l!==null)){a.cancelPendingCommit=l(Q0.bind(null,a,c,h,y,L,H,W,1,_e,se)),hi(a,b,L,!J);return}Q0(a,c,h,y,L,H,W,me,_e,se)}function fO(a){for(var l=a;;){var c=l.tag;if((c===0||c===11||c===15)&&l.flags&16384&&(c=l.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var y=c[h],b=y.getSnapshot;y=y.value;try{if(!Bn(b(),y))return!1}catch{return!1}}if(c=l.child,l.subtreeFlags&16384&&c!==null)c.return=l,l=c;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function hi(a,l,c,h){l&=~np,l&=~ja,a.suspendedLanes|=l,a.pingedLanes&=~l,h&&(a.warmLanes|=l),h=a.expirationTimes;for(var y=l;0<y;){var b=31-At(y),L=1<<b;h[b]=-1,y&=~L}c!==0&&An(a,c,l)}function sc(){return zt&6?!0:(hs(0),!1)}function up(){if(st!==null){if(Dt===0)var a=st.return;else a=st,ai=Na=null,mh(a),Eo=null,Yl=0,a=st;for(;a!==null;)U0(a.alternate,a),a=a.return;st=null}}function jo(a,l){a.finishedWork=null,a.finishedLanes=0;var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,DO(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),up(),Rt=a,st=c=Vi(a.current,null),ht=l,Dt=0,$n=null,fi=!1,Lo=Ze(a,l),tp=!1,zo=sr=np=ja=qi=Ft=0,Mr=cs=null,rp=!1,l&8&&(l|=l&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=l;0<h;){var y=31-At(h),b=1<<y;l|=a[y],h&=~b}return di=l,Ou(),c}function q0(a,l){it=null,P.H=jr,l===Vl?(l=lx(),Dt=3):l===ix?(l=lx(),Dt=4):Dt=l===a0?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,$n=l,st===null&&(Ft=1,Qu(a,tr(l,a.current)))}function Y0(){var a=P.H;return P.H=jr,a===null?jr:a}function W0(){var a=P.A;return P.A=uO,a}function cp(){Ft=4,fi||(ht&4194176)!==ht&&ir.current!==null||(Lo=!0),!(qi&134217727)&&!(ja&134217727)||Rt===null||hi(Rt,ht,sr,!1)}function fp(a,l,c){var h=zt;zt|=2;var y=Y0(),b=W0();(Rt!==a||ht!==l)&&(oc=null,jo(a,l)),l=!1;var L=Ft;e:do try{if(Dt!==0&&st!==null){var H=st,W=$n;switch(Dt){case 8:up(),L=6;break e;case 3:case 2:case 6:ir.current===null&&(l=!0);var J=Dt;if(Dt=0,$n=null,Mo(a,H,W,J),c&&Lo){L=0;break e}break;default:J=Dt,Dt=0,$n=null,Mo(a,H,W,J)}}dO(),L=Ft;break}catch(me){q0(a,me)}while(!0);return l&&a.shellSuspendCounter++,ai=Na=null,zt=h,P.H=y,P.A=b,st===null&&(Rt=null,ht=0,Ou()),L}function dO(){for(;st!==null;)X0(st)}function hO(a,l){var c=zt;zt|=2;var h=Y0(),y=W0();Rt!==a||ht!==l?(oc=null,ac=ve()+500,jo(a,l)):Lo=Ze(a,l);e:do try{if(Dt!==0&&st!==null){l=st;var b=$n;t:switch(Dt){case 1:Dt=0,$n=null,Mo(a,l,b,1);break;case 2:if(ax(b)){Dt=0,$n=null,K0(l);break}l=function(){Dt===2&&Rt===a&&(Dt=7),Pr(a)},b.then(l,l);break e;case 3:Dt=7;break e;case 4:Dt=5;break e;case 7:ax(b)?(Dt=0,$n=null,K0(l)):(Dt=0,$n=null,Mo(a,l,b,7));break;case 5:var L=null;switch(st.tag){case 26:L=st.memoizedState;case 5:case 27:var H=st;if(!L||kw(L)){Dt=0,$n=null;var W=H.sibling;if(W!==null)st=W;else{var J=H.return;J!==null?(st=J,uc(J)):st=null}break t}}Dt=0,$n=null,Mo(a,l,b,5);break;case 6:Dt=0,$n=null,Mo(a,l,b,6);break;case 8:up(),Ft=6;break e;default:throw Error(r(462))}}pO();break}catch(me){q0(a,me)}while(!0);return ai=Na=null,P.H=h,P.A=y,zt=c,st!==null?0:(Rt=null,ht=0,Ou(),Ft)}function pO(){for(;st!==null&&!He();)X0(st)}function X0(a){var l=v0(a.alternate,a,di);a.memoizedProps=a.pendingProps,l===null?uc(a):st=l}function K0(a){var l=a,c=l.alternate;switch(l.tag){case 15:case 0:l=f0(c,l,l.pendingProps,l.type,void 0,ht);break;case 11:l=f0(c,l,l.pendingProps,l.type.render,l.ref,ht);break;case 5:mh(l);default:U0(c,l),l=st=I0(l,di),l=v0(c,l,di)}a.memoizedProps=a.pendingProps,l===null?uc(a):st=l}function Mo(a,l,c,h){ai=Na=null,mh(l),Eo=null,Yl=0;var y=l.return;try{if(nO(a,y,l,c,ht)){Ft=1,Qu(a,tr(c,a.current)),st=null;return}}catch(b){if(y!==null)throw st=y,b;Ft=1,Qu(a,tr(c,a.current)),st=null;return}l.flags&32768?(pt||h===1?a=!0:Lo||ht&536870912?a=!1:(fi=a=!0,(h===2||h===3||h===6)&&(h=ir.current,h!==null&&h.tag===13&&(h.flags|=16384))),Z0(l,a)):uc(l)}function uc(a){var l=a;do{if(l.flags&32768){Z0(l,fi);return}a=l.return;var c=lO(l.alternate,l,di);if(c!==null){st=c;return}if(l=l.sibling,l!==null){st=l;return}st=l=a}while(l!==null);Ft===0&&(Ft=5)}function Z0(a,l){do{var c=sO(a.alternate,a);if(c!==null){c.flags&=32767,st=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!l&&(a=a.sibling,a!==null)){st=a;return}st=a=c}while(a!==null);Ft=6,st=null}function Q0(a,l,c,h,y,b,L,H,W,J){var me=P.T,_e=X.p;try{X.p=2,P.T=null,mO(a,l,c,h,_e,y,b,L,H,W,J)}finally{P.T=me,X.p=_e}}function mO(a,l,c,h,y,b,L,H){do Po();while(Ma!==null);if(zt&6)throw Error(r(327));var W=a.finishedWork;if(h=a.finishedLanes,W===null)return null;if(a.finishedWork=null,a.finishedLanes=0,W===a.current)throw Error(r(177));a.callbackNode=null,a.callbackPriority=0,a.cancelPendingCommit=null;var J=W.lanes|W.childLanes;if(J|=eh,Zr(a,h,J,b,L,H),a===Rt&&(st=Rt=null,ht=0),!(W.subtreeFlags&10256)&&!(W.flags&10256)||lc||(lc=!0,ap=J,op=c,bO(Oe,function(){return Po(),null})),c=(W.flags&15990)!==0,W.subtreeFlags&15990||c?(c=P.T,P.T=null,b=X.p,X.p=2,L=zt,zt|=4,iO(a,W),O0(W,a),IN(Ep,a.containerInfo),wc=!!Sp,Ep=Sp=null,a.current=W,A0(a,W.alternate,W),Ge(),zt=L,X.p=b,P.T=c):a.current=W,lc?(lc=!1,Ma=a,fs=h):J0(a,J),J=a.pendingLanes,J===0&&(Yi=null),qt(W.stateNode),Pr(a),l!==null)for(y=a.onRecoverableError,W=0;W<l.length;W++)J=l[W],y(J.value,{componentStack:J.stack});return fs&3&&Po(),J=a.pendingLanes,h&4194218&&J&42?a===lp?ds++:(ds=0,lp=a):ds=0,hs(0),null}function J0(a,l){(a.pooledCacheLanes&=l)===0&&(l=a.pooledCache,l!=null&&(a.pooledCache=null,Xl(l)))}function Po(){if(Ma!==null){var a=Ma,l=ap;ap=0;var c=sb(fs),h=P.T,y=X.p;try{if(X.p=32>c?32:c,P.T=null,Ma===null)var b=!1;else{c=op,op=null;var L=Ma,H=fs;if(Ma=null,fs=0,zt&6)throw Error(r(331));var W=zt;if(zt|=4,P0(L.current),z0(L,L.current,H,c),zt=W,hs(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(bt,L)}catch{}b=!0}return b}finally{X.p=y,P.T=h,J0(a,l)}}return!1}function ew(a,l,c){l=tr(c,l),l=Rh(a.stateNode,l,2),a=Bi(a,l,2),a!==null&&(Tn(a,2),Pr(a))}function kt(a,l,c){if(a.tag===3)ew(a,a,c);else for(;l!==null;){if(l.tag===3){ew(l,a,c);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Yi===null||!Yi.has(h))){a=tr(c,a),c=r0(2),h=Bi(l,c,2),h!==null&&(i0(c,h,l,a),Tn(h,2),Pr(h));break}}l=l.return}}function dp(a,l,c){var h=a.pingCache;if(h===null){h=a.pingCache=new cO;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(c)||(tp=!0,y.add(c),a=gO.bind(null,a,l,c),l.then(a,a))}function gO(a,l,c){var h=a.pingCache;h!==null&&h.delete(l),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Rt===a&&(ht&c)===c&&(Ft===4||Ft===3&&(ht&62914560)===ht&&300>ve()-ip?!(zt&2)&&jo(a,0):np|=c,zo===ht&&(zo=0)),Pr(a)}function tw(a,l){l===0&&(l=Cn()),a=Li(a,l),a!==null&&(Tn(a,l),Pr(a))}function vO(a){var l=a.memoizedState,c=0;l!==null&&(c=l.retryLane),tw(a,c)}function yO(a,l){var c=0;switch(a.tag){case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),tw(a,c)}function bO(a,l){return Se(a,l)}var cc=null,Fo=null,hp=!1,fc=!1,pp=!1,Pa=0;function Pr(a){a!==Fo&&a.next===null&&(Fo===null?cc=Fo=a:Fo=Fo.next=a),fc=!0,hp||(hp=!0,wO(xO))}function hs(a,l){if(!pp&&fc){pp=!0;do for(var c=!1,h=cc;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var L=h.suspendedLanes,H=h.pingedLanes;b=(1<<31-At(42|a)+1)-1,b&=y&~(L&~H),b=b&201326677?b&201326677|1:b?b|2:0}b!==0&&(c=!0,iw(h,b))}else b=ht,b=oo(h,h===Rt?b:0),!(b&3)||Ze(h,b)||(c=!0,iw(h,b));h=h.next}while(c);pp=!1}}function xO(){fc=hp=!1;var a=0;Pa!==0&&(RO()&&(a=Pa),Pa=0);for(var l=ve(),c=null,h=cc;h!==null;){var y=h.next,b=nw(h,l);b===0?(h.next=null,c===null?cc=y:c.next=y,y===null&&(Fo=c)):(c=h,(a!==0||b&3)&&(fc=!0)),h=y}hs(a)}function nw(a,l){for(var c=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,b=a.pendingLanes&-62914561;0<b;){var L=31-At(b),H=1<<L,W=y[L];W===-1?(!(H&c)||H&h)&&(y[L]=gt(H,l)):W<=l&&(a.expiredLanes|=H),b&=~H}if(l=Rt,c=ht,c=oo(a,a===l?c:0),h=a.callbackNode,c===0||a===l&&Dt===2||a.cancelPendingCommit!==null)return h!==null&&h!==null&&ie(h),a.callbackNode=null,a.callbackPriority=0;if(!(c&3)||Ze(a,c)){if(l=c&-c,l===a.callbackPriority)return l;switch(h!==null&&ie(h),sb(c)){case 2:case 8:c=de;break;case 32:c=Oe;break;case 268435456:c=Ye;break;default:c=Oe}return h=rw.bind(null,a),c=Se(c,h),a.callbackPriority=l,a.callbackNode=c,l}return h!==null&&h!==null&&ie(h),a.callbackPriority=2,a.callbackNode=null,2}function rw(a,l){var c=a.callbackNode;if(Po()&&a.callbackNode!==c)return null;var h=ht;return h=oo(a,a===Rt?h:0),h===0?null:($0(a,h,l),nw(a,ve()),a.callbackNode!=null&&a.callbackNode===c?rw.bind(null,a):null)}function iw(a,l){if(Po())return null;$0(a,l,!0)}function wO(a){NO(function(){zt&6?Se(te,a):a()})}function mp(){return Pa===0&&(Pa=_t()),Pa}function aw(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ku(""+a)}function ow(a,l){var c=l.ownerDocument.createElement("input");return c.name=l.name,c.value=l.value,a.id&&c.setAttribute("form",a.id),l.parentNode.insertBefore(c,l),a=new FormData(a),c.parentNode.removeChild(c),a}function SO(a,l,c,h,y){if(l==="submit"&&c&&c.stateNode===y){var b=aw((y[Rn]||null).action),L=h.submitter;L&&(l=(l=L[Rn]||null)?aw(l.formAction):L.getAttribute("formAction"),l!==null&&(b=l,L=null));var H=new Ru("action","action",null,h,y);a.push({event:H,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Pa!==0){var W=L?ow(y,L):new FormData(y);_h(c,{pending:!0,data:W,method:y.method,action:b},null,W)}}else typeof b=="function"&&(H.preventDefault(),W=L?ow(y,L):new FormData(y),_h(c,{pending:!0,data:W,method:y.method,action:b},b,W))},currentTarget:y}]})}}for(var gp=0;gp<Qb.length;gp++){var vp=Qb[gp],EO=vp.toLowerCase(),_O=vp[0].toUpperCase()+vp.slice(1);vr(EO,"on"+_O)}vr(Yb,"onAnimationEnd"),vr(Wb,"onAnimationIteration"),vr(Xb,"onAnimationStart"),vr("dblclick","onDoubleClick"),vr("focusin","onFocus"),vr("focusout","onBlur"),vr(BN,"onTransitionRun"),vr(UN,"onTransitionStart"),vr(HN,"onTransitionCancel"),vr(Kb,"onTransitionEnd"),co("onMouseEnter",["mouseout","mouseover"]),co("onMouseLeave",["mouseout","mouseover"]),co("onPointerEnter",["pointerout","pointerover"]),co("onPointerLeave",["pointerout","pointerover"]),ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ps="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(" "),kO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ps));function lw(a,l){l=(l&4)!==0;for(var c=0;c<a.length;c++){var h=a[c],y=h.event;h=h.listeners;e:{var b=void 0;if(l)for(var L=h.length-1;0<=L;L--){var H=h[L],W=H.instance,J=H.currentTarget;if(H=H.listener,W!==b&&y.isPropagationStopped())break e;b=H,y.currentTarget=J;try{b(y)}catch(me){Zu(me)}y.currentTarget=null,b=W}else for(L=0;L<h.length;L++){if(H=h[L],W=H.instance,J=H.currentTarget,H=H.listener,W!==b&&y.isPropagationStopped())break e;b=H,y.currentTarget=J;try{b(y)}catch(me){Zu(me)}y.currentTarget=null,b=W}}}}function ft(a,l){var c=l[Ld];c===void 0&&(c=l[Ld]=new Set);var h=a+"__bubble";c.has(h)||(sw(l,a,2,!1),c.add(h))}function yp(a,l,c){var h=0;l&&(h|=4),sw(c,a,h,l)}var dc="_reactListening"+Math.random().toString(36).slice(2);function bp(a){if(!a[dc]){a[dc]=!0,fb.forEach(function(c){c!=="selectionchange"&&(kO.has(c)||yp(c,!1,a),yp(c,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[dc]||(l[dc]=!0,yp("selectionchange",!1,l))}}function sw(a,l,c,h){switch(Nw(l)){case 2:var y=ZO;break;case 8:y=QO;break;default:y=Op}c=y.bind(null,l,c,a),y=void 0,!Bd||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?a.addEventListener(l,c,{capture:!0,passive:y}):a.addEventListener(l,c,!0):y!==void 0?a.addEventListener(l,c,{passive:y}):a.addEventListener(l,c,!1)}function xp(a,l,c,h,y){var b=h;if(!(l&1)&&!(l&2)&&h!==null)e:for(;;){if(h===null)return;var L=h.tag;if(L===3||L===4){var H=h.stateNode.containerInfo;if(H===y||H.nodeType===8&&H.parentNode===y)break;if(L===4)for(L=h.return;L!==null;){var W=L.tag;if((W===3||W===4)&&(W=L.stateNode.containerInfo,W===y||W.nodeType===8&&W.parentNode===y))return;L=L.return}for(;H!==null;){if(L=va(H),L===null)return;if(W=L.tag,W===5||W===6||W===26||W===27){h=b=L;continue e}H=H.parentNode}}h=h.return}Eb(function(){var J=b,me=Id(c),_e=[];e:{var se=Zb.get(a);if(se!==void 0){var pe=Ru,Be=a;switch(a){case"keypress":if(Tu(c)===0)break e;case"keydown":case"keyup":pe=yN;break;case"focusin":Be="focus",pe=Vd;break;case"focusout":Be="blur",pe=Vd;break;case"beforeblur":case"afterblur":pe=Vd;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Cb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=oN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=wN;break;case Yb:case Wb:case Xb:pe=uN;break;case Kb:pe=EN;break;case"scroll":case"scrollend":pe=iN;break;case"wheel":pe=kN;break;case"copy":case"cut":case"paste":pe=fN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Ab;break;case"toggle":case"beforetoggle":pe=TN}var Je=(l&4)!==0,It=!Je&&(a==="scroll"||a==="scrollend"),ne=Je?se!==null?se+"Capture":null:se;Je=[];for(var Q=J,le;Q!==null;){var ye=Q;if(le=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||le===null||ne===null||(ye=Ll(Q,ne),ye!=null&&Je.push(ms(Q,ye,le))),It)break;Q=Q.return}0<Je.length&&(se=new pe(se,Be,null,c,me),_e.push({event:se,listeners:Je}))}}if(!(l&7)){e:{if(se=a==="mouseover"||a==="pointerover",pe=a==="mouseout"||a==="pointerout",se&&c!==Fd&&(Be=c.relatedTarget||c.fromElement)&&(va(Be)||Be[lo]))break e;if((pe||se)&&(se=me.window===me?me:(se=me.ownerDocument)?se.defaultView||se.parentWindow:window,pe?(Be=c.relatedTarget||c.toElement,pe=J,Be=Be?va(Be):null,Be!==null&&(It=F(Be),Je=Be.tag,Be!==It||Je!==5&&Je!==27&&Je!==6)&&(Be=null)):(pe=null,Be=J),pe!==Be)){if(Je=Cb,ye="onMouseLeave",ne="onMouseEnter",Q="mouse",(a==="pointerout"||a==="pointerover")&&(Je=Ab,ye="onPointerLeave",ne="onPointerEnter",Q="pointer"),It=pe==null?se:Ol(pe),le=Be==null?se:Ol(Be),se=new Je(ye,Q+"leave",pe,c,me),se.target=It,se.relatedTarget=le,ye=null,va(me)===J&&(Je=new Je(ne,Q+"enter",Be,c,me),Je.target=le,Je.relatedTarget=It,ye=Je),It=ye,pe&&Be)t:{for(Je=pe,ne=Be,Q=0,le=Je;le;le=Io(le))Q++;for(le=0,ye=ne;ye;ye=Io(ye))le++;for(;0<Q-le;)Je=Io(Je),Q--;for(;0<le-Q;)ne=Io(ne),le--;for(;Q--;){if(Je===ne||ne!==null&&Je===ne.alternate)break t;Je=Io(Je),ne=Io(ne)}Je=null}else Je=null;pe!==null&&uw(_e,se,pe,Je,!1),Be!==null&&It!==null&&uw(_e,It,Be,Je,!0)}}e:{if(se=J?Ol(J):window,pe=se.nodeName&&se.nodeName.toLowerCase(),pe==="select"||pe==="input"&&se.type==="file")var Ie=Mb;else if(zb(se))if(Pb)Ie=PN;else{Ie=jN;var ot=zN}else pe=se.nodeName,!pe||pe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?J&&Pd(J.elementType)&&(Ie=Mb):Ie=MN;if(Ie&&(Ie=Ie(a,J))){jb(_e,Ie,c,me);break e}ot&&ot(a,se,J),a==="focusout"&&J&&se.type==="number"&&J.memoizedProps.value!=null&&Md(se,"number",se.value)}switch(ot=J?Ol(J):window,a){case"focusin":(zb(ot)||ot.contentEditable==="true")&&(vo=ot,Zd=J,Bl=null);break;case"focusout":Bl=Zd=vo=null;break;case"mousedown":Qd=!0;break;case"contextmenu":case"mouseup":case"dragend":Qd=!1,Vb(_e,c,me);break;case"selectionchange":if(GN)break;case"keydown":case"keyup":Vb(_e,c,me)}var Ve;if(Yd)e:{switch(a){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else go?Ob(a,c)&&(Ke="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(Ke="onCompositionStart");Ke&&(Rb&&c.locale!=="ko"&&(go||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&go&&(Ve=_b()):(Oi=me,Ud="value"in Oi?Oi.value:Oi.textContent,go=!0)),ot=hc(J,Ke),0<ot.length&&(Ke=new Tb(Ke,a,null,c,me),_e.push({event:Ke,listeners:ot}),Ve?Ke.data=Ve:(Ve=Lb(c),Ve!==null&&(Ke.data=Ve)))),(Ve=RN?DN(a,c):NN(a,c))&&(Ke=hc(J,"onBeforeInput"),0<Ke.length&&(ot=new Tb("onBeforeInput","beforeinput",null,c,me),_e.push({event:ot,listeners:Ke}),ot.data=Ve)),SO(_e,a,J,c,me)}lw(_e,l)})}function ms(a,l,c){return{instance:a,listener:l,currentTarget:c}}function hc(a,l){for(var c=l+"Capture",h=[];a!==null;){var y=a,b=y.stateNode;y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=Ll(a,c),y!=null&&h.unshift(ms(a,y,b)),y=Ll(a,l),y!=null&&h.push(ms(a,y,b))),a=a.return}return h}function Io(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function uw(a,l,c,h,y){for(var b=l._reactName,L=[];c!==null&&c!==h;){var H=c,W=H.alternate,J=H.stateNode;if(H=H.tag,W!==null&&W===h)break;H!==5&&H!==26&&H!==27||J===null||(W=J,y?(J=Ll(c,b),J!=null&&L.unshift(ms(c,J,W))):y||(J=Ll(c,b),J!=null&&L.push(ms(c,J,W)))),c=c.return}L.length!==0&&a.push({event:l,listeners:L})}var CO=/\r\n?/g,TO=/\u0000|\uFFFD/g;function cw(a){return(typeof a=="string"?a:""+a).replace(CO,`
|
||
`).replace(TO,"")}function fw(a,l){return l=cw(l),cw(a)===l}function pc(){}function wt(a,l,c,h,y,b){switch(c){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||ho(a,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&ho(a,""+h);break;case"className":Su(a,"class",h);break;case"tabIndex":Su(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Su(a,c,h);break;case"style":wb(a,h,b);break;case"data":if(l!=="object"){Su(a,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||c!=="href")){a.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=ku(""+h),a.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(c,"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 b=="function"&&(c==="formAction"?(l!=="input"&&wt(a,l,"name",y.name,y,null),wt(a,l,"formEncType",y.formEncType,y,null),wt(a,l,"formMethod",y.formMethod,y,null),wt(a,l,"formTarget",y.formTarget,y,null)):(wt(a,l,"encType",y.encType,y,null),wt(a,l,"method",y.method,y,null),wt(a,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=ku(""+h),a.setAttribute(c,h);break;case"onClick":h!=null&&(a.onclick=pc);break;case"onScroll":h!=null&&ft("scroll",a);break;case"onScrollEnd":h!=null&&ft("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}c=ku(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""+h):a.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":h===!0?a.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,h):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(c,h):a.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(c):a.setAttribute(c,h);break;case"popover":ft("beforetoggle",a),ft("toggle",a),wu(a,"popover",h);break;case"xlinkActuate":Jr(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Jr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Jr(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Jr(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Jr(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Jr(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Jr(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Jr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Jr(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":wu(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=nN.get(c)||c,wu(a,c,h))}}function wp(a,l,c,h,y,b){switch(c){case"style":wb(a,h,b);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"children":typeof h=="string"?ho(a,h):(typeof h=="number"||typeof h=="bigint")&&ho(a,""+h);break;case"onScroll":h!=null&&ft("scroll",a);break;case"onScrollEnd":h!=null&&ft("scrollend",a);break;case"onClick":h!=null&&(a.onclick=pc);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!db.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),l=c.slice(2,y?c.length-7:void 0),b=a[Rn]||null,b=b!=null?b[c]:null,typeof b=="function"&&a.removeEventListener(l,b,y),typeof h=="function")){typeof b!="function"&&b!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(l,h,y);break e}c in a?a[c]=h:h===!0?a.setAttribute(c,""):wu(a,c,h)}}}function ln(a,l,c){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",a),ft("load",a);var h=!1,y=!1,b;for(b in c)if(c.hasOwnProperty(b)){var L=c[b];if(L!=null)switch(b){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:wt(a,l,b,L,c,null)}}y&&wt(a,l,"srcSet",c.srcSet,c,null),h&&wt(a,l,"src",c.src,c,null);return;case"input":ft("invalid",a);var H=b=L=y=null,W=null,J=null;for(h in c)if(c.hasOwnProperty(h)){var me=c[h];if(me!=null)switch(h){case"name":y=me;break;case"type":L=me;break;case"checked":W=me;break;case"defaultChecked":J=me;break;case"value":b=me;break;case"defaultValue":H=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:wt(a,l,h,me,c,null)}}vb(a,b,H,W,J,L,y,!1),Eu(a);return;case"select":ft("invalid",a),h=L=b=null;for(y in c)if(c.hasOwnProperty(y)&&(H=c[y],H!=null))switch(y){case"value":b=H;break;case"defaultValue":L=H;break;case"multiple":h=H;default:wt(a,l,y,H,c,null)}l=b,c=L,a.multiple=!!h,l!=null?fo(a,!!h,l,!1):c!=null&&fo(a,!!h,c,!0);return;case"textarea":ft("invalid",a),b=y=h=null;for(L in c)if(c.hasOwnProperty(L)&&(H=c[L],H!=null))switch(L){case"value":h=H;break;case"defaultValue":y=H;break;case"children":b=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(91));break;default:wt(a,l,L,H,c,null)}bb(a,h,y,b),Eu(a);return;case"option":for(W in c)if(c.hasOwnProperty(W)&&(h=c[W],h!=null))switch(W){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:wt(a,l,W,h,c,null)}return;case"dialog":ft("cancel",a),ft("close",a);break;case"iframe":case"object":ft("load",a);break;case"video":case"audio":for(h=0;h<ps.length;h++)ft(ps[h],a);break;case"image":ft("error",a),ft("load",a);break;case"details":ft("toggle",a);break;case"embed":case"source":case"link":ft("error",a),ft("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in c)if(c.hasOwnProperty(J)&&(h=c[J],h!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:wt(a,l,J,h,c,null)}return;default:if(Pd(l)){for(me in c)c.hasOwnProperty(me)&&(h=c[me],h!==void 0&&wp(a,l,me,h,c,void 0));return}}for(H in c)c.hasOwnProperty(H)&&(h=c[H],h!=null&&wt(a,l,H,h,c,null))}function AO(a,l,c,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,L=null,H=null,W=null,J=null,me=null;for(pe in c){var _e=c[pe];if(c.hasOwnProperty(pe)&&_e!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":W=_e;default:h.hasOwnProperty(pe)||wt(a,l,pe,null,h,_e)}}for(var se in h){var pe=h[se];if(_e=c[se],h.hasOwnProperty(se)&&(pe!=null||_e!=null))switch(se){case"type":b=pe;break;case"name":y=pe;break;case"checked":J=pe;break;case"defaultChecked":me=pe;break;case"value":L=pe;break;case"defaultValue":H=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:pe!==_e&&wt(a,l,se,pe,h,_e)}}jd(a,L,H,W,J,me,b,y);return;case"select":pe=L=H=se=null;for(b in c)if(W=c[b],c.hasOwnProperty(b)&&W!=null)switch(b){case"value":break;case"multiple":pe=W;default:h.hasOwnProperty(b)||wt(a,l,b,null,h,W)}for(y in h)if(b=h[y],W=c[y],h.hasOwnProperty(y)&&(b!=null||W!=null))switch(y){case"value":se=b;break;case"defaultValue":H=b;break;case"multiple":L=b;default:b!==W&&wt(a,l,y,b,h,W)}l=H,c=L,h=pe,se!=null?fo(a,!!c,se,!1):!!h!=!!c&&(l!=null?fo(a,!!c,l,!0):fo(a,!!c,c?[]:"",!1));return;case"textarea":pe=se=null;for(H in c)if(y=c[H],c.hasOwnProperty(H)&&y!=null&&!h.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:wt(a,l,H,null,h,y)}for(L in h)if(y=h[L],b=c[L],h.hasOwnProperty(L)&&(y!=null||b!=null))switch(L){case"value":se=y;break;case"defaultValue":pe=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==b&&wt(a,l,L,y,h,b)}yb(a,se,pe);return;case"option":for(var Be in c)if(se=c[Be],c.hasOwnProperty(Be)&&se!=null&&!h.hasOwnProperty(Be))switch(Be){case"selected":a.selected=!1;break;default:wt(a,l,Be,null,h,se)}for(W in h)if(se=h[W],pe=c[W],h.hasOwnProperty(W)&&se!==pe&&(se!=null||pe!=null))switch(W){case"selected":a.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:wt(a,l,W,se,h,pe)}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 Je in c)se=c[Je],c.hasOwnProperty(Je)&&se!=null&&!h.hasOwnProperty(Je)&&wt(a,l,Je,null,h,se);for(J in h)if(se=h[J],pe=c[J],h.hasOwnProperty(J)&&se!==pe&&(se!=null||pe!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,l));break;default:wt(a,l,J,se,h,pe)}return;default:if(Pd(l)){for(var It in c)se=c[It],c.hasOwnProperty(It)&&se!==void 0&&!h.hasOwnProperty(It)&&wp(a,l,It,void 0,h,se);for(me in h)se=h[me],pe=c[me],!h.hasOwnProperty(me)||se===pe||se===void 0&&pe===void 0||wp(a,l,me,se,h,pe);return}}for(var ne in c)se=c[ne],c.hasOwnProperty(ne)&&se!=null&&!h.hasOwnProperty(ne)&&wt(a,l,ne,null,h,se);for(_e in h)se=h[_e],pe=c[_e],!h.hasOwnProperty(_e)||se===pe||se==null&&pe==null||wt(a,l,_e,se,h,pe)}var Sp=null,Ep=null;function mc(a){return a.nodeType===9?a:a.ownerDocument}function dw(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hw(a,l){if(a===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&l==="foreignObject"?0:a}function _p(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var kp=null;function RO(){var a=window.event;return a&&a.type==="popstate"?a===kp?!1:(kp=a,!0):(kp=null,!1)}var pw=typeof setTimeout=="function"?setTimeout:void 0,DO=typeof clearTimeout=="function"?clearTimeout:void 0,mw=typeof Promise=="function"?Promise:void 0,NO=typeof queueMicrotask=="function"?queueMicrotask:typeof mw<"u"?function(a){return mw.resolve(null).then(a).catch(OO)}:pw;function OO(a){setTimeout(function(){throw a})}function Cp(a,l){var c=l,h=0;do{var y=c.nextSibling;if(a.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"){if(h===0){a.removeChild(y),Es(l);return}h--}else c!=="$"&&c!=="$?"&&c!=="$!"||h++;c=y}while(c);Es(l)}function Tp(a){var l=a.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var c=l;switch(l=l.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Tp(c),zd(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function LO(a,l,c,h){for(;a.nodeType===1;){var y=c;if(a.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Nl])switch(l){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(b=a.getAttribute("rel"),b==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(b!==y.rel||a.getAttribute("href")!==(y.href==null?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(b=a.getAttribute("src"),(b!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(l==="input"&&a.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===b)return a}else return a;if(a=xr(a.nextSibling),a===null)break}return null}function zO(a,l,c){if(l==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=xr(a.nextSibling),a===null))return null;return a}function xr(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return a}function gw(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"){if(l===0)return a;l--}else c==="/$"&&l++}a=a.previousSibling}return null}function vw(a,l,c){switch(l=mc(c),a){case"html":if(a=l.documentElement,!a)throw Error(r(452));return a;case"head":if(a=l.head,!a)throw Error(r(453));return a;case"body":if(a=l.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}var ur=new Map,yw=new Set;function gc(a){return typeof a.getRootNode=="function"?a.getRootNode():a.ownerDocument}var pi=X.d;X.d={f:jO,r:MO,D:PO,C:FO,L:IO,m:GO,X:UO,S:BO,M:HO};function jO(){var a=pi.f(),l=sc();return a||l}function MO(a){var l=so(a);l!==null&&l.tag===5&&l.type==="form"?Vx(l):pi.r(a)}var Go=typeof document>"u"?null:document;function bw(a,l,c){var h=Go;if(h&&typeof l=="string"&&l){var y=Jn(l);y='link[rel="'+a+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),yw.has(y)||(yw.add(y),a={rel:a,crossOrigin:c,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),ln(l,"link",a),Kt(l),h.head.appendChild(l)))}}function PO(a){pi.D(a),bw("dns-prefetch",a,null)}function FO(a,l){pi.C(a,l),bw("preconnect",a,l)}function IO(a,l,c){pi.L(a,l,c);var h=Go;if(h&&a&&l){var y='link[rel="preload"][as="'+Jn(l)+'"]';l==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Jn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Jn(c.imageSizes)+'"]')):y+='[href="'+Jn(a)+'"]';var b=y;switch(l){case"style":b=Bo(a);break;case"script":b=Uo(a)}ur.has(b)||(a=j({rel:"preload",href:l==="image"&&c&&c.imageSrcSet?void 0:a,as:l},c),ur.set(b,a),h.querySelector(y)!==null||l==="style"&&h.querySelector(gs(b))||l==="script"&&h.querySelector(vs(b))||(l=h.createElement("link"),ln(l,"link",a),Kt(l),h.head.appendChild(l)))}}function GO(a,l){pi.m(a,l);var c=Go;if(c&&a){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+Jn(h)+'"][href="'+Jn(a)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Uo(a)}if(!ur.has(b)&&(a=j({rel:"modulepreload",href:a},l),ur.set(b,a),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(vs(b)))return}h=c.createElement("link"),ln(h,"link",a),Kt(h),c.head.appendChild(h)}}}function BO(a,l,c){pi.S(a,l,c);var h=Go;if(h&&a){var y=uo(h).hoistableStyles,b=Bo(a);l=l||"default";var L=y.get(b);if(!L){var H={loading:0,preload:null};if(L=h.querySelector(gs(b)))H.loading=5;else{a=j({rel:"stylesheet",href:a,"data-precedence":l},c),(c=ur.get(b))&&Ap(a,c);var W=L=h.createElement("link");Kt(W),ln(W,"link",a),W._p=new Promise(function(J,me){W.onload=J,W.onerror=me}),W.addEventListener("load",function(){H.loading|=1}),W.addEventListener("error",function(){H.loading|=2}),H.loading|=4,vc(L,l,h)}L={type:"stylesheet",instance:L,count:1,state:H},y.set(b,L)}}}function UO(a,l){pi.X(a,l);var c=Go;if(c&&a){var h=uo(c).hoistableScripts,y=Uo(a),b=h.get(y);b||(b=c.querySelector(vs(y)),b||(a=j({src:a,async:!0},l),(l=ur.get(y))&&Rp(a,l),b=c.createElement("script"),Kt(b),ln(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function HO(a,l){pi.M(a,l);var c=Go;if(c&&a){var h=uo(c).hoistableScripts,y=Uo(a),b=h.get(y);b||(b=c.querySelector(vs(y)),b||(a=j({src:a,async:!0,type:"module"},l),(l=ur.get(y))&&Rp(a,l),b=c.createElement("script"),Kt(b),ln(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function xw(a,l,c,h){var y=(y=Pe.current)?gc(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(l=Bo(c.href),c=uo(y).hoistableStyles,h=c.get(l),h||(h={type:"style",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Bo(c.href);var b=uo(y).hoistableStyles,L=b.get(a);if(L||(y=y.ownerDocument||y,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(a,L),(b=y.querySelector(gs(a)))&&!b._p&&(L.instance=b,L.state.loading=5),ur.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ur.set(a,c),b||$O(y,a,c,L.state))),l&&h===null)throw Error(r(528,""));return L}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=c.async,c=c.src,typeof c=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Uo(c),c=uo(y).hoistableScripts,h=c.get(l),h||(h={type:"script",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Bo(a){return'href="'+Jn(a)+'"'}function gs(a){return'link[rel="stylesheet"]['+a+"]"}function ww(a){return j({},a,{"data-precedence":a.precedence,precedence:null})}function $O(a,l,c,h){a.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=a.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),ln(l,"link",c),Kt(l),a.head.appendChild(l))}function Uo(a){return'[src="'+Jn(a)+'"]'}function vs(a){return"script[async]"+a}function Sw(a,l,c){if(l.count++,l.instance===null)switch(l.type){case"style":var h=a.querySelector('style[data-href~="'+Jn(c.href)+'"]');if(h)return l.instance=h,Kt(h),h;var y=j({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Kt(h),ln(h,"style",y),vc(h,c.precedence,a),l.instance=h;case"stylesheet":y=Bo(c.href);var b=a.querySelector(gs(y));if(b)return l.state.loading|=4,l.instance=b,Kt(b),b;h=ww(c),(y=ur.get(y))&&Ap(h,y),b=(a.ownerDocument||a).createElement("link"),Kt(b);var L=b;return L._p=new Promise(function(H,W){L.onload=H,L.onerror=W}),ln(b,"link",h),l.state.loading|=4,vc(b,c.precedence,a),l.instance=b;case"script":return b=Uo(c.src),(y=a.querySelector(vs(b)))?(l.instance=y,Kt(y),y):(h=c,(y=ur.get(b))&&(h=j({},c),Rp(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),Kt(y),ln(y,"link",h),a.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(h=l.instance,l.state.loading|=4,vc(h,c.precedence,a));return l.instance}function vc(a,l,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,L=0;L<h.length;L++){var H=h[L];if(H.dataset.precedence===l)b=H;else if(b!==y)break}b?b.parentNode.insertBefore(a,b.nextSibling):(l=c.nodeType===9?c.head:c,l.insertBefore(a,l.firstChild))}function Ap(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.title==null&&(a.title=l.title)}function Rp(a,l){a.crossOrigin==null&&(a.crossOrigin=l.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=l.referrerPolicy),a.integrity==null&&(a.integrity=l.integrity)}var yc=null;function Ew(a,l,c){if(yc===null){var h=new Map,y=yc=new Map;y.set(c,h)}else y=yc,h=y.get(c),h||(h=new Map,y.set(c,h));if(h.has(a))return h;for(h.set(a,null),c=c.getElementsByTagName(a),y=0;y<c.length;y++){var b=c[y];if(!(b[Nl]||b[hn]||a==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var L=b.getAttribute(l)||"";L=a+L;var H=h.get(L);H?H.push(b):h.set(L,[b])}}return h}function _w(a,l,c){a=a.ownerDocument||a,a.head.insertBefore(c,l==="title"?a.querySelector("head > title"):null)}function VO(a,l,c){if(c===1||l.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return a=l.disabled,typeof l.precedence=="string"&&a==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function kw(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var ys=null;function qO(){}function YO(a,l,c){if(ys===null)throw Error(r(475));var h=ys;if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(l.state.loading&4)){if(l.instance===null){var y=Bo(c.href),b=a.querySelector(gs(y));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=bc.bind(h),a.then(h,h)),l.state.loading|=4,l.instance=b,Kt(b);return}b=a.ownerDocument||a,c=ww(c),(y=ur.get(y))&&Ap(c,y),b=b.createElement("link"),Kt(b);var L=b;L._p=new Promise(function(H,W){L.onload=H,L.onerror=W}),ln(b,"link",c),l.instance=b}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,a),(a=l.state.preload)&&!(l.state.loading&3)&&(h.count++,l=bc.bind(h),a.addEventListener("load",l),a.addEventListener("error",l))}}function WO(){if(ys===null)throw Error(r(475));var a=ys;return a.stylesheets&&a.count===0&&Dp(a,a.stylesheets),0<a.count?function(l){var c=setTimeout(function(){if(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend){var h=a.unsuspend;a.unsuspend=null,h()}},6e4);return a.unsuspend=l,function(){a.unsuspend=null,clearTimeout(c)}}:null}function bc(){if(this.count--,this.count===0){if(this.stylesheets)Dp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var xc=null;function Dp(a,l){a.stylesheets=null,a.unsuspend!==null&&(a.count++,xc=new Map,l.forEach(XO,a),xc=null,bc.call(a))}function XO(a,l){if(!(l.state.loading&4)){var c=xc.get(a);if(c)var h=c.get(null);else{c=new Map,xc.set(a,c);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var L=y[b];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(c.set(L.dataset.precedence,L),h=L)}h&&c.set(null,h)}y=l.instance,L=y.getAttribute("data-precedence"),b=c.get(L)||h,b===h&&c.set(null,y),c.set(L,y),this.count++,h=bc.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),b?b.parentNode.insertBefore(y,b.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),l.state.loading|=4}}var bs={$$typeof:g,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function KO(a,l,c,h,y,b,L,H){this.tag=1,this.containerInfo=a,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=Sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sn(0),this.hiddenUpdates=Sn(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function Cw(a,l,c,h,y,b,L,H,W,J,me,_e){return a=new KO(a,l,c,L,H,W,J,_e),l=1,b===!0&&(l|=24),b=lr(3,null,null,l),a.current=b,b.stateNode=a,l=sh(),l.refCount++,a.pooledCache=l,l.refCount++,b.memoizedState={element:h,isDehydrated:c,cache:l},Uh(b),a}function Tw(a){return a?(a=xo,a):xo}function Aw(a,l,c,h,y,b){y=Tw(y),h.context===null?h.context=y:h.pendingContext=y,h=Gi(l),h.payload={element:c},b=b===void 0?null:b,b!==null&&(h.callback=b),c=Bi(a,h,l),c!==null&&(_n(c,a,l),ns(c,a,l))}function Rw(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<l?c:l}}function Np(a,l){Rw(a,l),(a=a.alternate)&&Rw(a,l)}function Dw(a){if(a.tag===13){var l=Li(a,67108864);l!==null&&_n(l,a,67108864),Np(a,67108864)}}var wc=!0;function ZO(a,l,c,h){var y=P.T;P.T=null;var b=X.p;try{X.p=2,Op(a,l,c,h)}finally{X.p=b,P.T=y}}function QO(a,l,c,h){var y=P.T;P.T=null;var b=X.p;try{X.p=8,Op(a,l,c,h)}finally{X.p=b,P.T=y}}function Op(a,l,c,h){if(wc){var y=Lp(h);if(y===null)xp(a,l,h,Sc,c),Ow(a,h);else if(eL(y,a,l,c,h))h.stopPropagation();else if(Ow(a,h),l&4&&-1<JO.indexOf(a)){for(;y!==null;){var b=so(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var L=dn(b.pendingLanes);if(L!==0){var H=b;for(H.pendingLanes|=2,H.entangledLanes|=2;L;){var W=1<<31-At(L);H.entanglements[1]|=W,L&=~W}Pr(b),!(zt&6)&&(ac=ve()+500,hs(0))}}break;case 13:H=Li(b,2),H!==null&&_n(H,b,2),sc(),Np(b,2)}if(b=Lp(h),b===null&&xp(a,l,h,Sc,c),b===y)break;y=b}y!==null&&h.stopPropagation()}else xp(a,l,h,null,c)}}function Lp(a){return a=Id(a),zp(a)}var Sc=null;function zp(a){if(Sc=null,a=va(a),a!==null){var l=F(a);if(l===null)a=null;else{var c=l.tag;if(c===13){if(a=K(l),a!==null)return a;a=null}else if(c===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null)}}return Sc=a,null}function Nw(a){switch(a){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(Ne()){case te:return 2;case de:return 8;case Oe:case $e:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var jp=!1,Wi=null,Xi=null,Ki=null,xs=new Map,ws=new Map,Zi=[],JO="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 Ow(a,l){switch(a){case"focusin":case"focusout":Wi=null;break;case"dragenter":case"dragleave":Xi=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":xs.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ws.delete(l.pointerId)}}function Ss(a,l,c,h,y,b){return a===null||a.nativeEvent!==b?(a={blockedOn:l,domEventName:c,eventSystemFlags:h,nativeEvent:b,targetContainers:[y]},l!==null&&(l=so(l),l!==null&&Dw(l)),a):(a.eventSystemFlags|=h,l=a.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),a)}function eL(a,l,c,h,y){switch(l){case"focusin":return Wi=Ss(Wi,a,l,c,h,y),!0;case"dragenter":return Xi=Ss(Xi,a,l,c,h,y),!0;case"mouseover":return Ki=Ss(Ki,a,l,c,h,y),!0;case"pointerover":var b=y.pointerId;return xs.set(b,Ss(xs.get(b)||null,a,l,c,h,y)),!0;case"gotpointercapture":return b=y.pointerId,ws.set(b,Ss(ws.get(b)||null,a,l,c,h,y)),!0}return!1}function Lw(a){var l=va(a.target);if(l!==null){var c=F(l);if(c!==null){if(l=c.tag,l===13){if(l=K(c),l!==null){a.blockedOn=l,WD(a.priority,function(){if(c.tag===13){var h=Vn(),y=Li(c,h);y!==null&&_n(y,c,h),Np(c,h)}});return}}else if(l===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Ec(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var c=Lp(a.nativeEvent);if(c===null){c=a.nativeEvent;var h=new c.constructor(c.type,c);Fd=h,c.target.dispatchEvent(h),Fd=null}else return l=so(c),l!==null&&Dw(l),a.blockedOn=c,!1;l.shift()}return!0}function zw(a,l,c){Ec(a)&&c.delete(l)}function tL(){jp=!1,Wi!==null&&Ec(Wi)&&(Wi=null),Xi!==null&&Ec(Xi)&&(Xi=null),Ki!==null&&Ec(Ki)&&(Ki=null),xs.forEach(zw),ws.forEach(zw)}function _c(a,l){a.blockedOn===l&&(a.blockedOn=null,jp||(jp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,tL)))}var kc=null;function jw(a){kc!==a&&(kc=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kc===a&&(kc=null);for(var l=0;l<a.length;l+=3){var c=a[l],h=a[l+1],y=a[l+2];if(typeof h!="function"){if(zp(h||c)===null)continue;break}var b=so(c);b!==null&&(a.splice(l,3),l-=3,_h(b,{pending:!0,data:y,method:c.method,action:h},h,y))}}))}function Es(a){function l(W){return _c(W,a)}Wi!==null&&_c(Wi,a),Xi!==null&&_c(Xi,a),Ki!==null&&_c(Ki,a),xs.forEach(l),ws.forEach(l);for(var c=0;c<Zi.length;c++){var h=Zi[c];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Zi.length&&(c=Zi[0],c.blockedOn===null);)Lw(c),c.blockedOn===null&&Zi.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var y=c[h],b=c[h+1],L=y[Rn]||null;if(typeof b=="function")L||jw(c);else if(L){var H=null;if(b&&b.hasAttribute("formAction")){if(y=b,L=b[Rn]||null)H=L.formAction;else if(zp(y)!==null)continue}else H=L.action;typeof H=="function"?c[h+1]=H:(c.splice(h,3),h-=3),jw(c)}}}function Mp(a){this._internalRoot=a}Cc.prototype.render=Mp.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(r(409));var c=l.current,h=Vn();Aw(c,h,a,l,null,null)},Cc.prototype.unmount=Mp.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;a.tag===0&&Po(),Aw(a.current,2,null,a,null,null),sc(),l[lo]=null}};function Cc(a){this._internalRoot=a}Cc.prototype.unstable_scheduleHydration=function(a){if(a){var l=ub();a={blockedOn:null,target:a,priority:l};for(var c=0;c<Zi.length&&l!==0&&l<Zi[c].priority;c++);Zi.splice(c,0,a),c===0&&Lw(a)}};var Mw=t.version;if(Mw!=="19.0.0")throw Error(r(527,Mw,"19.0.0"));X.findDOMNode=function(a){var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=$(l),a=a!==null?M(a):null,a=a===null?null:a.stateNode,a};var nL={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:P,findFiberByHostInstance:va,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tc.isDisabled&&Tc.supportsFiber)try{bt=Tc.inject(nL),rt=Tc}catch{}}return ks.createRoot=function(a,l){if(!i(a))throw Error(r(299));var c=!1,h="",y=Jx,b=e0,L=t0,H=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(L=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(H=l.unstable_transitionCallbacks)),l=Cw(a,1,!1,null,null,c,h,y,b,L,H,null),a[lo]=l.current,bp(a.nodeType===8?a.parentNode:a),new Mp(l)},ks.hydrateRoot=function(a,l,c){if(!i(a))throw Error(r(299));var h=!1,y="",b=Jx,L=e0,H=t0,W=null,J=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(L=c.onCaughtError),c.onRecoverableError!==void 0&&(H=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(W=c.unstable_transitionCallbacks),c.formState!==void 0&&(J=c.formState)),l=Cw(a,1,!0,l,c??null,h,y,b,L,H,W,J),l.context=Tw(null),c=l.current,h=Vn(),y=Gi(h),y.callback=null,Bi(c,y,h),l.current.lanes=h,Tn(l,h),Pr(l),a[lo]=l.current,bp(a),new Cc(l)},ks.version="19.0.0",ks}var qw;function gL(){if(qw)return Ip.exports;qw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ip.exports=mL(),Ip.exports}var vL=gL();const Yw=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const v=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,u);return u},yL=e=>e?Yw(e):Yw,bL=e=>e;function xL(e,t=bL){const n=be.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return be.useDebugValue(n),n}const wL=e=>{const t=yL(e),n=r=>xL(t,r);return Object.assign(n,t),n},Cv=e=>wL;function R_(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=f=>f===null?null:JSON.parse(f,void 0),u=(o=n.getItem(i))!=null?o:null;return u instanceof Promise?u.then(s):s(u)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const yg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return yg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return yg(r)(n)}}}},SL=(e,t)=>(n,r,i)=>{let o={storage:R_(()=>localStorage),partialize:x=>x,version:0,merge:(x,k)=>({...k,...x}),...t},s=!1;const u=new Set,f=new Set;let d=o.storage;if(!d)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...x)},r,i);const p=()=>{const x=o.partialize({...r()});return d.setItem(o.name,{state:x,version:o.version})},m=i.setState;i.setState=(x,k)=>{m(x,k),p()};const v=e((...x)=>{n(...x),p()},r,i);i.getInitialState=()=>v;let g;const w=()=>{var x,k;if(!d)return;s=!1,u.forEach(_=>{var T;return _((T=r())!=null?T:v)});const C=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(x=r())!=null?x:v))||void 0;return yg(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate){const T=o.migrate(_.state,_.version);return T instanceof Promise?T.then(N=>[!0,N]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var T;const[N,D]=_;if(g=o.merge(D,(T=r())!=null?T:v),n(g,!0),N)return p()}).then(()=>{C==null||C(g,void 0),g=r(),s=!0,f.forEach(_=>_(g))}).catch(_=>{C==null||C(void 0,_)})};return i.persist={setOptions:x=>{o={...o,...x},x.storage&&(d=x.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>s,onHydrate:x=>(u.add(x),()=>{u.delete(x)}),onFinishHydration:x=>(f.add(x),()=>{f.delete(x)})},o.skipHydration||w(),g||v},EL=SL;function D_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=D_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function N_(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=D_(e))&&(r&&(r+=" "),r+=t);return r}const Tv="-",_L=e=>{const t=CL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const u=s.split(Tv);return u[0]===""&&u.length!==1&&u.shift(),O_(u,t)||kL(s)},getConflictingClassGroupIds:(s,u)=>{const f=n[s]||[];return u&&r[s]?[...f,...r[s]]:f}}},O_=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?O_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Tv);return(s=t.validators.find(({validator:u})=>u(o)))==null?void 0:s.classGroupId},Ww=/^\[(.+)\]$/,kL=e=>{if(Ww.test(e)){const t=Ww.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},CL=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)bg(n[i],r,i,t);return r},bg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Xw(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(TL(i)){bg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{bg(s,Xw(t,o),n,r)})})},Xw=(e,t)=>{let n=e;return t.split(Tv).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},TL=e=>e.isThemeGetter,AL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},xg="!",wg=":",RL=wg.length,DL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,u=0,f=0,d;for(let w=0;w<i.length;w++){let x=i[w];if(s===0&&u===0){if(x===wg){o.push(i.slice(f,w)),f=w+RL;continue}if(x==="/"){d=w;continue}}x==="["?s++:x==="]"?s--:x==="("?u++:x===")"&&u--}const p=o.length===0?i:i.substring(f),m=NL(p),v=m!==p,g=d&&d>f?d-f:void 0;return{modifiers:o,hasImportantModifier:v,baseClassName:m,maybePostfixModifierPosition:g}};if(t){const i=t+wg,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},NL=e=>e.endsWith(xg)?e.substring(0,e.length-1):e.startsWith(xg)?e.substring(1):e,OL=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},LL=e=>({cache:AL(e.cacheSize),parseClassName:DL(e),sortModifiers:OL(e),..._L(e)}),zL=/\s+/,jL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],u=e.trim().split(zL);let f="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:v,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:x}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let k=!!x,C=r(k?w.substring(0,x):w);if(!C){if(!k){f=p+(f.length>0?" "+f:f);continue}if(C=r(w),!C){f=p+(f.length>0?" "+f:f);continue}k=!1}const _=o(v).join(":"),T=g?_+xg:_,N=T+C;if(s.includes(N))continue;s.push(N);const D=i(C,k);for(let z=0;z<D.length;++z){const R=D[z];s.push(T+R)}f=p+(f.length>0?" "+f:f)}return f};function ML(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=L_(t))&&(r&&(r+=" "),r+=n);return r}const L_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=L_(e[r]))&&(n&&(n+=" "),n+=t);return n};function PL(e,...t){let n,r,i,o=s;function s(f){const d=t.reduce((p,m)=>m(p),e());return n=LL(d),r=n.cache.get,i=n.cache.set,o=u,u(f)}function u(f){const d=r(f);if(d)return d;const p=jL(f,n);return i(f,p),p}return function(){return o(ML.apply(null,arguments))}}const en=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},z_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,j_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,FL=/^\d+\/\d+$/,IL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GL=/\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$/,BL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,UL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,HL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ho=e=>FL.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),Kw=e=>e.endsWith("%")&&ct(e.slice(0,-1)),Ji=e=>IL.test(e),$L=()=>!0,VL=e=>GL.test(e)&&!BL.test(e),Av=()=>!1,qL=e=>UL.test(e),YL=e=>HL.test(e),WL=e=>!ze(e)&&!je(e),XL=e=>ml(e,F_,Av),ze=e=>z_.test(e),Ia=e=>ml(e,I_,VL),Hp=e=>ml(e,oz,ct),KL=e=>ml(e,M_,Av),ZL=e=>ml(e,P_,YL),QL=e=>ml(e,Av,qL),je=e=>j_.test(e),Ac=e=>gl(e,I_),JL=e=>gl(e,lz),ez=e=>gl(e,M_),tz=e=>gl(e,F_),nz=e=>gl(e,P_),rz=e=>gl(e,sz,!0),ml=(e,t,n)=>{const r=z_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gl=(e,t,n=!1)=>{const r=j_.exec(e);return r?r[1]?t(r[1]):n:!1},M_=e=>e==="position",iz=new Set(["image","url"]),P_=e=>iz.has(e),az=new Set(["length","size","percentage"]),F_=e=>az.has(e),I_=e=>e==="length",oz=e=>e==="number",lz=e=>e==="family-name",sz=e=>e==="shadow",uz=()=>{const e=en("color"),t=en("font"),n=en("text"),r=en("font-weight"),i=en("tracking"),o=en("leading"),s=en("breakpoint"),u=en("container"),f=en("spacing"),d=en("radius"),p=en("shadow"),m=en("inset-shadow"),v=en("drop-shadow"),g=en("blur"),w=en("perspective"),x=en("aspect"),k=en("ease"),C=en("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],z=()=>[Ho,"px","full","auto",je,ze,f],R=()=>[Fa,"none","subgrid",je,ze],B=()=>["auto",{span:["full",Fa,je,ze]},je,ze],P=()=>[Fa,"auto",je,ze],j=()=>["auto","min","max","fr",je,ze],V=()=>[je,ze,f],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],I=()=>["start","end","center","stretch"],Y=()=>[je,ze,f],Z=()=>["px",...Y()],U=()=>["px","auto",...Y()],G=()=>[Ho,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",je,ze,f],F=()=>[e,je,ze],K=()=>[Kw,Ia],A=()=>["","none","full",d,je,ze],$=()=>["",ct,Ac,Ia],M=()=>["solid","dashed","dotted","double"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["","none",g,je,ze],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",je,ze],ue=()=>["none",ct,je,ze],ae=()=>["none",ct,je,ze],oe=()=>[ct,je,ze],Ce=()=>[Ho,"full","px",je,ze,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ji],breakpoint:[Ji],color:[$L],container:[Ji],"drop-shadow":[Ji],ease:["in","out","in-out"],font:[WL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ji],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ji],shadow:[Ji],spacing:[ct],text:[Ji],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ho,ze,je,x]}],container:["container"],columns:[{columns:[ct,ze,je,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...T(),ze,je]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",je,ze]}],basis:[{basis:[Ho,"full","auto",je,ze,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,Ho,"auto","initial","none",ze]}],grow:[{grow:["",ct,je,ze]}],shrink:[{shrink:["",ct,je,ze]}],order:[{order:[Fa,"first","last","none",je,ze]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...I(),"baseline"]}],"align-self":[{self:["auto",...I(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[u,"screen",...G()]}],"min-w":[{"min-w":[u,"screen","none",...G()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[s]},...G()]}],h:[{h:["screen",...G()]}],"min-h":[{"min-h":["screen","none",...G()]}],"max-h":[{"max-h":["screen",...G()]}],"font-size":[{text:["base",n,Ac,Ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,je,Hp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Kw,ze]}],"font-family":[{font:[JL,ze,t]}],"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:[i,je,ze]}],"line-clamp":[{"line-clamp":[ct,"none",je,Hp]}],leading:[{leading:[je,ze,o,f]}],"list-image":[{"list-image":["none",je,ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",je,Ia]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[ct,"auto",je,ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...Y()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,ze]}],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",je,ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...T(),ez,KL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",tz,XL]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,je,ze],radial:["",je,ze],conic:[Fa,je,ze]},nz,ZL]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...M(),"hidden","none"]}],"divide-style":[{divide:[...M(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...M(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,je,ze]}],"outline-w":[{outline:["",ct,Ac,Ia]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,rz,QL]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",je,ze,m]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[ct,Ia]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":F()}],opacity:[{opacity:[ct,je,ze]}],"mix-blend":[{"mix-blend":[...O(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none",je,ze]}],blur:[{blur:X()}],brightness:[{brightness:[ct,je,ze]}],contrast:[{contrast:[ct,je,ze]}],"drop-shadow":[{"drop-shadow":["","none",v,je,ze]}],grayscale:[{grayscale:["",ct,je,ze]}],"hue-rotate":[{"hue-rotate":[ct,je,ze]}],invert:[{invert:["",ct,je,ze]}],saturate:[{saturate:[ct,je,ze]}],sepia:[{sepia:["",ct,je,ze]}],"backdrop-filter":[{"backdrop-filter":["","none",je,ze]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[ct,je,ze]}],"backdrop-contrast":[{"backdrop-contrast":[ct,je,ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,je,ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,je,ze]}],"backdrop-invert":[{"backdrop-invert":["",ct,je,ze]}],"backdrop-opacity":[{"backdrop-opacity":[ct,je,ze]}],"backdrop-saturate":[{"backdrop-saturate":[ct,je,ze]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,je,ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",je,ze]}],ease:[{ease:["linear","initial",k,je,ze]}],delay:[{delay:[ct,je,ze]}],animate:[{animate:["none",C,je,ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,ze]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[je,ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",je,ze]}],"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":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"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",je,ze]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[ct,Ac,Ia,Hp]}],stroke:[{stroke:["none",...F()]}],"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","*","**"]}},cz=PL(uz);function Me(...e){return cz(N_(e))}function fz(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Cr(e){return e instanceof Error?e.message:`${e}`}const Rv=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},G_="",Hr="ghost",dz="#B2EBF2",hz="#000",pz="#E2E2E2",mz="#EEEEEE",gz="#F57F17",vz="#969696",yz="#F57F17",Zw="#B2EBF2",$p=20,Qw=4,bz=20,xz=15,Jw="*",wz={"text/plain":[".txt",".md",".html",".htm",".tex",".json",".xml",".yaml",".yml",".rtf",".odt",".epub",".csv",".log",".conf",".ini",".properties",".sql",".bat",".sh",".c",".cpp",".py",".java",".js",".ts",".swift",".go",".rb",".php",".css",".scss",".less"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},e1={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},Sz=Cv()(EL(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:Jw,enableHealthCheck:!0,apiKey:null,currentTab:"documents",retrievalHistory:[],querySettings:{mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},setTheme:t=>e({theme:t}),setQueryLabel:t=>e({queryLabel:t}),setEnableHealthCheck:t=>e({enableHealthCheck:t}),setApiKey:t=>e({apiKey:t}),setCurrentTab:t=>e({currentTab:t}),setRetrievalHistory:t=>e({retrievalHistory:t}),updateQuerySettings:t=>e(n=>({querySettings:{...n.querySettings,...t}}))}),{name:"settings-storage",storage:R_(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=Jw),t<4&&(e.showPropertyPanel=!0,e.showNodeSearchBar=!0,e.showNodeLabel=!0,e.enableHealthCheck=!0,e.apiKey=null),t<5&&(e.currentTab="documents"),t<6&&(e.querySettings={mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},e.retrievalHistory=[]),e)})),Qe=Rv(Sz),Ez={theme:"system",setTheme:()=>null},B_=E.createContext(Ez);function _z({children:e,...t}){const[n,r]=E.useState(Qe.getState().theme);E.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),n==="system"){const s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(s),r(s);return}o.classList.add(n)},[n]);const i={theme:n,setTheme:o=>{Qe.getState().setTheme(o),r(o)}};return S.jsx(B_.Provider,{...t,value:i,children:e})}const t1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,n1=N_,U_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return n1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(d=>{const p=n==null?void 0:n[d],m=o==null?void 0:o[d];if(p===null)return null;const v=t1(p)||t1(m);return i[d][v]}),u=n&&Object.entries(n).reduce((d,p)=>{let[m,v]=p;return v===void 0||(d[m]=v),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:v,...g}=p;return Object.entries(g).every(w=>{let[x,k]=w;return Array.isArray(k)?k.includes({...o,...u}[x]):{...o,...u}[x]===k})?[...d,m,v]:d},[]);return n1(e,s,f,n==null?void 0:n.class,n==null?void 0:n.className)},kz=U_("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"}}),H_=E.forwardRef(({className:e,variant:t,...n},r)=>S.jsx("div",{ref:r,role:"alert",className:Me(kz({variant:t}),e),...n}));H_.displayName="Alert";const $_=E.forwardRef(({className:e,...t},n)=>S.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));$_.displayName="AlertTitle";const V_=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));V_.displayName="AlertDescription";function q_(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cz}=Object.prototype,{getPrototypeOf:Dv}=Object,Vf=(e=>t=>{const n=Cz.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Dr=e=>(e=e.toLowerCase(),t=>Vf(t)===e),qf=e=>t=>typeof t===e,{isArray:vl}=Array,Vs=qf("undefined");function Tz(e){return e!==null&&!Vs(e)&&e.constructor!==null&&!Vs(e.constructor)&&Wn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Y_=Dr("ArrayBuffer");function Az(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Y_(e.buffer),t}const Rz=qf("string"),Wn=qf("function"),W_=qf("number"),Yf=e=>e!==null&&typeof e=="object",Dz=e=>e===!0||e===!1,tf=e=>{if(Vf(e)!=="object")return!1;const t=Dv(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Nz=Dr("Date"),Oz=Dr("File"),Lz=Dr("Blob"),zz=Dr("FileList"),jz=e=>Yf(e)&&Wn(e.pipe),Mz=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Wn(e.append)&&((t=Vf(e))==="formdata"||t==="object"&&Wn(e.toString)&&e.toString()==="[object FormData]"))},Pz=Dr("URLSearchParams"),[Fz,Iz,Gz,Bz]=["ReadableStream","Request","Response","Headers"].map(Dr),Uz=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ru(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),vl(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let u;for(r=0;r<s;r++)u=o[r],t.call(null,e[u],u,e)}}function X_(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const qa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,K_=e=>!Vs(e)&&e!==qa;function Sg(){const{caseless:e}=K_(this)&&this||{},t={},n=(r,i)=>{const o=e&&X_(t,i)||i;tf(t[o])&&tf(r)?t[o]=Sg(t[o],r):tf(r)?t[o]=Sg({},r):vl(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ru(arguments[r],n);return t}const Hz=(e,t,n,{allOwnKeys:r}={})=>(ru(t,(i,o)=>{n&&Wn(i)?e[o]=q_(i,n):e[o]=i},{allOwnKeys:r}),e),$z=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vz=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},qz=(e,t,n,r)=>{let i,o,s;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!u[s]&&(t[s]=e[s],u[s]=!0);e=n!==!1&&Dv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Yz=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Wz=e=>{if(!e)return null;if(vl(e))return e;let t=e.length;if(!W_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Xz=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Dv(Uint8Array)),Kz=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Zz=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Qz=Dr("HTMLFormElement"),Jz=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),r1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ej=Dr("RegExp"),Z_=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ru(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},tj=e=>{Z_(e,(t,n)=>{if(Wn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Wn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},nj=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return vl(e)?r(e):r(String(e).split(t)),n},rj=()=>{},ij=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Vp="abcdefghijklmnopqrstuvwxyz",i1="0123456789",Q_={DIGIT:i1,ALPHA:Vp,ALPHA_DIGIT:Vp+Vp.toUpperCase()+i1},aj=(e=16,t=Q_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function oj(e){return!!(e&&Wn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const lj=e=>{const t=new Array(10),n=(r,i)=>{if(Yf(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=vl(r)?[]:{};return ru(r,(s,u)=>{const f=n(s,i+1);!Vs(f)&&(o[u]=f)}),t[i]=void 0,o}}return r};return n(e,0)},sj=Dr("AsyncFunction"),uj=e=>e&&(Yf(e)||Wn(e))&&Wn(e.then)&&Wn(e.catch),J_=((e,t)=>e?setImmediate:t?((n,r)=>(qa.addEventListener("message",({source:i,data:o})=>{i===qa&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),qa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wn(qa.postMessage)),cj=typeof queueMicrotask<"u"?queueMicrotask.bind(qa):typeof process<"u"&&process.nextTick||J_,fe={isArray:vl,isArrayBuffer:Y_,isBuffer:Tz,isFormData:Mz,isArrayBufferView:Az,isString:Rz,isNumber:W_,isBoolean:Dz,isObject:Yf,isPlainObject:tf,isReadableStream:Fz,isRequest:Iz,isResponse:Gz,isHeaders:Bz,isUndefined:Vs,isDate:Nz,isFile:Oz,isBlob:Lz,isRegExp:ej,isFunction:Wn,isStream:jz,isURLSearchParams:Pz,isTypedArray:Xz,isFileList:zz,forEach:ru,merge:Sg,extend:Hz,trim:Uz,stripBOM:$z,inherits:Vz,toFlatObject:qz,kindOf:Vf,kindOfTest:Dr,endsWith:Yz,toArray:Wz,forEachEntry:Kz,matchAll:Zz,isHTMLForm:Qz,hasOwnProperty:r1,hasOwnProp:r1,reduceDescriptors:Z_,freezeMethods:tj,toObjectSet:nj,toCamelCase:Jz,noop:rj,toFiniteNumber:ij,findKey:X_,global:qa,isContextDefined:K_,ALPHABET:Q_,generateString:aj,isSpecCompliantForm:oj,toJSONObject:lj,isAsyncFn:sj,isThenable:uj,setImmediate:J_,asap:cj};function tt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fe.inherits(tt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const ek=tt.prototype,tk={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tk[e]={value:e}});Object.defineProperties(tt,tk);Object.defineProperty(ek,"isAxiosError",{value:!0});tt.from=(e,t,n,r,i,o)=>{const s=Object.create(ek);return fe.toFlatObject(e,s,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),tt.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const fj=null;function Eg(e){return fe.isPlainObject(e)||fe.isArray(e)}function nk(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function a1(e,t,n){return e?e.concat(t).map(function(i,o){return i=nk(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function dj(e){return fe.isArray(e)&&!e.some(Eg)}const hj=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Wf(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,k){return!fe.isUndefined(k[x])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,s=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(i))throw new TypeError("visitor must be a function");function d(w){if(w===null)return"";if(fe.isDate(w))return w.toISOString();if(!f&&fe.isBlob(w))throw new tt("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(w)||fe.isTypedArray(w)?f&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function p(w,x,k){let C=w;if(w&&!k&&typeof w=="object"){if(fe.endsWith(x,"{}"))x=r?x:x.slice(0,-2),w=JSON.stringify(w);else if(fe.isArray(w)&&dj(w)||(fe.isFileList(w)||fe.endsWith(x,"[]"))&&(C=fe.toArray(w)))return x=nk(x),C.forEach(function(T,N){!(fe.isUndefined(T)||T===null)&&t.append(s===!0?a1([x],N,o):s===null?x:x+"[]",d(T))}),!1}return Eg(w)?!0:(t.append(a1(k,x,o),d(w)),!1)}const m=[],v=Object.assign(hj,{defaultVisitor:p,convertValue:d,isVisitable:Eg});function g(w,x){if(!fe.isUndefined(w)){if(m.indexOf(w)!==-1)throw Error("Circular reference detected in "+x.join("."));m.push(w),fe.forEach(w,function(C,_){(!(fe.isUndefined(C)||C===null)&&i.call(t,C,fe.isString(_)?_.trim():_,x,v))===!0&&g(C,x?x.concat(_):[_])}),m.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return g(e),t}function o1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Nv(e,t){this._pairs=[],e&&Wf(e,this,t)}const rk=Nv.prototype;rk.append=function(t,n){this._pairs.push([t,n])};rk.toString=function(t){const n=t?function(r){return t.call(this,r,o1)}:o1;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function pj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ik(e,t,n){if(!t)return e;const r=n&&n.encode||pj;fe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=fe.isURLSearchParams(t)?t.toString():new Nv(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class l1{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ak={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mj=typeof URLSearchParams<"u"?URLSearchParams:Nv,gj=typeof FormData<"u"?FormData:null,vj=typeof Blob<"u"?Blob:null,yj={isBrowser:!0,classes:{URLSearchParams:mj,FormData:gj,Blob:vj},protocols:["http","https","file","blob","url","data"]},Ov=typeof window<"u"&&typeof document<"u",_g=typeof navigator=="object"&&navigator||void 0,bj=Ov&&(!_g||["ReactNative","NativeScript","NS"].indexOf(_g.product)<0),xj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",wj=Ov&&window.location.href||"http://localhost",Sj=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ov,hasStandardBrowserEnv:bj,hasStandardBrowserWebWorkerEnv:xj,navigator:_g,origin:wj},Symbol.toStringTag,{value:"Module"})),gn={...Sj,...yj};function Ej(e,t){return Wf(e,new gn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return gn.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function _j(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function kj(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function ok(e){function t(n,r,i,o){let s=n[o++];if(s==="__proto__")return!0;const u=Number.isFinite(+s),f=o>=n.length;return s=!s&&fe.isArray(i)?i.length:s,f?(fe.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!u):((!i[s]||!fe.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&fe.isArray(i[s])&&(i[s]=kj(i[s])),!u)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,i)=>{t(_j(r),i,n,0)}),n}return null}function Cj(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const iu={transitional:ak,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return i?JSON.stringify(ok(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ej(t,this.formSerializer).toString();if((u=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Wf(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Cj(t)):t}],transformResponse:[function(t){const n=this.transitional||iu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(u){if(s)throw u.name==="SyntaxError"?tt.from(u,tt.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gn.classes.FormData,Blob:gn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{iu.headers[e]={}});const Tj=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Aj=e=>{const t={};let n,r,i;return e&&e.split(`
|
||
`).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&Tj[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},s1=Symbol("internals");function Cs(e){return e&&String(e).trim().toLowerCase()}function nf(e){return e===!1||e==null?e:fe.isArray(e)?e.map(nf):String(e)}function Rj(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Dj=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qp(e,t,n,r,i){if(fe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function Nj(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Oj(e,t){const n=fe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}let jn=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(u,f,d){const p=Cs(f);if(!p)throw new Error("header name must be a non-empty string");const m=fe.findKey(i,p);(!m||i[m]===void 0||d===!0||d===void 0&&i[m]!==!1)&&(i[m||f]=nf(u))}const s=(u,f)=>fe.forEach(u,(d,p)=>o(d,p,f));if(fe.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(fe.isString(t)&&(t=t.trim())&&!Dj(t))s(Aj(t),n);else if(fe.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Cs(t),t){const r=fe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Rj(i);if(fe.isFunction(n))return n.call(this,i,r);if(fe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cs(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||qp(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=Cs(s),s){const u=fe.findKey(r,s);u&&(!n||qp(r,r[u],u,n))&&(delete r[u],i=!0)}}return fe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||qp(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return fe.forEach(this,(i,o)=>{const s=fe.findKey(r,o);if(s){n[s]=nf(i),delete n[o];return}const u=t?Nj(o):String(o).trim();u!==o&&delete n[o],n[u]=nf(i),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&fe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[s1]=this[s1]={accessors:{}}).accessors,i=this.prototype;function o(s){const u=Cs(s);r[u]||(Oj(i,s),r[u]=!0)}return fe.isArray(t)?t.forEach(o):o(t),this}};jn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(jn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(jn);function Yp(e,t){const n=this||iu,r=t||n,i=jn.from(r.headers);let o=r.data;return fe.forEach(e,function(u){o=u.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function lk(e){return!!(e&&e.__CANCEL__)}function yl(e,t,n){tt.call(this,e??"canceled",tt.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits(yl,tt,{__CANCEL__:!0});function sk(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new tt("Request failed with status code "+n.status,[tt.ERR_BAD_REQUEST,tt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lj(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zj(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),p=r[o];s||(s=d),n[i]=f,r[i]=d;let m=o,v=0;for(;m!==i;)v+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-s<t)return;const g=p&&d-p;return g?Math.round(v*1e3/g):void 0}}function jj(e,t){let n=0,r=1e3/t,i,o;const s=(d,p=Date.now())=>{n=p,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const p=Date.now(),m=p-n;m>=r?s(d,p):(i=d,o||(o=setTimeout(()=>{o=null,s(i)},r-m)))},()=>i&&s(i)]}const yf=(e,t,n=3)=>{let r=0;const i=zj(50,250);return jj(o=>{const s=o.loaded,u=o.lengthComputable?o.total:void 0,f=s-r,d=i(f),p=s<=u;r=s;const m={loaded:s,total:u,progress:u?s/u:void 0,bytes:f,rate:d||void 0,estimated:d&&u&&p?(u-s)/d:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(m)},n)},u1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},c1=e=>(...t)=>fe.asap(()=>e(...t)),Mj=gn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gn.origin),gn.navigator&&/(msie|trident)/i.test(gn.navigator.userAgent)):()=>!0,Pj=gn.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];fe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),fe.isString(r)&&s.push("path="+r),fe.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Fj(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ij(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function uk(e,t){return e&&!Fj(t)?Ij(e,t):t}const f1=e=>e instanceof jn?{...e}:e;function Wa(e,t){t=t||{};const n={};function r(d,p,m,v){return fe.isPlainObject(d)&&fe.isPlainObject(p)?fe.merge.call({caseless:v},d,p):fe.isPlainObject(p)?fe.merge({},p):fe.isArray(p)?p.slice():p}function i(d,p,m,v){if(fe.isUndefined(p)){if(!fe.isUndefined(d))return r(void 0,d,m,v)}else return r(d,p,m,v)}function o(d,p){if(!fe.isUndefined(p))return r(void 0,p)}function s(d,p){if(fe.isUndefined(p)){if(!fe.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function u(d,p,m){if(m in t)return r(d,p);if(m in e)return r(void 0,d)}const f={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(d,p,m)=>i(f1(d),f1(p),m,!0)};return fe.forEach(Object.keys(Object.assign({},e,t)),function(p){const m=f[p]||i,v=m(e[p],t[p],p);fe.isUndefined(v)&&m!==u||(n[p]=v)}),n}const ck=e=>{const t=Wa({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:u}=t;t.headers=s=jn.from(s),t.url=ik(uk(t.baseURL,t.url),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(fe.isFormData(n)){if(gn.hasStandardBrowserEnv||gn.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((f=s.getContentType())!==!1){const[d,...p]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([d||"multipart/form-data",...p].join("; "))}}if(gn.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&Mj(t.url))){const d=i&&o&&Pj.read(o);d&&s.set(i,d)}return t},Gj=typeof XMLHttpRequest<"u",Bj=Gj&&function(e){return new Promise(function(n,r){const i=ck(e);let o=i.data;const s=jn.from(i.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:d}=i,p,m,v,g,w;function x(){g&&g(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function C(){if(!k)return;const T=jn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:T,config:e,request:k};sk(function(R){n(R),x()},function(R){r(R),x()},D),k=null}"onloadend"in k?k.onloadend=C:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(C)},k.onabort=function(){k&&(r(new tt("Request aborted",tt.ECONNABORTED,e,k)),k=null)},k.onerror=function(){r(new tt("Network Error",tt.ERR_NETWORK,e,k)),k=null},k.ontimeout=function(){let N=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||ak;i.timeoutErrorMessage&&(N=i.timeoutErrorMessage),r(new tt(N,D.clarifyTimeoutError?tt.ETIMEDOUT:tt.ECONNABORTED,e,k)),k=null},o===void 0&&s.setContentType(null),"setRequestHeader"in k&&fe.forEach(s.toJSON(),function(N,D){k.setRequestHeader(D,N)}),fe.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),u&&u!=="json"&&(k.responseType=i.responseType),d&&([v,w]=yf(d,!0),k.addEventListener("progress",v)),f&&k.upload&&([m,g]=yf(f),k.upload.addEventListener("progress",m),k.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(p=T=>{k&&(r(!T||T.type?new yl(null,e,k):T),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const _=Lj(i.url);if(_&&gn.protocols.indexOf(_)===-1){r(new tt("Unsupported protocol "+_+":",tt.ERR_BAD_REQUEST,e));return}k.send(o||null)})},Uj=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(d){if(!i){i=!0,u();const p=d instanceof Error?d:this.reason;r.abort(p instanceof tt?p:new yl(p instanceof Error?p.message:p))}};let s=t&&setTimeout(()=>{s=null,o(new tt(`timeout ${t} of ms exceeded`,tt.ETIMEDOUT))},t);const u=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>fe.asap(u),f}},Hj=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},$j=async function*(e,t){for await(const n of Vj(e))yield*Hj(n,t)},Vj=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},d1=(e,t,n,r)=>{const i=$j(e,t);let o=0,s,u=f=>{s||(s=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:d,value:p}=await i.next();if(d){u(),f.close();return}let m=p.byteLength;if(n){let v=o+=m;n(v)}f.enqueue(new Uint8Array(p))}catch(d){throw u(d),d}},cancel(f){return u(f),i.return()}},{highWaterMark:2})},Xf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",fk=Xf&&typeof ReadableStream=="function",qj=Xf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),dk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Yj=fk&&dk(()=>{let e=!1;const t=new Request(gn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h1=64*1024,kg=fk&&dk(()=>fe.isReadableStream(new Response("").body)),bf={stream:kg&&(e=>e.body)};Xf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!bf[t]&&(bf[t]=fe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new tt(`Response type '${t}' is not supported`,tt.ERR_NOT_SUPPORT,r)})})})(new Response);const Wj=async e=>{if(e==null)return 0;if(fe.isBlob(e))return e.size;if(fe.isSpecCompliantForm(e))return(await new Request(gn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(e)||fe.isArrayBuffer(e))return e.byteLength;if(fe.isURLSearchParams(e)&&(e=e+""),fe.isString(e))return(await qj(e)).byteLength},Xj=async(e,t)=>{const n=fe.toFiniteNumber(e.getContentLength());return n??Wj(t)},Kj=Xf&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:u,onUploadProgress:f,responseType:d,headers:p,withCredentials:m="same-origin",fetchOptions:v}=ck(e);d=d?(d+"").toLowerCase():"text";let g=Uj([i,o&&o.toAbortSignal()],s),w;const x=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let k;try{if(f&&Yj&&n!=="get"&&n!=="head"&&(k=await Xj(p,r))!==0){let D=new Request(t,{method:"POST",body:r,duplex:"half"}),z;if(fe.isFormData(r)&&(z=D.headers.get("content-type"))&&p.setContentType(z),D.body){const[R,B]=u1(k,yf(c1(f)));r=d1(D.body,h1,R,B)}}fe.isString(m)||(m=m?"include":"omit");const C="credentials"in Request.prototype;w=new Request(t,{...v,signal:g,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:C?m:void 0});let _=await fetch(w);const T=kg&&(d==="stream"||d==="response");if(kg&&(u||T&&x)){const D={};["status","statusText","headers"].forEach(P=>{D[P]=_[P]});const z=fe.toFiniteNumber(_.headers.get("content-length")),[R,B]=u&&u1(z,yf(c1(u),!0))||[];_=new Response(d1(_.body,h1,R,()=>{B&&B(),x&&x()}),D)}d=d||"text";let N=await bf[fe.findKey(bf,d)||"text"](_,e);return!T&&x&&x(),await new Promise((D,z)=>{sk(D,z,{data:N,headers:jn.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:w})})}catch(C){throw x&&x(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new tt("Network Error",tt.ERR_NETWORK,e,w),{cause:C.cause||C}):tt.from(C,C&&C.code,e,w)}}),Cg={http:fj,xhr:Bj,fetch:Kj};fe.forEach(Cg,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const p1=e=>`- ${e}`,Zj=e=>fe.isFunction(e)||e===null||e===!1,hk={getAdapter:e=>{e=fe.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o<t;o++){n=e[o];let s;if(r=n,!Zj(n)&&(r=Cg[(s=String(n)).toLowerCase()],r===void 0))throw new tt(`Unknown adapter '${s}'`);if(r)break;i[s||"#"+o]=r}if(!r){const o=Object.entries(i).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
|
||
`+o.map(p1).join(`
|
||
`):" "+p1(o[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Cg};function Wp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yl(null,e)}function m1(e){return Wp(e),e.headers=jn.from(e.headers),e.data=Yp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hk.getAdapter(e.adapter||iu.adapter)(e).then(function(r){return Wp(e),r.data=Yp.call(e,e.transformResponse,r),r.headers=jn.from(r.headers),r},function(r){return lk(r)||(Wp(e),r&&r.response&&(r.response.data=Yp.call(e,e.transformResponse,r.response),r.response.headers=jn.from(r.response.headers))),Promise.reject(r)})}const pk="1.7.9",Kf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const g1={};Kf.transitional=function(t,n,r){function i(o,s){return"[Axios v"+pk+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,u)=>{if(t===!1)throw new tt(i(s," has been removed"+(n?" in "+n:"")),tt.ERR_DEPRECATED);return n&&!g1[s]&&(g1[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,u):!0}};Kf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Qj(e,t,n){if(typeof e!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const u=e[o],f=u===void 0||s(u,o,e);if(f!==!0)throw new tt("option "+o+" must be "+f,tt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new tt("Unknown option "+o,tt.ERR_BAD_OPTION)}}const rf={assertOptions:Qj,validators:Kf},Fr=rf.validators;let Ya=class{constructor(t){this.defaults=t,this.interceptors={request:new l1,response:new l1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Wa(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&rf.assertOptions(r,{silentJSONParsing:Fr.transitional(Fr.boolean),forcedJSONParsing:Fr.transitional(Fr.boolean),clarifyTimeoutError:Fr.transitional(Fr.boolean)},!1),i!=null&&(fe.isFunction(i)?n.paramsSerializer={serialize:i}:rf.assertOptions(i,{encode:Fr.function,serialize:Fr.function},!0)),rf.assertOptions(n,{baseUrl:Fr.spelling("baseURL"),withXsrfToken:Fr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&fe.merge(o.common,o[n.method]);o&&fe.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=jn.concat(s,o);const u=[];let f=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(f=f&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const d=[];this.interceptors.response.forEach(function(x){d.push(x.fulfilled,x.rejected)});let p,m=0,v;if(!f){const w=[m1.bind(this),void 0];for(w.unshift.apply(w,u),w.push.apply(w,d),v=w.length,p=Promise.resolve(n);m<v;)p=p.then(w[m++],w[m++]);return p}v=u.length;let g=n;for(m=0;m<v;){const w=u[m++],x=u[m++];try{g=w(g)}catch(k){x.call(this,k);break}}try{p=m1.call(this,g)}catch(w){return Promise.reject(w)}for(m=0,v=d.length;m<v;)p=p.then(d[m++],d[m++]);return p}getUri(t){t=Wa(this.defaults,t);const n=uk(t.baseURL,t.url);return ik(n,t.params,t.paramsSerializer)}};fe.forEach(["delete","get","head","options"],function(t){Ya.prototype[t]=function(n,r){return this.request(Wa(r||{},{method:t,url:n,data:(r||{}).data}))}});fe.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,u){return this.request(Wa(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Ya.prototype[t]=n(),Ya.prototype[t+"Form"]=n(!0)});let Jj=class mk{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(u=>{r.subscribe(u),o=u}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,u){r.reason||(r.reason=new yl(o,s,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new mk(function(i){t=i}),cancel:t}}};function eM(e){return function(n){return e.apply(null,n)}}function tM(e){return fe.isObject(e)&&e.isAxiosError===!0}const Tg={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tg).forEach(([e,t])=>{Tg[t]=e});function gk(e){const t=new Ya(e),n=q_(Ya.prototype.request,t);return fe.extend(n,Ya.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return gk(Wa(e,i))},n}const Bt=gk(iu);Bt.Axios=Ya;Bt.CanceledError=yl;Bt.CancelToken=Jj;Bt.isCancel=lk;Bt.VERSION=pk;Bt.toFormData=Wf;Bt.AxiosError=tt;Bt.Cancel=Bt.CanceledError;Bt.all=function(t){return Promise.all(t)};Bt.spread=eM;Bt.isAxiosError=tM;Bt.mergeConfig=Wa;Bt.AxiosHeaders=jn;Bt.formToJSON=e=>ok(fe.isHTMLForm(e)?new FormData(e):e);Bt.getAdapter=hk.getAdapter;Bt.HttpStatusCode=Tg;Bt.default=Bt;const{Axios:YX,AxiosError:WX,CanceledError:XX,isCancel:KX,CancelToken:ZX,VERSION:QX,all:JX,Cancel:eK,isAxiosError:tK,spread:nK,toFormData:rK,AxiosHeaders:iK,HttpStatusCode:aK,formToJSON:oK,getAdapter:lK,mergeConfig:sK}=Bt,vk="Invalid API Key",yk="API Key required",Nr=Bt.create({baseURL:G_,headers:{"Content-Type":"application/json"}});Nr.interceptors.request.use(e=>{const t=Qe.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Nr.interceptors.response.use(e=>e,e=>{var t;throw e.response?new Error(`${e.response.status} ${e.response.statusText}
|
||
${JSON.stringify(e.response.data)}
|
||
${(t=e.config)==null?void 0:t.url}`):e});const nM=async e=>(await Nr.get(`/graphs?label=${e}`)).data,rM=async()=>(await Nr.get("/graph/label/list")).data,iM=async()=>{try{return(await Nr.get("/health")).data}catch(e){return{status:"error",message:Cr(e)}}},aM=async()=>(await Nr.get("/documents")).data,oM=async()=>(await Nr.post("/documents/scan")).data,lM=async e=>(await Nr.post("/query",e)).data,sM=async(e,t,n)=>{try{let r="";if(await Nr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[i=>{r+=i;const o=r.split(`
|
||
`);r=o.pop()||"";for(const s of o)if(s.trim())try{const u=JSON.parse(s);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return i}]}).catch(i=>{n&&n(Cr(i))}),r.trim())try{const i=JSON.parse(r);i.response?t(i.response):i.error&&n&&n(i.error)}catch(i){console.error("Error parsing final chunk:",i),n&&n("Error parsing server response")}}catch(r){const i=Cr(r);console.error("Stream request failed:",i),n&&n(i)}},uM=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Nr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?i=>{const o=Math.round(i.loaded*100/i.total);t(o)}:void 0})).data},cM=async()=>(await Nr.delete("/documents")).data,fM=Cv()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await iM();return t.status==="healthy"?(e({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:t}),!0):(e({health:!1,message:t.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{e({health:!0,message:null,messageTitle:null})},setErrorMessage:(t,n)=>{e({health:!1,message:t,messageTitle:n})}})),Mn=Rv(fM);/**
|
||
* @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 dM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).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 hM={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 pM=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...u},f)=>E.createElement("svg",{ref:f,...hM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:bk("lucide",i),...u},[...s.map(([d,p])=>E.createElement(d,p)),...Array.isArray(o)?o:[o]]));/**
|
||
* @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=(e,t)=>{const n=E.forwardRef(({className:r,...i},o)=>E.createElement(pM,{ref:o,iconNode:t,className:bk(`lucide-${dM(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
||
* @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 mM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lv=Et("Check",mM);/**
|
||
* @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 gM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zv=Et("ChevronDown",gM);/**
|
||
* @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 vM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xk=Et("ChevronUp",vM);/**
|
||
* @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 yM=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],bM=Et("ChevronsUpDown",yM);/**
|
||
* @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 xM=[["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"}]],wM=Et("CircleAlert",xM);/**
|
||
* @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 SM=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],wk=Et("Eraser",SM);/**
|
||
* @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 EM=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],_M=Et("FileText",EM);/**
|
||
* @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 kM=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],CM=Et("Files",kM);/**
|
||
* @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 TM=[["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"}]],AM=Et("Fullscreen",TM);/**
|
||
* @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 RM=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],DM=Et("Github",RM);/**
|
||
* @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 NM=[["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"}]],OM=Et("Grip",NM);/**
|
||
* @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 LM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Sk=Et("LoaderCircle",LM);/**
|
||
* @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 zM=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],jM=Et("Loader",zM);/**
|
||
* @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 MM=[["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"}]],PM=Et("Maximize",MM);/**
|
||
* @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 FM=[["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"}]],IM=Et("Minimize",FM);/**
|
||
* @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 GM=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],BM=Et("Moon",GM);/**
|
||
* @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 UM=[["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"}]],HM=Et("Pause",UM);/**
|
||
* @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 $M=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],VM=Et("Play",$M);/**
|
||
* @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 qM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],YM=Et("RefreshCw",qM);/**
|
||
* @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 WM=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],XM=Et("Search",WM);/**
|
||
* @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 KM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ZM=Et("Send",KM);/**
|
||
* @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 QM=[["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"}]],JM=Et("Settings",QM);/**
|
||
* @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 eP=[["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"}]],tP=Et("Sun",eP);/**
|
||
* @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 nP=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Ag=Et("Upload",nP);/**
|
||
* @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 rP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ek=Et("X",rP);/**
|
||
* @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 iP=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],aP=Et("Zap",iP);/**
|
||
* @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 oP=[["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"}]],lP=Et("ZoomIn",oP);/**
|
||
* @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 sP=[["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"}]],uP=Et("ZoomOut",sP),cP=()=>{const e=Mn.use.health(),t=Mn.use.message(),n=Mn.use.messageTitle(),[r,i]=E.useState(!1);return E.useEffect(()=>{setTimeout(()=>{i(!0)},50)},[]),S.jsxs(H_,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&S.jsx("div",{children:S.jsx(wM,{className:"size-4"})}),S.jsxs("div",{children:[S.jsx($_,{className:"font-bold",children:n}),S.jsx(V_,{children:t})]})]})};function fP(e,t){const n=E.createContext(t),r=o=>{const{children:s,...u}=o,f=E.useMemo(()=>u,Object.values(u));return S.jsx(n.Provider,{value:f,children:s})};r.displayName=e+"Provider";function i(o){const s=E.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function hr(e,t=[]){let n=[];function r(o,s){const u=E.createContext(s),f=n.length;n=[...n,s];const d=m=>{var C;const{scope:v,children:g,...w}=m,x=((C=v==null?void 0:v[e])==null?void 0:C[f])||u,k=E.useMemo(()=>w,Object.values(w));return S.jsx(x.Provider,{value:k,children:g})};d.displayName=o+"Provider";function p(m,v){var x;const g=((x=v==null?void 0:v[e])==null?void 0:x[f])||u,w=E.useContext(g);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,p]}const i=()=>{const o=n.map(s=>E.createContext(s));return function(u){const f=(u==null?void 0:u[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[r,dP(i,...t)]}function dP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((u,{useScope:f,scopeName:d})=>{const m=f(o)[`__scope${d}`];return{...u,...m}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function v1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _k(...e){return t=>{let n=!1;const r=e.map(i=>{const o=v1(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():v1(e[i],null)}}}}function dt(...e){return E.useCallback(_k(...e),e)}function qe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var xn=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},hP=fL.useId||(()=>{}),pP=0;function bn(e){const[t,n]=E.useState(hP());return xn(()=>{n(r=>r??String(pP++))},[e]),t?`radix-${t}`:""}function un(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function _i({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=mP({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,u=un(n),f=E.useCallback(d=>{if(o){const m=typeof d=="function"?d(e):d;m!==e&&u(m)}else i(d)},[o,e,i,u]);return[s,f]}function mP({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,i=E.useRef(r),o=un(t);return E.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var au=A_();const kk=fn(au);var ua=E.forwardRef((e,t)=>{const{children:n,...r}=e,i=E.Children.toArray(n),o=i.find(gP);if(o){const s=o.props.children,u=i.map(f=>f===o?E.Children.count(s)>1?E.Children.only(null):E.isValidElement(s)?s.props.children:null:f);return S.jsx(Rg,{...r,ref:t,children:E.isValidElement(s)?E.cloneElement(s,void 0,u):null})}return S.jsx(Rg,{...r,ref:t,children:n})});ua.displayName="Slot";var Rg=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const i=yP(n),o=vP(r,n.props);return n.type!==E.Fragment&&(o.ref=t?_k(t,i):i),E.cloneElement(n,o)}return E.Children.count(n)>1?E.Children.only(null):null});Rg.displayName="SlotClone";var jv=({children:e})=>S.jsx(S.Fragment,{children:e});function gP(e){return E.isValidElement(e)&&e.type===jv}function vP(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{o(...u),i(...u)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function yP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],We=bP.reduce((e,t)=>{const n=E.forwardRef((r,i)=>{const{asChild:o,...s}=r,u=o?ua:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xP(e,t){e&&au.flushSync(()=>e.dispatchEvent(t))}function wP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var SP="DismissableLayer",Dg="dismissableLayer.update",EP="dismissableLayer.pointerDownOutside",_P="dismissableLayer.focusOutside",y1,Ck=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ou=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:u,...f}=e,d=E.useContext(Ck),[p,m]=E.useState(null),v=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=E.useState({}),w=dt(t,R=>m(R)),x=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(k),_=p?x.indexOf(p):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,N=_>=C,D=TP(R=>{const B=R.target,P=[...d.branches].some(j=>j.contains(B));!N||P||(i==null||i(R),s==null||s(R),R.defaultPrevented||u==null||u())},v),z=AP(R=>{const B=R.target;[...d.branches].some(j=>j.contains(B))||(o==null||o(R),s==null||s(R),R.defaultPrevented||u==null||u())},v);return wP(R=>{_===d.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},v),E.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(y1=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),b1(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=y1)}},[p,v,n,d]),E.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),b1())},[p,d]),E.useEffect(()=>{const R=()=>g({});return document.addEventListener(Dg,R),()=>document.removeEventListener(Dg,R)},[]),S.jsx(We.div,{...f,ref:w,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:qe(e.onFocusCapture,z.onFocusCapture),onBlurCapture:qe(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:qe(e.onPointerDownCapture,D.onPointerDownCapture)})});ou.displayName=SP;var kP="DismissableLayerBranch",CP=E.forwardRef((e,t)=>{const n=E.useContext(Ck),r=E.useRef(null),i=dt(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(We.div,{...e,ref:i})});CP.displayName=kP;function TP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let f=function(){Tk(EP,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function AP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&Tk(_P,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b1(){const e=new CustomEvent(Dg);document.dispatchEvent(e)}function Tk(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?xP(i,o):i.dispatchEvent(o)}var Xp="focusScope.autoFocusOnMount",Kp="focusScope.autoFocusOnUnmount",x1={bubbles:!1,cancelable:!0},RP="FocusScope",Zf=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[u,f]=E.useState(null),d=un(i),p=un(o),m=E.useRef(null),v=dt(t,x=>f(x)),g=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let x=function(T){if(g.paused||!u)return;const N=T.target;u.contains(N)?m.current=N:ia(m.current,{select:!0})},k=function(T){if(g.paused||!u)return;const N=T.relatedTarget;N!==null&&(u.contains(N)||ia(m.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(const D of T)D.removedNodes.length>0&&ia(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const _=new MutationObserver(C);return u&&_.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),_.disconnect()}}},[r,u,g.paused]),E.useEffect(()=>{if(u){S1.add(g);const x=document.activeElement;if(!u.contains(x)){const C=new CustomEvent(Xp,x1);u.addEventListener(Xp,d),u.dispatchEvent(C),C.defaultPrevented||(DP(jP(Ak(u)),{select:!0}),document.activeElement===x&&ia(u))}return()=>{u.removeEventListener(Xp,d),setTimeout(()=>{const C=new CustomEvent(Kp,x1);u.addEventListener(Kp,p),u.dispatchEvent(C),C.defaultPrevented||ia(x??document.body,{select:!0}),u.removeEventListener(Kp,p),S1.remove(g)},0)}}},[u,d,p,g]);const w=E.useCallback(x=>{if(!n&&!r||g.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(k&&C){const _=x.currentTarget,[T,N]=NP(_);T&&N?!x.shiftKey&&C===N?(x.preventDefault(),n&&ia(T,{select:!0})):x.shiftKey&&C===T&&(x.preventDefault(),n&&ia(N,{select:!0})):C===_&&x.preventDefault()}},[n,r,g.paused]);return S.jsx(We.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});Zf.displayName=RP;function DP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ia(r,{select:t}),document.activeElement!==n)return}function NP(e){const t=Ak(e),n=w1(t,e),r=w1(t.reverse(),e);return[n,r]}function Ak(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function w1(e,t){for(const n of e)if(!OP(n,{upTo:t}))return n}function OP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function LP(e){return e instanceof HTMLInputElement&&"select"in e}function ia(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LP(e)&&t&&e.select()}}var S1=zP();function zP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=E1(e,t),e.unshift(t)},remove(t){var n;e=E1(e,t),(n=e[0])==null||n.resume()}}}function E1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jP(e){return e.filter(t=>t.tagName!=="A")}var MP="Portal",Qf=E.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=E.useState(!1);xn(()=>o(!0),[]);const s=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return s?kk.createPortal(S.jsx(We.div,{...r,ref:t}),s):null});Qf.displayName=MP;function PP(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Zn=e=>{const{present:t,children:n}=e,r=FP(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=dt(r.ref,IP(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};Zn.displayName="Presence";function FP(e){const[t,n]=E.useState(),r=E.useRef({}),i=E.useRef(e),o=E.useRef("none"),s=e?"mounted":"unmounted",[u,f]=PP(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const d=Rc(r.current);o.current=u==="mounted"?d:"none"},[u]),xn(()=>{const d=r.current,p=i.current;if(p!==e){const v=o.current,g=Rc(d);e?f("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(p&&v!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),xn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=g=>{const x=Rc(r.current).includes(g.animationName);if(g.target===t&&x&&(f("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},v=g=>{g.target===t&&(o.current=Rc(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:E.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Rc(e){return(e==null?void 0:e.animationName)||"none"}function IP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zp=0;function Mv(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_1()),document.body.insertAdjacentElement("beforeend",e[1]??_1()),Zp++,()=>{Zp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zp--}},[])}function _1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Br=function(){return Br=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)};function Rk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function no(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function u(p){try{d(r.next(p))}catch(m){s(m)}}function f(p){try{d(r.throw(p))}catch(m){s(m)}}function d(p){p.done?o(p.value):i(p.value).then(u,f)}d((r=r.apply(e,t||[])).next())})}function GP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var af="right-scroll-bar-position",of="width-before-scroll-bar",BP="with-scroll-bars-hidden",UP="--removed-body-scroll-bar-size";function Qp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function HP(e,t){var n=E.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var $P=typeof window<"u"?E.useLayoutEffect:E.useEffect,k1=new WeakMap;function VP(e,t){var n=HP(null,function(r){return e.forEach(function(i){return Qp(i,r)})});return $P(function(){var r=k1.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(u){o.has(u)||Qp(u,null)}),o.forEach(function(u){i.has(u)||Qp(u,s)})}k1.set(n,e)},[e]),n}function qP(e){return e}function YP(e,t){t===void 0&&(t=qP);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(u){return u!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var u=n;n=[],u.forEach(o),s=n}var f=function(){var p=s;s=[],p.forEach(o)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(p){s.push(p),d()},filter:function(p){return s=s.filter(p),n}}}};return i}function WP(e){e===void 0&&(e={});var t=YP(null);return t.options=Br({async:!0,ssr:!1},e),t}var Dk=function(e){var t=e.sideCar,n=Rk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,Br({},n))};Dk.isSideCarExport=!0;function XP(e,t){return e.useMedium(t),Dk}var Nk=WP(),Jp=function(){},Jf=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:Jp,onWheelCapture:Jp,onTouchMoveCapture:Jp}),i=r[0],o=r[1],s=e.forwardProps,u=e.children,f=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,g=e.noIsolation,w=e.inert,x=e.allowPinchZoom,k=e.as,C=k===void 0?"div":k,_=e.gapMode,T=Rk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=v,D=VP([n,t]),z=Br(Br({},T),i);return E.createElement(E.Fragment,null,p&&E.createElement(N,{sideCar:Nk,removeScrollBar:d,shards:m,noIsolation:g,inert:w,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:_}),s?E.cloneElement(E.Children.only(u),Br(Br({},z),{ref:D})):E.createElement(C,Br({},z,{className:f,ref:D}),u))});Jf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jf.classNames={fullWidth:of,zeroRight:af};var KP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ZP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KP();return t&&e.setAttribute("nonce",t),e}function QP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eF=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZP())&&(QP(t,n),JP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tF=function(){var e=eF();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ok=function(){var e=tF(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},nF={left:0,top:0,right:0,gap:0},em=function(e){return parseInt(e||"",10)||0},rF=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[em(n),em(r),em(i)]},iF=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nF;var t=rF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aF=Ok(),tl="data-scroll-locked",oF=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(BP,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
body[`).concat(tl,`] {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(i,`px;
|
||
padding-top: `).concat(o,`px;
|
||
padding-right: `).concat(s,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(af,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(of,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(af," .").concat(af,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(of," .").concat(of,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body[`).concat(tl,`] {
|
||
`).concat(UP,": ").concat(u,`px;
|
||
}
|
||
`)},C1=function(){var e=parseInt(document.body.getAttribute(tl)||"0",10);return isFinite(e)?e:0},lF=function(){E.useEffect(function(){return document.body.setAttribute(tl,(C1()+1).toString()),function(){var e=C1()-1;e<=0?document.body.removeAttribute(tl):document.body.setAttribute(tl,e.toString())}},[])},sF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;lF();var o=E.useMemo(function(){return iF(i)},[i]);return E.createElement(aF,{styles:oF(o,!t,i,n?"":"!important")})},Ng=!1;if(typeof window<"u")try{var Dc=Object.defineProperty({},"passive",{get:function(){return Ng=!0,!0}});window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{Ng=!1}var $o=Ng?{passive:!1}:!1,uF=function(e){return e.tagName==="TEXTAREA"},Lk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uF(e)&&n[t]==="visible")},cF=function(e){return Lk(e,"overflowY")},fF=function(e){return Lk(e,"overflowX")},T1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=zk(e,r);if(i){var o=jk(e,r),s=o[1],u=o[2];if(s>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dF=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zk=function(e,t){return e==="v"?cF(t):fF(t)},jk=function(e,t){return e==="v"?dF(t):hF(t)},pF=function(e,t){return e==="h"&&t==="rtl"?-1:1},mF=function(e,t,n,r,i){var o=pF(e,window.getComputedStyle(t).direction),s=o*r,u=n.target,f=t.contains(u),d=!1,p=s>0,m=0,v=0;do{var g=jk(e,u),w=g[0],x=g[1],k=g[2],C=x-k-o*w;(w||C)&&zk(e,u)&&(m+=C,v+=w),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(v)<1)&&(d=!0),d},Nc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A1=function(e){return[e.deltaX,e.deltaY]},R1=function(e){return e&&"current"in e?e.current:e},gF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vF=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},yF=0,Vo=[];function bF(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(yF++)[0],o=E.useState(Ok)[0],s=E.useRef(e);E.useEffect(function(){s.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=GP([e.lockRef.current],(e.shards||[]).map(R1),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=E.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!s.current.allowPinchZoom;var C=Nc(x),_=n.current,T="deltaX"in x?x.deltaX:_[0]-C[0],N="deltaY"in x?x.deltaY:_[1]-C[1],D,z=x.target,R=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in x&&R==="h"&&z.type==="range")return!1;var B=T1(R,z);if(!B)return!0;if(B?D=R:(D=R==="v"?"h":"v",B=T1(R,z)),!B)return!1;if(!r.current&&"changedTouches"in x&&(T||N)&&(r.current=D),!D)return!0;var P=r.current||D;return mF(P,k,x,P==="h"?T:N)},[]),f=E.useCallback(function(x){var k=x;if(!(!Vo.length||Vo[Vo.length-1]!==o)){var C="deltaY"in k?A1(k):Nc(k),_=t.current.filter(function(D){return D.name===k.type&&(D.target===k.target||k.target===D.shadowParent)&&gF(D.delta,C)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(s.current.shards||[]).map(R1).filter(Boolean).filter(function(D){return D.contains(k.target)}),N=T.length>0?u(k,T[0]):!s.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),d=E.useCallback(function(x,k,C,_){var T={name:x,delta:k,target:C,should:_,shadowParent:xF(C)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),p=E.useCallback(function(x){n.current=Nc(x),r.current=void 0},[]),m=E.useCallback(function(x){d(x.type,A1(x),x.target,u(x,e.lockRef.current))},[]),v=E.useCallback(function(x){d(x.type,Nc(x),x.target,u(x,e.lockRef.current))},[]);E.useEffect(function(){return Vo.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,$o),document.addEventListener("touchmove",f,$o),document.addEventListener("touchstart",p,$o),function(){Vo=Vo.filter(function(x){return x!==o}),document.removeEventListener("wheel",f,$o),document.removeEventListener("touchmove",f,$o),document.removeEventListener("touchstart",p,$o)}},[]);var g=e.removeScrollBar,w=e.inert;return E.createElement(E.Fragment,null,w?E.createElement(o,{styles:vF(i)}):null,g?E.createElement(sF,{gapMode:e.gapMode}):null)}function xF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wF=XP(Nk,bF);var ed=E.forwardRef(function(e,t){return E.createElement(Jf,Br({},e,{ref:t,sideCar:wF}))});ed.classNames=Jf.classNames;var SF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qo=new WeakMap,Oc=new WeakMap,Lc={},tm=0,Mk=function(e){return e&&(e.host||Mk(e.parentNode))},EF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Mk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_F=function(e,t,n,r){var i=EF(t,Array.isArray(e)?e:[e]);Lc[n]||(Lc[n]=new WeakMap);var o=Lc[n],s=[],u=new Set,f=new Set(i),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};i.forEach(d);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(v){if(u.has(v))p(v);else try{var g=v.getAttribute(r),w=g!==null&&g!=="false",x=(qo.get(v)||0)+1,k=(o.get(v)||0)+1;qo.set(v,x),o.set(v,k),s.push(v),x===1&&w&&Oc.set(v,!0),k===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),u.clear(),tm++,function(){s.forEach(function(m){var v=qo.get(m)-1,g=o.get(m)-1;qo.set(m,v),o.set(m,g),v||(Oc.has(m)||m.removeAttribute(r),Oc.delete(m)),g||m.removeAttribute(n)}),tm--,tm||(qo=new WeakMap,qo=new WeakMap,Oc=new WeakMap,Lc={})}},Pv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=SF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),_F(r,i,n,"aria-hidden")):function(){return null}},Fv="Dialog",[Pk,Fk]=hr(Fv),[kF,Or]=Pk(Fv),Ik=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,u=E.useRef(null),f=E.useRef(null),[d=!1,p]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(kF,{scope:t,triggerRef:u,contentRef:f,contentId:bn(),titleId:bn(),descriptionId:bn(),open:d,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(m=>!m),[p]),modal:s,children:n})};Ik.displayName=Fv;var Gk="DialogTrigger",Bk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Gk,n),o=dt(t,i.triggerRef);return S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bv(i.open),...r,ref:o,onClick:qe(e.onClick,i.onOpenToggle)})});Bk.displayName=Gk;var Iv="DialogPortal",[CF,Uk]=Pk(Iv,{forceMount:void 0}),Hk=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Or(Iv,t);return S.jsx(CF,{scope:t,forceMount:n,children:E.Children.map(r,s=>S.jsx(Zn,{present:n||o.open,children:S.jsx(Qf,{asChild:!0,container:i,children:s})}))})};Hk.displayName=Iv;var xf="DialogOverlay",$k=E.forwardRef((e,t)=>{const n=Uk(xf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Or(xf,e.__scopeDialog);return o.modal?S.jsx(Zn,{present:r||o.open,children:S.jsx(TF,{...i,ref:t})}):null});$k.displayName=xf;var TF=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(xf,n);return S.jsx(ed,{as:ua,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(We.div,{"data-state":Bv(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xa="DialogContent",Vk=E.forwardRef((e,t)=>{const n=Uk(Xa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Or(Xa,e.__scopeDialog);return S.jsx(Zn,{present:r||o.open,children:o.modal?S.jsx(AF,{...i,ref:t}):S.jsx(RF,{...i,ref:t})})});Vk.displayName=Xa;var AF=E.forwardRef((e,t)=>{const n=Or(Xa,e.__scopeDialog),r=E.useRef(null),i=dt(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return Pv(o)},[]),S.jsx(qk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&o.preventDefault()}),onFocusOutside:qe(e.onFocusOutside,o=>o.preventDefault())})}),RF=E.forwardRef((e,t)=>{const n=Or(Xa,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(qk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,u;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),qk=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,u=Or(Xa,n),f=E.useRef(null),d=dt(t,f);return Mv(),S.jsxs(S.Fragment,{children:[S.jsx(Zf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Bv(u.open),...s,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(NF,{titleId:u.titleId}),S.jsx(LF,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Gv="DialogTitle",Yk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Gv,n);return S.jsx(We.h2,{id:i.titleId,...r,ref:t})});Yk.displayName=Gv;var Wk="DialogDescription",Xk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Wk,n);return S.jsx(We.p,{id:i.descriptionId,...r,ref:t})});Xk.displayName=Wk;var Kk="DialogClose",Zk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Kk,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});Zk.displayName=Kk;function Bv(e){return e?"open":"closed"}var Qk="DialogTitleWarning",[DF,Jk]=fP(Qk,{contentName:Xa,titleName:Gv,docsSlug:"dialog"}),NF=({titleId:e})=>{const t=Jk(Qk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OF="DialogDescriptionWarning",LF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jk(OF).contentName}}.`;return E.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Uv=Ik,eC=Bk,Hv=Hk,td=$k,nd=Vk,$v=Yk,Vv=Xk,qv=Zk,tC="AlertDialog",[zF,uK]=hr(tC,[Fk]),Ti=Fk(),nC=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ti(t);return S.jsx(Uv,{...r,...n,modal:!0})};nC.displayName=tC;var jF="AlertDialogTrigger",MF=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(eC,{...i,...r,ref:t})});MF.displayName=jF;var PF="AlertDialogPortal",rC=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ti(t);return S.jsx(Hv,{...r,...n})};rC.displayName=PF;var FF="AlertDialogOverlay",iC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(td,{...i,...r,ref:t})});iC.displayName=FF;var nl="AlertDialogContent",[IF,GF]=zF(nl),aC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Ti(n),s=E.useRef(null),u=dt(t,s),f=E.useRef(null);return S.jsx(DF,{contentName:nl,titleName:oC,docsSlug:"alert-dialog",children:S.jsx(IF,{scope:n,cancelRef:f,children:S.jsxs(nd,{role:"alertdialog",...o,...i,ref:u,onOpenAutoFocus:qe(i.onOpenAutoFocus,d=>{var p;d.preventDefault(),(p=f.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[S.jsx(jv,{children:r}),S.jsx(UF,{contentRef:s})]})})})});aC.displayName=nl;var oC="AlertDialogTitle",lC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx($v,{...i,...r,ref:t})});lC.displayName=oC;var sC="AlertDialogDescription",uC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(Vv,{...i,...r,ref:t})});uC.displayName=sC;var BF="AlertDialogAction",cC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(qv,{...i,...r,ref:t})});cC.displayName=BF;var fC="AlertDialogCancel",dC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=GF(fC,n),o=Ti(n),s=dt(t,i);return S.jsx(qv,{...o,...r,ref:s})});dC.displayName=fC;var UF=({contentRef:e})=>{const t=`\`${nl}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${nl}\` by passing a \`${sC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||
|
||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${nl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return E.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},HF=nC,$F=rC,hC=iC,pC=aC,mC=cC,gC=dC,vC=lC,yC=uC;const VF=["top","right","bottom","left"],ca=Math.min,Yn=Math.max,wf=Math.round,zc=Math.floor,$r=e=>({x:e,y:e}),qF={left:"right",right:"left",bottom:"top",top:"bottom"},YF={start:"end",end:"start"};function Og(e,t,n){return Yn(e,ca(t,n))}function ki(e,t){return typeof e=="function"?e(t):e}function Ci(e){return e.split("-")[0]}function bl(e){return e.split("-")[1]}function Yv(e){return e==="x"?"y":"x"}function Wv(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Ci(e))?"y":"x"}function Xv(e){return Yv(fa(e))}function WF(e,t,n){n===void 0&&(n=!1);const r=bl(e),i=Xv(e),o=Wv(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Sf(s)),[s,Sf(s)]}function XF(e){const t=Sf(e);return[Lg(e),t,Lg(t)]}function Lg(e){return e.replace(/start|end/g,t=>YF[t])}function KF(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function ZF(e,t,n,r){const i=bl(e);let o=KF(Ci(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Lg)))),o}function Sf(e){return e.replace(/left|right|bottom|top/g,t=>qF[t])}function QF(e){return{top:0,right:0,bottom:0,left:0,...e}}function bC(e){return typeof e!="number"?QF(e):{top:e,right:e,bottom:e,left:e}}function Ef(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function D1(e,t,n){let{reference:r,floating:i}=e;const o=fa(t),s=Xv(t),u=Wv(s),f=Ci(t),d=o==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,v=r[u]/2-i[u]/2;let g;switch(f){case"top":g={x:p,y:r.y-i.height};break;case"bottom":g={x:p,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:m};break;case"left":g={x:r.x-i.width,y:m};break;default:g={x:r.x,y:r.y}}switch(bl(t)){case"start":g[s]-=v*(n&&d?-1:1);break;case"end":g[s]+=v*(n&&d?-1:1);break}return g}const JF=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,u=o.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:m}=D1(d,r,f),v=r,g={},w=0;for(let x=0;x<u.length;x++){const{name:k,fn:C}=u[x],{x:_,y:T,data:N,reset:D}=await C({x:p,y:m,initialPlacement:r,placement:v,strategy:i,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});p=_??p,m=T??m,g={...g,[k]:{...g[k],...N}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(v=D.placement),D.rects&&(d=D.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:p,y:m}=D1(d,v,f)),x=-1)}return{x:p,y:m,placement:v,strategy:i,middlewareData:g}};async function qs(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:u,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:v=!1,padding:g=0}=ki(t,e),w=bC(g),k=u[v?m==="floating"?"reference":"floating":m],C=Ef(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(k)))==null||n?k:k.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:f})),_=m==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),N=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},D=Ef(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:_,offsetParent:T,strategy:f}):_);return{top:(C.top-D.top+w.top)/N.y,bottom:(D.bottom-C.bottom+w.bottom)/N.y,left:(C.left-D.left+w.left)/N.x,right:(D.right-C.right+w.right)/N.x}}const e4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:u,middlewareData:f}=t,{element:d,padding:p=0}=ki(e,t)||{};if(d==null)return{};const m=bC(p),v={x:n,y:r},g=Xv(i),w=Wv(g),x=await s.getDimensions(d),k=g==="y",C=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",N=o.reference[w]+o.reference[g]-v[g]-o.floating[w],D=v[g]-o.reference[g],z=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let R=z?z[T]:0;(!R||!await(s.isElement==null?void 0:s.isElement(z)))&&(R=u.floating[T]||o.floating[w]);const B=N/2-D/2,P=R/2-x[w]/2-1,j=ca(m[C],P),V=ca(m[_],P),q=j,I=R-x[w]-V,Y=R/2-x[w]/2+B,Z=Og(q,Y,I),U=!f.arrow&&bl(i)!=null&&Y!==Z&&o.reference[w]/2-(Y<q?j:V)-x[w]/2<0,G=U?Y<q?Y-q:Y-I:0;return{[g]:v[g]+G,data:{[g]:Z,centerOffset:Y-Z-G,...U&&{alignmentOffset:G}},reset:U}}}),t4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:u,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...k}=ki(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=Ci(i),_=fa(u),T=Ci(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=v||(T||!x?[Sf(u)]:XF(u)),z=w!=="none";!v&&z&&D.push(...ZF(u,x,w,N));const R=[u,...D],B=await qs(t,k),P=[];let j=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&P.push(B[C]),m){const Y=WF(i,s,N);P.push(B[Y[0]],B[Y[1]])}if(j=[...j,{placement:i,overflows:P}],!P.every(Y=>Y<=0)){var V,q;const Y=(((V=o.flip)==null?void 0:V.index)||0)+1,Z=R[Y];if(Z)return{data:{index:Y,overflows:j},reset:{placement:Z}};let U=(q=j.filter(G=>G.overflows[0]<=0).sort((G,F)=>G.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!U)switch(g){case"bestFit":{var I;const G=(I=j.filter(F=>{if(z){const K=fa(F.placement);return K===_||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,A)=>K+A,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:I[0];G&&(U=G);break}case"initialPlacement":U=u;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function N1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O1(e){return VF.some(t=>e[t]>=0)}const n4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ki(e,t);switch(r){case"referenceHidden":{const o=await qs(t,{...i,elementContext:"reference"}),s=N1(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:O1(s)}}}case"escaped":{const o=await qs(t,{...i,altBoundary:!0}),s=N1(o,n.floating);return{data:{escapedOffsets:s,escaped:O1(s)}}}default:return{}}}}};async function r4(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Ci(n),u=bl(n),f=fa(n)==="y",d=["left","top"].includes(s)?-1:1,p=o&&f?-1:1,m=ki(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(g=u==="end"?w*-1:w),f?{x:g*p,y:v*d}:{x:v*d,y:g*p}}const i4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:u}=t,f=await r4(t,e);return s===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:s}}}}},a4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u={fn:k=>{let{x:C,y:_}=k;return{x:C,y:_}}},...f}=ki(e,t),d={x:n,y:r},p=await qs(t,f),m=fa(Ci(i)),v=Yv(m);let g=d[v],w=d[m];if(o){const k=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=g+p[k],T=g-p[C];g=Og(_,g,T)}if(s){const k=m==="y"?"top":"left",C=m==="y"?"bottom":"right",_=w+p[k],T=w-p[C];w=Og(_,w,T)}const x=u.fn({...t,[v]:g,[m]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:s}}}}}},o4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:u=0,mainAxis:f=!0,crossAxis:d=!0}=ki(e,t),p={x:n,y:r},m=fa(i),v=Yv(m);let g=p[v],w=p[m];const x=ki(u,t),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const T=v==="y"?"height":"width",N=o.reference[v]-o.floating[T]+k.mainAxis,D=o.reference[v]+o.reference[T]-k.mainAxis;g<N?g=N:g>D&&(g=D)}if(d){var C,_;const T=v==="y"?"width":"height",N=["top","left"].includes(Ci(i)),D=o.reference[m]-o.floating[T]+(N&&((C=s.offset)==null?void 0:C[m])||0)+(N?0:k.crossAxis),z=o.reference[m]+o.reference[T]+(N?0:((_=s.offset)==null?void 0:_[m])||0)-(N?k.crossAxis:0);w<D?w=D:w>z&&(w=z)}return{[v]:g,[m]:w}}}},l4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:u}=t,{apply:f=()=>{},...d}=ki(e,t),p=await qs(t,d),m=Ci(i),v=bl(i),g=fa(i)==="y",{width:w,height:x}=o.floating;let k,C;m==="top"||m==="bottom"?(k=m,C=v===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(C=m,k=v==="end"?"top":"bottom");const _=x-p.top-p.bottom,T=w-p.left-p.right,N=ca(x-p[k],_),D=ca(w-p[C],T),z=!t.middlewareData.shift;let R=N,B=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=_),z&&!v){const j=Yn(p.left,0),V=Yn(p.right,0),q=Yn(p.top,0),I=Yn(p.bottom,0);g?B=w-2*(j!==0||V!==0?j+V:Yn(p.left,p.right)):R=x-2*(q!==0||I!==0?q+I:Yn(p.top,p.bottom))}await f({...t,availableWidth:B,availableHeight:R});const P=await s.getDimensions(u.floating);return w!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function rd(){return typeof window<"u"}function xl(e){return xC(e)?(e.nodeName||"").toLowerCase():"#document"}function Xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qr(e){var t;return(t=(xC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xC(e){return rd()?e instanceof Node||e instanceof Xn(e).Node:!1}function Ar(e){return rd()?e instanceof Element||e instanceof Xn(e).Element:!1}function Vr(e){return rd()?e instanceof HTMLElement||e instanceof Xn(e).HTMLElement:!1}function L1(e){return!rd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xn(e).ShadowRoot}function lu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function s4(e){return["table","td","th"].includes(xl(e))}function id(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Kv(e){const t=Zv(),n=Ar(e)?Rr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function u4(e){let t=da(e);for(;Vr(t)&&!ll(t);){if(Kv(t))return t;if(id(t))return null;t=da(t)}return null}function Zv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ll(e){return["html","body","#document"].includes(xl(e))}function Rr(e){return Xn(e).getComputedStyle(e)}function ad(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function da(e){if(xl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L1(e)&&e.host||qr(e);return L1(t)?t.host:t}function wC(e){const t=da(e);return ll(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&lu(t)?t:wC(t)}function Ys(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=wC(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Xn(i);if(o){const u=zg(s);return t.concat(s,s.visualViewport||[],lu(i)?i:[],u&&n?Ys(u):[])}return t.concat(i,Ys(i,[],n))}function zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function SC(e){const t=Rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vr(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,u=wf(n)!==o||wf(r)!==s;return u&&(n=o,r=s),{width:n,height:r,$:u}}function Qv(e){return Ar(e)?e:e.contextElement}function rl(e){const t=Qv(e);if(!Vr(t))return $r(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=SC(t);let s=(o?wf(n.width):n.width)/r,u=(o?wf(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const c4=$r(0);function EC(e){const t=Xn(e);return!Zv()||!t.visualViewport?c4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function f4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xn(e)?!1:t}function Ka(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Qv(e);let s=$r(1);t&&(r?Ar(r)&&(s=rl(r)):s=rl(e));const u=f4(o,n,r)?EC(o):$r(0);let f=(i.left+u.x)/s.x,d=(i.top+u.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(o){const v=Xn(o),g=r&&Ar(r)?Xn(r):r;let w=v,x=zg(w);for(;x&&r&&g!==w;){const k=rl(x),C=x.getBoundingClientRect(),_=Rr(x),T=C.left+(x.clientLeft+parseFloat(_.paddingLeft))*k.x,N=C.top+(x.clientTop+parseFloat(_.paddingTop))*k.y;f*=k.x,d*=k.y,p*=k.x,m*=k.y,f+=T,d+=N,w=Xn(x),x=zg(w)}}return Ef({width:p,height:m,x:f,y:d})}function Jv(e,t){const n=ad(e).scrollLeft;return t?t.left+n:Ka(qr(e)).left+n}function _C(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Jv(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function d4(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=qr(r),u=t?id(t.floating):!1;if(r===s||u&&o)return n;let f={scrollLeft:0,scrollTop:0},d=$r(1);const p=$r(0),m=Vr(r);if((m||!m&&!o)&&((xl(r)!=="body"||lu(s))&&(f=ad(r)),Vr(r))){const g=Ka(r);d=rl(r),p.x=g.x+r.clientLeft,p.y=g.y+r.clientTop}const v=s&&!m&&!o?_C(s,f,!0):$r(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+p.x+v.x,y:n.y*d.y-f.scrollTop*d.y+p.y+v.y}}function h4(e){return Array.from(e.getClientRects())}function p4(e){const t=qr(e),n=ad(e),r=e.ownerDocument.body,i=Yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jv(e);const u=-n.scrollTop;return Rr(r).direction==="rtl"&&(s+=Yn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:u}}function m4(e,t){const n=Xn(e),r=qr(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,u=0,f=0;if(i){o=i.width,s=i.height;const d=Zv();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:s,x:u,y:f}}function g4(e,t){const n=Ka(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Vr(e)?rl(e):$r(1),s=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,d=r*o.y;return{width:s,height:u,x:f,y:d}}function z1(e,t,n){let r;if(t==="viewport")r=m4(e,n);else if(t==="document")r=p4(qr(e));else if(Ar(t))r=g4(t,n);else{const i=EC(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ef(r)}function kC(e,t){const n=da(e);return n===t||!Ar(n)||ll(n)?!1:Rr(n).position==="fixed"||kC(n,t)}function v4(e,t){const n=t.get(e);if(n)return n;let r=Ys(e,[],!1).filter(u=>Ar(u)&&xl(u)!=="body"),i=null;const o=Rr(e).position==="fixed";let s=o?da(e):e;for(;Ar(s)&&!ll(s);){const u=Rr(s),f=Kv(s);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||lu(s)&&!f&&kC(e,s))?r=r.filter(p=>p!==s):i=u,s=da(s)}return t.set(e,r),r}function y4(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?id(t)?[]:v4(t,this._c):[].concat(n),r],u=s[0],f=s.reduce((d,p)=>{const m=z1(t,p,i);return d.top=Yn(m.top,d.top),d.right=ca(m.right,d.right),d.bottom=ca(m.bottom,d.bottom),d.left=Yn(m.left,d.left),d},z1(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function b4(e){const{width:t,height:n}=SC(e);return{width:t,height:n}}function x4(e,t,n){const r=Vr(t),i=qr(t),o=n==="fixed",s=Ka(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=$r(0);if(r||!r&&!o)if((xl(t)!=="body"||lu(i))&&(u=ad(t)),r){const v=Ka(t,!0,o,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else i&&(f.x=Jv(i));const d=i&&!r&&!o?_C(i,u):$r(0),p=s.left+u.scrollLeft-f.x-d.x,m=s.top+u.scrollTop-f.y-d.y;return{x:p,y:m,width:s.width,height:s.height}}function nm(e){return Rr(e).position==="static"}function j1(e,t){if(!Vr(e)||Rr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qr(e)===n&&(n=n.ownerDocument.body),n}function CC(e,t){const n=Xn(e);if(id(e))return n;if(!Vr(e)){let i=da(e);for(;i&&!ll(i);){if(Ar(i)&&!nm(i))return i;i=da(i)}return n}let r=j1(e,t);for(;r&&s4(r)&&nm(r);)r=j1(r,t);return r&&ll(r)&&nm(r)&&!Kv(r)?n:r||u4(e)||n}const w4=async function(e){const t=this.getOffsetParent||CC,n=this.getDimensions,r=await n(e.floating);return{reference:x4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function S4(e){return Rr(e).direction==="rtl"}const E4={convertOffsetParentRelativeRectToViewportRelativeRect:d4,getDocumentElement:qr,getClippingRect:y4,getOffsetParent:CC,getElementRects:w4,getClientRects:h4,getDimensions:b4,getScale:rl,isElement:Ar,isRTL:S4};function TC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _4(e,t){let n=null,r;const i=qr(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function s(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:p,top:m,width:v,height:g}=d;if(u||t(),!v||!g)return;const w=zc(m),x=zc(i.clientWidth-(p+v)),k=zc(i.clientHeight-(m+g)),C=zc(p),T={rootMargin:-w+"px "+-x+"px "+-k+"px "+-C+"px",threshold:Yn(0,ca(1,f))||1};let N=!0;function D(z){const R=z[0].intersectionRatio;if(R!==f){if(!N)return s();R?s(!1,R):r=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!TC(d,e.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(D,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return s(!0),o}function k4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Qv(e),p=i||o?[...d?Ys(d):[],...Ys(t)]:[];p.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const m=d&&u?_4(d,n):null;let v=-1,g=null;s&&(g=new ResizeObserver(C=>{let[_]=C;_&&_.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,x=f?Ka(e):null;f&&k();function k(){const C=Ka(e);x&&!TC(x,C)&&n(),x=C,w=requestAnimationFrame(k)}return n(),()=>{var C;p.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),m==null||m(),(C=g)==null||C.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const C4=i4,T4=a4,A4=t4,R4=l4,D4=n4,M1=e4,N4=o4,O4=(e,t,n)=>{const r=new Map,i={platform:E4,...n},o={...i.platform,_c:r};return JF(e,t,{...i,platform:o})};var lf=typeof document<"u"?E.useLayoutEffect:E.useEffect;function _f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_f(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!_f(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function AC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function P1(e,t){const n=AC(e);return Math.round(t*n)/n}function rm(e){const t=E.useRef(e);return lf(()=>{t.current=e}),t}function L4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:u=!0,whileElementsMounted:f,open:d}=e,[p,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=E.useState(r);_f(v,r)||g(r);const[w,x]=E.useState(null),[k,C]=E.useState(null),_=E.useCallback(F=>{F!==z.current&&(z.current=F,x(F))},[]),T=E.useCallback(F=>{F!==R.current&&(R.current=F,C(F))},[]),N=o||w,D=s||k,z=E.useRef(null),R=E.useRef(null),B=E.useRef(p),P=f!=null,j=rm(f),V=rm(i),q=rm(d),I=E.useCallback(()=>{if(!z.current||!R.current)return;const F={placement:t,strategy:n,middleware:v};V.current&&(F.platform=V.current),O4(z.current,R.current,F).then(K=>{const A={...K,isPositioned:q.current!==!1};Y.current&&!_f(B.current,A)&&(B.current=A,au.flushSync(()=>{m(A)}))})},[v,t,n,V,q]);lf(()=>{d===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const Y=E.useRef(!1);lf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),lf(()=>{if(N&&(z.current=N),D&&(R.current=D),N&&D){if(j.current)return j.current(N,D,I);I()}},[N,D,I,j,P]);const Z=E.useMemo(()=>({reference:z,floating:R,setReference:_,setFloating:T}),[_,T]),U=E.useMemo(()=>({reference:N,floating:D}),[N,D]),G=E.useMemo(()=>{const F={position:n,left:0,top:0};if(!U.floating)return F;const K=P1(U.floating,p.x),A=P1(U.floating,p.y);return u?{...F,transform:"translate("+K+"px, "+A+"px)",...AC(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:A}},[n,u,U.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:I,refs:Z,elements:U,floatingStyles:G}),[p,I,Z,U,G])}const z4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?M1({element:r.current,padding:i}).fn(n):{}:r?M1({element:r,padding:i}).fn(n):{}}}},j4=(e,t)=>({...C4(e),options:[e,t]}),M4=(e,t)=>({...T4(e),options:[e,t]}),P4=(e,t)=>({...N4(e),options:[e,t]}),F4=(e,t)=>({...A4(e),options:[e,t]}),I4=(e,t)=>({...R4(e),options:[e,t]}),G4=(e,t)=>({...D4(e),options:[e,t]}),B4=(e,t)=>({...z4(e),options:[e,t]});var U4="Arrow",RC=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return S.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});RC.displayName=U4;var H4=RC;function DC(e){const[t,n]=E.useState(void 0);return xn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,u;if("borderBoxSize"in o){const f=o.borderBoxSize,d=Array.isArray(f)?f[0]:f;s=d.inlineSize,u=d.blockSize}else s=e.offsetWidth,u=e.offsetHeight;n({width:s,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ey="Popper",[NC,wl]=hr(ey),[$4,OC]=NC(ey),LC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return S.jsx($4,{scope:t,anchor:r,onAnchorChange:i,children:n})};LC.displayName=ey;var zC="PopperAnchor",jC=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=OC(zC,n),s=E.useRef(null),u=dt(t,s);return E.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:S.jsx(We.div,{...i,ref:u})});jC.displayName=zC;var ty="PopperContent",[V4,q4]=NC(ty),MC=E.forwardRef((e,t)=>{var ae,oe,Ce,he,Ee,we;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:w,...x}=e,k=OC(ty,n),[C,_]=E.useState(null),T=dt(t,Pe=>_(Pe)),[N,D]=E.useState(null),z=DC(N),R=(z==null?void 0:z.width)??0,B=(z==null?void 0:z.height)??0,P=r+(o!=="center"?"-"+o:""),j=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},V=Array.isArray(d)?d:[d],q=V.length>0,I={padding:j,boundary:V.filter(W4),altBoundary:q},{refs:Y,floatingStyles:Z,placement:U,isPositioned:G,middlewareData:F}=L4({strategy:"fixed",placement:P,whileElementsMounted:(...Pe)=>k4(...Pe,{animationFrame:g==="always"}),elements:{reference:k.anchor},middleware:[j4({mainAxis:i+B,alignmentAxis:s}),f&&M4({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?P4():void 0,...I}),f&&F4({...I}),I4({...I,apply:({elements:Pe,rects:Ae,availableWidth:xe,availableHeight:ee})=>{const{width:ce,height:Te}=Ae.reference,ge=Pe.floating.style;ge.setProperty("--radix-popper-available-width",`${xe}px`),ge.setProperty("--radix-popper-available-height",`${ee}px`),ge.setProperty("--radix-popper-anchor-width",`${ce}px`),ge.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),N&&B4({element:N,padding:u}),X4({arrowWidth:R,arrowHeight:B}),v&&G4({strategy:"referenceHidden",...I})]}),[K,A]=IC(U),$=un(w);xn(()=>{G&&($==null||$())},[G,$]);const M=(ae=F.arrow)==null?void 0:ae.x,O=(oe=F.arrow)==null?void 0:oe.y,X=((Ce=F.arrow)==null?void 0:Ce.centerOffset)!==0,[re,ue]=E.useState();return xn(()=>{C&&ue(window.getComputedStyle(C).zIndex)},[C]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=F.transformOrigin)==null?void 0:he.x,(Ee=F.transformOrigin)==null?void 0:Ee.y].join(" "),...((we=F.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(V4,{scope:n,placedSide:K,onArrowChange:D,arrowX:M,arrowY:O,shouldHideArrow:X,children:S.jsx(We.div,{"data-side":K,"data-align":A,...x,ref:T,style:{...x.style,animation:G?void 0:"none"}})})})});MC.displayName=ty;var PC="PopperArrow",Y4={top:"bottom",right:"left",bottom:"top",left:"right"},FC=E.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=q4(PC,r),s=Y4[o.placedSide];return S.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S.jsx(H4,{...i,ref:n,style:{...i.style,display:"block"}})})});FC.displayName=PC;function W4(e){return e!==null}var X4=e=>({name:"transformOrigin",options:e,fn(t){var k,C,_;const{placement:n,rects:r,middlewareData:i}=t,s=((k=i.arrow)==null?void 0:k.centerOffset)!==0,u=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[d,p]=IC(n),m={start:"0%",center:"50%",end:"100%"}[p],v=(((C=i.arrow)==null?void 0:C.x)??0)+u/2,g=(((_=i.arrow)==null?void 0:_.y)??0)+f/2;let w="",x="";return d==="bottom"?(w=s?m:`${v}px`,x=`${-f}px`):d==="top"?(w=s?m:`${v}px`,x=`${r.floating.height+f}px`):d==="right"?(w=`${-f}px`,x=s?m:`${g}px`):d==="left"&&(w=`${r.floating.width+f}px`,x=s?m:`${g}px`),{data:{x:w,y:x}}}});function IC(e){const[t,n="center"]=e.split("-");return[t,n]}var ny=LC,od=jC,ry=MC,iy=FC,K4="VisuallyHidden",ay=E.forwardRef((e,t)=>S.jsx(We.span,{...e,ref:t,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",...e.style}}));ay.displayName=K4;var Z4=ay,[ld,cK]=hr("Tooltip",[wl]),sd=wl(),GC="TooltipProvider",Q4=700,jg="tooltip.open",[J4,oy]=ld(GC),BC=e=>{const{__scopeTooltip:t,delayDuration:n=Q4,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,u]=E.useState(!0),f=E.useRef(!1),d=E.useRef(0);return E.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),S.jsx(J4,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(d.current),u(!1)},[]),onClose:E.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:E.useCallback(p=>{f.current=p},[]),disableHoverableContent:i,children:o})};BC.displayName=GC;var ud="Tooltip",[eI,cd]=ld(ud),UC=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:u}=e,f=oy(ud,e.__scopeTooltip),d=sd(t),[p,m]=E.useState(null),v=bn(),g=E.useRef(0),w=s??f.disableHoverableContent,x=u??f.delayDuration,k=E.useRef(!1),[C=!1,_]=_i({prop:r,defaultProp:i,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(jg))):f.onClose(),o==null||o(R)}}),T=E.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),N=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,k.current=!1,_(!0)},[_]),D=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,_(!1)},[_]),z=E.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{k.current=!0,_(!0),g.current=0},x)},[x,_]);return E.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),S.jsx(ny,{...d,children:S.jsx(eI,{scope:t,contentId:v,open:C,stateAttribute:T,trigger:p,onTriggerChange:m,onTriggerEnter:E.useCallback(()=>{f.isOpenDelayed?z():N()},[f.isOpenDelayed,z,N]),onTriggerLeave:E.useCallback(()=>{w?D():(window.clearTimeout(g.current),g.current=0)},[D,w]),onOpen:N,onClose:D,disableHoverableContent:w,children:n})})};UC.displayName=ud;var Mg="TooltipTrigger",HC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=cd(Mg,n),o=oy(Mg,n),s=sd(n),u=E.useRef(null),f=dt(t,u,i.onTriggerChange),d=E.useRef(!1),p=E.useRef(!1),m=E.useCallback(()=>d.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(od,{asChild:!0,...s,children:S.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:f,onPointerMove:qe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:qe(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:qe(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:qe(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:qe(e.onBlur,i.onClose),onClick:qe(e.onClick,i.onClose)})})});HC.displayName=Mg;var tI="TooltipPortal",[fK,nI]=ld(tI,{forceMount:void 0}),sl="TooltipContent",$C=E.forwardRef((e,t)=>{const n=nI(sl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=cd(sl,e.__scopeTooltip);return S.jsx(Zn,{present:r||s.open,children:s.disableHoverableContent?S.jsx(VC,{side:i,...o,ref:t}):S.jsx(rI,{side:i,...o,ref:t})})}),rI=E.forwardRef((e,t)=>{const n=cd(sl,e.__scopeTooltip),r=oy(sl,e.__scopeTooltip),i=E.useRef(null),o=dt(t,i),[s,u]=E.useState(null),{trigger:f,onClose:d}=n,p=i.current,{onPointerInTransitChange:m}=r,v=E.useCallback(()=>{u(null),m(!1)},[m]),g=E.useCallback((w,x)=>{const k=w.currentTarget,C={x:w.clientX,y:w.clientY},_=lI(C,k.getBoundingClientRect()),T=sI(C,_),N=uI(x.getBoundingClientRect()),D=fI([...T,...N]);u(D),m(!0)},[m]);return E.useEffect(()=>()=>v(),[v]),E.useEffect(()=>{if(f&&p){const w=k=>g(k,p),x=k=>g(k,f);return f.addEventListener("pointerleave",w),p.addEventListener("pointerleave",x),()=>{f.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",x)}}},[f,p,g,v]),E.useEffect(()=>{if(s){const w=x=>{const k=x.target,C={x:x.clientX,y:x.clientY},_=(f==null?void 0:f.contains(k))||(p==null?void 0:p.contains(k)),T=!cI(C,s);_?v():T&&(v(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,p,s,d,v]),S.jsx(VC,{...e,ref:o})}),[iI,aI]=ld(ud,{isInside:!1}),VC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...u}=e,f=cd(sl,n),d=sd(n),{onClose:p}=f;return E.useEffect(()=>(document.addEventListener(jg,p),()=>document.removeEventListener(jg,p)),[p]),E.useEffect(()=>{if(f.trigger){const m=v=>{const g=v.target;g!=null&&g.contains(f.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[f.trigger,p]),S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:S.jsxs(ry,{"data-state":f.stateAttribute,...d,...u,ref:t,style:{...u.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:[S.jsx(jv,{children:r}),S.jsx(iI,{scope:n,isInside:!0,children:S.jsx(Z4,{id:f.contentId,role:"tooltip",children:i||r})})]})})});$C.displayName=sl;var qC="TooltipArrow",oI=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=sd(n);return aI(qC,n).isInside?null:S.jsx(iy,{...i,...r,ref:t})});oI.displayName=qC;function lI(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function sI(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function uI(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function cI(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const u=t[o].x,f=t[o].y,d=t[s].x,p=t[s].y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(i=!i)}return i}function fI(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),dI(t)}function dI(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var hI=BC,pI=UC,mI=HC,YC=$C;const WC=hI,XC=pI,KC=mI,gI=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>S.jsxs(E.Fragment,{children:[t,n<e.split("\\n").length-1&&S.jsx("br",{})]},n)),ly=E.forwardRef(({className:e,sideOffset:t=4,children:n,...r},i)=>S.jsx(YC,{ref:i,sideOffset:t,className:Me("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 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?gI(n):n}));ly.displayName=YC.displayName;const kf=U_("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"}}),Ot=E.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:i="right",asChild:o=!1,...s},u)=>{const f=o?ua:"button";return n?S.jsx(WC,{children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx(f,{className:Me(kf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...s})}),S.jsx(ly,{side:i,children:n})]})}):S.jsx(f,{className:Me(kf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...s})});Ot.displayName="Button";const vI=HF,yI=$F,ZC=E.forwardRef(({className:e,...t},n)=>S.jsx(hC,{className:Me("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",e),...t,ref:n}));ZC.displayName=hC.displayName;const QC=E.forwardRef(({className:e,...t},n)=>S.jsxs(yI,{children:[S.jsx(ZC,{}),S.jsx(pC,{ref:n,className:Me("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-top-[48%] 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",e),...t})]}));QC.displayName=pC.displayName;const JC=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});JC.displayName="AlertDialogHeader";const eT=E.forwardRef(({className:e,...t},n)=>S.jsx(vC,{ref:n,className:Me("text-lg font-semibold",e),...t}));eT.displayName=vC.displayName;const tT=E.forwardRef(({className:e,...t},n)=>S.jsx(yC,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));tT.displayName=yC.displayName;const bI=E.forwardRef(({className:e,...t},n)=>S.jsx(mC,{ref:n,className:Me(kf(),e),...t}));bI.displayName=mC.displayName;const xI=E.forwardRef(({className:e,...t},n)=>S.jsx(gC,{ref:n,className:Me(kf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));xI.displayName=gC.displayName;const Za=E.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:Me("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",e),ref:r,...n}));Za.displayName="Input";var wI=e=>{switch(e){case"success":return _I;case"info":return CI;case"warning":return kI;case"error":return TI;default:return null}},SI=Array(12).fill(0),EI=({visible:e,className:t})=>be.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},be.createElement("div",{className:"sonner-spinner"},SI.map((n,r)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_I=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),kI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),CI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),TI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),AI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),RI=()=>{let[e,t]=be.useState(document.hidden);return be.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Pg=1,DI=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Pg++,o=this.toasts.find(u=>u.id===i),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:n}),{...u,...e,id:i,dismissible:s,title:n}):u):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,s=r.then(async f=>{if(o=["resolve",f],be.isValidElement(f))i=!1,this.create({id:n,type:"default",message:f});else if(OI(f)&&!f.ok){i=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:d,description:p})}else if(t.success!==void 0){i=!1;let d=typeof t.success=="function"?await t.success(f):t.success,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:d,description:p})}}).catch(async f=>{if(o=["reject",f],t.error!==void 0){i=!1;let d=typeof t.error=="function"?await t.error(f):t.error,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:d,description:p})}}).finally(()=>{var f;i&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,d)=>s.then(()=>o[0]==="reject"?d(o[1]):f(o[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Pg++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},zn=new DI,NI=(e,t)=>{let n=(t==null?void 0:t.id)||Pg++;return zn.addToast({title:e,...t,id:n}),n},OI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LI=NI,zI=()=>zn.toasts,jI=()=>zn.getActiveToasts(),vn=Object.assign(LI,{success:zn.success,info:zn.info,warning:zn.warning,error:zn.error,custom:zn.custom,message:zn.message,promise:zn.promise,dismiss:zn.dismiss,loading:zn.loading},{getHistory:zI,getToasts:jI});function MI(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}MI(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
||
`);function jc(e){return e.label!==void 0}var PI=3,FI="32px",II="16px",F1=4e3,GI=356,BI=14,UI=20,HI=200;function wr(...e){return e.filter(Boolean).join(" ")}function $I(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var VI=e=>{var t,n,r,i,o,s,u,f,d,p,m;let{invert:v,toast:g,unstyled:w,interacting:x,setHeights:k,visibleToasts:C,heights:_,index:T,toasts:N,expanded:D,removeToast:z,defaultRichColors:R,closeButton:B,style:P,cancelButtonStyle:j,actionButtonStyle:V,className:q="",descriptionClassName:I="",duration:Y,position:Z,gap:U,loadingIcon:G,expandByDefault:F,classNames:K,icons:A,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:M}=e,[O,X]=be.useState(null),[re,ue]=be.useState(null),[ae,oe]=be.useState(!1),[Ce,he]=be.useState(!1),[Ee,we]=be.useState(!1),[Pe,Ae]=be.useState(!1),[xe,ee]=be.useState(!1),[ce,Te]=be.useState(0),[ge,Se]=be.useState(0),ie=be.useRef(g.duration||Y||F1),He=be.useRef(null),Ge=be.useRef(null),ve=T===0,Ne=T+1<=C,te=g.type,de=g.dismissible!==!1,Oe=g.className||"",$e=g.descriptionClassName||"",Ye=be.useMemo(()=>_.findIndex(Ze=>Ze.toastId===g.id)||0,[_,g.id]),vt=be.useMemo(()=>{var Ze;return(Ze=g.closeButton)!=null?Ze:B},[g.closeButton,B]),Mt=be.useMemo(()=>g.duration||Y||F1,[g.duration,Y]),bt=be.useRef(0),rt=be.useRef(0),qt=be.useRef(0),at=be.useRef(null),[At,rn]=Z.split("-"),io=be.useMemo(()=>_.reduce((Ze,gt,_t)=>_t>=Ye?Ze:Ze+gt.height,0),[_,Ye]),xu=RI(),ao=g.invert||v,Di=te==="loading";rt.current=be.useMemo(()=>Ye*U+io,[Ye,io]),be.useEffect(()=>{ie.current=Mt},[Mt]),be.useEffect(()=>{oe(!0)},[]),be.useEffect(()=>{let Ze=Ge.current;if(Ze){let gt=Ze.getBoundingClientRect().height;return Se(gt),k(_t=>[{toastId:g.id,height:gt,position:g.position},..._t]),()=>k(_t=>_t.filter(Cn=>Cn.toastId!==g.id))}},[k,g.id]),be.useLayoutEffect(()=>{if(!ae)return;let Ze=Ge.current,gt=Ze.style.height;Ze.style.height="auto";let _t=Ze.getBoundingClientRect().height;Ze.style.height=gt,Se(_t),k(Cn=>Cn.find(Sn=>Sn.toastId===g.id)?Cn.map(Sn=>Sn.toastId===g.id?{...Sn,height:_t}:Sn):[{toastId:g.id,height:_t,position:g.position},...Cn])},[ae,g.title,g.description,k,g.id]);let dn=be.useCallback(()=>{he(!0),Te(rt.current),k(Ze=>Ze.filter(gt=>gt.toastId!==g.id)),setTimeout(()=>{z(g)},HI)},[g,z,k,rt]);be.useEffect(()=>{if(g.promise&&te==="loading"||g.duration===1/0||g.type==="loading")return;let Ze;return D||x||M&&xu?(()=>{if(qt.current<bt.current){let gt=new Date().getTime()-bt.current;ie.current=ie.current-gt}qt.current=new Date().getTime()})():ie.current!==1/0&&(bt.current=new Date().getTime(),Ze=setTimeout(()=>{var gt;(gt=g.onAutoClose)==null||gt.call(g,g),dn()},ie.current)),()=>clearTimeout(Ze)},[D,x,g,te,M,xu,dn]),be.useEffect(()=>{g.delete&&dn()},[dn,g.delete]);function oo(){var Ze,gt,_t;return A!=null&&A.loading?be.createElement("div",{className:wr(K==null?void 0:K.loader,(Ze=g==null?void 0:g.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":te==="loading"},A.loading):G?be.createElement("div",{className:wr(K==null?void 0:K.loader,(gt=g==null?void 0:g.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":te==="loading"},G):be.createElement(EI,{className:wr(K==null?void 0:K.loader,(_t=g==null?void 0:g.classNames)==null?void 0:_t.loader),visible:te==="loading"})}return be.createElement("li",{tabIndex:0,ref:Ge,className:wr(q,Oe,K==null?void 0:K.toast,(t=g==null?void 0:g.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[te],(n=g==null?void 0:g.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:R,"data-styled":!(g.jsx||g.unstyled||w),"data-mounted":ae,"data-promise":!!g.promise,"data-swiped":xe,"data-removed":Ce,"data-visible":Ne,"data-y-position":At,"data-x-position":rn,"data-index":T,"data-front":ve,"data-swiping":Ee,"data-dismissible":de,"data-type":te,"data-invert":ao,"data-swipe-out":Pe,"data-swipe-direction":re,"data-expanded":!!(D||F&&ae),style:{"--index":T,"--toasts-before":T,"--z-index":N.length-T,"--offset":`${Ce?ce:rt.current}px`,"--initial-height":F?"auto":`${ge}px`,...P,...g.style},onDragEnd:()=>{we(!1),X(null),at.current=null},onPointerDown:Ze=>{Di||!de||(He.current=new Date,Te(rt.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(we(!0),at.current={x:Ze.clientX,y:Ze.clientY}))},onPointerUp:()=>{var Ze,gt,_t,Cn;if(Pe||!de)return;at.current=null;let Sn=Number(((Ze=Ge.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((gt=Ge.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Zr=new Date().getTime()-((_t=He.current)==null?void 0:_t.getTime()),An=O==="x"?Sn:Tn,gr=Math.abs(An)/Zr;if(Math.abs(An)>=UI||gr>.11){Te(rt.current),(Cn=g.onDismiss)==null||Cn.call(g,g),ue(O==="x"?Sn>0?"right":"left":Tn>0?"down":"up"),dn(),Ae(!0),ee(!1);return}we(!1),X(null)},onPointerMove:Ze=>{var gt,_t,Cn,Sn;if(!at.current||!de||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Tn=Ze.clientY-at.current.y,Zr=Ze.clientX-at.current.x,An=(_t=e.swipeDirections)!=null?_t:$I(Z);!O&&(Math.abs(Zr)>1||Math.abs(Tn)>1)&&X(Math.abs(Zr)>Math.abs(Tn)?"x":"y");let gr={x:0,y:0};O==="y"?(An.includes("top")||An.includes("bottom"))&&(An.includes("top")&&Tn<0||An.includes("bottom")&&Tn>0)&&(gr.y=Tn):O==="x"&&(An.includes("left")||An.includes("right"))&&(An.includes("left")&&Zr<0||An.includes("right")&&Zr>0)&&(gr.x=Zr),(Math.abs(gr.x)>0||Math.abs(gr.y)>0)&&ee(!0),(Cn=Ge.current)==null||Cn.style.setProperty("--swipe-amount-x",`${gr.x}px`),(Sn=Ge.current)==null||Sn.style.setProperty("--swipe-amount-y",`${gr.y}px`)}},vt&&!g.jsx?be.createElement("button",{"aria-label":$,"data-disabled":Di,"data-close-button":!0,onClick:Di||!de?()=>{}:()=>{var Ze;dn(),(Ze=g.onDismiss)==null||Ze.call(g,g)},className:wr(K==null?void 0:K.closeButton,(i=g==null?void 0:g.classNames)==null?void 0:i.closeButton)},(o=A==null?void 0:A.close)!=null?o:AI):null,g.jsx||E.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:be.createElement(be.Fragment,null,te||g.icon||g.promise?be.createElement("div",{"data-icon":"",className:wr(K==null?void 0:K.icon,(s=g==null?void 0:g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||oo():null,g.type!=="loading"?g.icon||(A==null?void 0:A[te])||wI(te):null):null,be.createElement("div",{"data-content":"",className:wr(K==null?void 0:K.content,(u=g==null?void 0:g.classNames)==null?void 0:u.content)},be.createElement("div",{"data-title":"",className:wr(K==null?void 0:K.title,(f=g==null?void 0:g.classNames)==null?void 0:f.title)},typeof g.title=="function"?g.title():g.title),g.description?be.createElement("div",{"data-description":"",className:wr(I,$e,K==null?void 0:K.description,(d=g==null?void 0:g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),E.isValidElement(g.cancel)?g.cancel:g.cancel&&jc(g.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||j,onClick:Ze=>{var gt,_t;jc(g.cancel)&&de&&((_t=(gt=g.cancel).onClick)==null||_t.call(gt,Ze),dn())},className:wr(K==null?void 0:K.cancelButton,(p=g==null?void 0:g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,E.isValidElement(g.action)?g.action:g.action&&jc(g.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||V,onClick:Ze=>{var gt,_t;jc(g.action)&&((_t=(gt=g.action).onClick)==null||_t.call(gt,Ze),!Ze.defaultPrevented&&dn())},className:wr(K==null?void 0:K.actionButton,(m=g==null?void 0:g.classNames)==null?void 0:m.actionButton)},g.action.label):null))};function I1(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function qI(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,s=o?"--mobile-offset":"--offset",u=o?II:FI;function f(d){["top","right","bottom","left"].forEach(p=>{n[`${s}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${s}-${d}`]=u:n[`${s}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(u)}),n}var YI=E.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:s,className:u,offset:f,mobileOffset:d,theme:p="light",richColors:m,duration:v,style:g,visibleToasts:w=PI,toastOptions:x,dir:k=I1(),gap:C=BI,loadingIcon:_,icons:T,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:D}=e,[z,R]=be.useState([]),B=be.useMemo(()=>Array.from(new Set([r].concat(z.filter(M=>M.position).map(M=>M.position)))),[z,r]),[P,j]=be.useState([]),[V,q]=be.useState(!1),[I,Y]=be.useState(!1),[Z,U]=be.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=be.useRef(null),F=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=be.useRef(null),A=be.useRef(!1),$=be.useCallback(M=>{R(O=>{var X;return(X=O.find(re=>re.id===M.id))!=null&&X.delete||zn.dismiss(M.id),O.filter(({id:re})=>re!==M.id)})},[]);return be.useEffect(()=>zn.subscribe(M=>{if(M.dismiss){R(O=>O.map(X=>X.id===M.id?{...X,delete:!0}:X));return}setTimeout(()=>{kk.flushSync(()=>{R(O=>{let X=O.findIndex(re=>re.id===M.id);return X!==-1?[...O.slice(0,X),{...O[X],...M},...O.slice(X+1)]:[M,...O]})})})}),[]),be.useEffect(()=>{if(p!=="system"){U(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{U(O?"dark":"light")})}catch{M.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(re){console.error(re)}})}},[p]),be.useEffect(()=>{z.length<=1&&q(!1)},[z]),be.useEffect(()=>{let M=O=>{var X,re;i.every(ue=>O[ue]||O.code===ue)&&(q(!0),(X=G.current)==null||X.focus()),O.code==="Escape"&&(document.activeElement===G.current||(re=G.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),be.useEffect(()=>{if(G.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,A.current=!1)}},[G.current]),be.createElement("section",{ref:t,"aria-label":`${N} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((M,O)=>{var X;let[re,ue]=M.split("-");return z.length?be.createElement("ol",{key:M,dir:k==="auto"?I1():k,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":re,"data-lifted":V&&z.length>1&&!o,"data-x-position":ue,style:{"--front-toast-height":`${((X=P[0])==null?void 0:X.height)||0}px`,"--width":`${GI}px`,"--gap":`${C}px`,...g,...qI(f,d)},onBlur:ae=>{A.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(A.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||A.current||(A.current=!0,K.current=ae.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{I||q(!1)},onDragEnd:()=>q(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},z.filter(ae=>!ae.position&&O===0||ae.position===M).map((ae,oe)=>{var Ce,he;return be.createElement(VI,{key:ae.id,icons:T,index:oe,toast:ae,defaultRichColors:m,duration:(Ce=x==null?void 0:x.duration)!=null?Ce:v,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:n,visibleToasts:w,closeButton:(he=x==null?void 0:x.closeButton)!=null?he:s,interacting:I,position:M,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:$,toasts:z.filter(Ee=>Ee.position==ae.position),heights:P.filter(Ee=>Ee.position==ae.position),setHeights:j,expandByDefault:o,gap:C,loadingIcon:_,expanded:V,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const WI=()=>{const[e,t]=E.useState(!0),n=Qe.use.apiKey(),[r,i]=E.useState(""),o=Mn.use.message();E.useEffect(()=>{i(n||"")},[n,e]),E.useEffect(()=>{o&&(o.includes(vk)||o.includes(yk))&&t(!0)},[o,t]);const s=E.useCallback(async()=>{if(Qe.setState({apiKey:r||null}),await Mn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=E.useCallback(f=>{i(f.target.value)},[i]);return S.jsx(vI,{open:e,onOpenChange:t,children:S.jsxs(QC,{children:[S.jsxs(JC,{children:[S.jsx(eT,{children:"API Key is required"}),S.jsx(tT,{children:"Please enter your API key"})]}),S.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[S.jsx(Za,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),S.jsx(Ot,{onClick:s,variant:"outline",size:"sm",children:"Save"})]})]})})};var sy="Popover",[nT,dK]=hr(sy,[wl]),su=wl(),[XI,ha]=nT(sy),rT=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,u=su(t),f=E.useRef(null),[d,p]=E.useState(!1),[m=!1,v]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(ny,{...u,children:S.jsx(XI,{scope:t,contentId:bn(),triggerRef:f,open:m,onOpenChange:v,onOpenToggle:E.useCallback(()=>v(g=>!g),[v]),hasCustomAnchor:d,onCustomAnchorAdd:E.useCallback(()=>p(!0),[]),onCustomAnchorRemove:E.useCallback(()=>p(!1),[]),modal:s,children:n})})};rT.displayName=sy;var iT="PopoverAnchor",KI=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(iT,n),o=su(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=i;return E.useEffect(()=>(s(),()=>u()),[s,u]),S.jsx(od,{...o,...r,ref:t})});KI.displayName=iT;var aT="PopoverTrigger",oT=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(aT,n),o=su(n),s=dt(t,i.triggerRef),u=S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":fT(i.open),...r,ref:s,onClick:qe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(od,{asChild:!0,...o,children:u})});oT.displayName=aT;var uy="PopoverPortal",[ZI,QI]=nT(uy,{forceMount:void 0}),lT=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=ha(uy,t);return S.jsx(ZI,{scope:t,forceMount:n,children:S.jsx(Zn,{present:n||o.open,children:S.jsx(Qf,{asChild:!0,container:i,children:r})})})};lT.displayName=uy;var ul="PopoverContent",sT=E.forwardRef((e,t)=>{const n=QI(ul,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=ha(ul,e.__scopePopover);return S.jsx(Zn,{present:r||o.open,children:o.modal?S.jsx(JI,{...i,ref:t}):S.jsx(e3,{...i,ref:t})})});sT.displayName=ul;var JI=E.forwardRef((e,t)=>{const n=ha(ul,e.__scopePopover),r=E.useRef(null),i=dt(t,r),o=E.useRef(!1);return E.useEffect(()=>{const s=r.current;if(s)return Pv(s)},[]),S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(uT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,s=>{var u;s.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,d=u.button===2||f;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:qe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),e3=E.forwardRef((e,t)=>{const n=ha(ul,e.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(uT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,u;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),uT=E.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,...m}=e,v=ha(ul,n),g=su(n);return Mv(),S.jsx(Zf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:S.jsx(ry,{"data-state":fT(v.open),role:"dialog",id:v.contentId,...g,...m,ref:t,style:{...m.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)"}})})})}),cT="PopoverClose",t3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(cT,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});t3.displayName=cT;var n3="PopoverArrow",r3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=su(n);return S.jsx(iy,{...i,...r,ref:t})});r3.displayName=n3;function fT(e){return e?"open":"closed"}var i3=rT,a3=oT,o3=lT,dT=sT;const fd=i3,dd=a3,uu=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>S.jsx(o3,{children:S.jsx(dT,{ref:i,align:t,sideOffset:n,className:Me("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",e),...r})}));uu.displayName=dT.displayName;const l3=({status:e})=>e?S.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Info"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Working Directory:"}),S.jsx("span",{className:"truncate",children:e.working_directory}),S.jsx("span",{children:"Input Directory:"}),S.jsx("span",{className:"truncate",children:e.input_directory})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"LLM Binding:"}),S.jsx("span",{children:e.configuration.llm_binding}),S.jsx("span",{children:"LLM Binding Host:"}),S.jsx("span",{children:e.configuration.llm_binding_host}),S.jsx("span",{children:"LLM Model:"}),S.jsx("span",{children:e.configuration.llm_model}),S.jsx("span",{children:"Max Tokens:"}),S.jsx("span",{children:e.configuration.max_tokens})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Embedding Binding:"}),S.jsx("span",{children:e.configuration.embedding_binding}),S.jsx("span",{children:"Embedding Binding Host:"}),S.jsx("span",{children:e.configuration.embedding_binding_host}),S.jsx("span",{children:"Embedding Model:"}),S.jsx("span",{children:e.configuration.embedding_model})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"KV Storage:"}),S.jsx("span",{children:e.configuration.kv_storage}),S.jsx("span",{children:"Doc Status Storage:"}),S.jsx("span",{children:e.configuration.doc_status_storage}),S.jsx("span",{children:"Graph Storage:"}),S.jsx("span",{children:e.configuration.graph_storage}),S.jsx("span",{children:"Vector Storage:"}),S.jsx("span",{children:e.configuration.vector_storage})]})]})]}):S.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),s3=()=>{const e=Mn.use.health(),t=Mn.use.lastCheckTime(),n=Mn.use.status(),[r,i]=E.useState(!1);return E.useEffect(()=>{i(!0);const o=setTimeout(()=>i(!1),300);return()=>clearTimeout(o)},[t]),S.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:S.jsxs(fd,{children:[S.jsx(dd,{asChild:!0,children:S.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[S.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),S.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),S.jsx(uu,{className:"w-auto",side:"top",align:"end",children:S.jsx(l3,{status:n})})]})})},hT=()=>{const e=E.useContext(B_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function u3(){const{theme:e,setTheme:t}=hT(),n=E.useCallback(()=>t("light"),[t]),r=E.useCallback(()=>t("dark"),[t]);return e==="dark"?S.jsx(Ot,{onClick:n,variant:Hr,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:S.jsx(BM,{})}):S.jsx(Ot,{onClick:r,variant:Hr,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:S.jsx(tP,{})})}function pT(e){const t=e+"CollectionProvider",[n,r]=hr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:w,children:x}=g,k=be.useRef(null),C=be.useRef(new Map).current;return S.jsx(i,{scope:w,itemMap:C,collectionRef:k,children:x})};s.displayName=t;const u=e+"CollectionSlot",f=be.forwardRef((g,w)=>{const{scope:x,children:k}=g,C=o(u,x),_=dt(w,C.collectionRef);return S.jsx(ua,{ref:_,children:k})});f.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=be.forwardRef((g,w)=>{const{scope:x,children:k,...C}=g,_=be.useRef(null),T=dt(w,_),N=o(d,x);return be.useEffect(()=>(N.itemMap.set(_,{ref:_,...C}),()=>void N.itemMap.delete(_))),S.jsx(ua,{[p]:"",ref:T,children:k})});m.displayName=d;function v(g){const w=o(e+"CollectionConsumer",g);return be.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((N,D)=>C.indexOf(N.ref.current)-C.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:f,ItemSlot:m},v,r]}var c3=E.createContext(void 0);function hd(e){const t=E.useContext(c3);return e||t||"ltr"}var im="rovingFocusGroup.onEntryFocus",f3={bubbles:!1,cancelable:!0},pd="RovingFocusGroup",[Fg,mT,d3]=pT(pd),[h3,gT]=hr(pd,[d3]),[p3,m3]=h3(pd),vT=E.forwardRef((e,t)=>S.jsx(Fg.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(Fg.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(g3,{...e,ref:t})})}));vT.displayName=pd;var g3=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,v=E.useRef(null),g=dt(t,v),w=hd(o),[x=null,k]=_i({prop:s,defaultProp:u,onChange:f}),[C,_]=E.useState(!1),T=un(d),N=mT(n),D=E.useRef(!1),[z,R]=E.useState(0);return E.useEffect(()=>{const B=v.current;if(B)return B.addEventListener(im,T),()=>B.removeEventListener(im,T)},[T]),S.jsx(p3,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:E.useCallback(B=>k(B),[k]),onItemShiftTab:E.useCallback(()=>_(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(B=>B+1),[]),onFocusableItemRemove:E.useCallback(()=>R(B=>B-1),[]),children:S.jsx(We.div,{tabIndex:C||z===0?-1:0,"data-orientation":r,...m,ref:g,style:{outline:"none",...e.style},onMouseDown:qe(e.onMouseDown,()=>{D.current=!0}),onFocus:qe(e.onFocus,B=>{const P=!D.current;if(B.target===B.currentTarget&&P&&!C){const j=new CustomEvent(im,f3);if(B.currentTarget.dispatchEvent(j),!j.defaultPrevented){const V=N().filter(U=>U.focusable),q=V.find(U=>U.active),I=V.find(U=>U.id===x),Z=[q,I,...V].filter(Boolean).map(U=>U.ref.current);xT(Z,p)}}D.current=!1}),onBlur:qe(e.onBlur,()=>_(!1))})})}),yT="RovingFocusGroupItem",bT=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,u=bn(),f=o||u,d=m3(yT,n),p=d.currentTabStopId===f,m=mT(n),{onFocusableItemAdd:v,onFocusableItemRemove:g}=d;return E.useEffect(()=>{if(r)return v(),()=>g()},[r,v,g]),S.jsx(Fg.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:S.jsx(We.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:qe(e.onMouseDown,w=>{r?d.onItemFocus(f):w.preventDefault()}),onFocus:qe(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:qe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=b3(w,d.orientation,d.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=m().filter(_=>_.focusable).map(_=>_.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const _=C.indexOf(w.currentTarget);C=d.loop?x3(C,_+1):C.slice(_+1)}setTimeout(()=>xT(C))}})})})});bT.displayName=yT;var v3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function b3(e,t,n){const r=y3(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return v3[r]}function xT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var w3=vT,S3=bT,cy="Tabs",[E3,hK]=hr(cy,[gT]),wT=gT(),[_3,fy]=E3(cy),ST=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:u,activationMode:f="automatic",...d}=e,p=hd(u),[m,v]=_i({prop:r,onChange:i,defaultProp:o});return S.jsx(_3,{scope:n,baseId:bn(),value:m,onValueChange:v,orientation:s,dir:p,activationMode:f,children:S.jsx(We.div,{dir:p,"data-orientation":s,...d,ref:t})})});ST.displayName=cy;var ET="TabsList",_T=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=fy(ET,n),s=wT(n);return S.jsx(w3,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:S.jsx(We.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});_T.displayName=ET;var kT="TabsTrigger",CT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=fy(kT,n),u=wT(n),f=RT(s.baseId,r),d=DT(s.baseId,r),p=r===s.value;return S.jsx(S3,{asChild:!0,...u,focusable:!i,active:p,children:S.jsx(We.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:qe(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?s.onValueChange(r):m.preventDefault()}),onKeyDown:qe(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&s.onValueChange(r)}),onFocus:qe(e.onFocus,()=>{const m=s.activationMode!=="manual";!p&&!i&&m&&s.onValueChange(r)})})})});CT.displayName=kT;var TT="TabsContent",AT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,u=fy(TT,n),f=RT(u.baseId,r),d=DT(u.baseId,r),p=r===u.value,m=E.useRef(p);return E.useEffect(()=>{const v=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(v)},[]),S.jsx(Zn,{present:i||p,children:({present:v})=>S.jsx(We.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:v&&o})})});AT.displayName=TT;function RT(e,t){return`${e}-trigger-${t}`}function DT(e,t){return`${e}-content-${t}`}var k3=ST,NT=_T,OT=CT,LT=AT;const C3=k3,zT=E.forwardRef(({className:e,...t},n)=>S.jsx(NT,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));zT.displayName=NT.displayName;const jT=E.forwardRef(({className:e,...t},n)=>S.jsx(OT,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",e),...t}));jT.displayName=OT.displayName;const Ps=E.forwardRef(({className:e,...t},n)=>S.jsx(LT,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));Ps.displayName=LT.displayName;function Mc({value:e,currentTab:t,children:n}){return S.jsx(jT,{value:e,className:Me("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function T3(){const e=Qe.use.currentTab();return S.jsx("div",{className:"flex h-8 self-center",children:S.jsxs(zT,{className:"h-full gap-2",children:[S.jsx(Mc,{value:"documents",currentTab:e,children:"Documents"}),S.jsx(Mc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),S.jsx(Mc,{value:"retrieval",currentTab:e,children:"Retrieval"}),S.jsx(Mc,{value:"api",currentTab:e,children:"API"})]})})}function A3(){return S.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[S.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[S.jsx(aP,{className:"size-4 text-emerald-400","aria-hidden":"true"}),S.jsx("span",{className:"font-bold md:inline-block",children:e1.name})]}),S.jsx("div",{className:"flex h-10 flex-1 justify-center",children:S.jsx(T3,{})}),S.jsxs("nav",{className:"flex items-center",children:[S.jsx(Ot,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:S.jsx("a",{href:e1.github,target:"_blank",rel:"noopener noreferrer",children:S.jsx(DM,{className:"size-4","aria-hidden":"true"})})}),S.jsx(u3,{})]})]})}var Pc={exports:{}},G1;function R3(){if(G1)return Pc.exports;G1=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,z,R){return Function.prototype.apply.call(D,z,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:n=function(D){return Object.getOwnPropertyNames(D)};function r(N){console&&console.warn&&console.warn(N)}var i=Number.isNaN||function(D){return D!==D};function o(){o.init.call(this)}Pc.exports=o,Pc.exports.once=C,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(N){if(typeof N!="number"||N<0||i(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");s=N}}),o.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},o.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function f(N){return N._maxListeners===void 0?o.defaultMaxListeners:N._maxListeners}o.prototype.getMaxListeners=function(){return f(this)},o.prototype.emit=function(D){for(var z=[],R=1;R<arguments.length;R++)z.push(arguments[R]);var B=D==="error",P=this._events;if(P!==void 0)B=B&&P.error===void 0;else if(!B)return!1;if(B){var j;if(z.length>0&&(j=z[0]),j instanceof Error)throw j;var V=new Error("Unhandled error."+(j?" ("+j.message+")":""));throw V.context=j,V}var q=P[D];if(q===void 0)return!1;if(typeof q=="function")t(q,this,z);else for(var I=q.length,Y=w(q,I),R=0;R<I;++R)t(Y[R],this,z);return!0};function d(N,D,z,R){var B,P,j;if(u(z),P=N._events,P===void 0?(P=N._events=Object.create(null),N._eventsCount=0):(P.newListener!==void 0&&(N.emit("newListener",D,z.listener?z.listener:z),P=N._events),j=P[D]),j===void 0)j=P[D]=z,++N._eventsCount;else if(typeof j=="function"?j=P[D]=R?[z,j]:[j,z]:R?j.unshift(z):j.push(z),B=f(N),B>0&&j.length>B&&!j.warned){j.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+j.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=N,V.type=D,V.count=j.length,r(V)}return N}o.prototype.addListener=function(D,z){return d(this,D,z,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(D,z){return d(this,D,z,!0)};function p(){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 m(N,D,z){var R={fired:!1,wrapFn:void 0,target:N,type:D,listener:z},B=p.bind(R);return B.listener=z,R.wrapFn=B,B}o.prototype.once=function(D,z){return u(z),this.on(D,m(this,D,z)),this},o.prototype.prependOnceListener=function(D,z){return u(z),this.prependListener(D,m(this,D,z)),this},o.prototype.removeListener=function(D,z){var R,B,P,j,V;if(u(z),B=this._events,B===void 0)return this;if(R=B[D],R===void 0)return this;if(R===z||R.listener===z)--this._eventsCount===0?this._events=Object.create(null):(delete B[D],B.removeListener&&this.emit("removeListener",D,R.listener||z));else if(typeof R!="function"){for(P=-1,j=R.length-1;j>=0;j--)if(R[j]===z||R[j].listener===z){V=R[j].listener,P=j;break}if(P<0)return this;P===0?R.shift():x(R,P),R.length===1&&(B[D]=R[0]),B.removeListener!==void 0&&this.emit("removeListener",D,V||z)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(D){var z,R,B;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[D]),this;if(arguments.length===0){var P=Object.keys(R),j;for(B=0;B<P.length;++B)j=P[B],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(z=R[D],typeof z=="function")this.removeListener(D,z);else if(z!==void 0)for(B=z.length-1;B>=0;B--)this.removeListener(D,z[B]);return this};function v(N,D,z){var R=N._events;if(R===void 0)return[];var B=R[D];return B===void 0?[]:typeof B=="function"?z?[B.listener||B]:[B]:z?k(B):w(B,B.length)}o.prototype.listeners=function(D){return v(this,D,!0)},o.prototype.rawListeners=function(D){return v(this,D,!1)},o.listenerCount=function(N,D){return typeof N.listenerCount=="function"?N.listenerCount(D):g.call(N,D)},o.prototype.listenerCount=g;function g(N){var D=this._events;if(D!==void 0){var z=D[N];if(typeof z=="function")return 1;if(z!==void 0)return z.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(N,D){for(var z=new Array(D),R=0;R<D;++R)z[R]=N[R];return z}function x(N,D){for(;D+1<N.length;D++)N[D]=N[D+1];N.pop()}function k(N){for(var D=new Array(N.length),z=0;z<D.length;++z)D[z]=N[z].listener||N[z];return D}function C(N,D){return new Promise(function(z,R){function B(j){N.removeListener(D,P),R(j)}function P(){typeof N.removeListener=="function"&&N.removeListener("error",B),z([].slice.call(arguments))}T(N,D,P,{once:!0}),D!=="error"&&_(N,B,{once:!0})})}function _(N,D,z){typeof N.on=="function"&&T(N,"error",D,z)}function T(N,D,z,R){if(typeof N.on=="function")R.once?N.once(D,z):N.on(D,z);else if(typeof N.addEventListener=="function")N.addEventListener(D,function B(P){R.once&&N.removeEventListener(D,B),z(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof N)}return Pc.exports}var MT=R3();function D3(){const e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(const r in arguments[t])e[r]=arguments[t][r];return e}let Xt=D3;typeof Object.assign=="function"&&(Xt=Object.assign);function dr(e,t,n,r){const i=e._nodes.get(t);let o=null;return i&&(r==="mixed"?o=i.out&&i.out[n]||i.undirected&&i.undirected[n]:r==="directed"?o=i.out&&i.out[n]:o=i.undirected&&i.undirected[n]),o}function cn(e){return typeof e=="object"&&e!==null}function PT(e){let t;for(t in e)return!1;return!0}function cr(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function Sr(e,t,n){const r={enumerable:!0,configurable:!0};typeof n=="function"?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function B1(e){return!(!cn(e)||e.attributes&&!Array.isArray(e.attributes))}function N3(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function Ei(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Sl(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class dy extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class Le extends dy{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Le.prototype.constructor)}}class De extends dy{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Xe extends dy{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Xe.prototype.constructor)}}function FT(e,t){this.key=e,this.attributes=t,this.clear()}FT.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 IT(e,t){this.key=e,this.attributes=t,this.clear()}IT.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function GT(e,t){this.key=e,this.attributes=t,this.clear()}GT.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function El(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}El.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};El.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const i=this.source[e],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[t][n]=this};El.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};El.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const BT=0,UT=1,O3=2,HT=3;function Ai(e,t,n,r,i,o,s){let u,f,d,p;if(r=""+r,n===BT){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);d=i,p=o}else if(n===HT){if(i=""+i,f=e._edges.get(i),!f)throw new De(`Graph.${t}: could not find the "${i}" edge in the graph.`);const m=f.source.key,v=f.target.key;if(r===m)u=f.target;else if(r===v)u=f.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${m}, ${v}).`);d=o,p=s}else{if(f=e._edges.get(r),!f)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===UT?u=f.source:u=f.target,d=i,p=o}return[u,d,p]}function L3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);return s.attributes[u]}}function z3(e,t,n){e.prototype[t]=function(r,i){const[o]=Ai(this,t,n,r,i);return o.attributes}}function j3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);return s.attributes.hasOwnProperty(u)}}function M3(e,t,n){e.prototype[t]=function(r,i,o,s){const[u,f,d]=Ai(this,t,n,r,i,o,s);return u.attributes[f]=d,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function P3(e,t,n){e.prototype[t]=function(r,i,o,s){const[u,f,d]=Ai(this,t,n,r,i,o,s);if(typeof d!="function")throw new Le(`Graph.${t}: updater should be a function.`);const p=u.attributes,m=d(p[f]);return p[f]=m,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function F3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);return delete s.attributes[u],this.emit("nodeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:u}),this}}function I3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return s.attributes=u,this.emit("nodeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function G3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Xt(s.attributes,u),this.emit("nodeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:u}),this}}function B3(e,t,n){e.prototype[t]=function(r,i,o){const[s,u]=Ai(this,t,n,r,i,o);if(typeof u!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return s.attributes=u(s.attributes),this.emit("nodeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const U3=[{name:e=>`get${e}Attribute`,attacher:L3},{name:e=>`get${e}Attributes`,attacher:z3},{name:e=>`has${e}Attribute`,attacher:j3},{name:e=>`set${e}Attribute`,attacher:M3},{name:e=>`update${e}Attribute`,attacher:P3},{name:e=>`remove${e}Attribute`,attacher:F3},{name:e=>`replace${e}Attributes`,attacher:I3},{name:e=>`merge${e}Attributes`,attacher:G3},{name:e=>`update${e}Attributes`,attacher:B3}];function H3(e){U3.forEach(function({name:t,attacher:n}){n(e,t("Node"),BT),n(e,t("Source"),UT),n(e,t("Target"),O3),n(e,t("Opposite"),HT)})}function $3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: 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 s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}function V3(e,t,n){e.prototype[t]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Xe(`Graph.${t}: 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 o=""+r,s=""+arguments[1];if(i=dr(this,o,s,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function q3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: 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 s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function Y3(e,t,n){e.prototype[t]=function(r,i,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`Graph.${t}: 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 u=""+r,f=""+i;if(i=arguments[2],o=arguments[3],s=dr(this,u,f,n),!s)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,s=this._edges.get(r),!s)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function W3(e,t,n){e.prototype[t]=function(r,i,o){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`Graph.${t}: 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 u=""+r,f=""+i;if(i=arguments[2],o=arguments[3],s=dr(this,u,f,n),!s)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,s=this._edges.get(r),!s)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new Le(`Graph.${t}: updater should be a function.`);return s.attributes[i]=o(s.attributes[i]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:i}),this}}function X3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: 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 s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function K3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: 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 s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function Z3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: 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 s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new Le(`Graph.${t}: provided attributes are not a plain object.`);return Xt(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function Q3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: 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 s=""+r,u=""+i;if(i=arguments[2],o=dr(this,s,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: 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(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new Le(`Graph.${t}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const J3=[{name:e=>`get${e}Attribute`,attacher:$3},{name:e=>`get${e}Attributes`,attacher:V3},{name:e=>`has${e}Attribute`,attacher:q3},{name:e=>`set${e}Attribute`,attacher:Y3},{name:e=>`update${e}Attribute`,attacher:W3},{name:e=>`remove${e}Attribute`,attacher:X3},{name:e=>`replace${e}Attributes`,attacher:K3},{name:e=>`merge${e}Attributes`,attacher:Z3},{name:e=>`update${e}Attributes`,attacher:Q3}];function e5(e){J3.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const t5=[{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 n5(e,t,n,r){let i=!1;for(const o in t){if(o===r)continue;const s=t[o];if(i=n(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&i)return s.key}}function r5(e,t,n,r){let i,o,s,u=!1;for(const f in t)if(f!==r){i=t[f];do{if(o=i.source,s=i.target,u=n(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected),e&&u)return i.key;i=i.next}while(i!==void 0)}}function am(e,t){const n=Object.keys(e),r=n.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const s=n[o++];if(s===t){i=void 0;continue}i=e[s]}while(!i);return{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 i5(e,t,n,r){const i=t[n];if(!i)return;const o=i.source,s=i.target;if(r(i.key,i.attributes,o.key,s.key,o.attributes,s.attributes,i.undirected)&&e)return i.key}function a5(e,t,n,r){let i=t[n];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key;i=i.next}while(i!==void 0)}function om(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const i={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function o5(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),i=t==="undirected",o=e._edges.values();let s=0,u,f;for(;u=o.next(),u.done!==!0;)f=u.value,f.undirected===i&&(r[s++]=f.key);return r}function $T(e,t,n,r){if(t.size===0)return;const i=n!=="mixed"&&n!==t.type,o=n==="undirected";let s,u,f=!1;const d=t._edges.values();for(;s=d.next(),s.done!==!0;){if(u=s.value,i&&u.undirected!==o)continue;const{key:p,attributes:m,source:v,target:g}=u;if(f=r(p,m,v.key,g.key,v.attributes,g.attributes,u.undirected),e&&f)return p}}function l5(e,t){if(e.size===0)return Sl();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",i=e._edges.values();return{[Symbol.iterator](){return this},next(){let o,s;for(;;){if(o=i.next(),o.done)return o;if(s=o.value,!(n&&s.undirected!==r))break}return{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},done:!1}}}}function hy(e,t,n,r,i,o){const s=t?r5:n5;let u;if(n!=="undirected"&&(r!=="out"&&(u=s(e,i.in,o),e&&u)||r!=="in"&&(u=s(e,i.out,o,r?void 0:i.key),e&&u))||n!=="directed"&&(u=s(e,i.undirected,o),e&&u))return u}function s5(e,t,n,r){const i=[];return hy(!1,e,t,n,r,function(o){i.push(o)}),i}function u5(e,t,n){let r=Sl();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Ei(r,am(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Ei(r,am(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Ei(r,am(n.undirected))),r}function py(e,t,n,r,i,o,s){const u=n?a5:i5;let f;if(t!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(f=u(e,i.in,o,s),e&&f)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(f=u(e,i.out,o,s),e&&f))||t!=="directed"&&typeof i.undirected<"u"&&(f=u(e,i.undirected,o,s),e&&f))return f}function c5(e,t,n,r,i){const o=[];return py(!1,e,t,n,r,i,function(s){o.push(s)}),o}function f5(e,t,n,r){let i=Sl();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(i=Ei(i,om(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(i=Ei(i,om(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=Ei(i,om(n.undirected,r))),i}function d5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o,s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return o5(this,r);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return s5(this.multi,r==="mixed"?this.type:r,i,u)}if(arguments.length===2){o=""+o,s=""+s;const u=this._nodes.get(o);if(!u)throw new De(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new De(`Graph.${n}: could not find the "${s}" target node in the graph.`);return c5(r,this.multi,i,u,s)}throw new Le(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function h5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p,m){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return m=d,$T(!1,this,r,m);if(arguments.length===2){d=""+d,m=p;const v=this._nodes.get(d);if(typeof v>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);return hy(!1,this.multi,r==="mixed"?this.type:r,i,v,m)}if(arguments.length===3){d=""+d,p=""+p;const v=this._nodes.get(d);if(!v)throw new De(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${o}: could not find the "${p}" target node in the graph.`);return py(!1,r,this.multi,i,v,p,m)}throw new Le(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop();let m;if(d.length===0){let v=0;r!=="directed"&&(v+=this.undirectedSize),r!=="undirected"&&(v+=this.directedSize),m=new Array(v);let g=0;d.push((w,x,k,C,_,T,N)=>{m[g++]=p(w,x,k,C,_,T,N)})}else m=[],d.push((v,g,w,x,k,C,_)=>{m.push(p(v,g,w,x,k,C,_))});return this[o].apply(this,d),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop(),m=[];return d.push((v,g,w,x,k,C,_)=>{p(v,g,w,x,k,C,_)&&m.push(v)}),this[o].apply(this,d),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let d=Array.prototype.slice.call(arguments);if(d.length<2||d.length>4)throw new Le(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${d.length}).`);if(typeof d[d.length-1]=="function"&&typeof d[d.length-2]!="function")throw new Le(`Graph.${f}: 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 p,m;d.length===2?(p=d[0],m=d[1],d=[]):d.length===3?(p=d[1],m=d[2],d=[d[0]]):d.length===4&&(p=d[2],m=d[3],d=[d[0],d[1]]);let v=m;return d.push((g,w,x,k,C,_,T)=>{v=p(v,g,w,x,k,C,_,T)}),this[o].apply(this,d),v}}function p5(e,t){const{name:n,type:r,direction:i}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(f,d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=f,$T(!0,this,r,p);if(arguments.length===2){f=""+f,p=d;const m=this._nodes.get(f);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${f}" node in the graph.`);return hy(!0,this.multi,r==="mixed"?this.type:r,i,m,p)}if(arguments.length===3){f=""+f,d=""+d;const m=this._nodes.get(f);if(!m)throw new De(`Graph.${o}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(d))throw new De(`Graph.${o}: could not find the "${d}" target node in the graph.`);return py(!0,r,this.multi,i,m,d,p)}throw new Le(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const s="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>d(m,v,g,w,x,k,C)),!!this[o].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>!d(m,v,g,w,x,k,C)),!this[o].apply(this,f)}}function m5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Sl();if(!arguments.length)return l5(this,r);if(arguments.length===1){s=""+s;const f=this._nodes.get(s);if(!f)throw new De(`Graph.${o}: could not find the "${s}" node in the graph.`);return u5(r,i,f)}if(arguments.length===2){s=""+s,u=""+u;const f=this._nodes.get(s);if(!f)throw new De(`Graph.${o}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${o}: could not find the "${u}" target node in the graph.`);return f5(r,i,f,u)}throw new Le(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function g5(e){t5.forEach(t=>{d5(e,t),h5(e,t),p5(e,t),m5(e,t)})}const v5=[{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 md(){this.A=null,this.B=null}md.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};md.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Ts(e,t,n,r,i){for(const o in r){const s=r[o],u=s.source,f=s.target,d=u===n?f:u;if(t&&t.has(d.key))continue;const p=i(d.key,d.attributes);if(e&&p)return d.key}}function my(e,t,n,r,i){if(t!=="mixed"){if(t==="undirected")return Ts(e,null,r,r.undirected,i);if(typeof n=="string")return Ts(e,null,r,r[n],i)}const o=new md;let s;if(t!=="undirected"){if(n!=="out"){if(s=Ts(e,null,r,r.in,i),e&&s)return s;o.wrap(r.in)}if(n!=="in"){if(s=Ts(e,o,r,r.out,i),e&&s)return s;o.wrap(r.out)}}if(t!=="directed"&&(s=Ts(e,o,r,r.undirected,i),e&&s))return s}function y5(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return my(!1,e,t,n,function(i){r.push(i)}),r}function As(e,t,n){const r=Object.keys(n),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let s=null;do{if(o>=i)return e&&e.wrap(n),{done:!0};const u=n[r[o++]],f=u.source,d=u.target;if(s=f===t?d:f,e&&e.has(s.key)){s=null;continue}}while(s===null);return{done:!1,value:{neighbor:s.key,attributes:s.attributes}}}}}function b5(e,t,n){if(e!=="mixed"){if(e==="undirected")return As(null,n,n.undirected);if(typeof t=="string")return As(null,n,n[t])}let r=Sl();const i=new md;return e!=="undirected"&&(t!=="out"&&(r=Ei(r,As(i,n,n.in))),t!=="in"&&(r=Ei(r,As(i,n,n.out)))),e!=="directed"&&(r=Ei(r,As(i,n,n.undirected))),r}function x5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return y5(r==="mixed"?this.type:r,i,s)}}function w5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);my(!1,r==="mixed"?this.type:r,i,m,p)};const s="map"+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(d,p){const m=[];return this[o](d,(v,g)=>{m.push(p(v,g))}),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(d,p){const m=[];return this[o](d,(v,g)=>{p(v,g)&&m.push(v)}),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(d,p,m){if(arguments.length<3)throw new Le(`Graph.${f}: 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 v=m;return this[o](d,(g,w)=>{v=p(v,g,w)}),v}}function S5(e,t){const{name:n,type:r,direction:i}=t,o=n[0].toUpperCase()+n.slice(1,-1),s="find"+o;e.prototype[s]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${s}: could not find the "${d}" node in the graph.`);return my(!0,r==="mixed"?this.type:r,i,m,p)};const u="some"+o;e.prototype[u]=function(d,p){return!!this[s](d,p)};const f="every"+o;e.prototype[f]=function(d,p){return!this[s](d,(v,g)=>!p(v,g))}}function E5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Sl();s=""+s;const u=this._nodes.get(s);if(typeof u>"u")throw new De(`Graph.${o}: could not find the "${s}" node in the graph.`);return b5(r==="mixed"?this.type:r,i,u)}}function _5(e){v5.forEach(t=>{x5(e,t),w5(e,t),S5(e,t),E5(e,t)})}function Fc(e,t,n,r,i){const o=r._nodes.values(),s=r.type;let u,f,d,p,m,v;for(;u=o.next(),u.done!==!0;){let g=!1;if(f=u.value,s!=="undirected"){p=f.out;for(d in p){m=p[d];do v=m.target,g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}if(s!=="directed"){p=f.undirected;for(d in p)if(!(t&&f.key>d)){m=p[d];do v=m.target,v.key!==d&&(v=m.source),g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}n&&!g&&i(f.key,null,f.attributes,null,null,null,null)}}function k5(e,t){const n={key:e};return PT(t.attributes)||(n.attributes=Xt({},t.attributes)),n}function C5(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return PT(n.attributes)||(r.attributes=Xt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function T5(e){if(!cn(e))throw new Le('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new Le("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function A5(e){if(!cn(e))throw new Le('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new Le("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const R5=N3(),D5=new Set(["directed","undirected","mixed"]),U1=new Set(["domain","_events","_eventsCount","_maxListeners"]),N5=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],O5={allowSelfLoops:!0,multi:!1,type:"mixed"};function L5(e,t,n){if(n&&!cn(n))throw new Le(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Xe(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function H1(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function VT(e,t,n,r,i,o,s,u){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!cn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(o=""+o,s=""+s,u=u||{},!e.allowSelfLoops&&o===s)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(o),d=e._nodes.get(s);if(!f)throw new De(`Graph.${t}: source node "${o}" not found.`);if(!d)throw new De(`Graph.${t}: target node "${s}" not found.`);const p={key:null,undirected:r,source:o,target:s,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?typeof f.undirected[s]<"u":typeof f.out[s]<"u"))throw new Xe(`Graph.${t}: an edge linking "${o}" to "${s}" 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 m=new El(r,i,f,d,u);e._edges.set(i,m);const v=o===s;return r?(f.undirectedDegree++,d.undirectedDegree++,v&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,d.inDegree++,v&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,p.key=i,e.emit("edgeAdded",p),i}function z5(e,t,n,r,i,o,s,u,f){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(f){if(typeof u!="function")throw new Le(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!cn(u))throw new Le(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}o=""+o,s=""+s;let d;if(f&&(d=u,u=void 0),!e.allowSelfLoops&&o===s)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(o),m=e._nodes.get(s),v,g;if(!n&&(v=e._edges.get(i),v)){if((v.source.key!==o||v.target.key!==s)&&(!r||v.source.key!==s||v.target.key!==o))throw new Xe(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${s}" target vs. ("${v.source.key}", "${v.target.key}").`);g=v}if(!g&&!e.multi&&p&&(g=r?p.undirected[s]:p.out[s]),g){const _=[g.key,!1,!1,!1];if(f?!d:!u)return _;if(f){const T=g.attributes;g.attributes=d(T),e.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else Xt(g.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:u});return _}u=u||{},f&&d&&(u=d(u));const w={key:null,undirected:r,source:o,target:s,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);let x=!1,k=!1;p||(p=H1(e,o,{}),x=!0,o===s&&(m=p,k=!0)),m||(m=H1(e,s,{}),k=!0),v=new El(r,i,p,m,u),e._edges.set(i,v);const C=o===s;return r?(p.undirectedDegree++,m.undirectedDegree++,C&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,m.inDegree++,C&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?v.attachMulti():v.attach(),r?e._undirectedSize++:e._directedSize++,w.key=i,e.emit("edgeAdded",w),[i,!0,x,k]}function Yo(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:i}=t,o=t.undirected,s=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,s&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,s&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:i,source:n.key,target:r.key,undirected:o})}class St extends MT.EventEmitter{constructor(t){if(super(),t=Xt({},O5,t),typeof t.multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!D5.has(t.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?FT:t.type==="directed"?IT:GT;cr(this,"NodeDataClass",n);const r="geid_"+R5()+"_";let i=0;const o=()=>{let s;do s=r+i++;while(this._edges.has(s));return s};cr(this,"_attributes",{}),cr(this,"_nodes",new Map),cr(this,"_edges",new Map),cr(this,"_directedSize",0),cr(this,"_undirectedSize",0),cr(this,"_directedSelfLoopCount",0),cr(this,"_undirectedSelfLoopCount",0),cr(this,"_edgeKeyGenerator",o),cr(this,"_options",t),U1.forEach(s=>cr(this,s,this[s])),Sr(this,"order",()=>this._nodes.size),Sr(this,"size",()=>this._edges.size),Sr(this,"directedSize",()=>this._directedSize),Sr(this,"undirectedSize",()=>this._undirectedSize),Sr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Sr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Sr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Sr(this,"multi",this._options.multi),Sr(this,"type",this._options.type),Sr(this,"allowSelfLoops",this._options.allowSelfLoops),Sr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new Le(`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(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new Le(`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(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new Le(`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(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(t,n){if(this.multi)throw new Xe("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(t===i)return o;if(t===o)return i;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${i}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return L5(this,t,n).key}mergeNode(t,n){if(n&&!cn(n))throw new Le(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Xt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new Le(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(t,i),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do Yo(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do Yo(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do Yo(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=dr(this,r,i,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Yo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Xe("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 Xe("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.");t=""+t,n=""+n;const r=dr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Xe("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 Xe("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 r=dr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new Le("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!cn(t))throw new Le("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!cn(t))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return Xt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new Le("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!B1(n))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!B1(n))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,s,u;for(;i=r.next(),i.done!==!0;)o=i.value,s=o.source,u=o.target,o.attributes=t(o.key,o.attributes,s.key,u.key,s.attributes,u.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Fc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Fc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new Le("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)}findNode(t){if(typeof t!="function")throw new Le("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return i.key}mapNodes(t){if(typeof t!="function")throw new Le("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const o=new Array(this.order);let s=0;for(;r=n.next(),r.done!==!0;)i=r.value,o[s++]=t(i.key,i.attributes);return o}someNode(t){if(typeof t!="function")throw new Le("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new Le("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!t(i.key,i.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new Le("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const o=[];for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("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 r=n;const i=this._nodes.values();let o,s;for(;o=i.next(),o.done!==!0;)s=o.value,r=t(r,s.key,s.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,o)=>{t[n++]=k5(o,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,o)=>{r[n++]=C5(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof St)return t.forEachNode((f,d)=>{n?this.mergeNode(f,d):this.addNode(f,d)}),t.forEachEdge((f,d,p,m,v,g,w)=>{n?w?this.mergeUndirectedEdgeWithKey(f,p,m,d):this.mergeDirectedEdgeWithKey(f,p,m,d):w?this.addUndirectedEdgeWithKey(f,p,m,d):this.addDirectedEdgeWithKey(f,p,m,d)}),this;if(!cn(t))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!cn(t.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,o,s,u;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r<i;r++){s=o[r],T5(s);const{key:f,attributes:d}=s;n?this.mergeNode(f,d):this.addNode(f,d)}}if(t.edges){let f=!1;if(this.type==="undirected"&&(f=!0),o=t.edges,!Array.isArray(o))throw new Le("Graph.import: invalid edges. Expecting an array.");for(r=0,i=o.length;r<i;r++){u=o[r],A5(u);const{source:d,target:p,attributes:m,undirected:v=f}=u;let g;"key"in u?(g=n?v?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:v?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,g.call(this,u.key,d,p,m)):(g=n?v?this.mergeUndirectedEdge:this.mergeDirectedEdge:v?this.addUndirectedEdge:this.addDirectedEdge,g.call(this,d,p,m))}}return this}nullCopy(t){const n=new St(Xt({},this._options,t));return n.replaceAttributes(Xt({},this.getAttributes())),n}emptyCopy(t){const n=this.nullCopy(t);return this._nodes.forEach((r,i)=>{const o=Xt({},r.attributes);r=new n.NodeDataClass(i,o),n._nodes.set(i,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Xe(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new Xe("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 t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new Xe("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 n=this.emptyCopy(t),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,VT(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,Xt({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((o,s)=>{t[s]=o.attributes});const n={},r={};this._edges.forEach((o,s)=>{const u=o.undirected?"--":"->";let f="",d=o.source.key,p=o.target.key,m;o.undirected&&d>p&&(m=d,d=p,p=m);const v=`(${d})${u}(${p})`;s.startsWith("geid_")?this.multi&&(typeof r[v]>"u"?r[v]=0:r[v]++,f+=`${r[v]}. `):f+=`[${s}]: `,f+=v,n[f]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!U1.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,cr(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(St.prototype[Symbol.for("nodejs.util.inspect.custom")]=St.prototype.inspect);N5.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?VT:z5;e.generateKey?St.prototype[n]=function(i,o,s){return r(this,n,!0,(e.type||this.type)==="undirected",null,i,o,s,t==="update")}:St.prototype[n]=function(i,o,s,u){return r(this,n,!1,(e.type||this.type)==="undirected",i,o,s,u,t==="update")}})});H3(St);e5(St);g5(St);_5(St);class Ws extends St{constructor(t){const n=Xt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class qT extends St{constructor(t){const n=Xt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class YT extends St{constructor(t){const n=Xt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class WT extends St{constructor(t){const n=Xt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class XT extends St{constructor(t){const n=Xt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function _l(e){e.from=function(t,n){const r=Xt({},t.options,n),i=new e(r);return i.import(t),i}}_l(St);_l(Ws);_l(qT);_l(YT);_l(WT);_l(XT);St.Graph=St;St.DirectedGraph=Ws;St.UndirectedGraph=qT;St.MultiGraph=YT;St.MultiDirectedGraph=WT;St.MultiUndirectedGraph=XT;St.InvalidArgumentsGraphError=Le;St.NotFoundGraphError=De;St.UsageGraphError=Xe;function j5(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Gs(e){var t=j5(e,"string");return typeof t=="symbol"?t:t+""}function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $1(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gs(r.key),r)}}function nn(e,t,n){return t&&$1(e.prototype,t),n&&$1(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cl(e){return cl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cl(e)}function KT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KT=function(){return!!e})()}function M5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P5(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M5(e)}function Pn(e,t,n){return t=cl(t),P5(e,KT()?Reflect.construct(t,n||[],cl(e).constructor):t.apply(e,n))}function Ig(e,t){return Ig=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ig(e,t)}function Fn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ig(e,t)}function F5(e){if(Array.isArray(e))return e}function I5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,u=[],f=!0,d=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){d=!0,i=p}finally{try{if(!f&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(d)throw i}}return u}}function Gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZT(e,t){if(e){if(typeof e=="string")return Gg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gg(e,t):void 0}}function G5(){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 fl(e,t){return F5(e)||I5(e,t)||ZT(e,t)||G5()}var lm={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"},QT=new Int8Array(4),sf=new Int32Array(QT.buffer,0,1),JT=new Float32Array(QT.buffer,0,1),B5=/^\s*rgba?\s*\(/,U5=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function H5(e){var t=0,n=0,r=0,i=1;if(e[0]==="#")e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(B5.test(e)){var o=e.match(U5);o&&(t=+o[1],n=+o[2],r=+o[3],o[4]&&(i=+o[4]))}return{r:t,g:n,b:r,a:i}}var il={};for(var Ic in lm)il[Ic]=Yr(lm[Ic]),il[lm[Ic]]=il[Ic];function eA(e,t,n,r,i){return sf[0]=r<<24|n<<16|t<<8|e,sf[0]=sf[0]&4278190079,JT[0]}function Yr(e){if(e=e.toLowerCase(),typeof il[e]<"u")return il[e];var t=H5(e),n=t.r,r=t.g,i=t.b,o=t.a;o=o*255|0;var s=eA(n,r,i,o);return il[e]=s,s}function $5(e,t){JT[0]=Yr(e);var n=sf[0],r=n&255,i=n>>8&255,o=n>>16&255,s=n>>24&255;return[r,i,o,s]}var sm={};function tA(e){if(typeof sm[e]<"u")return sm[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,i=255,o=eA(t,n,r,i);return sm[e]=o,o}function V1(e,t,n,r){return n+(t<<8)+(e<<16)}function q1(e,t,n,r,i,o){var s=Math.floor(n/o*i),u=Math.floor(e.drawingBufferHeight/o-r/o*i),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(s,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var d=fl(f,4),p=d[0],m=d[1],v=d[2],g=d[3];return[p,m,v,g]}function ke(e,t,n){return(t=Gs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y1(Object(n),!0).forEach(function(r){ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V5(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=cl(e))!==null;);return e}function Bg(){return Bg=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=V5(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Bg.apply(null,arguments)}function nA(e,t,n,r){var i=Bg(cl(e.prototype),t,n);return typeof i=="function"?function(o){return i.apply(n,o)}:i}function q5(e){return e.normalized?1:e.size}function um(e){var t=0;return e.forEach(function(n){return t+=q5(n)}),t}function rA(e,t,n){var r=e==="VERTEX"?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=t.createShader(r);if(i===null)throw new Error("loadShader: error while creating the shader");t.shaderSource(i,n),t.compileShader(i);var o=t.getShaderParameter(i,t.COMPILE_STATUS);if(!o){var s=t.getShaderInfoLog(i);throw t.deleteShader(i),new Error(`loadShader: error while compiling the shader:
|
||
`.concat(s,`
|
||
`).concat(n))}return i}function Y5(e,t){return rA("VERTEX",e,t)}function W5(e,t){return rA("FRAGMENT",e,t)}function X5(e,t){var n=e.createProgram();if(n===null)throw new Error("loadProgram: error while creating the program.");var r,i;for(r=0,i=t.length;r<i;r++)e.attachShader(n,t[r]);e.linkProgram(n);var o=e.getProgramParameter(n,e.LINK_STATUS);if(!o)throw e.deleteProgram(n),new Error("loadProgram: error while linking the program.");return n}function W1(e){var t=e.gl,n=e.buffer,r=e.program,i=e.vertexShader,o=e.fragmentShader;t.deleteShader(i),t.deleteShader(o),t.deleteProgram(r),t.deleteBuffer(n)}function X1(e){return e%1===0?e.toFixed(1):e.toString()}var K1=`#define PICKING_MODE
|
||
`,K5=ke(ke(ke(ke(ke(ke(ke(ke({},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),iA=function(){function e(t,n,r){tn(this,e),ke(this,"array",new Float32Array),ke(this,"constantArray",new Float32Array),ke(this,"capacity",0),ke(this,"verticesCount",0);var i=this.getDefinition();if(this.VERTICES=i.VERTICES,this.VERTEX_SHADER_SOURCE=i.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=i.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=i.UNIFORMS,this.ATTRIBUTES=i.ATTRIBUTES,this.METHOD=i.METHOD,this.CONSTANT_ATTRIBUTES="CONSTANT_ATTRIBUTES"in i?i.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA="CONSTANT_DATA"in i?i.CONSTANT_DATA:[],this.isInstanced="CONSTANT_ATTRIBUTES"in i,this.ATTRIBUTES_ITEMS_COUNT=um(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=r,this.normalProgram=this.getProgramInfo("normal",t,i.VERTEX_SHADER_SOURCE,i.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo("pick",t,K1+i.VERTEX_SHADER_SOURCE,K1+i.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var o=um(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*o);for(var s=0;s<this.CONSTANT_DATA.length;s++){var u=this.CONSTANT_DATA[s];if(u.length!==o)throw new Error("Program: error while getting constant data (one vector has ".concat(u.length," items instead of ").concat(o,")"));for(var f=0;f<u.length;f++)this.constantArray[s*o+f]=u[f]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return nn(e,[{key:"kill",value:function(){W1(this.normalProgram),this.pickProgram&&(W1(this.pickProgram),this.pickProgram=null)}},{key:"getProgramInfo",value:function(n,r,i,o,s){var u=this.getDefinition(),f=r.createBuffer();if(f===null)throw new Error("Program: error while creating the WebGL buffer.");var d=Y5(r,i),p=W5(r,o),m=X5(r,[d,p]),v={};u.UNIFORMS.forEach(function(x){var k=r.getUniformLocation(m,x);k&&(v[x]=k)});var g={};u.ATTRIBUTES.forEach(function(x){g[x.name]=r.getAttribLocation(m,x.name)});var w;if("CONSTANT_ATTRIBUTES"in u&&(u.CONSTANT_ATTRIBUTES.forEach(function(x){g[x.name]=r.getAttribLocation(m,x.name)}),w=r.createBuffer(),w===null))throw new Error("Program: error while creating the WebGL constant buffer.");return{name:n,program:m,gl:r,frameBuffer:s,buffer:f,constantBuffer:w||{},uniformLocations:v,attributeLocations:g,isPicking:n==="pick",vertexShader:d,fragmentShader:p}}},{key:"bindProgram",value:function(n){var r=this,i=0,o=n.gl,s=n.buffer;this.isInstanced?(o.bindBuffer(o.ARRAY_BUFFER,n.constantBuffer),i=0,this.CONSTANT_ATTRIBUTES.forEach(function(u){return i+=r.bindAttribute(u,n,i,!1)}),o.bufferData(o.ARRAY_BUFFER,this.constantArray,o.STATIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,n.buffer),i=0,this.ATTRIBUTES.forEach(function(u){return i+=r.bindAttribute(u,n,i,!0)}),o.bufferData(o.ARRAY_BUFFER,this.array,o.DYNAMIC_DRAW)):(o.bindBuffer(o.ARRAY_BUFFER,s),i=0,this.ATTRIBUTES.forEach(function(u){return i+=r.bindAttribute(u,n,i)}),o.bufferData(o.ARRAY_BUFFER,this.array,o.DYNAMIC_DRAW)),o.bindBuffer(o.ARRAY_BUFFER,null)}},{key:"unbindProgram",value:function(n){var r=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(i){return r.unbindAttribute(i,n,!1)}),this.ATTRIBUTES.forEach(function(i){return r.unbindAttribute(i,n,!0)})):this.ATTRIBUTES.forEach(function(i){return r.unbindAttribute(i,n)})}},{key:"bindAttribute",value:function(n,r,i,o){var s=K5[n.type];if(typeof s!="number")throw new Error('Program.bind: yet unsupported attribute type "'.concat(n.type,'"'));var u=r.attributeLocations[n.name],f=r.gl;if(u!==-1){f.enableVertexAttribArray(u);var d=this.isInstanced?(o?this.ATTRIBUTES_ITEMS_COUNT:um(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(f.vertexAttribPointer(u,n.size,n.type,n.normalized||!1,d,i),this.isInstanced&&o)if(f instanceof WebGL2RenderingContext)f.vertexAttribDivisor(u,1);else{var p=f.getExtension("ANGLE_instanced_arrays");p&&p.vertexAttribDivisorANGLE(u,1)}}return n.size*s}},{key:"unbindAttribute",value:function(n,r,i){var o=r.attributeLocations[n.name],s=r.gl;if(o!==-1&&(s.disableVertexAttribArray(o),this.isInstanced&&i))if(s instanceof WebGL2RenderingContext)s.vertexAttribDivisor(o,0);else{var u=s.getExtension("ANGLE_instanced_arrays");u&&u.vertexAttribDivisorANGLE(o,0)}}},{key:"reallocate",value:function(n){n!==this.capacity&&(this.capacity=n,this.verticesCount=this.VERTICES*n,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(n,r){var i=r.gl,o=r.program;i.enable(i.BLEND),i.useProgram(o),this.setUniforms(n,r),this.drawWebGL(this.METHOD,r)}},{key:"render",value:function(n){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,n.width*n.pixelRatio/n.downSizingRatio,n.height*n.pixelRatio/n.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(Fe(Fe({},n),{},{pixelRatio:n.pixelRatio/n.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,n.width*n.pixelRatio,n.height*n.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(n,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:"drawWebGL",value:function(n,r){var i=r.gl,o=r.frameBuffer;if(i.bindFramebuffer(i.FRAMEBUFFER,o),!this.isInstanced)i.drawArrays(n,0,this.verticesCount);else if(i instanceof WebGL2RenderingContext)i.drawArraysInstanced(n,0,this.VERTICES,this.capacity);else{var s=i.getExtension("ANGLE_instanced_arrays");s&&s.drawArraysInstancedANGLE(n,0,this.VERTICES,this.capacity)}}}])}(),gy=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"kill",value:function(){nA(t,"kill",this)([])}},{key:"process",value:function(r,i,o){var s=i*this.STRIDE;if(o.hidden){for(var u=s+this.STRIDE;s<u;s++)this.array[s]=0;return}return this.processVisibleItem(tA(r),s,o)}}])}(iA),cu=function(e){function t(){var n;tn(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=Pn(this,t,[].concat(i)),ke(n,"drawLabel",void 0),n}return Fn(t,e),nn(t,[{key:"kill",value:function(){nA(t,"kill",this)([])}},{key:"process",value:function(r,i,o,s,u){var f=i*this.STRIDE;if(u.hidden||o.hidden||s.hidden){for(var d=f+this.STRIDE;f<d;f++)this.array[f]=0;return}return this.processVisibleItem(tA(r),f,o,s,u)}}])}(iA);function aA(e,t){return function(){function n(r,i,o){tn(this,n),ke(this,"drawLabel",t),this.programs=e.map(function(s){return new s(r,i,o)})}return nn(n,[{key:"reallocate",value:function(i){this.programs.forEach(function(o){return o.reallocate(i)})}},{key:"process",value:function(i,o,s,u,f){this.programs.forEach(function(d){return d.process(i,o,s,u,f)})}},{key:"render",value:function(i){this.programs.forEach(function(o){return o.render(i)})}},{key:"kill",value:function(){this.programs.forEach(function(i){return i.kill()})}}])}()}function Z5(e,t,n,r,i){var o=i.edgeLabelSize,s=i.edgeLabelFont,u=i.edgeLabelWeight,f=i.edgeLabelColor.attribute?t[i.edgeLabelColor.attribute]||i.edgeLabelColor.color||"#000":i.edgeLabelColor.color,d=t.label;if(d){e.fillStyle=f,e.font="".concat(u," ").concat(o,"px ").concat(s);var p=n.size,m=r.size,v=n.x,g=n.y,w=r.x,x=r.y,k=(v+w)/2,C=(g+x)/2,_=w-v,T=x-g,N=Math.sqrt(_*_+T*T);if(!(N<p+m)){v+=_*p/N,g+=T*p/N,w-=_*m/N,x-=T*m/N,k=(v+w)/2,C=(g+x)/2,_=w-v,T=x-g,N=Math.sqrt(_*_+T*T);var D=e.measureText(d).width;if(D>N){var z="…";for(d=d+z,D=e.measureText(d).width;D>N&&d.length>1;)d=d.slice(0,-2)+z,D=e.measureText(d).width;if(d.length<4)return}var R;_>0?T>0?R=Math.acos(_/N):R=Math.asin(T/N):T>0?R=Math.acos(_/N)+Math.PI:R=Math.asin(_/N)+Math.PI/2,e.save(),e.translate(k,C),e.rotate(R),e.fillText(d,-D/2,t.size/2+o),e.restore()}}}function oA(e,t,n){if(t.label){var r=n.labelSize,i=n.labelFont,o=n.labelWeight,s=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=s,e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function Q5(e,t,n){var r=n.labelSize,i=n.labelFont,o=n.labelWeight;e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var s=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),d=Math.round(r+2*s),p=Math.max(t.size,r/2)+s,m=Math.asin(d/2/p),v=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(d/2,2)));e.beginPath(),e.moveTo(t.x+v,t.y+d/2),e.lineTo(t.x+p+f,t.y+d/2),e.lineTo(t.x+p+f,t.y-d/2),e.lineTo(t.x+v,t.y-d/2),e.arc(t.x,t.y,p,m,-m),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+s,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,oA(e,t,n)}var J5=`
|
||
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
|
||
}
|
||
`,eG=J5,tG=`
|
||
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;
|
||
}
|
||
`,nG=tG,lA=WebGLRenderingContext,Z1=lA.UNSIGNED_BYTE,cm=lA.FLOAT,rG=["u_sizeRatio","u_correctionRatio","u_matrix"],fu=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:nG,FRAGMENT_SHADER_SOURCE:eG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:rG,ATTRIBUTES:[{name:"a_position",size:2,type:cm},{name:"a_size",size:1,type:cm},{name:"a_color",size:4,type:Z1,normalized:!0},{name:"a_id",size:4,type:Z1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:cm}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,i,o){var s=this.array,u=Yr(o.color);s[i++]=o.x,s[i++]=o.y,s[i++]=o.size,s[i++]=u,s[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,s=i.uniformLocations,u=s.u_sizeRatio,f=s.u_correctionRatio,d=s.u_matrix;o.uniform1f(f,r.correctionRatio),o.uniform1f(u,r.sizeRatio),o.uniformMatrix3fv(d,!1,r.matrix)}}])}(gy);ke(fu,"ANGLE_1",0);ke(fu,"ANGLE_2",2*Math.PI/3);ke(fu,"ANGLE_3",4*Math.PI/3);var iG=`
|
||
precision mediump float;
|
||
|
||
varying vec4 v_color;
|
||
|
||
void main(void) {
|
||
gl_FragColor = v_color;
|
||
}
|
||
`,aG=iG,oG=`
|
||
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;
|
||
}
|
||
`,lG=oG,sA=WebGLRenderingContext,Q1=sA.UNSIGNED_BYTE,Gc=sA.FLOAT,sG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],du={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Cf(e){var t=Fe(Fe({},du),e||{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:lG,FRAGMENT_SHADER_SOURCE:aG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:sG,ATTRIBUTES:[{name:"a_position",size:2,type:Gc},{name:"a_normal",size:2,type:Gc},{name:"a_radius",size:1,type:Gc},{name:"a_color",size:4,type:Q1,normalized:!0},{name:"a_id",size:4,type:Q1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Gc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(o,s,u,f,d){if(t.extremity==="source"){var p=[f,u];u=p[0],f=p[1]}var m=d.size||1,v=f.size||1,g=u.x,w=u.y,x=f.x,k=f.y,C=Yr(d.color),_=x-g,T=k-w,N=_*_+T*T,D=0,z=0;N&&(N=1/Math.sqrt(N),D=-T*N*m,z=_*N*m);var R=this.array;R[s++]=x,R[s++]=k,R[s++]=-D,R[s++]=-z,R[s++]=v,R[s++]=C,R[s++]=o}},{key:"setUniforms",value:function(o,s){var u=s.gl,f=s.uniformLocations,d=f.u_matrix,p=f.u_sizeRatio,m=f.u_correctionRatio,v=f.u_minEdgeThickness,g=f.u_lengthToThicknessRatio,w=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.sizeRatio),u.uniform1f(m,o.correctionRatio),u.uniform1f(v,o.minEdgeThickness),u.uniform1f(g,t.lengthToThicknessRatio),u.uniform1f(w,t.widenessToThicknessRatio)}}])}(cu)}Cf();var uG=`
|
||
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
|
||
}
|
||
`,vy=uG,cG=`
|
||
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;
|
||
}
|
||
`,fG=cG,uA=WebGLRenderingContext,J1=uA.UNSIGNED_BYTE,Ga=uA.FLOAT,dG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],hG={lengthToThicknessRatio:du.lengthToThicknessRatio};function cA(e){var t=Fe(Fe({},hG),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:fG,FRAGMENT_SHADER_SOURCE:vy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:dG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ga},{name:"a_positionEnd",size:2,type:Ga},{name:"a_normal",size:2,type:Ga},{name:"a_color",size:4,type:J1,normalized:!0},{name:"a_id",size:4,type:J1,normalized:!0},{name:"a_radius",size:1,type:Ga}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ga},{name:"a_normalCoef",size:1,type:Ga},{name:"a_radiusCoef",size:1,type:Ga}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(o,s,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=f.size||1,T=k*k+C*C,N=0,D=0;T&&(T=1/Math.sqrt(T),N=-C*T*p,D=k*T*p);var z=this.array;z[s++]=m,z[s++]=v,z[s++]=g,z[s++]=w,z[s++]=N,z[s++]=D,z[s++]=x,z[s++]=o,z[s++]=_}},{key:"setUniforms",value:function(o,s){var u=s.gl,f=s.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}cA();function pG(e){return aA([cA(),Cf(e)])}var mG=pG(),fA=mG,gG=`
|
||
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;
|
||
}
|
||
`,vG=gG,dA=WebGLRenderingContext,eS=dA.UNSIGNED_BYTE,Rs=dA.FLOAT,yG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],bG=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:vG,FRAGMENT_SHADER_SOURCE:vy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:yG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Rs},{name:"a_positionEnd",size:2,type:Rs},{name:"a_normal",size:2,type:Rs},{name:"a_color",size:4,type:eS,normalized:!0},{name:"a_id",size:4,type:eS,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Rs},{name:"a_normalCoef",size:1,type:Rs}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(r,i,o,s,u){var f=u.size||1,d=o.x,p=o.y,m=s.x,v=s.y,g=Yr(u.color),w=m-d,x=v-p,k=w*w+x*x,C=0,_=0;k&&(k=1/Math.sqrt(k),C=-x*k*f,_=w*k*f);var T=this.array;T[i++]=d,T[i++]=p,T[i++]=m,T[i++]=v,T[i++]=C,T[i++]=_,T[i++]=g,T[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,s=i.uniformLocations,u=s.u_matrix,f=s.u_zoomRatio,d=s.u_feather,p=s.u_pixelRatio,m=s.u_correctionRatio,v=s.u_sizeRatio,g=s.u_minEdgeThickness;o.uniformMatrix3fv(u,!1,r.matrix),o.uniform1f(f,r.zoomRatio),o.uniform1f(v,r.sizeRatio),o.uniform1f(m,r.correctionRatio),o.uniform1f(p,r.pixelRatio),o.uniform1f(d,r.antiAliasingFeather),o.uniform1f(g,r.minEdgeThickness)}}])}(cu),yy=function(e){function t(){var n;return tn(this,t),n=Pn(this,t),n.rawEmitter=n,n}return Fn(t,e),nn(t)}(MT.EventEmitter),fm,tS;function Wr(){return tS||(tS=1,fm=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),fm}var xG=Wr();const wG=fn(xG);var SG=function(t){return t},EG=function(t){return t*t},_G=function(t){return t*(2-t)},kG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},CG=function(t){return t*t*t},TG=function(t){return--t*t*t+1},AG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},hA={linear:SG,quadraticIn:EG,quadraticOut:_G,quadraticInOut:kG,cubicIn:CG,cubicOut:TG,cubicInOut:AG},pA={easing:"quadraticInOut",duration:150};function RG(e,t,n,r){var i=Object.assign({},pA,n),o=typeof i.easing=="function"?i.easing:hA[i.easing],s=Date.now(),u={};for(var f in t){var d=t[f];u[f]={};for(var p in d)u[f][p]=e.getNodeAttribute(f,p)}var m=null,v=function(){m=null;var w=(Date.now()-s)/i.duration;if(w>=1){for(var x in t){var k=t[x];for(var C in k)e.setNodeAttribute(x,C,k[C])}return}w=o(w);for(var _ in t){var T=t[_],N=u[_];for(var D in T)e.setNodeAttribute(_,D,T[D]*w+N[D]*(1-w))}m=requestAnimationFrame(v)};return v(),function(){m&&cancelAnimationFrame(m)}}function Er(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Bc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function nS(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function rS(e,t,n){return e[6]=t,e[7]=n,e}function ea(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],u=e[5],f=e[6],d=e[7],p=e[8],m=t[0],v=t[1],g=t[2],w=t[3],x=t[4],k=t[5],C=t[6],_=t[7],T=t[8];return e[0]=m*n+v*o+g*f,e[1]=m*r+v*s+g*d,e[2]=m*i+v*u+g*p,e[3]=w*n+x*o+k*f,e[4]=w*r+x*s+k*d,e[5]=w*i+x*u+k*p,e[6]=C*n+_*o+T*f,e[7]=C*r+_*s+T*d,e[8]=C*i+_*u+T*p,e}function Ug(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],o=e[3],s=e[4],u=e[6],f=e[7],d=t.x,p=t.y;return{x:d*r+p*o+u*n,y:d*i+p*s+f*n}}function DG(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Ds(e,t,n,r,i){var o=e.angle,s=e.ratio,u=e.x,f=e.y,d=t.width,p=t.height,m=Er(),v=Math.min(d,p)-2*r,g=DG(t,n);return i?(ea(m,rS(Er(),u,f)),ea(m,Bc(Er(),s)),ea(m,nS(Er(),o)),ea(m,Bc(Er(),d/v/2/g,p/v/2/g))):(ea(m,Bc(Er(),2*(v/d)*g,2*(v/p)*g)),ea(m,nS(Er(),-o)),ea(m,Bc(Er(),1/s)),ea(m,rS(Er(),-u,-f))),m}function NG(e,t,n){var r=Ug(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,o=r.y;return 1/Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/n.width}function OG(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEachNode(function(o,s){var u=s.x,f=s.y;u<t&&(t=u),u>n&&(n=u),f<r&&(r=f),f>i&&(i=f)}),{x:[t,n],y:[r,i]}}function LG(e){if(!wG(e))throw new Error("Sigma: invalid graph instance.");e.forEachNode(function(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function zG(e,t,n){var r=document.createElement(e);if(t)for(var i in t)r.style[i]=t[i];if(n)for(var o in n)r.setAttribute(o,n[o]);return r}function iS(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function aS(e,t,n){return n.sort(function(r,i){var o=t(r)||0,s=t(i)||0;return o<s?-1:o>s?1:0})}function oS(e){var t=fl(e.x,2),n=t[0],r=t[1],i=fl(e.y,2),o=i[0],s=i[1],u=Math.max(r-n,s-o),f=(r+n)/2,d=(s+o)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(d)&&(d=0);var p=function(v){return{x:.5+(v.x-f)/u,y:.5+(v.y-d)/u}};return p.applyTo=function(m){m.x=.5+(m.x-f)/u,m.y=.5+(m.y-d)/u},p.inverse=function(m){return{x:f+u*(m.x-.5),y:d+u*(m.y-.5)}},p.ratio=u,p}function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}function lS(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var i=0;t.forEach(function(o){e[r+i]=o,i++})}}function dm(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];r&&Object.assign(e,r)}return e}var by={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:Z5,defaultDrawNodeLabel:oA,defaultDrawNodeHover:Q5,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:{}},jG={circle:fu},MG={arrow:fA,line:bG};function hm(e){if(typeof e.labelDensity!="number"||e.labelDensity<0)throw new Error("Settings: invalid `labelDensity`. Expecting a positive number.");var t=e.minCameraRatio,n=e.maxCameraRatio;if(typeof t=="number"&&typeof n=="number"&&n<t)throw new Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function PG(e){var t=dm({},by,e);return t.nodeProgramClasses=dm({},jG,t.nodeProgramClasses),t.edgeProgramClasses=dm({},MG,t.edgeProgramClasses),t}var Uc=1.5,sS=function(e){function t(){var n;return tn(this,t),n=Pn(this,t),ke(n,"x",.5),ke(n,"y",.5),ke(n,"angle",0),ke(n,"ratio",1),ke(n,"minRatio",null),ke(n,"maxRatio",null),ke(n,"enabledZooming",!0),ke(n,"enabledPanning",!0),ke(n,"enabledRotation",!0),ke(n,"clean",null),ke(n,"nextFrame",null),ke(n,"previousState",null),ke(n,"enabled",!0),n.previousState=n.getState(),n}return Fn(t,e),nn(t,[{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(r){return this.x===r.x&&this.y===r.y&&this.ratio===r.ratio&&this.angle===r.angle}},{key:"getPreviousState",value:function(){var r=this.previousState;return r?{x:r.x,y:r.y,angle:r.angle,ratio:r.ratio}:null}},{key:"getBoundedRatio",value:function(r){var i=r;return typeof this.minRatio=="number"&&(i=Math.max(i,this.minRatio)),typeof this.maxRatio=="number"&&(i=Math.min(i,this.maxRatio)),i}},{key:"validateState",value:function(r){var i={};return this.enabledPanning&&typeof r.x=="number"&&(i.x=r.x),this.enabledPanning&&typeof r.y=="number"&&(i.y=r.y),this.enabledZooming&&typeof r.ratio=="number"&&(i.ratio=this.getBoundedRatio(r.ratio)),this.enabledRotation&&typeof r.angle=="number"&&(i.angle=r.angle),this.clean?this.clean(Fe(Fe({},this.getState()),i)):i}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"setState",value:function(r){if(!this.enabled)return this;this.previousState=this.getState();var i=this.validateState(r);return typeof i.x=="number"&&(this.x=i.x),typeof i.y=="number"&&(this.y=i.y),typeof i.ratio=="number"&&(this.ratio=i.ratio),typeof i.angle=="number"&&(this.angle=i.angle),this.hasState(this.previousState)||this.emit("updated",this.getState()),this}},{key:"updateState",value:function(r){return this.setState(r(this.getState())),this}},{key:"animate",value:function(r){var i=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(!s)return new Promise(function(g){return i.animate(r,o,g)});if(this.enabled){var u=Fe(Fe({},pA),o),f=this.validateState(r),d=typeof u.easing=="function"?u.easing:hA[u.easing],p=Date.now(),m=this.getState(),v=function(){var w=(Date.now()-p)/u.duration;if(w>=1){i.nextFrame=null,i.setState(f),i.animationCallback&&(i.animationCallback.call(null),i.animationCallback=void 0);return}var x=d(w),k={};typeof f.x=="number"&&(k.x=m.x+(f.x-m.x)*x),typeof f.y=="number"&&(k.y=m.y+(f.y-m.y)*x),i.enabledRotation&&typeof f.angle=="number"&&(k.angle=m.angle+(f.angle-m.angle)*x),typeof f.ratio=="number"&&(k.ratio=m.ratio+(f.ratio-m.ratio)*x),i.setState(k),i.nextFrame=requestAnimationFrame(v)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(v)):v(),this.animationCallback=s}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Uc)},r):this.animate({ratio:this.ratio/Uc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Uc)},r):this.animate({ratio:this.ratio*Uc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var i=new t;return i.setState(r)}}])}(yy);function kr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function yi(e,t){var n=Fe(Fe({},kr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Ns(e){var t="x"in e?e:Fe(Fe({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function FG(e,t){return Fe(Fe({},yi(e,t)),{},{delta:mA(e)})}var IG=2;function uf(e){for(var t=[],n=0,r=Math.min(e.length,IG);n<r;n++)t.push(e[n]);return t}function Os(e,t,n){var r={touches:uf(e.touches).map(function(i){return kr(i,n)}),previousTouches:t.map(function(i){return kr(i,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0},original:e};return r}function mA(e){if(typeof e.deltaY<"u")return e.deltaY*-3/360;if(typeof e.detail<"u")return e.detail/-9;throw new Error("Captor: could not extract delta from event.")}var gA=function(e){function t(n,r){var i;return tn(this,t),i=Pn(this,t),i.container=n,i.renderer=r,i}return Fn(t,e),nn(t)}(yy),GG=["doubleClickTimeout","doubleClickZoomingDuration","doubleClickZoomingRatio","dragTimeout","draggedEventsTolerance","inertiaDuration","inertiaRatio","zoomDuration","zoomingRatio"],BG=GG.reduce(function(e,t){return Fe(Fe({},e),{},ke({},t,by[t]))},{}),UG=function(e){function t(n,r){var i;return tn(this,t),i=Pn(this,t,[n,r]),ke(i,"enabled",!0),ke(i,"draggedEvents",0),ke(i,"downStartTime",null),ke(i,"lastMouseX",null),ke(i,"lastMouseY",null),ke(i,"isMouseDown",!1),ke(i,"isMoving",!1),ke(i,"movingTimeout",null),ke(i,"startCameraState",null),ke(i,"clicks",0),ke(i,"doubleClickTimeout",null),ke(i,"currentWheelDirection",0),ke(i,"settings",BG),i.handleClick=i.handleClick.bind(i),i.handleRightClick=i.handleRightClick.bind(i),i.handleDown=i.handleDown.bind(i),i.handleUp=i.handleUp.bind(i),i.handleMove=i.handleMove.bind(i),i.handleWheel=i.handleWheel.bind(i),i.handleLeave=i.handleLeave.bind(i),i.handleEnter=i.handleEnter.bind(i),n.addEventListener("click",i.handleClick,{capture:!1}),n.addEventListener("contextmenu",i.handleRightClick,{capture:!1}),n.addEventListener("mousedown",i.handleDown,{capture:!1}),n.addEventListener("wheel",i.handleWheel,{capture:!1}),n.addEventListener("mouseleave",i.handleLeave,{capture:!1}),n.addEventListener("mouseenter",i.handleEnter,{capture:!1}),document.addEventListener("mousemove",i.handleMove,{capture:!1}),document.addEventListener("mouseup",i.handleUp,{capture:!1}),i}return Fn(t,e),nn(t,[{key:"kill",value:function(){var r=this.container;r.removeEventListener("click",this.handleClick),r.removeEventListener("contextmenu",this.handleRightClick),r.removeEventListener("mousedown",this.handleDown),r.removeEventListener("wheel",this.handleWheel),r.removeEventListener("mouseleave",this.handleLeave),r.removeEventListener("mouseenter",this.handleEnter),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(r){var i=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(r);setTimeout(function(){i.clicks=0,i.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit("click",yi(r,this.container))}}},{key:"handleRightClick",value:function(r){this.enabled&&this.emit("rightClick",yi(r,this.container))}},{key:"handleDoubleClick",value:function(r){if(this.enabled){r.preventDefault(),r.stopPropagation();var i=yi(r,this.container);if(this.emit("doubleClick",i),!i.sigmaDefaultPrevented){var o=this.renderer.getCamera(),s=o.getBoundedRatio(o.getState().ratio/this.settings.doubleClickZoomingRatio);o.animate(this.renderer.getViewportZoomedState(kr(r,this.container),s),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}}},{key:"handleDown",value:function(r){if(this.enabled){if(r.button===0){this.startCameraState=this.renderer.getCamera().getState();var i=kr(r,this.container),o=i.x,s=i.y;this.lastMouseX=o,this.lastMouseY=s,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",yi(r,this.container))}}},{key:"handleUp",value:function(r){var i=this;if(!(!this.enabled||!this.isMouseDown)){var o=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout=="number"&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var s=kr(r,this.container),u=s.x,f=s.y,d=o.getState(),p=o.getPreviousState()||{x:0,y:0};this.isMoving?o.animate({x:d.x+this.settings.inertiaRatio*(d.x-p.x),y:d.y+this.settings.inertiaRatio*(d.y-p.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"}):(this.lastMouseX!==u||this.lastMouseY!==f)&&o.setState({x:d.x,y:d.y}),this.isMoving=!1,setTimeout(function(){var m=i.draggedEvents>0;i.draggedEvents=0,m&&i.renderer.getSetting("hideEdgesOnMove")&&i.renderer.refresh()},0),this.emit("mouseup",yi(r,this.container))}}},{key:"handleMove",value:function(r){var i=this;if(this.enabled){var o=yi(r,this.container);if(this.emit("mousemovebody",o),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",o),!o.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){i.movingTimeout=null,i.isMoving=!1},this.settings.dragTimeout);var s=this.renderer.getCamera(),u=kr(r,this.container),f=u.x,d=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),m=this.renderer.viewportToFramedGraph({x:f,y:d}),v=p.x-m.x,g=p.y-m.y,w=s.getState(),x=w.x+v,k=w.y+g;s.setState({x,y:k}),this.lastMouseX=f,this.lastMouseY=d,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",yi(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",yi(r,this.container))}},{key:"handleWheel",value:function(r){var i=this,o=this.renderer.getCamera();if(!(!this.enabled||!o.enabledZooming)){var s=mA(r);if(s){var u=FG(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var f=o.getState().ratio,d=s>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=o.getBoundedRatio(f*d),m=s>0?1:-1,v=Date.now();f!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===m&&this.lastWheelTriggerTime&&v-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(o.animate(this.renderer.getViewportZoomedState(kr(r,this.container),p),{easing:"quadraticOut",duration:this.settings.zoomDuration},function(){i.currentWheelDirection=0}),this.currentWheelDirection=m,this.lastWheelTriggerTime=v))}}}},{key:"setSettings",value:function(r){this.settings=r}}])}(gA),HG=["dragTimeout","inertiaDuration","inertiaRatio","doubleClickTimeout","doubleClickZoomingRatio","doubleClickZoomingDuration","tapMoveTolerance"],$G=HG.reduce(function(e,t){return Fe(Fe({},e),{},ke({},t,by[t]))},{}),VG=function(e){function t(n,r){var i;return tn(this,t),i=Pn(this,t,[n,r]),ke(i,"enabled",!0),ke(i,"isMoving",!1),ke(i,"hasMoved",!1),ke(i,"touchMode",0),ke(i,"startTouchesPositions",[]),ke(i,"lastTouches",[]),ke(i,"lastTap",null),ke(i,"settings",$G),i.handleStart=i.handleStart.bind(i),i.handleLeave=i.handleLeave.bind(i),i.handleMove=i.handleMove.bind(i),n.addEventListener("touchstart",i.handleStart,{capture:!1}),n.addEventListener("touchcancel",i.handleLeave,{capture:!1}),document.addEventListener("touchend",i.handleLeave,{capture:!1,passive:!1}),document.addEventListener("touchmove",i.handleMove,{capture:!1,passive:!1}),i}return Fn(t,e),nn(t,[{key:"kill",value:function(){var r=this.container;r.removeEventListener("touchstart",this.handleStart),r.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(r){var i=this;if(this.enabled){r.preventDefault();var o=uf(r.touches);if(this.touchMode=o.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=o.map(function(g){return kr(g,i.container)}),this.touchMode===2){var s=fl(this.startTouchesPositions,2),u=s[0],f=u.x,d=u.y,p=s[1],m=p.x,v=p.y;this.startTouchesAngle=Math.atan2(v-d,m-f),this.startTouchesDistance=Math.sqrt(Math.pow(m-f,2)+Math.pow(v-d,2))}this.emit("touchdown",Os(r,this.lastTouches,this.container)),this.lastTouches=o,this.lastTouchesPositions=this.startTouchesPositions}}},{key:"handleLeave",value:function(r){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(r.cancelable&&r.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(r.touches.length===1){this.handleStart(r),r.preventDefault();break}case 1:if(this.isMoving){var i=this.renderer.getCamera(),o=i.getState(),s=i.getPreviousState()||{x:0,y:0};i.animate({x:o.x+this.settings.inertiaRatio*(o.x-s.x),y:o.y+this.settings.inertiaRatio*(o.y-s.y)},{duration:this.settings.inertiaDuration,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit("touchup",Os(r,this.lastTouches,this.container)),!r.touches.length){var u=kr(this.lastTouches[0],this.container),f=this.startTouchesPositions[0],d=Math.pow(u.x-f.x,2)+Math.pow(u.y-f.y,2);if(!r.touches.length&&d<Math.pow(this.settings.tapMoveTolerance,2))if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var p=Os(r,this.lastTouches,this.container);if(this.emit("doubletap",p),this.lastTap=null,!p.sigmaDefaultPrevented){var m=this.renderer.getCamera(),v=m.getBoundedRatio(m.getState().ratio/this.settings.doubleClickZoomingRatio);m.animate(this.renderer.getViewportZoomedState(u,v),{easing:"quadraticInOut",duration:this.settings.doubleClickZoomingDuration})}}else{var g=Os(r,this.lastTouches,this.container);this.emit("tap",g),this.lastTap={time:Date.now(),position:g.touches[0]||g.previousTouches[0]}}}this.lastTouches=uf(r.touches),this.startTouchesPositions=[]}}},{key:"handleMove",value:function(r){var i=this;if(!(!this.enabled||!this.startTouchesPositions.length)){r.preventDefault();var o=uf(r.touches),s=o.map(function($){return kr($,i.container)}),u=this.lastTouches;this.lastTouches=o,this.lastTouchesPositions=s;var f=Os(r,u,this.container);if(this.emit("touchmove",f),!f.sigmaDefaultPrevented&&(this.hasMoved||(this.hasMoved=s.some(function($,M){var O=i.startTouchesPositions[M];return O&&($.x!==O.x||$.y!==O.y)})),!!this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){i.isMoving=!1},this.settings.dragTimeout);var d=this.renderer.getCamera(),p=this.startCameraState,m=this.renderer.getSetting("stagePadding");switch(this.touchMode){case 1:{var v=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),g=v.x,w=v.y,x=this.renderer.viewportToFramedGraph(s[0]),k=x.x,C=x.y;d.setState({x:p.x+g-k,y:p.y+w-C});break}case 2:{var _={x:.5,y:.5,angle:0,ratio:1},T=s[0],N=T.x,D=T.y,z=s[1],R=z.x,B=z.y,P=Math.atan2(B-D,R-N)-this.startTouchesAngle,j=Math.hypot(B-D,R-N)/this.startTouchesDistance,V=d.getBoundedRatio(p.ratio/j);_.ratio=V,_.angle=p.angle+P;var q=this.getDimensions(),I=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:p}),Y=Math.min(q.width,q.height)-2*m,Z=Y/q.width,U=Y/q.height,G=V/Y,F=N-Y/2/Z,K=D-Y/2/U,A=[F*Math.cos(-_.angle)-K*Math.sin(-_.angle),K*Math.cos(-_.angle)+F*Math.sin(-_.angle)];F=A[0],K=A[1],_.x=I.x-F*G,_.y=I.y+K*G,d.setState(_);break}}}}}},{key:"setSettings",value:function(r){this.settings=r}}])}(gA);function qG(e){if(Array.isArray(e))return Gg(e)}function YG(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WG(){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 uS(e){return qG(e)||YG(e)||ZT(e)||WG()}function XG(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function pm(e,t){if(e==null)return{};var n,r,i=XG(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var cS=function(){function e(t,n){tn(this,e),this.key=t,this.size=n}return nn(e,null,[{key:"compare",value:function(n,r){return n.size>r.size?-1:n.size<r.size||n.key>r.key?1:-1}}])}(),fS=function(){function e(){tn(this,e),ke(this,"width",0),ke(this,"height",0),ke(this,"cellSize",0),ke(this,"columns",0),ke(this,"rows",0),ke(this,"cells",{})}return nn(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),i=Math.floor(n.y/this.cellSize);return i*this.columns+r}},{key:"add",value:function(n,r,i){var o=new cS(n,r),s=this.getIndex(i),u=this.cells[s];u||(u=[],this.cells[s]=u),u.push(o)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(cS.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var i=this.cellSize*this.cellSize,o=i/n/n,s=o*r/i,u=Math.ceil(s),f=[];for(var d in this.cells)for(var p=this.cells[d],m=0;m<Math.min(u,p.length);m++)f.push(p[m].key);return f}}])}();function KG(e){var t=e.graph,n=e.hoveredNode,r=e.highlightedNodes,i=e.displayedNodeLabels,o=[];return t.forEachEdge(function(s,u,f,d){(f===n||d===n||r.has(f)||r.has(d)||i.has(f)&&i.has(d))&&o.push(s)}),o}var ZG=150,QG=50,Si=Object.prototype.hasOwnProperty;function JG(e,t,n){if(!Si.call(n,"x")||!Si.call(n,"y"))throw new Error('Sigma: could not find a valid position (x, y) for node "'.concat(t,'". 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 n.color||(n.color=e.defaultNodeColor),!n.label&&n.label!==""&&(n.label=null),n.label!==void 0&&n.label!==null?n.label=""+n.label:n.label=null,n.size||(n.size=2),Si.call(n,"hidden")||(n.hidden=!1),Si.call(n,"highlighted")||(n.highlighted=!1),Si.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultNodeType),n.zIndex||(n.zIndex=0),n}function eB(e,t,n){return n.color||(n.color=e.defaultEdgeColor),n.label||(n.label=""),n.size||(n.size=.5),Si.call(n,"hidden")||(n.hidden=!1),Si.call(n,"forceLabel")||(n.forceLabel=!1),(!n.type||n.type==="")&&(n.type=e.defaultEdgeType),n.zIndex||(n.zIndex=0),n}var tB=function(e){function t(n,r){var i,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(tn(this,t),i=Pn(this,t),ke(i,"elements",{}),ke(i,"canvasContexts",{}),ke(i,"webGLContexts",{}),ke(i,"pickingLayers",new Set),ke(i,"textures",{}),ke(i,"frameBuffers",{}),ke(i,"activeListeners",{}),ke(i,"labelGrid",new fS),ke(i,"nodeDataCache",{}),ke(i,"edgeDataCache",{}),ke(i,"nodeProgramIndex",{}),ke(i,"edgeProgramIndex",{}),ke(i,"nodesWithForcedLabels",new Set),ke(i,"edgesWithForcedLabels",new Set),ke(i,"nodeExtent",{x:[0,1],y:[0,1]}),ke(i,"nodeZExtent",[1/0,-1/0]),ke(i,"edgeZExtent",[1/0,-1/0]),ke(i,"matrix",Er()),ke(i,"invMatrix",Er()),ke(i,"correctionRatio",1),ke(i,"customBBox",null),ke(i,"normalizationFunction",oS({x:[0,1],y:[0,1]})),ke(i,"graphToViewportRatio",1),ke(i,"itemIDsIndex",{}),ke(i,"nodeIndices",{}),ke(i,"edgeIndices",{}),ke(i,"width",0),ke(i,"height",0),ke(i,"pixelRatio",iS()),ke(i,"pickingDownSizingRatio",2*i.pixelRatio),ke(i,"displayedNodeLabels",new Set),ke(i,"displayedEdgeLabels",new Set),ke(i,"highlightedNodes",new Set),ke(i,"hoveredNode",null),ke(i,"hoveredEdge",null),ke(i,"renderFrame",null),ke(i,"renderHighlightedNodesFrame",null),ke(i,"needToProcess",!1),ke(i,"checkEdgesEventsFrame",null),ke(i,"nodePrograms",{}),ke(i,"nodeHoverPrograms",{}),ke(i,"edgePrograms",{}),i.settings=PG(o),hm(i.settings),LG(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");i.graph=n,i.container=r,i.createWebGLContext("edges",{picking:o.enableEdgeEvents}),i.createCanvasContext("edgeLabels"),i.createWebGLContext("nodes",{picking:!0}),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createWebGLContext("hoverNodes"),i.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),i.resize();for(var s in i.settings.nodeProgramClasses)i.registerNodeProgram(s,i.settings.nodeProgramClasses[s],i.settings.nodeHoverProgramClasses[s]);for(var u in i.settings.edgeProgramClasses)i.registerEdgeProgram(u,i.settings.edgeProgramClasses[u]);return i.camera=new sS,i.bindCameraHandlers(),i.mouseCaptor=new UG(i.elements.mouse,i),i.mouseCaptor.setSettings(i.settings),i.touchCaptor=new VG(i.elements.mouse,i),i.touchCaptor.setSettings(i.settings),i.bindEventHandlers(),i.bindGraphHandlers(),i.handleSettingsUpdate(),i.refresh(),i}return Fn(t,e),nn(t,[{key:"registerNodeProgram",value:function(r,i,o){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new i(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(o||i)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,i){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new i(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var i=this.nodePrograms,o=i[r],s=pm(i,[r].map(Gs));o.kill(),this.nodePrograms=s}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,f=u[r],d=pm(u,[r].map(Gs));f.kill(),this.nodePrograms=d}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var i=this.edgePrograms,o=i[r],s=pm(i,[r].map(Gs));o.kill(),this.edgePrograms=s}return this}},{key:"resetWebGLTexture",value:function(r){var i=this.webGLContexts[r],o=this.frameBuffers[r],s=this.textures[r];s&&i.deleteTexture(s);var u=i.createTexture();return i.bindFramebuffer(i.FRAMEBUFFER,o),i.bindTexture(i.TEXTURE_2D,u),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.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(r){var i=r.x,o=r.y,s=q1(this.webGLContexts.nodes,this.frameBuffers.nodes,i,o,this.pixelRatio,this.pickingDownSizingRatio),u=V1.apply(void 0,uS(s)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(o){var s=Ns(o),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}},f=r.getNodeAtPosition(s);if(f&&r.hoveredNode!==f&&!r.nodeDataCache[f].hidden){r.hoveredNode&&r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.hoveredNode=f,r.emit("enterNode",Fe(Fe({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(s)!==r.hoveredNode){var d=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Fe(Fe({},u),{},{node:d})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Fe(Fe({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(o){var s=Ns(o);r.emit("moveBody",{event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(o){var s=Ns(o),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Fe({},u))},this.activeListeners.handleEnter=function(o){var s=Ns(o),u={event:s,preventSigmaDefault:function(){s.preventSigmaDefault()}};r.emit("enterStage",Fe({},u))};var i=function(s){return function(u){var f=Ns(u),d={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},p=r.getNodeAtPosition(f);if(p)return r.emit("".concat(s,"Node"),Fe(Fe({},d),{},{node:p}));if(r.settings.enableEdgeEvents){var m=r.getEdgeAtPoint(f.x,f.y);if(m)return r.emit("".concat(s,"Edge"),Fe(Fe({},d),{},{edge:m}))}return r.emit("".concat(s,"Stage"),d)}};return this.activeListeners.handleClick=i("click"),this.activeListeners.handleRightClick=i("rightClick"),this.activeListeners.handleDoubleClick=i("doubleClick"),this.activeListeners.handleWheel=i("wheel"),this.activeListeners.handleDown=i("down"),this.activeListeners.handleUp=i("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 r=this,i=this.graph,o=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(s){var u,f=(u=s.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var d=!f||f.some(function(p){return o.has(p)});r.refresh({partialGraph:{nodes:i.nodes()},skipIndexation:!d,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(s){var u,f=(u=s.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var d=f&&["zIndex","type"].some(function(p){return f==null?void 0:f.includes(p)});r.refresh({partialGraph:{edges:i.edges()},skipIndexation:!d,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(s){var u=s.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(s){var u=s.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(s){var u=s.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(s){var u=s.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(s){var u=s.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(s){var u=s.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},i.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),i.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),i.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),i.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),i.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),i.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),i.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),i.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),i.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),i.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,i){var o=q1(this.webGLContexts.edges,this.frameBuffers.edges,r,i,this.pixelRatio,this.pickingDownSizingRatio),s=V1.apply(void 0,uS(o)),u=this.itemIDsIndex[s];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var i=this.graph,o=this.settings,s=this.getDimensions();if(this.nodeExtent=OG(this.graph),!this.settings.autoRescale){var u=s.width,f=s.height,d=this.nodeExtent,p=d.x,m=d.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(m[0]+m[1])/2-f/2,(m[0]+m[1])/2+f/2]}}this.normalizationFunction=oS(this.customBBox||this.nodeExtent);var v=new sS,g=Ds(v.getState(),s,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(s,o.labelGridCellSize);for(var w={},x={},k={},C={},_=1,T=i.nodes(),N=0,D=T.length;N<D;N++){var z=T[N],R=this.nodeDataCache[z],B=i.getNodeAttributes(z);R.x=B.x,R.y=B.y,this.normalizationFunction.applyTo(R),typeof R.label=="string"&&!R.hidden&&this.labelGrid.add(z,R.size,this.framedGraphToViewport(R,{matrix:g})),w[R.type]=(w[R.type]||0)+1}this.labelGrid.organize();for(var P in this.nodePrograms){if(!Si.call(this.nodePrograms,P))throw new Error('Sigma: could not find a suitable program for node type "'.concat(P,'"!'));this.nodePrograms[P].reallocate(w[P]||0),w[P]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(T=aS(this.nodeZExtent,function(re){return r.nodeDataCache[re].zIndex},T));for(var j=0,V=T.length;j<V;j++){var q=T[j];x[q]=_,C[x[q]]={type:"node",id:q},_++;var I=this.nodeDataCache[q];this.addNodeToProgram(q,x[q],w[I.type]++)}for(var Y={},Z=i.edges(),U=0,G=Z.length;U<G;U++){var F=Z[U],K=this.edgeDataCache[F];Y[K.type]=(Y[K.type]||0)+1}this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(Z=aS(this.edgeZExtent,function(re){return r.edgeDataCache[re].zIndex},Z));for(var A in this.edgePrograms){if(!Si.call(this.edgePrograms,A))throw new Error('Sigma: could not find a suitable program for edge type "'.concat(A,'"!'));this.edgePrograms[A].reallocate(Y[A]||0),Y[A]=0}for(var $=0,M=Z.length;$<M;$++){var O=Z[$];k[O]=_,C[k[O]]={type:"edge",id:O},_++;var X=this.edgeDataCache[O];this.addEdgeToProgram(O,k[O],Y[X.type]++)}return this.itemIDsIndex=C,this.nodeIndices=x,this.edgeIndices=k,this.emit("afterProcess"),this}},{key:"handleSettingsUpdate",value:function(r){var i=this,o=this.settings;if(this.camera.minRatio=o.minCameraRatio,this.camera.maxRatio=o.maxCameraRatio,this.camera.enabledZooming=o.enableCameraZooming,this.camera.enabledPanning=o.enableCameraPanning,this.camera.enabledRotation=o.enableCameraRotation,o.cameraPanBoundaries?this.camera.clean=function(p){return i.cleanCameraState(p,o.cameraPanBoundaries&&Hg(o.cameraPanBoundaries)==="object"?o.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),r){if(r.edgeProgramClasses!==o.edgeProgramClasses){for(var s in o.edgeProgramClasses)o.edgeProgramClasses[s]!==r.edgeProgramClasses[s]&&this.registerEdgeProgram(s,o.edgeProgramClasses[s]);for(var u in r.edgeProgramClasses)o.edgeProgramClasses[u]||this.unregisterEdgeProgram(u)}if(r.nodeProgramClasses!==o.nodeProgramClasses||r.nodeHoverProgramClasses!==o.nodeHoverProgramClasses){for(var f in o.nodeProgramClasses)(o.nodeProgramClasses[f]!==r.nodeProgramClasses[f]||o.nodeHoverProgramClasses[f]!==r.nodeHoverProgramClasses[f])&&this.registerNodeProgram(f,o.nodeProgramClasses[f],o.nodeHoverProgramClasses[f]);for(var d in r.nodeProgramClasses)o.nodeProgramClasses[d]||this.unregisterNodeProgram(d)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:"cleanCameraState",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.tolerance,s=o===void 0?0:o,u=i.boundaries,f=Fe({},r),d=u||this.nodeExtent,p=fl(d.x,2),m=p[0],v=p[1],g=fl(d.y,2),w=g[0],x=g[1],k=[this.graphToViewport({x:m,y:w},{cameraState:r}),this.graphToViewport({x:v,y:w},{cameraState:r}),this.graphToViewport({x:m,y:x},{cameraState:r}),this.graphToViewport({x:v,y:x},{cameraState:r})],C=1/0,_=-1/0,T=1/0,N=-1/0;k.forEach(function(Y){var Z=Y.x,U=Y.y;C=Math.min(C,Z),_=Math.max(_,Z),T=Math.min(T,U),N=Math.max(N,U)});var D=_-C,z=N-T,R=this.getDimensions(),B=R.width,P=R.height,j=0,V=0;if(D>=B?_<B-s?j=_-(B-s):C>s&&(j=C-s):_>B+s?j=_-(B+s):C<-s&&(j=C+s),z>=P?N<P-s?V=N-(P-s):T>s&&(V=T-s):N>P+s?V=N-(P+s):T<-s&&(V=T+s),j||V){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),I=this.viewportToFramedGraph({x:j,y:V},{cameraState:r});j=I.x-q.x,V=I.y-q.y,f.x+=j,f.y+=V}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),i=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);lS(i,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var o=this.canvasContexts.labels,s=0,u=i.length;s<u;s++){var f=i[s],d=this.nodeDataCache[f];if(!this.displayedNodeLabels.has(f)&&!d.hidden){var p=this.framedGraphToViewport(d),m=p.x,v=p.y,g=this.scaleSize(d.size);if(!(!d.forceLabel&&g<this.settings.labelRenderedSizeThreshold)&&!(m<-150||m>this.width+ZG||v<-50||v>this.height+QG)){this.displayedNodeLabels.add(f);var w=this.settings.defaultDrawNodeLabel,x=this.nodePrograms[d.type],k=(x==null?void 0:x.drawLabel)||w;k(o,Fe(Fe({key:f},d),{},{size:g,x:m,y:v}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var i=KG({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});lS(i,this.edgesWithForcedLabels);for(var o=new Set,s=0,u=i.length;s<u;s++){var f=i[s],d=this.graph.extremities(f),p=this.nodeDataCache[d[0]],m=this.nodeDataCache[d[1]],v=this.edgeDataCache[f];if(!o.has(f)&&!(v.hidden||p.hidden||m.hidden)){var g=this.settings.defaultDrawEdgeLabel,w=this.edgePrograms[v.type],x=(w==null?void 0:w.drawLabel)||g;x(r,Fe(Fe({key:f},v),{},{size:this.scaleSize(v.size)}),Fe(Fe(Fe({key:d[0]},p),this.framedGraphToViewport(p)),{},{size:this.scaleSize(p.size)}),Fe(Fe(Fe({key:d[1]},m),this.framedGraphToViewport(m)),{},{size:this.scaleSize(m.size)}),this.settings),o.add(f)}}return this.displayedEdgeLabels=o,this}},{key:"renderHighlightedNodes",value:function(){var r=this,i=this.canvasContexts.hovers;i.clearRect(0,0,this.width,this.height);var o=function(g){var w=r.nodeDataCache[g],x=r.framedGraphToViewport(w),k=x.x,C=x.y,_=r.scaleSize(w.size),T=r.settings.defaultDrawNodeHover,N=r.nodePrograms[w.type],D=(N==null?void 0:N.drawHover)||T;D(i,Fe(Fe({key:g},w),{},{size:_,x:k,y:C}),r.settings)},s=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&s.push(this.hoveredNode),this.highlightedNodes.forEach(function(v){v!==r.hoveredNode&&s.push(v)}),s.forEach(function(v){return o(v)});var u={};s.forEach(function(v){var g=r.nodeDataCache[v].type;u[g]=(u[g]||0)+1});for(var f in this.nodeHoverPrograms)this.nodeHoverPrograms[f].reallocate(u[f]||0),u[f]=0;s.forEach(function(v){var g=r.nodeDataCache[v];r.nodeHoverPrograms[g.type].process(0,u[g.type]++,g)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var d=this.getRenderParams();for(var p in this.nodeHoverPrograms){var m=this.nodeHoverPrograms[p];m.render(d)}}},{key:"scheduleHighlightedNodesRender",value:function(){var r=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){r.renderHighlightedNodesFrame=null,r.renderHighlightedNodes(),r.renderEdgeLabels()}))}},{key:"render",value:function(){var r=this;this.emit("beforeRender");var i=function(){return r.emit("afterRender"),r};if(this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(k){return r.resetWebGLTexture(k)}),!this.graph.order)return i();var o=this.mouseCaptor,s=this.camera.isAnimated()||o.isMoving||o.draggedEvents||o.currentWheelDirection,u=this.camera.getState(),f=this.getDimensions(),d=this.getGraphDimensions(),p=this.getStagePadding();this.matrix=Ds(u,f,d,p),this.invMatrix=Ds(u,f,d,p,!0),this.correctionRatio=NG(this.matrix,u,f),this.graphToViewportRatio=this.getGraphToViewportRatio();var m=this.getRenderParams();for(var v in this.nodePrograms){var g=this.nodePrograms[v];g.render(m)}if(!this.settings.hideEdgesOnMove||!s)for(var w in this.edgePrograms){var x=this.edgePrograms[w];x.render(m)}return this.settings.hideLabelsOnMove&&s||(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes()),i()}},{key:"addNode",value:function(r){var i=Object.assign({},this.graph.getNodeAttributes(r));this.settings.nodeReducer&&(i=this.settings.nodeReducer(r,i));var o=JG(this.settings,r,i);this.nodeDataCache[r]=o,this.nodesWithForcedLabels.delete(r),o.forceLabel&&!o.hidden&&this.nodesWithForcedLabels.add(r),this.highlightedNodes.delete(r),o.highlighted&&!o.hidden&&this.highlightedNodes.add(r),this.settings.zIndex&&(o.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=o.zIndex),o.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=o.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var i=this.nodeDataCache[r];this.normalizationFunction.applyTo(i)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var i=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(i=this.settings.edgeReducer(r,i));var o=eB(this.settings,r,i);this.edgeDataCache[r]=o,this.edgesWithForcedLabels.delete(r),o.forceLabel&&!o.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(o.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=o.zIndex),o.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=o.zIndex))}},{key:"updateEdge",value:function(r){this.addEdge(r)}},{key:"removeEdge",value:function(r){delete this.edgeDataCache[r],delete this.edgeProgramIndex[r],this.hoveredEdge===r&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(r)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new fS,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(r,i,o){var s=this.nodeDataCache[r],u=this.nodePrograms[s.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(s.type,'"!'));u.process(i,o,s),this.nodeProgramIndex[r]=o}},{key:"addEdgeToProgram",value:function(r,i,o){var s=this.edgeDataCache[r],u=this.edgePrograms[s.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(s.type,'"!'));var f=this.graph.extremities(r),d=this.nodeDataCache[f[0]],p=this.nodeDataCache[f[1]];u.process(i,o,d,p,s),this.edgeProgramIndex[r]=o}},{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 r=this.settings,i=r.stagePadding,o=r.autoRescale;return o&&i||0}},{key:"createLayer",value:function(r,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[r])throw new Error('Sigma: a layer named "'.concat(r,'" already exists'));var s=zG(i,{position:"absolute"},{class:"sigma-".concat(r)});return o.style&&Object.assign(s.style,o.style),this.elements[r]=s,"beforeLayer"in o&&o.beforeLayer?this.elements[o.beforeLayer].before(s):"afterLayer"in o&&o.afterLayer?this.elements[o.afterLayer].after(s):this.container.appendChild(s),s}},{key:"createCanvas",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(r,"canvas",i)}},{key:"createCanvasContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createCanvas(r,i),s={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[r]=o.getContext("2d",s),this}},{key:"createWebGLContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=(i==null?void 0:i.canvas)||this.createCanvas(r,i);i.hidden&&o.remove();var s=Fe({preserveDrawingBuffer:!1,antialias:!1},i),u;u=o.getContext("webgl2",s),u||(u=o.getContext("webgl",s)),u||(u=o.getContext("experimental-webgl",s));var f=u;if(this.webGLContexts[r]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),i.picking){this.pickingLayers.add(r);var d=f.createFramebuffer();if(!d)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(r));this.frameBuffers[r]=d}return f}},{key:"killLayer",value:function(r){var i=this.elements[r];if(!i)throw new Error("Sigma: cannot kill layer ".concat(r,", which does not exist"));if(this.webGLContexts[r]){var o,s=this.webGLContexts[r];(o=s.getExtension("WEBGL_lose_context"))===null||o===void 0||o.loseContext(),delete this.webGLContexts[r]}else this.canvasContexts[r]&&delete this.canvasContexts[r];return i.remove(),delete this.elements[r],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(r){this.unbindCameraHandlers(),this.camera=r,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(r){r!==this.graph&&(this.hoveredNode&&!r.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!r.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=r,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 r=this.customBBox||this.nodeExtent;return{width:r.x[1]-r.x[0]||1,height:r.y[1]-r.y[0]||1}}},{key:"getNodeDisplayData",value:function(r){var i=this.nodeDataCache[r];return i?Object.assign({},i):void 0}},{key:"getEdgeDisplayData",value:function(r){var i=this.edgeDataCache[r];return i?Object.assign({},i):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 Fe({},this.settings)}},{key:"getSetting",value:function(r){return this.settings[r]}},{key:"setSetting",value:function(r,i){var o=Fe({},this.settings);return this.settings[r]=i,hm(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(r,i){return this.setSetting(r,i(this.settings[r])),this}},{key:"setSettings",value:function(r){var i=Fe({},this.settings);return this.settings=Fe(Fe({},this.settings),r),hm(this.settings),this.handleSettingsUpdate(i),this.scheduleRefresh(),this}},{key:"resize",value:function(r){var i=this.width,o=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=iS(),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(!r&&i===this.width&&o===this.height)return this;for(var s in this.elements){var u=this.elements[s];u.style.width=this.width+"px",u.style.height=this.height+"px"}for(var f in this.canvasContexts)this.elements[f].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[f].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[f].scale(this.pixelRatio,this.pixelRatio);for(var d in this.webGLContexts){this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px");var p=this.webGLContexts[d];if(p.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(d)){var m=this.textures[d];m&&p.deleteTexture(m)}}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(r){var i=this,o=(r==null?void 0:r.skipIndexation)!==void 0?r==null?void 0:r.skipIndexation:!1,s=(r==null?void 0:r.schedule)!==void 0?r.schedule:!1,u=!r||!r.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(N){return i.addNode(N)}),this.graph.forEachEdge(function(N){return i.addEdge(N)});else{for(var f,d,p=((f=r.partialGraph)===null||f===void 0?void 0:f.nodes)||[],m=0,v=(p==null?void 0:p.length)||0;m<v;m++){var g=p[m];if(this.updateNode(g),o){var w=this.nodeProgramIndex[g];if(w===void 0)throw new Error('Sigma: node "'.concat(g,`" can't be repaint`));this.addNodeToProgram(g,this.nodeIndices[g],w)}}for(var x=(r==null||(d=r.partialGraph)===null||d===void 0?void 0:d.edges)||[],k=0,C=x.length;k<C;k++){var _=x[k];if(this.updateEdge(_),o){var T=this.edgeProgramIndex[_];if(T===void 0)throw new Error('Sigma: edge "'.concat(_,`" can't be repaint`));this.addEdgeToProgram(_,this.edgeIndices[_],T)}}}return(u||!o)&&(this.needToProcess=!0),s?this.scheduleRender():this.render(),this}},{key:"scheduleRender",value:function(){var r=this;return this.renderFrame||(this.renderFrame=requestAnimationFrame(function(){r.render()})),this}},{key:"scheduleRefresh",value:function(r){return this.refresh(Fe(Fe({},r),{},{schedule:!0}))}},{key:"getViewportZoomedState",value:function(r,i){var o=this.camera.getState(),s=o.ratio,u=o.angle,f=o.x,d=o.y,p=this.settings,m=p.minCameraRatio,v=p.maxCameraRatio;typeof v=="number"&&(i=Math.min(i,v)),typeof m=="number"&&(i=Math.max(i,m));var g=i/s,w={x:this.width/2,y:this.height/2},x=this.viewportToFramedGraph(r),k=this.viewportToFramedGraph(w);return{angle:u,x:(x.x-k.x)*(1-g)+f,y:(x.y-k.y)*(1-g)+d,ratio:i}}},{key:"viewRectangle",value:function(){var r=this.viewportToFramedGraph({x:0,y:0}),i=this.viewportToFramedGraph({x:this.width,y:0}),o=this.viewportToFramedGraph({x:0,y:this.height});return{x1:r.x,y1:r.y,x2:i.x,y2:i.y,height:i.y-o.y}}},{key:"framedGraphToViewport",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!!i.graphDimensions,s=i.matrix?i.matrix:o?Ds(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding()):this.matrix,u=Ug(s,r);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!i.graphDimensions,s=i.matrix?i.matrix:o?Ds(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding(),!0):this.invMatrix,u=Ug(s,{x:r.x/this.width*2-1,y:1-r.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(r,i))}},{key:"graphToViewport",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(r),i)}},{key:"getGraphToViewportRatio",value:function(){var r={x:0,y:0},i={x:1,y:1},o=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),s=this.graphToViewport(r),u=this.graphToViewport(i),f=Math.sqrt(Math.pow(s.x-u.x,2)+Math.pow(s.y-u.y,2));return f/o}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(r){return this.customBBox=r,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 r=this.container;r.firstChild;)r.removeChild(r.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var i in this.nodePrograms)this.nodePrograms[i].kill();for(var o in this.nodeHoverPrograms)this.nodeHoverPrograms[o].kill();for(var s in this.edgePrograms)this.edgePrograms[s].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return r/this.settings.zoomToSizeRatioFunction(i)*(this.getSetting("itemSizesReference")==="positions"?i*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var r={};for(var i in this.elements)this.elements[i]instanceof HTMLCanvasElement&&(r[i]=this.elements[i]);return r}}])}(yy);const vA=E.createContext(null),nB=vA.Provider;function xy(){const e=E.useContext(vA);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of <SigmaContainer>");return e}function pr(){return xy().sigma}function yA(){const{sigma:e}=xy();return E.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function gd(e){return new Set(Object.keys(e))}const dS=gd({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}),hS=gd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),pS=gd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),mS=gd({updated:!0});function bA(){const e=pr(),t=yA(),[n,r]=E.useState({});return E.useEffect(()=>{if(!e||!n)return;const i=n,o=Object.keys(i);return o.forEach(s=>{const u=i[s];dS.has(s)&&e.on(s,u),hS.has(s)&&e.getMouseCaptor().on(s,u),pS.has(s)&&e.getTouchCaptor().on(s,u),mS.has(s)&&e.getCamera().on(s,u)}),()=>{e&&o.forEach(s=>{const u=i[s];dS.has(s)&&e.off(s,u),hS.has(s)&&e.getMouseCaptor().off(s,u),pS.has(s)&&e.getTouchCaptor().off(s,u),mS.has(s)&&e.getCamera().off(s,u)})}},[e,n,t]),r}function rB(){const e=pr();return E.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function hu(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(const n in e)if(!Object.hasOwn(t,n)||!hu(e[n],t[n]))return!1;return!0}return!1}function xA(e){const t=pr(),[n,r]=E.useState(e||{});E.useEffect(()=>{r(d=>hu(d,e||{})?d:e||{})},[e]);const i=E.useCallback(d=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),d))},[t,n]),o=E.useCallback(d=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),d))},[t,n]),s=E.useCallback(d=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),d))},[t,n]),u=E.useCallback((d,p)=>{t.getCamera().animate(d,Object.assign(Object.assign({},n),p))},[t,n]),f=E.useCallback((d,p)=>{const m=t.getNodeDisplayData(d);m?t.getCamera().animate(m,Object.assign(Object.assign({},n),p)):console.warn(`Node ${d} not found`)},[t,n]);return{zoomIn:i,zoomOut:o,reset:s,goto:u,gotoNode:f}}function iB(e){const t=xy(),[n,r]=E.useState(!1),[i,o]=E.useState(t.container),s=E.useCallback(()=>r(u=>!u),[]);return E.useEffect(()=>(document.addEventListener("fullscreenchange",s),()=>document.removeEventListener("fullscreenchange",s)),[s]),E.useEffect(()=>{o(t.container)},[e,t.container]),{toggle:E.useCallback(()=>{var u;u=i,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[i]),isFullScreen:n}}const aB=E.forwardRef(({graph:e,id:t,className:n,style:r,settings:i={},children:o},s)=>{const u=E.useRef(null),f=E.useRef(null),d={className:`react-sigma ${n||""}`,id:t,style:r},[p,m]=E.useState(null),[v,g]=E.useState(i);E.useEffect(()=>{g(k=>hu(k,i)?k:i)},[i]),E.useEffect(()=>{m(k=>{let C=null;if(f.current!==null){let _=new St;e&&(_=typeof e=="function"?new e:e);let T=null;k&&(T=k.getCamera().getState(),k.kill()),C=new tB(_,f.current,v),T&&C.getCamera().setState(T)}return C})},[f,e,v]),E.useImperativeHandle(s,()=>p,[p]);const w=E.useMemo(()=>p&&u.current?{sigma:p,container:u.current}:null,[p,u]),x=w!==null?be.createElement(nB,{value:w},o):null;return be.createElement("div",Object.assign({},d,{ref:u}),be.createElement("div",{className:"sigma-container",ref:f}),x)});var oB=`
|
||
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
|
||
}
|
||
`,lB=oB,sB=`
|
||
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;
|
||
}
|
||
`,uB=sB,wA=WebGLRenderingContext,gS=wA.UNSIGNED_BYTE,vS=wA.FLOAT,cB=["u_sizeRatio","u_pixelRatio","u_matrix"],fB=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:uB,FRAGMENT_SHADER_SOURCE:lB,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:cB,ATTRIBUTES:[{name:"a_position",size:2,type:vS},{name:"a_size",size:1,type:vS},{name:"a_color",size:4,type:gS,normalized:!0},{name:"a_id",size:4,type:gS,normalized:!0}]}}},{key:"processVisibleItem",value:function(r,i,o){var s=this.array;s[i++]=o.x,s[i++]=o.y,s[i++]=o.size,s[i++]=Yr(o.color),s[i++]=r}},{key:"setUniforms",value:function(r,i){var o=r.sizeRatio,s=r.pixelRatio,u=r.matrix,f=i.gl,d=i.uniformLocations,p=d.u_sizeRatio,m=d.u_pixelRatio,v=d.u_matrix;f.uniform1f(m,s),f.uniform1f(p,o),f.uniformMatrix3fv(v,!1,u)}}])}(gy),dB=`
|
||
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;
|
||
}
|
||
`,hB=dB,SA=WebGLRenderingContext,yS=SA.UNSIGNED_BYTE,gi=SA.FLOAT,pB=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],mB={lengthToThicknessRatio:du.lengthToThicknessRatio};function EA(e){var t=Fe(Fe({},mB),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:hB,FRAGMENT_SHADER_SOURCE:vy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:pB,ATTRIBUTES:[{name:"a_positionStart",size:2,type:gi},{name:"a_positionEnd",size:2,type:gi},{name:"a_normal",size:2,type:gi},{name:"a_color",size:4,type:yS,normalized:!0},{name:"a_id",size:4,type:yS,normalized:!0},{name:"a_sourceRadius",size:1,type:gi},{name:"a_targetRadius",size:1,type:gi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:gi},{name:"a_normalCoef",size:1,type:gi},{name:"a_sourceRadiusCoef",size:1,type:gi},{name:"a_targetRadiusCoef",size:1,type:gi}],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(o,s,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=u.size||1,T=f.size||1,N=k*k+C*C,D=0,z=0;N&&(N=1/Math.sqrt(N),D=-C*N*p,z=k*N*p);var R=this.array;R[s++]=m,R[s++]=v,R[s++]=g,R[s++]=w,R[s++]=D,R[s++]=z,R[s++]=x,R[s++]=o,R[s++]=_,R[s++]=T}},{key:"setUniforms",value:function(o,s){var u=s.gl,f=s.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}EA();function gB(e){return aA([EA(),Cf(e),Cf(Fe(Fe({},e),{},{extremity:"source"}))])}gB();function vB(e){if(Array.isArray(e))return e}function yB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,u=[],f=!0,d=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){d=!0,i=p}finally{try{if(!f&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(d)throw i}}return u}}function $g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _A(e,t){if(e){if(typeof e=="string")return $g(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$g(e,t):void 0}}function bB(){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 xB(e,t){return vB(e)||yB(e,t)||_A(e,t)||bB()}function wB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SB(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kA(e){var t=SB(e,"string");return typeof t=="symbol"?t:t+""}function EB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kA(r.key),r)}}function _B(e,t,n){return t&&EB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tf(e)}function CA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CA=function(){return!!e})()}function Vg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kB(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vg(e)}function CB(e,t,n){return t=Tf(t),kB(e,CA()?Reflect.construct(t,n||[],Tf(e).constructor):t.apply(e,n))}function qg(e,t){return qg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},qg(e,t)}function TB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qg(e,t)}function Zo(e,t,n){return(t=kA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AB(e){if(Array.isArray(e))return $g(e)}function RB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DB(){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 mm(e){return AB(e)||RB(e)||_A(e)||DB()}function bS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bS(Object(n),!0).forEach(function(r){Zo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var NB="relative",OB={drawLabel:void 0,drawHover:void 0,borders:[{size:{value:.1},color:{attribute:"borderColor"}},{size:{fill:!0},color:{attribute:"color"}}]},LB="#000000";function zB(e){var t=e.borders,n=X1(t.filter(function(i){var o=i.size;return"fill"in o}).length),r=`
|
||
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(t.flatMap(function(i,o){var s=i.size;return"attribute"in s?["varying float v_borderSize_".concat(o+1,";")]:[]}).join(`
|
||
`),`
|
||
`).concat(t.flatMap(function(i,o){var s=i.color;return"attribute"in s?["varying vec4 v_borderColor_".concat(o+1,";")]:"value"in s?["uniform vec4 u_borderColor_".concat(o+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(t.flatMap(function(i,o){var s=i.size;if("fill"in s)return[];s=s;var u="attribute"in s?"v_borderSize_".concat(o+1):X1(s.value),f=(s.mode||NB)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(o+1," = ").concat(f," * ").concat(u,";")]}).join(`
|
||
`),`
|
||
// Now, let's split the remaining space between "fill" borders:
|
||
float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(i,o){var s=i.size;return"fill"in s?[]:["borderSize_".concat(o+1)]}).join(" + "),") ) / ").concat(n,`;
|
||
`).concat(t.flatMap(function(i,o){var s=i.size;return"fill"in s?[" float borderSize_".concat(o+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(t.map(function(i,o){return" float adjustedBorderSize_".concat(o+1," = adjustedBorderSize_").concat(o," - borderSize_").concat(o+1,";")}).join(`
|
||
`),`
|
||
|
||
// Colors:
|
||
vec4 borderColor_0 = transparent;
|
||
`).concat(t.map(function(i,o){var s=i.color,u=[];return"attribute"in s?u.push(" vec4 borderColor_".concat(o+1," = v_borderColor_").concat(o+1,";")):"transparent"in s?u.push(" vec4 borderColor_".concat(o+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(o+1," = u_borderColor_").concat(o+1,";")),u.push(" borderColor_".concat(o+1,".a *= bias;")),u.push(" if (borderSize_".concat(o+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(o+1," = borderColor_").concat(o,"; }")),u.join(`
|
||
`)}).join(`
|
||
`),`
|
||
if (dist > adjustedBorderSize_0) {
|
||
gl_FragColor = borderColor_0;
|
||
} else `).concat(t.map(function(i,o){return"if (dist > adjustedBorderSize_".concat(o,` - aaBorder) {
|
||
gl_FragColor = mix(borderColor_`).concat(o+1,", borderColor_").concat(o,", (dist - adjustedBorderSize_").concat(o,` + aaBorder) / aaBorder);
|
||
} else if (dist > adjustedBorderSize_`).concat(o+1,`) {
|
||
gl_FragColor = borderColor_`).concat(o+1,`;
|
||
} else `)}).join(""),` { /* Nothing to add here */ }
|
||
#endif
|
||
}
|
||
`);return r}function jB(e){var t=e.borders,n=`
|
||
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(t.flatMap(function(r,i){var o=r.size;return"attribute"in o?["attribute float a_borderSize_".concat(i+1,";"),"varying float v_borderSize_".concat(i+1,";")]:[]}).join(`
|
||
`),`
|
||
`).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?["attribute vec4 a_borderColor_".concat(i+1,";"),"varying vec4 v_borderColor_".concat(i+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(t.flatMap(function(r,i){var o=r.size;return"attribute"in o?[" v_borderSize_".concat(i+1," = a_borderSize_").concat(i+1,";")]:[]}).join(`
|
||
`),`
|
||
`).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?[" v_borderColor_".concat(i+1," = a_borderColor_").concat(i+1,";")]:[]}).join(`
|
||
`),`
|
||
#endif
|
||
}
|
||
`);return n}var TA=WebGLRenderingContext,wS=TA.UNSIGNED_BYTE,Hc=TA.FLOAT;function MB(e){var t,n=xS(xS({},OB),{}),r=n.borders,i=n.drawLabel,o=n.drawHover,s=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(mm(r.flatMap(function(u,f){var d=u.color;return"value"in d?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){TB(f,u);function f(){var d;wB(this,f);for(var p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return d=CB(this,f,[].concat(m)),Zo(Vg(d),"drawLabel",i),Zo(Vg(d),"drawHover",o),d}return _B(f,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:jB(n),FRAGMENT_SHADER_SOURCE:zB(n),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:s,ATTRIBUTES:[{name:"a_position",size:2,type:Hc},{name:"a_id",size:4,type:wS,normalized:!0},{name:"a_size",size:1,type:Hc}].concat(mm(r.flatMap(function(p,m){var v=p.color;return"attribute"in v?[{name:"a_borderColor_".concat(m+1),size:4,type:wS,normalized:!0}]:[]})),mm(r.flatMap(function(p,m){var v=p.size;return"attribute"in v?[{name:"a_borderSize_".concat(m+1),size:1,type:Hc}]:[]}))),CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:Hc}],CONSTANT_DATA:[[f.ANGLE_1],[f.ANGLE_2],[f.ANGLE_3]]}}},{key:"processVisibleItem",value:function(p,m,v){var g=this.array;g[m++]=v.x,g[m++]=v.y,g[m++]=p,g[m++]=v.size,r.forEach(function(w){var x=w.color;"attribute"in x&&(g[m++]=Yr(v[x.attribute]||x.defaultValue||LB))}),r.forEach(function(w){var x=w.size;"attribute"in x&&(g[m++]=v[x.attribute]||x.defaultValue)})}},{key:"setUniforms",value:function(p,m){var v=m.gl,g=m.uniformLocations,w=g.u_sizeRatio,x=g.u_correctionRatio,k=g.u_matrix;v.uniform1f(x,p.correctionRatio),v.uniform1f(w,p.sizeRatio),v.uniformMatrix3fv(k,!1,p.matrix),r.forEach(function(C,_){var T=C.color;if("value"in T){var N=g["u_borderColor_".concat(_+1)],D=$5(T.value),z=xB(D,4),R=z[0],B=z[1],P=z[2],j=z[3];v.uniform4f(N,R/255,B/255,P/255,j/255)}})}}]),f}(gy),Zo(t,"ANGLE_1",0),Zo(t,"ANGLE_2",2*Math.PI/3),Zo(t,"ANGLE_3",4*Math.PI/3),t}var PB=MB();function FB(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AA(e){var t=FB(e,"string");return typeof t=="symbol"?t:t+""}function RA(e,t,n){return(t=AA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Af(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SS(Object(n),!0).forEach(function(r){RA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AA(r.key),r)}}function BB(e,t,n){return t&&GB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rf(e){return Rf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rf(e)}function DA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DA=function(){return!!e})()}function NA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UB(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NA(e)}function HB(e,t,n){return t=Rf(t),UB(e,DA()?Reflect.construct(t,n||[],Rf(e).constructor):t.apply(e,n))}function Yg(e,t){return Yg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yg(e,t)}function $B(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yg(e,t)}function Wg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VB(e){if(Array.isArray(e))return Wg(e)}function qB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YB(e,t){if(e){if(typeof e=="string")return Wg(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wg(e,t):void 0}}function WB(){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 gm(e){return VB(e)||qB(e)||YB(e)||WB()}function OA(e,t,n,r){var i=Math.pow(1-e,2)*t.x+2*(1-e)*e*n.x+Math.pow(e,2)*r.x,o=Math.pow(1-e,2)*t.y+2*(1-e)*e*n.y+Math.pow(e,2)*r.y;return{x:i,y:o}}function XB(e,t,n){for(var r=20,i=0,o=e,s=0;s<r;s++){var u=OA((s+1)/r,e,t,n);i+=Math.sqrt(Math.pow(o.x-u.x,2)+Math.pow(o.y-u.y,2)),o=u}return i}function KB(e){var t=e.curvatureAttribute,n=e.defaultCurvature,r=e.keepLabelUpright,i=r===void 0?!0:r;return function(o,s,u,f,d){var p=d.edgeLabelSize,m=s[t]||n,v=d.edgeLabelFont,g=d.edgeLabelWeight,w=d.edgeLabelColor.attribute?s[d.edgeLabelColor.attribute]||d.edgeLabelColor.color||"#000":d.edgeLabelColor.color,x=s.label;if(x){o.fillStyle=w,o.font="".concat(g," ").concat(p,"px ").concat(v);var k=!i||u.x<f.x,C=k?u.x:f.x,_=k?u.y:f.y,T=k?f.x:u.x,N=k?f.y:u.y,D=(C+T)/2,z=(_+N)/2,R=T-C,B=N-_,P=Math.sqrt(Math.pow(R,2)+Math.pow(B,2)),j=k?1:-1,V=D+B*m*j,q=z-R*m*j,I=s.size*.7+5,Y={x:q-_,y:-(V-C)},Z=Math.sqrt(Math.pow(Y.x,2)+Math.pow(Y.y,2)),U={x:N-q,y:-(T-V)},G=Math.sqrt(Math.pow(U.x,2)+Math.pow(U.y,2));C+=I*Y.x/Z,_+=I*Y.y/Z,T+=I*U.x/G,N+=I*U.y/G,V+=I*B/P,q-=I*R/P;var F={x:V,y:q},K={x:C,y:_},A={x:T,y:N},$=XB(K,F,A);if(!($<u.size+f.size)){var M=o.measureText(x).width,O=$-u.size-f.size;if(M>O){var X="…";for(x=x+X,M=o.measureText(x).width;M>O&&x.length>1;)x=x.slice(0,-2)+X,M=o.measureText(x).width;if(x.length<4)return}for(var re={},ue=0,ae=x.length;ue<ae;ue++){var oe=x[ue];re[oe]||(re[oe]=o.measureText(oe).width*(1+m*.35))}for(var Ce=.5-M/$/2,he=0,Ee=x.length;he<Ee;he++){var we=x[he],Pe=OA(Ce,K,F,A),Ae=2*(1-Ce)*(V-C)+2*Ce*(T-V),xe=2*(1-Ce)*(q-_)+2*Ce*(N-q),ee=Math.atan2(xe,Ae);o.save(),o.translate(Pe.x,Pe.y),o.rotate(ee),o.fillText(we,0,0),o.restore(),Ce+=re[we]/$}}}}}function ZB(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",r=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",i=`
|
||
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(n?`
|
||
varying float v_targetSize;
|
||
varying vec2 v_targetPoint;`:"",`
|
||
`).concat(r?`
|
||
varying float v_sourceSize;
|
||
varying vec2 v_sourcePoint;`:"",`
|
||
`).concat(t?`
|
||
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(n?`
|
||
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(r?`
|
||
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 i}function QB(e){var t=e.arrowHead,n=(t==null?void 0:t.extremity)==="target"||(t==null?void 0:t.extremity)==="both",r=(t==null?void 0:t.extremity)==="source"||(t==null?void 0:t.extremity)==="both",i=`
|
||
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(n?`attribute float a_targetSize;
|
||
`:"",`
|
||
`).concat(r?`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(n?`
|
||
varying float v_targetSize;
|
||
varying vec2 v_targetPoint;`:"",`
|
||
`).concat(r?`
|
||
varying float v_sourceSize;
|
||
varying vec2 v_sourcePoint;`:"",`
|
||
`).concat(t?`
|
||
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(t?"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(n?`
|
||
v_targetSize = a_targetSize * u_pixelRatio / u_sizeRatio;
|
||
v_targetPoint = viewportTarget;
|
||
`:"",`
|
||
`).concat(r?`
|
||
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 i}var LA=.25,JB={arrowHead:null,curvatureAttribute:"curvature",defaultCurvature:LA},zA=WebGLRenderingContext,ES=zA.UNSIGNED_BYTE,ta=zA.FLOAT;function wy(e){var t=Af(Af({},JB),e||{}),n=t,r=n.arrowHead,i=n.curvatureAttribute,o=n.drawLabel,s=(r==null?void 0:r.extremity)==="target"||(r==null?void 0:r.extremity)==="both",u=(r==null?void 0:r.extremity)==="source"||(r==null?void 0:r.extremity)==="both",f=["u_matrix","u_sizeRatio","u_dimensions","u_pixelRatio","u_feather","u_minEdgeThickness"].concat(gm(r?["u_lengthToThicknessRatio","u_widenessToThicknessRatio"]:[]));return function(d){$B(p,d);function p(){var m;IB(this,p);for(var v=arguments.length,g=new Array(v),w=0;w<v;w++)g[w]=arguments[w];return m=HB(this,p,[].concat(g)),RA(NA(m),"drawLabel",o||KB(t)),m}return BB(p,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:QB(t),FRAGMENT_SHADER_SOURCE:ZB(t),METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:f,ATTRIBUTES:[{name:"a_source",size:2,type:ta},{name:"a_target",size:2,type:ta}].concat(gm(s?[{name:"a_targetSize",size:1,type:ta}]:[]),gm(u?[{name:"a_sourceSize",size:1,type:ta}]:[]),[{name:"a_thickness",size:1,type:ta},{name:"a_curvature",size:1,type:ta},{name:"a_color",size:4,type:ES,normalized:!0},{name:"a_id",size:4,type:ES,normalized:!0}]),CONSTANT_ATTRIBUTES:[{name:"a_current",size:1,type:ta},{name:"a_direction",size:1,type:ta}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[0,-1],[1,1],[1,-1]]}}},{key:"processVisibleItem",value:function(v,g,w,x,k){var C,_=k.size||1,T=w.x,N=w.y,D=x.x,z=x.y,R=Yr(k.color),B=(C=k[i])!==null&&C!==void 0?C:LA,P=this.array;P[g++]=T,P[g++]=N,P[g++]=D,P[g++]=z,s&&(P[g++]=x.size),u&&(P[g++]=w.size),P[g++]=_,P[g++]=B,P[g++]=R,P[g++]=v}},{key:"setUniforms",value:function(v,g){var w=g.gl,x=g.uniformLocations,k=x.u_matrix,C=x.u_pixelRatio,_=x.u_feather,T=x.u_sizeRatio,N=x.u_dimensions,D=x.u_minEdgeThickness;if(w.uniformMatrix3fv(k,!1,v.matrix),w.uniform1f(C,v.pixelRatio),w.uniform1f(T,v.sizeRatio),w.uniform1f(_,v.antiAliasingFeather),w.uniform2f(N,v.width*v.pixelRatio,v.height*v.pixelRatio),w.uniform1f(D,v.minEdgeThickness),r){var z=x.u_lengthToThicknessRatio,R=x.u_widenessToThicknessRatio;w.uniform1f(z,r.lengthToThicknessRatio),w.uniform1f(R,r.widenessToThicknessRatio)}}}]),p}(cu)}var eU=wy(),tU=wy({arrowHead:du});wy({arrowHead:Af(Af({},du),{},{extremity:"both"})});class nU{constructor(){mi(this,"nodes",[]);mi(this,"edges",[]);mi(this,"nodeIdMap",{});mi(this,"edgeIdMap",{});mi(this,"edgeDynamicIdMap",{});mi(this,"getNode",t=>{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});mi(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});mi(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t<this.edges.length;t++){const n=this.edges[t];this.edgeDynamicIdMap[n.dynamicId]=t}})}}const rU=Cv()(e=>({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),yt=Rv(rU),iU=({node:e,move:t})=>{const n=pr(),{gotoNode:r}=xA();return E.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(r(e),yt.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,r]),null};function kl(e,t){const n=pr(),r=E.useRef(t);return hu(r.current,t)||(r.current=t),{positions:E.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:E.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function Sy(e,t){const n=pr(),[r,i]=E.useState(!1),[o,s]=E.useState(null),u=E.useRef(t);return hu(u.current,t)||(u.current=t),E.useEffect(()=>{i(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),s(f),()=>{f!==null&&f.kill()}},[n,u,s,i,e]),{stop:E.useCallback(()=>{o&&(o.stop(),i(!1))},[o,i]),start:E.useCallback(()=>{o&&(o.start(),i(!0))},[o,i]),kill:E.useCallback(()=>{o&&o.kill(),i(!1)},[o,i]),isRunning:r}}var vm,_S;function pu(){if(_S)return vm;_S=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,r){n=n||{};var i={};for(var o in r){var s=n[o],u=r[o];if(!e(u)){i[o]=t(s,u);continue}s===void 0?i[o]=u:i[o]=s}return i}return vm=t,vm}var ym,kS;function aU(){if(kS)return ym;kS=1;function e(n){return function(r,i){return r+Math.floor(n()*(i-r+1))}}var t=e(Math.random);return t.createRandom=e,ym=t,ym}var bm,CS;function oU(){if(CS)return bm;CS=1;var e=aU().createRandom;function t(r){var i=e(r);return function(o){for(var s=o.length,u=s-1,f=-1;++f<s;){var d=i(f,u),p=o[d];o[d]=o[f],o[f]=p}}}var n=t(Math.random);return n.createShuffleInPlace=t,bm=n,bm}var xm,TS;function lU(){if(TS)return xm;TS=1;var e=pu(),t=Wr(),n=oU(),r={attributes:{x:"x",y:"y"},center:0,hierarchyAttributes:[],rng:Math.random,scale:1};function i(R,B,P,j,V){this.wrappedCircle=V||null,this.children={},this.countChildren=0,this.id=R||null,this.next=null,this.previous=null,this.x=B||null,this.y=P||null,V?this.r=1010101:this.r=j||999}i.prototype.hasChildren=function(){return this.countChildren>0},i.prototype.addChild=function(R,B){this.children[R]=B,++this.countChildren},i.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var B=new i;this.children[R]=B,++this.countChildren}return this.children[R]},i.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var B in R.children){var P=R.children[B];P.x+=R.x,P.y+=R.y,P.applyPositionToChildren()}}};function o(R,B,P){for(var j in B.children){var V=B.children[j];V.hasChildren()?o(R,V,P):P[V.id]={x:V.x,y:V.y}}}function s(R,B){var P=R.r-B.r,j=B.x-R.x,V=B.y-R.y;return P<0||P*P<j*j+V*V}function u(R,B){var P=R.r-B.r+1e-6,j=B.x-R.x,V=B.y-R.y;return P>0&&P*P>j*j+V*V}function f(R,B){for(var P=0;P<B.length;++P)if(!u(R,B[P]))return!1;return!0}function d(R){return new i(null,R.x,R.y,R.r)}function p(R,B){var P=R.x,j=R.y,V=R.r,q=B.x,I=B.y,Y=B.r,Z=q-P,U=I-j,G=Y-V,F=Math.sqrt(Z*Z+U*U);return new i(null,(P+q+Z/F*G)/2,(j+I+U/F*G)/2,(F+V+Y)/2)}function m(R,B,P){var j=R.x,V=R.y,q=R.r,I=B.x,Y=B.y,Z=B.r,U=P.x,G=P.y,F=P.r,K=j-I,A=j-U,$=V-Y,M=V-G,O=Z-q,X=F-q,re=j*j+V*V-q*q,ue=re-I*I-Y*Y+Z*Z,ae=re-U*U-G*G+F*F,oe=A*$-K*M,Ce=($*ae-M*ue)/(oe*2)-j,he=(M*O-$*X)/oe,Ee=(A*ue-K*ae)/(oe*2)-V,we=(K*X-A*O)/oe,Pe=he*he+we*we-1,Ae=2*(q+Ce*he+Ee*we),xe=Ce*Ce+Ee*Ee-q*q,ee=-(Pe?(Ae+Math.sqrt(Ae*Ae-4*Pe*xe))/(2*Pe):xe/Ae);return new i(null,j+Ce+he*ee,V+Ee+we*ee,ee)}function v(R){switch(R.length){case 1:return d(R[0]);case 2:return p(R[0],R[1]);case 3:return m(R[0],R[1],R[2]);default:throw new Error("graphology-layout/circlepack: Invalid basis length "+R.length)}}function g(R,B){var P,j;if(f(B,R))return[B];for(P=0;P<R.length;++P)if(s(B,R[P])&&f(p(R[P],B),R))return[R[P],B];for(P=0;P<R.length-1;++P)for(j=P+1;j<R.length;++j)if(s(p(R[P],R[j]),B)&&s(p(R[P],B),R[j])&&s(p(R[j],B),R[P])&&f(m(R[P],R[j],B),R))return[R[P],R[j],B];throw new Error("graphology-layout/circlepack: extendBasis failure !")}function w(R){var B=R.wrappedCircle,P=R.next.wrappedCircle,j=B.r+P.r,V=(B.x*P.r+P.x*B.r)/j,q=(B.y*P.r+P.y*B.r)/j;return V*V+q*q}function x(R,B){var P=0,j=R.slice(),V=R.length,q=[],I,Y;for(B(j);P<V;)I=j[P],Y&&u(Y,I)?++P:(q=g(q,I),Y=v(q),P=0);return Y}function k(R,B,P){var j=R.x-B.x,V,q,I=R.y-B.y,Y,Z,U=j*j+I*I;U?(q=B.r+P.r,q*=q,Z=R.r+P.r,Z*=Z,q>Z?(V=(U+Z-q)/(2*U),Y=Math.sqrt(Math.max(0,Z/U-V*V)),P.x=R.x-V*j-Y*I,P.y=R.y-V*I+Y*j):(V=(U+q-Z)/(2*U),Y=Math.sqrt(Math.max(0,q/U-V*V)),P.x=B.x+V*j-Y*I,P.y=B.y+V*I+Y*j)):(P.x=B.x+P.r,P.y=B.y)}function C(R,B){var P=R.r+B.r-1e-6,j=B.x-R.x,V=B.y-R.y;return P>0&&P*P>j*j+V*V}function _(R,B){var P=R.length;if(P===0)return 0;var j,V,q,I,Y,Z,U,G,F,K;if(j=R[0],j.x=0,j.y=0,P<=1)return j.r;if(V=R[1],j.x=-V.r,V.x=j.r,V.y=0,P<=2)return j.r+V.r;q=R[2],k(V,j,q),j=new i(null,null,null,null,j),V=new i(null,null,null,null,V),q=new i(null,null,null,null,q),j.next=q.previous=V,V.next=j.previous=q,q.next=V.previous=j;e:for(Z=3;Z<P;++Z){q=R[Z],k(j.wrappedCircle,V.wrappedCircle,q),q=new i(null,null,null,null,q),U=V.next,G=j.previous,F=V.wrappedCircle.r,K=j.wrappedCircle.r;do if(F<=K){if(C(U.wrappedCircle,q.wrappedCircle)){V=U,j.next=V,V.previous=j,--Z;continue e}F+=U.wrappedCircle.r,U=U.next}else{if(C(G.wrappedCircle,q.wrappedCircle)){j=G,j.next=V,V.previous=j,--Z;continue e}K+=G.wrappedCircle.r,G=G.previous}while(U!==G.next);for(q.previous=j,q.next=V,j.next=V.previous=V=q,I=w(j);(q=q.next)!==V;)(Y=w(q))<I&&(j=q,I=Y);V=j.next}j=[V.wrappedCircle],q=V;for(var A=1e4;(q=q.next)!==V&&--A!==0;)j.push(q.wrappedCircle);for(q=x(j,B),Z=0;Z<P;++Z)j=R[Z],j.x-=q.x,j.y-=q.y;return q.r}function T(R,B){var P=0;if(R.hasChildren()){for(var j in R.children){var V=R.children[j];V.hasChildren()&&(V.r=T(V,B))}P=_(Object.values(R.children),B)}return P}function N(R,B){T(R,B);for(var P in R.children){var j=R.children[P];j.applyPositionToChildren()}}function D(R,B,P){if(!t(B))throw new Error("graphology-layout/circlepack: the given graph is not a valid graphology instance.");P=e(P,r);var j={},V={},q=B.nodes(),I=P.center,Y=P.hierarchyAttributes,Z=n.createShuffleInPlace(P.rng),U=P.scale,G=new i;B.forEachNode(function(O,X){var re=X.size?X.size:1,ue=new i(O,null,null,re),ae=G;Y.forEach(function(oe){var Ce=X[oe];ae=ae.getChild(Ce)}),ae.addChild(O,ue)}),N(G,Z),o(B,G,j);var F=q.length,K,A,$;for($=0;$<F;$++){var M=q[$];K=I+U*j[M].x,A=I+U*j[M].y,V[M]={x:K,y:A},R&&(B.setNodeAttribute(M,P.attributes.x,K),B.setNodeAttribute(M,P.attributes.y,A))}return V}var z=D.bind(null,!1);return z.assign=D.bind(null,!0),xm=z,xm}var sU=lU();const uU=fn(sU);function cU(e={}){return kl(uU,e)}var wm,AS;function fU(){if(AS)return wm;AS=1;var e=pu(),t=Wr(),n={dimensions:["x","y"],center:.5,scale:1};function r(o,s,u){if(!t(s))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");u=e(u,n);var f=u.dimensions;if(!Array.isArray(f)||f.length!==2)throw new Error("graphology-layout/random: given dimensions are invalid.");var d=u.center,p=u.scale,m=Math.PI*2,v=(d-.5)*p,g=s.order,w=f[0],x=f[1];function k(T,N){return N[w]=p*Math.cos(T*m/g)+v,N[x]=p*Math.sin(T*m/g)+v,N}var C=0;if(!o){var _={};return s.forEachNode(function(T){_[T]=k(C++,{})}),_}s.updateEachNodeAttributes(function(T,N){return k(C++,N),N},{attributes:f})}var i=r.bind(null,!1);return i.assign=r.bind(null,!0),wm=i,wm}var dU=fU();const hU=fn(dU);function pU(e={}){return kl(hU,e)}var Ls={},RS;function Ey(){if(RS)return Ls;RS=1;function e(r){return typeof r!="number"||isNaN(r)?1:r}function t(r,i){var o={},s=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return s(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f),o}function n(r,i){var o={},s=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(s=i);var u=function(d){return s(d[r])},f=function(){return s(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var m=d.extremities(p);return s(r(p,d.getEdgeAttributes(p),m[0],m[1],d.getNodeAttributes(m[0]),d.getNodeAttributes(m[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,m,v,g,w,x){return s(r(d,p,m,v,g,w,x))},o.fromPartialEntry=function(d,p,m,v){return s(r(d,p,m,v))},o.fromMinimalEntry=function(d,p){return s(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f,o.fromMinimalEntry=f),o}return Ls.createNodeValueGetter=t,Ls.createEdgeValueGetter=n,Ls.createEdgeWeightGetter=function(r){return n(r,e)},Ls}var Sm,DS;function jA(){if(DS)return Sm;DS=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=Ey();return Sm=function(r,i,o){const{nodeXAttribute:s,nodeYAttribute:u}=o,{attraction:f,repulsion:d,gravity:p,inertia:m,maxMove:v}=o.settings;let{shouldSkipNode:g,shouldSkipEdge:w,isNodeFixed:x}=o;x=e(x),g=e(g,!1),w=t(w,!1);const k=r.filterNodes((T,N)=>!g.fromEntry(T,N)),C=k.length;for(let T=0;T<C;T++){const N=k[T],D=r.getNodeAttributes(N),z=i[N];z?i[N]={dx:z.dx*m,dy:z.dy*m,x:D[s]||0,y:D[u]||0}:i[N]={dx:0,dy:0,x:D[s]||0,y:D[u]||0}}if(d)for(let T=0;T<C;T++){const N=k[T],D=i[N];for(let z=T+1;z<C;z++){const R=k[z],B=i[R],P=B.x-D.x,j=B.y-D.y,V=Math.sqrt(P*P+j*j)||1,q=d/V*P,I=d/V*j;D.dx-=q,D.dy-=I,B.dx+=q,B.dy+=I}}if(f&&r.forEachEdge((T,N,D,z,R,B,P)=>{if(D===z||g.fromEntry(D,R)||g.fromEntry(z,B)||w.fromEntry(T,N,D,z,R,B,P))return;const j=i[D],V=i[z],q=V.x-j.x,I=V.y-j.y,Y=Math.sqrt(q*q+I*I)||1,Z=f*Y*q,U=f*Y*I;j.dx+=Z,j.dy+=U,V.dx-=Z,V.dy-=U}),p)for(let T=0;T<C;T++){const N=k[T],D=i[N],{x:z,y:R}=D,B=Math.sqrt(z*z+R*R)||1;i[N].dx-=z*p*B,i[N].dy-=R*p*B}const _=!1;for(let T=0;T<C;T++){const N=k[T],D=i[N],z=Math.sqrt(D.dx*D.dx+D.dy*D.dy);z>v&&(D.dx*=v/z,D.dy*=v/z),x.fromGraph(r,N)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:_}},Sm}var $c={},NS;function MA(){return NS||(NS=1,$c.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:i}=n;e.updateEachNodeAttributes((o,s)=>{const u=t[o];return!u||u.fixed||(s[r]=u.x,s[i]=u.y),s},{attributes:["x","y"]})},$c.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),$c}var Em,OS;function PA(){return OS||(OS=1,Em={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),Em}var _m,LS;function mU(){if(LS)return _m;LS=1;const e=Wr(),t=pu(),n=jA(),r=MA(),i=PA();function o(u,f,d){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,i),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const m={};let v=null,g;for(g=0;g<p&&(v=n(f,m,d),!v.converged);g++);if(u){r.assignLayoutChanges(f,m,d);return}return r.collectLayoutChanges(m)}const s=o.bind(null,!1);return s.assign=o.bind(null,!0),_m=s,_m}var gU=mU();const vU=fn(gU);var km,zS;function yU(){if(zS)return km;zS=1;const e=Wr(),t=pu(),n=jA(),r=MA(),i=PA();function o(s,u){if(!e(s))throw new Error("graphology-layout-force/worker: the given graph is not a valid graphology instance.");u=t(u,i),this.callbacks={},u.onConverged&&(this.callbacks.onConverged=u.onConverged),this.graph=s,this.params=u,this.nodeStates={},this.frameID=null,this.running=!1,this.killed=!1}return o.prototype.isRunning=function(){return this.running},o.prototype.runFrame=function(){let{converged:s}=n(this.graph,this.nodeStates,this.params);r.assignLayoutChanges(this.graph,this.nodeStates,this.params),s=!1,s?(this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop()):this.frameID=window.requestAnimationFrame(()=>this.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},km=o,km}var bU=yU();const xU=fn(bU);function wU(e={maxIterations:100}){return kl(vU,e)}function SU(e={}){return Sy(xU,e)}var Cm,jS;function EU(){if(jS)return Cm;jS=1;var e=0,t=1,n=2,r=3,i=4,o=5,s=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,z=3,R=10,B=3,P=9,j=10;return Cm=function(q,I,Y){var Z,U,G,F,K,A,$,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;G<re;G+=R)I[G+i]=I[G+n],I[G+o]=I[G+r],I[G+n]=0,I[G+r]=0;if(q.outboundAttractionDistribution){for(Ce=0,G=0;G<re;G+=R)Ce+=I[G+s];Ce/=re/R}if(q.barnesHutOptimize){var ce=1/0,Te=-1/0,ge=1/0,Se=-1/0,ie,He,Ge;for(G=0;G<re;G+=R)ce=Math.min(ce,I[G+e]),Te=Math.max(Te,I[G+e]),ge=Math.min(ge,I[G+t]),Se=Math.max(Se,I[G+t]);var ve=Te-ce,Ne=Se-ge;for(ve>Ne?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G<re;G+=R)for(U=0,Ge=z;;)if(ee[U+_]>=0){I[G+e]<ee[U+w]?I[G+t]<ee[U+x]?ie=ee[U+_]:ie=ee[U+_]+P:I[G+t]<ee[U+x]?ie=ee[U+_]+P*2:ie=ee[U+_]+P*3,ee[U+N]=(ee[U+N]*ee[U+T]+I[G+e]*I[G+s])/(ee[U+T]+I[G+s]),ee[U+D]=(ee[U+D]*ee[U+T]+I[G+t]*I[G+s])/(ee[U+T]+I[G+s]),ee[U+T]+=I[G+s],U=ie;continue}else if(ee[U+g]<0){ee[U+g]=G;break}else{if(ee[U+_]=Z*P,M=ee[U+k]/2,O=ee[U+_],ee[O+g]=-1,ee[O+w]=ee[U+w]-M,ee[O+x]=ee[U+x]-M,ee[O+k]=M,ee[O+C]=O+P,ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,O+=P,ee[O+g]=-1,ee[O+w]=ee[U+w]-M,ee[O+x]=ee[U+x]+M,ee[O+k]=M,ee[O+C]=O+P,ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,O+=P,ee[O+g]=-1,ee[O+w]=ee[U+w]+M,ee[O+x]=ee[U+x]-M,ee[O+k]=M,ee[O+C]=O+P,ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,O+=P,ee[O+g]=-1,ee[O+w]=ee[U+w]+M,ee[O+x]=ee[U+x]+M,ee[O+k]=M,ee[O+C]=ee[U+C],ee[O+_]=-1,ee[O+T]=0,ee[O+N]=0,ee[O+D]=0,Z+=4,I[ee[U+g]+e]<ee[U+w]?I[ee[U+g]+t]<ee[U+x]?ie=ee[U+_]:ie=ee[U+_]+P:I[ee[U+g]+t]<ee[U+x]?ie=ee[U+_]+P*2:ie=ee[U+_]+P*3,ee[U+T]=I[ee[U+g]+s],ee[U+N]=I[ee[U+g]+e],ee[U+D]=I[ee[U+g]+t],ee[ie+g]=ee[U+g],ee[U+g]=-1,I[G+e]<ee[U+w]?I[G+t]<ee[U+x]?He=ee[U+_]:He=ee[U+_]+P:I[G+t]<ee[U+x]?He=ee[U+_]+P*2:He=ee[U+_]+P*3,ie===He)if(Ge--){U=ie;continue}else{Ge=z;break}ee[He+g]=G;break}}if(q.barnesHutOptimize)for(he=q.scalingRatio,G=0;G<re;G+=R)for(U=0;;)if(ee[U+_]>=0)if(Ae=Math.pow(I[G+e]-ee[U+N],2)+Math.pow(I[G+t]-ee[U+D],2),X=ee[U+k],4*X*X/Ae<oe){if(Ee=I[G+e]-ee[U+N],we=I[G+t]-ee[U+D],ae===!0?Ae>0?(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*ee[U+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*ee[U+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),U=ee[U+C],U<0)break;continue}else{U=ee[U+_];continue}else{if(A=ee[U+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+s]*I[A+s]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+s]*I[A+s]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),U=ee[U+C],U<0)break;continue}else for(he=q.scalingRatio,F=0;F<re;F+=R)for(K=0;K<F;K+=R)Ee=I[F+e]-I[K+e],we=I[F+t]-I[K+t],ae===!0?(Ae=Math.sqrt(Ee*Ee+we*we)-I[F+f]-I[K+f],Ae>0?(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+s]*I[K+s],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+s]*I[K+s]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G<re;G+=R)xe=0,Ee=I[G+e],we=I[G+t],Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.strongGravityMode?Ae>0&&(xe=he*I[G+s]*O):Ae>0&&(xe=he*I[G+s]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),$=0;$<ue;$+=B)F=Y[$+p],K=Y[$+m],M=Y[$+v],Pe=Math.pow(M,q.edgeWeightInfluence),Ee=I[F+e]-I[K+e],we=I[F+t]-I[K+t],ae===!0?(Ae=Math.sqrt(Ee*Ee+we*we)-I[F+f]-I[K+f],q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+s]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+s]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+s]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,$e,Ye,vt;if(ae===!0)for(G=0;G<re;G+=R)I[G+d]!==1&&(te=Math.sqrt(Math.pow(I[G+n],2)+Math.pow(I[G+r],2)),te>j&&(I[G+n]=I[G+n]*j/te,I[G+r]=I[G+r]*j/te),de=I[G+s]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,$e=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*($e/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*($e/q.slowDown),I[G+t]=vt);else for(G=0;G<re;G+=R)I[G+d]!==1&&(de=I[G+s]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,$e=I[G+u]*Math.log(1+Oe)/(1+Math.sqrt(de)),I[G+u]=Math.min(1,Math.sqrt($e*(Math.pow(I[G+n],2)+Math.pow(I[G+r],2))/(1+Math.sqrt(de)))),Ye=I[G+e]+I[G+n]*($e/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*($e/q.slowDown),I[G+t]=vt);return{}},Cm}var vi={},MS;function FA(){if(MS)return vi;MS=1;var e=10,t=3;return vi.assign=function(n){n=n||{};var r=Array.prototype.slice.call(arguments).slice(1),i,o,s;for(i=0,s=r.length;i<s;i++)if(r[i])for(o in r[i])n[o]=r[i][o];return n},vi.validateSettings=function(n){return"linLogMode"in n&&typeof n.linLogMode!="boolean"?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in n&&typeof n.outboundAttractionDistribution!="boolean"?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in n&&typeof n.adjustSizes!="boolean"?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in n&&typeof n.edgeWeightInfluence!="number"?{message:"the `edgeWeightInfluence` setting should be a number."}:"scalingRatio"in n&&!(typeof n.scalingRatio=="number"&&n.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,s={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){s[p]=u,f[u]=m.x,f[u+1]=m.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=s[v],_=s[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(s,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(s,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,s){r[i]=s.x,r[i+1]=s.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),s={},u=0,f=0,d=r.length;u<d;u+=e){if(i){var p=Object.assign({},n.getNodeAttributes(o[f]));p.x=r[u],p.y=r[u+1],p=i(o[f],p),s[o[f]]={x:p.x,y:p.y}}else s[o[f]]={x:r[u],y:r[u+1]};f++}return s},vi.createWorker=function(r){var i=window.URL||window.webkitURL,o=r.toString(),s=i.createObjectURL(new Blob(["("+o+").call(this);"],{type:"text/javascript"})),u=new Worker(s);return i.revokeObjectURL(s),u},vi}var Tm,PS;function IA(){return PS||(PS=1,Tm={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}),Tm}var Am,FS;function _U(){if(FS)return Am;FS=1;var e=Wr(),t=Ey().createEdgeWeightGetter,n=EU(),r=FA(),i=IA();function o(f,d,p){if(!e(d))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");typeof p=="number"&&(p={iterations:p});var m=p.iterations;if(typeof m!="number")throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(m<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var v=t("getEdgeWeight"in p?p.getEdgeWeight:"weight").fromEntry,g=typeof p.outputReducer=="function"?p.outputReducer:null,w=r.assign({},i,p.settings),x=r.validateSettings(w);if(x)throw new Error("graphology-layout-forceatlas2: "+x.message);var k=r.graphToByteArrays(d,v),C;for(C=0;C<m;C++)n(w,k.nodes,k.edges);if(f){r.assignLayoutChanges(d,k.nodes,g);return}return r.collectLayoutChanges(d,k.nodes)}function s(f){var d=typeof f=="number"?f:f.order;return{barnesHutOptimize:d>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=s,Am=u,Am}var kU=_U();const CU=fn(kU);var Rm,IS;function TU(){return IS||(IS=1,Rm=function(){var t,n,r={};(function(){var o=0,s=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,z=4,R=5,B=6,P=7,j=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,$,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;M<he;M+=q)F[M+d]=F[M+u],F[M+p]=F[M+f],F[M+u]=0,F[M+f]=0;if(G.outboundAttractionDistribution){for(Ae=0,M=0;M<he;M+=q)Ae+=F[M+m];Ae/=he/q}if(G.barnesHutOptimize){var He=1/0,Ge=-1/0,ve=1/0,Ne=-1/0,te,de,Oe;for(M=0;M<he;M+=q)He=Math.min(He,F[M+o]),Ge=Math.max(Ge,F[M+o]),ve=Math.min(ve,F[M+s]),Ne=Math.max(Ne,F[M+s]);var $e=Ge-He,Ye=Ne-ve;for($e>Ye?(ve-=($e-Ye)/2,Ne=ve+$e):(He-=(Ye-$e)/2,Ge=He+Ye),ie[0+_]=-1,ie[0+T]=(He+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-He,Ne-ve),ie[0+z]=-1,ie[0+R]=-1,ie[0+B]=0,ie[0+P]=0,ie[0+j]=0,A=1,M=0;M<he;M+=q)for($=0,Oe=V;;)if(ie[$+R]>=0){F[M+o]<ie[$+T]?F[M+s]<ie[$+N]?te=ie[$+R]:te=ie[$+R]+Y:F[M+s]<ie[$+N]?te=ie[$+R]+Y*2:te=ie[$+R]+Y*3,ie[$+P]=(ie[$+P]*ie[$+B]+F[M+o]*F[M+m])/(ie[$+B]+F[M+m]),ie[$+j]=(ie[$+j]*ie[$+B]+F[M+s]*F[M+m])/(ie[$+B]+F[M+m]),ie[$+B]+=F[M+m],$=te;continue}else if(ie[$+_]<0){ie[$+_]=M;break}else{if(ie[$+R]=A*Y,ae=ie[$+D]/2,oe=ie[$+R],ie[oe+_]=-1,ie[oe+T]=ie[$+T]-ae,ie[oe+N]=ie[$+N]-ae,ie[oe+D]=ae,ie[oe+z]=oe+Y,ie[oe+R]=-1,ie[oe+B]=0,ie[oe+P]=0,ie[oe+j]=0,oe+=Y,ie[oe+_]=-1,ie[oe+T]=ie[$+T]-ae,ie[oe+N]=ie[$+N]+ae,ie[oe+D]=ae,ie[oe+z]=oe+Y,ie[oe+R]=-1,ie[oe+B]=0,ie[oe+P]=0,ie[oe+j]=0,oe+=Y,ie[oe+_]=-1,ie[oe+T]=ie[$+T]+ae,ie[oe+N]=ie[$+N]-ae,ie[oe+D]=ae,ie[oe+z]=oe+Y,ie[oe+R]=-1,ie[oe+B]=0,ie[oe+P]=0,ie[oe+j]=0,oe+=Y,ie[oe+_]=-1,ie[oe+T]=ie[$+T]+ae,ie[oe+N]=ie[$+N]+ae,ie[oe+D]=ae,ie[oe+z]=ie[$+z],ie[oe+R]=-1,ie[oe+B]=0,ie[oe+P]=0,ie[oe+j]=0,A+=4,F[ie[$+_]+o]<ie[$+T]?F[ie[$+_]+s]<ie[$+N]?te=ie[$+R]:te=ie[$+R]+Y:F[ie[$+_]+s]<ie[$+N]?te=ie[$+R]+Y*2:te=ie[$+R]+Y*3,ie[$+B]=F[ie[$+_]+m],ie[$+P]=F[ie[$+_]+o],ie[$+j]=F[ie[$+_]+s],ie[te+_]=ie[$+_],ie[$+_]=-1,F[M+o]<ie[$+T]?F[M+s]<ie[$+N]?de=ie[$+R]:de=ie[$+R]+Y:F[M+s]<ie[$+N]?de=ie[$+R]+Y*2:de=ie[$+R]+Y*3,te===de)if(Oe--){$=te;continue}else{Oe=V;break}ie[de+_]=M;break}}if(G.barnesHutOptimize)for(xe=G.scalingRatio,M=0;M<he;M+=q)for($=0;;)if(ie[$+R]>=0)if(ge=Math.pow(F[M+o]-ie[$+P],2)+Math.pow(F[M+s]-ie[$+j],2),Ce=ie[$+D],4*Ce*Ce/ge<Pe){if(ee=F[M+o]-ie[$+P],ce=F[M+s]-ie[$+j],we===!0?ge>0?(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[$+B]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[$+B]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),$=ie[$+z],$<0)break;continue}else{$=ie[$+R];continue}else{if(re=ie[$+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+s]-F[re+s],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),$=ie[$+z],$<0)break;continue}else for(xe=G.scalingRatio,O=0;O<he;O+=q)for(X=0;X<O;X+=q)ee=F[O+o]-F[X+o],ce=F[O+s]-F[X+s],we===!0?(ge=Math.sqrt(ee*ee+ce*ce)-F[O+g]-F[X+g],ge>0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M<he;M+=q)Se=0,ee=F[M+o],ce=F[M+s],ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.strongGravityMode?ge>0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue<Ee;ue+=I)O=K[ue+x],X=K[ue+k],ae=K[ue+C],Te=Math.pow(ae,G.edgeWeightInfluence),ee=F[O+o]-F[X+o],ce=F[O+s]-F[X+s],we===!0?(ge=Math.sqrt(ee*ee+ce*ce)-F[O+g]-F[X+g],G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;M<he;M+=q)F[M+w]!==1&&(vt=Math.sqrt(Math.pow(F[M+u],2)+Math.pow(F[M+f],2)),vt>Z&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+s]+F[M+f]*(rt/G.slowDown),F[M+s]=at);else for(M=0;M<he;M+=q)F[M+w]!==1&&(Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=F[M+v]*Math.log(1+bt)/(1+Math.sqrt(Mt)),F[M+v]=Math.min(1,Math.sqrt(rt*(Math.pow(F[M+u],2)+Math.pow(F[M+f],2))/(1+Math.sqrt(Mt)))),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+s]+F[M+f]*(rt/G.slowDown),F[M+s]=at);return{}}})();var i=r.exports;self.addEventListener("message",function(o){var s=o.data;t=new Float32Array(s.nodes),s.edges&&(n=new Float32Array(s.edges)),i(s.settings,t,n),self.postMessage({nodes:t.buffer},[t.buffer])})}),Rm}var Dm,GS;function AU(){if(GS)return Dm;GS=1;var e=TU(),t=Wr(),n=Ey().createEdgeWeightGetter,r=FA(),i=IA();function o(s,u){if(u=u||{},!t(s))throw new Error("graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.");var f=n("getEdgeWeight"in u?u.getEdgeWeight:"weight").fromEntry,d=r.assign({},i,u.settings),p=r.validateSettings(d);if(p)throw new Error("graphology-layout-forceatlas2/worker: "+p.message);this.worker=null,this.graph=s,this.settings=d,this.getEdgeWeight=f,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof u.outputReducer=="function"?u.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var m=void 0,v=this;this.handleGraphUpdate=function(){v.worker&&v.worker.terminate(),m&&clearTimeout(m),m=setTimeout(function(){m=void 0,v.spawnWorker()},0)},s.on("nodeAdded",this.handleGraphUpdate),s.on("edgeAdded",this.handleGraphUpdate),s.on("nodeDropped",this.handleGraphUpdate),s.on("edgeDropped",this.handleGraphUpdate),this.spawnWorker()}return o.prototype.isRunning=function(){return this.running},o.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=r.createWorker(e),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},o.prototype.handleMessage=function(s){if(this.running){var u=new Float32Array(s.data.nodes);r.assignLayoutChanges(this.graph,u,this.outputReducer),this.outputReducer&&r.readGraphPositions(this.graph,u),this.matrices.nodes=u,this.askForIterations()}},o.prototype.askForIterations=function(s){var u=this.matrices,f={settings:this.settings,nodes:u.nodes.buffer},d=[u.nodes.buffer];return s&&(f.edges=u.edges.buffer,d.push(u.edges.buffer)),this.worker.postMessage(f,d),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-forceatlas2/worker.start: layout was killed.");return this.running?this:(this.matrices=r.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0),this)},o.prototype.stop=function(){return this.running=!1,this},o.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)},Dm=o,Dm}var RU=AU();const DU=fn(RU);function GA(e={iterations:100}){return kl(CU,e)}function NU(e={}){return Sy(DU,e)}var Nm,BS;function OU(){if(BS)return Nm;BS=1;var e=0,t=1,n=2,r=3;function i(s,u){return s+"§"+u}function o(){return .01*(.5-Math.random())}return Nm=function(u,f){var d=u.margin,p=u.ratio,m=u.expansion,v=u.gridSize,g=u.speed,w,x,k,C,_,T,N=!0,D=f.length,z=D/r|0,R=new Float32Array(z),B=new Float32Array(z),P=1/0,j=1/0,V=-1/0,q=-1/0;for(w=0;w<D;w+=r)k=f[w+e],C=f[w+t],T=f[w+n]*p+d,P=Math.min(P,k-T),V=Math.max(V,k+T),j=Math.min(j,C-T),q=Math.max(q,C+T);var I=V-P,Y=q-j,Z=(P+V)/2,U=(j+q)/2;P=Z-m*I/2,V=Z+m*I/2,j=U-m*Y/2,q=U+m*Y/2;var G=new Array(v*v),F=G.length,K;for(K=0;K<F;K++)G[K]=[];var A,$,M,O,X,re,ue,ae,oe,Ce;for(w=0;w<D;w+=r)for(k=f[w+e],C=f[w+t],T=f[w+n]*p+d,A=k-T,$=k+T,M=C-T,O=C+T,X=Math.floor(v*(A-P)/(V-P)),re=Math.floor(v*($-P)/(V-P)),ue=Math.floor(v*(M-j)/(q-j)),ae=Math.floor(v*(O-j)/(q-j)),oe=X;oe<=re;oe++)for(Ce=ue;Ce<=ae;Ce++)G[oe*v+Ce].push(w);var he,Ee=new Set,we,Pe,Ae,xe,ee,ce,Te,ge,Se,ie,He,Ge,ve;for(K=0;K<F;K++)for(he=G[K],w=0,_=he.length;w<_;w++)for(we=he[w],Ae=f[we+e],ee=f[we+t],Te=f[we+n],x=w+1;x<_;x++)Pe=he[x],Se=i(we,Pe),!(F>1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,He=ce-ee,Ge=Math.sqrt(ie*ie+He*He),ve=Ge<Te*p+d+(ge*p+d),ve&&(N=!1,Pe=Pe/r|0,Ge>0?(R[Pe]+=ie/Ge*(1+Te),B[Pe]+=He/Ge*(1+Te)):(R[Pe]+=I*o(),B[Pe]+=Y*o())));for(w=0,x=0;w<D;w+=r,x++)f[w+e]+=R[x]*.1*g,f[w+t]+=B[x]*.1*g;return{converged:N}},Nm}var Ba={},US;function BA(){if(US)return Ba;US=1;var e=3;return Ba.validateSettings=function(t){return"gridSize"in t&&typeof t.gridSize!="number"||t.gridSize<=0?{message:"the `gridSize` setting should be a positive number."}:"margin"in t&&typeof t.margin!="number"||t.margin<0?{message:"the `margin` setting should be 0 or a positive number."}:"expansion"in t&&typeof t.expansion!="number"||t.expansion<=0?{message:"the `expansion` setting should be a positive number."}:"ratio"in t&&typeof t.ratio!="number"||t.ratio<=0?{message:"the `ratio` setting should be a positive number."}:"speed"in t&&typeof t.speed!="number"||t.speed<=0?{message:"the `speed` setting should be a positive number."}:null},Ba.graphToByteArray=function(t,n){var r=t.order,i=new Float32Array(r*e),o=0;return t.forEachNode(function(s,u){typeof n=="function"&&(u=n(s,u)),i[o]=u.x,i[o+1]=u.y,i[o+2]=u.size||1,o+=e}),i},Ba.assignLayoutChanges=function(t,n,r){var i=0;t.forEachNode(function(o){var s={x:n[i],y:n[i+1]};typeof r=="function"&&(s=r(o,s)),t.mergeNodeAttributes(o,s),i+=e})},Ba.collectLayoutChanges=function(t,n,r){var i={},o=0;return t.forEachNode(function(s){var u={x:n[o],y:n[o+1]};typeof r=="function"&&(u=r(s,u)),i[s]=u,o+=e}),i},Ba.createWorker=function(n){var r=window.URL||window.webkitURL,i=n.toString(),o=r.createObjectURL(new Blob(["("+i+").call(this);"],{type:"text/javascript"})),s=new Worker(o);return r.revokeObjectURL(o),s},Ba}var Om,HS;function UA(){return HS||(HS=1,Om={gridSize:20,margin:5,expansion:1.1,ratio:1,speed:3}),Om}var Lm,$S;function LU(){if($S)return Lm;$S=1;var e=Wr(),t=OU(),n=BA(),r=UA(),i=500;function o(u,f,d){if(!e(f))throw new Error("graphology-layout-noverlap: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};var p=d.maxIterations||i;if(typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");var m=Object.assign({},r,d.settings),v=n.validateSettings(m);if(v)throw new Error("graphology-layout-noverlap: "+v.message);var g=n.graphToByteArray(f,d.inputReducer),w=!1,x;for(x=0;x<p&&!w;x++)w=t(m,g).converged;if(u){n.assignLayoutChanges(f,g,d.outputReducer);return}return n.collectLayoutChanges(f,g,d.outputReducer)}var s=o.bind(null,!1);return s.assign=o.bind(null,!0),Lm=s,Lm}var zU=LU();const jU=fn(zU);var zm,VS;function MU(){return VS||(VS=1,zm=function(){var t,n={};(function(){var i=0,o=1,s=2,u=3;function f(p,m){return p+"§"+m}function d(){return .01*(.5-Math.random())}n.exports=function(m,v){var g=m.margin,w=m.ratio,x=m.expansion,k=m.gridSize,C=m.speed,_,T,N,D,z,R,B=!0,P=v.length,j=P/u|0,V=new Float32Array(j),q=new Float32Array(j),I=1/0,Y=1/0,Z=-1/0,U=-1/0;for(_=0;_<P;_+=u)N=v[_+i],D=v[_+o],R=v[_+s]*w+g,I=Math.min(I,N-R),Z=Math.max(Z,N+R),Y=Math.min(Y,D-R),U=Math.max(U,D+R);var G=Z-I,F=U-Y,K=(I+Z)/2,A=(Y+U)/2;I=K-x*G/2,Z=K+x*G/2,Y=A-x*F/2,U=A+x*F/2;var $=new Array(k*k),M=$.length,O;for(O=0;O<M;O++)$[O]=[];var X,re,ue,ae,oe,Ce,he,Ee,we,Pe;for(_=0;_<P;_+=u)for(N=v[_+i],D=v[_+o],R=v[_+s]*w+g,X=N-R,re=N+R,ue=D-R,ae=D+R,oe=Math.floor(k*(X-I)/(Z-I)),Ce=Math.floor(k*(re-I)/(Z-I)),he=Math.floor(k*(ue-Y)/(U-Y)),Ee=Math.floor(k*(ae-Y)/(U-Y)),we=oe;we<=Ce;we++)for(Pe=he;Pe<=Ee;Pe++)$[we*k+Pe].push(_);var Ae,xe=new Set,ee,ce,Te,ge,Se,ie,He,Ge,ve,Ne,te,de,Oe;for(O=0;O<M;O++)for(Ae=$[O],_=0,z=Ae.length;_<z;_++)for(ee=Ae[_],Te=v[ee+i],Se=v[ee+o],He=v[ee+s],T=_+1;T<z;T++)ce=Ae[T],ve=f(ee,ce),!(M>1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+s],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de<He*w+g+(Ge*w+g),Oe&&(B=!1,ce=ce/u|0,de>0?(V[ce]+=Ne/de*(1+He),q[ce]+=te/de*(1+He)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_<P;_+=u,T++)v[_+i]+=V[T]*.1*C,v[_+o]+=q[T]*.1*C;return{converged:B}}})();var r=n.exports;self.addEventListener("message",function(i){var o=i.data;t=new Float32Array(o.nodes);var s=r(o.settings,t);self.postMessage({result:s,nodes:t.buffer},[t.buffer])})}),zm}var jm,qS;function PU(){if(qS)return jm;qS=1;var e=MU(),t=Wr(),n=BA(),r=UA();function i(o,s){if(s=s||{},!t(o))throw new Error("graphology-layout-noverlap/worker: the given graph is not a valid graphology instance.");var u=Object.assign({},r,s.settings),f=n.validateSettings(u);if(f)throw new Error("graphology-layout-noverlap/worker: "+f.message);this.worker=null,this.graph=o,this.settings=u,this.matrices=null,this.running=!1,this.killed=!1,this.inputReducer=s.inputReducer,this.outputReducer=s.outputReducer,this.callbacks={onConverged:typeof s.onConverged=="function"?s.onConverged:null},this.handleMessage=this.handleMessage.bind(this);var d=!1,p=this;this.handleAddition=function(){d||(d=!0,p.spawnWorker(),setTimeout(function(){d=!1},0))},o.on("nodeAdded",this.handleAddition),o.on("edgeAdded",this.handleAddition),this.spawnWorker()}return i.prototype.isRunning=function(){return this.running},i.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=n.createWorker(e),this.worker.addEventListener("message",this.handleMessage),this.running&&(this.running=!1,this.start())},i.prototype.handleMessage=function(o){if(this.running){var s=new Float32Array(o.data.nodes);if(n.assignLayoutChanges(this.graph,s,this.outputReducer),this.matrices.nodes=s,o.data.result.converged){this.callbacks.onConverged&&this.callbacks.onConverged(),this.stop();return}this.askForIterations()}},i.prototype.askForIterations=function(){var o=this.matrices,s={settings:this.settings,nodes:o.nodes.buffer},u=[o.nodes.buffer];return this.worker.postMessage(s,u),this},i.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-noverlap/worker.start: layout was killed.");return this.running?this:(this.matrices={nodes:n.graphToByteArray(this.graph,this.inputReducer)},this.running=!0,this.askForIterations(),this)},i.prototype.stop=function(){return this.running=!1,this},i.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)},jm=i,jm}var FU=PU();const IU=fn(FU);function GU(e={}){return kl(jU,e)}function BU(e={}){return Sy(IU,e)}var Mm,YS;function UU(){if(YS)return Mm;YS=1;var e=pu(),t=Wr(),n={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function r(o,s,u){if(!t(s))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");u=e(u,n);var f=u.dimensions;if(!Array.isArray(f)||f.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var d=f.length,p=u.center,m=u.rng,v=u.scale,g=(p-.5)*v;function w(k){for(var C=0;C<d;C++)k[f[C]]=m()*v+g;return k}if(!o){var x={};return s.forEachNode(function(k){x[k]=w({})}),x}s.updateEachNodeAttributes(function(k,C){return w(C),C},{attributes:f})}var i=r.bind(null,!1);return i.assign=r.bind(null,!0),Mm=i,Mm}var HU=UU();const $U=fn(HU);function VU(e={}){return kl($U,e)}var WS=1,qU=.9,YU=.8,WU=.17,Pm=.1,Fm=.999,XU=.9999,KU=.99,ZU=/[\\\/_+.#"@\[\(\{&]/,QU=/[\\\/_+.#"@\[\(\{&]/g,JU=/[\s-]/,HA=/[\s-]/g;function Xg(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?WS:KU;var u=`${i},${o}`;if(s[u]!==void 0)return s[u];for(var f=r.charAt(o),d=n.indexOf(f,i),p=0,m,v,g,w;d>=0;)m=Xg(e,t,n,r,d+1,o+1,s),m>p&&(d===i?m*=WS:ZU.test(e.charAt(d-1))?(m*=YU,g=e.slice(i,d-1).match(QU),g&&i>0&&(m*=Math.pow(Fm,g.length))):JU.test(e.charAt(d-1))?(m*=qU,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Fm,w.length))):(m*=WU,i>0&&(m*=Math.pow(Fm,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=XU)),(m<Pm&&n.charAt(d-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(d-1)!==r.charAt(o))&&(v=Xg(e,t,n,r,d+1,o+2,s),v*Pm>m&&(m=v*Pm)),m>p&&(p=m),d=n.indexOf(f,d+1);return s[u]=p,p}function XS(e){return e.toLowerCase().replace(HA," ")}function e6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Xg(e,t,XS(e),XS(t),0,0,{})}var Im={exports:{}},Gm={};/**
|
||
* @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 KS;function t6(){if(KS)return Gm;KS=1;var e=$f();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),s(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Gm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Gm}var ZS;function n6(){return ZS||(ZS=1,Im.exports=t6()),Im.exports}var r6=n6(),zs='[cmdk-group=""]',Bm='[cmdk-group-items=""]',i6='[cmdk-group-heading=""]',_y='[cmdk-item=""]',QS=`${_y}:not([aria-disabled="true"])`,Kg="cmdk-item-select",Ha="data-value",a6=(e,t,n)=>e6(e,t,n),$A=E.createContext(void 0),mu=()=>E.useContext($A),VA=E.createContext(void 0),ky=()=>E.useContext(VA),qA=E.createContext(void 0),YA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),s=Qo(()=>new Set),u=WA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),z=g6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{z(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(s.current.add(M),()=>s.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),j(),z(1,V);else if(M==="value"&&(X||z(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{s.current.forEach(M=>M())}}),[]),B=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),z(2,()=>{j(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),z(3,()=>{q(),j(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();z(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:a6;return M?ue(M,n.current.search,O):0}function j(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${zs}[${Ha}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute(Ha);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(zs))==null?void 0:O.querySelector(i6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${_y}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(QS))||[])}function U(M){let O=Z()[M];O&&R.setState("value",O.getAttribute(Ha))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute(Ha))}function F(M){let O=Y(),X=O==null?void 0:O.closest(zs),re;for(;X&&!re;)X=M>0?p6(X,zs):m6(X,zs),re=X==null?void 0:X.querySelector(QS);re?R.setState("value",re.getAttribute(Ha)):G(M)}let K=()=>U(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},$=M=>{M.preventDefault(),M.metaKey?U(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&$(M);break}case"ArrowUp":{$(M);break}case"Home":{M.preventDefault(),U(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Kg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:y6},f),vd(e,M=>E.createElement(VA.Provider,{value:R},E.createElement($A.Provider,{value:B},M))))}),o6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),s=E.useContext(qA),u=mu(),f=WA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Qa(()=>{if(!d)return u.item(i,s==null?void 0:s.id)},[d]);let p=XA(i,o,[e.value,e.children,o],e.keywords),m=ky(),v=Ja(z=>z.value&&z.value===p.current),g=Ja(z=>d||u.filter()===!1?!0:z.search?z.filtered.items.get(i)>0:!0);E.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(Kg,w),()=>z.removeEventListener(Kg,w)},[g,e.onSelect,e.disabled]);function w(){var z,R;x(),(R=(z=f.current).onSelect)==null||R.call(z,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xs([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(s):!0);Qa(()=>p.group(s),[]),XA(s,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:s,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xs([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),vd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(qA.Provider,{value:v},g))))}),s6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(s=>!s.search);return!n&&!o?null:E.createElement(We.div,{ref:Xs([i,t]),...r,"cmdk-separator":"",role:"separator"})}),u6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=ky(),s=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${_y}[${Ha}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:s,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),c6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),s=E.useRef(null),u=mu();return E.useEffect(()=>{if(s.current&&o.current){let f=s.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xs([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},vd(e,f=>E.createElement("div",{ref:Xs([s,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),f6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...u}=e;return E.createElement(Uv,{open:n,onOpenChange:r},E.createElement(Hv,{container:s},E.createElement(td,{"cmdk-overlay":"",className:i}),E.createElement(nd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(YA,{ref:t,...u}))))}),d6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),h6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},vd(e,s=>E.createElement("div",{"aria-hidden":!0},s)))}),In=Object.assign(YA,{List:c6,Item:o6,Input:u6,Group:l6,Separator:s6,Dialog:f6,Empty:d6,Loading:h6});function p6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function m6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xs(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=ky(),n=()=>e(t.snapshot());return r6.useSyncExternalStore(t.subscribe,n,n)}function XA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var s;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(s=t.current)==null||s.setAttribute(Ha,u),i.current=u}),i}var g6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function v6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function vd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(v6(t),{ref:t.ref},n(t.props.children)):n(t)}var y6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const KA=Uv,ZA=eC,b6=Hv,QA=E.forwardRef(({className:e,...t},n)=>S.jsx(td,{ref:n,className:Me("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",e),...t}));QA.displayName=td.displayName;const Cy=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(b6,{children:[S.jsx(QA,{}),S.jsxs(nd,{ref:r,className:Me("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-top-[48%] 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",e),...n,children:[t,S.jsxs(qv,{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:[S.jsx(Ek,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Cy.displayName=nd.displayName;const Ty=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ty.displayName="DialogHeader";const Ay=E.forwardRef(({className:e,...t},n)=>S.jsx($v,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ay.displayName=$v.displayName;const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Ry.displayName=Vv.displayName;const yd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));yd.displayName=In.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(XM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("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",e),...t})]}));Dy.displayName=In.Input.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));bd.displayName=In.List.displayName;const Ny=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Ny.displayName=In.Empty.displayName;const Cl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className:Me("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",e),...t}));Cl.displayName=In.Group.displayName;const x6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));x6.displayName=In.Separator.displayName;const Tl=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("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",e),...t}));Tl.displayName=In.Item.displayName;const w6=({layout:e,autoRunFor:t})=>{const n=pr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let s=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),s=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),s&&clearTimeout(s)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:Hr,children:o?S.jsx(HM,{}):S.jsx(VM,{})})},S6=()=>{const e=pr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=pU(),s=cU(),u=VU(),f=GU({settings:{margin:1}}),d=wU({maxIterations:20}),p=GA({iterations:20}),m=BU(),v=SU(),g=NU(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:s},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[s,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;RG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(w6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(fd,{open:r,onOpenChange:i,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:Hr,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(OM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(yd,{children:S.jsx(bd,{children:S.jsx(Cl,{children:Object.keys(w).map(k=>S.jsx(Tl,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},E6=cf.exports,JS;function _6(){return JS||(JS=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function s(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m<p.length;m++){f+=p.charCodeAt(m);var v=.02519603282416938*f;f=v>>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})(E6,e)}(cf)),cf.exports}var ff={exports:{}},k6=ff.exports,eE;function C6(){return eE||(eE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p<d.length+64;p++)f.x^=d.charCodeAt(p)|0,f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor128=s})(k6,e)}(ff)),ff.exports}var df={exports:{}},T6=df.exports,tE;function A6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p<d.length+64;p++)f.x^=d.charCodeAt(p)|0,p==d.length&&(f.d=f.x<<10^f.x>>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorwow=s})(T6,e)}(df)),df.exports}var hf={exports:{}},R6=hf.exports,nE;function D6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v<m.length;++v)g[v&7]=g[v&7]<<15^m.charCodeAt(v)+g[v+1&7]<<13;for(;g.length<8;)g.push(0);for(v=0;v<8&&g[v]===0;++v);for(v==8?g[7]=-1:g[v],p.x=g,p.i=0,v=256;v>0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xorshift7=s})(R6,e)}(hf)),hf.exports}var pf={exports:{}},N6=pf.exports,rE;function O6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function s(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.xor4096=s})(N6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,iE;function z6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p<d.length+20;p++)f.b^=d.charCodeAt(p)|0,f.next()}function o(u,f){return f.a=u.a,f.b=u.b,f.c=u.c,f.d=u.d,f}function s(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=s:this.tychei=s})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const j6={},M6=Object.freeze(Object.defineProperty({__proto__:null,default:j6},Symbol.toStringTag,{value:"Module"})),P6=lL(M6);var F6=gf.exports,aE;function I6(){return aE||(aE=1,function(e){(function(t,n,r){var i=256,o=6,s=52,u="random",f=r.pow(i,o),d=r.pow(2,s),p=d*2,m=i-1,v;function g(N,D,z){var R=[];D=D==!0?{entropy:!0}:D||{};var B=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),j=function(){for(var V=P.g(o),q=f,I=0;V<d;)V=(V+I)*i,q*=i,I=P.g(1);for(;V>=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return j.int32=function(){return P.g(4)|0},j.quick=function(){return P.g(4)/4294967296},j.double=j,C(T(P.S),n),(D.pass||z||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(j,B,"global"in D?D.global:this==r,D.state)}function w(N){var D,z=N.length,R=this,B=0,P=R.i=R.j=0,j=R.S=[];for(z||(N=[z++]);B<i;)j[B]=B++;for(B=0;B<i;B++)j[B]=j[P=m&P+N[B%z]+(D=j[B])],j[P]=D;(R.g=function(V){for(var q,I=0,Y=R.i,Z=R.j,U=R.S;V--;)q=U[Y=m&Y+1],I=I*i+U[m&(U[Y]=U[Z=m&Z+q])+(U[Z]=q)];return R.i=Y,R.j=Z,I})(i)}function x(N,D){return D.i=N.i,D.j=N.j,D.S=N.S.slice(),D}function k(N,D){var z=[],R=typeof N,B;if(D&&R=="object")for(B in N)try{z.push(k(N[B],D-1))}catch{}return z.length?z:R=="string"?N:N+"\0"}function C(N,D){for(var z=N+"",R,B=0;B<z.length;)D[m&B]=m&(R^=D[m&B]*19)+z.charCodeAt(B++);return T(D)}function _(){try{var N;return v&&(N=v.randomBytes)?N=N(i):(N=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(N)),T(N)}catch{var D=t.navigator,z=D&&D.plugins;return[+new Date,t,z,t.screen,T(n)]}}function T(N){return String.fromCharCode.apply(0,N)}if(C(r.random(),n),e.exports){e.exports=g;try{v=P6}catch{}}else r["seed"+u]=g})(typeof self<"u"?self:F6,[],Math)}(gf)),gf.exports}var Um,oE;function G6(){if(oE)return Um;oE=1;var e=_6(),t=C6(),n=A6(),r=D6(),i=O6(),o=z6(),s=I6();return s.alea=e,s.xor128=t,s.xorwow=n,s.xorshift7=r,s.xor4096=i,s.tychei=o,Um=s,Um}var B6=G6();const U6=fn(B6),H6=e=>{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},$6=async e=>{let t=null;try{t=await nM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f<t.nodes.length;f++){const d=t.nodes[f];r[d.id]=f,U6(d.id,{global:!0}),d.color=fz(),d.x=Math.random(),d.y=Math.random(),d.degree=0,d.size=10}for(let f=0;f<t.edges.length;f++){const d=t.edges[f];i[d.id]=f;const p=r[d.source],m=r[d.target];if(p!==void 0&&p!==void 0){const v=t.nodes[p],g=t.nodes[m];if(!v){console.error(`Source node ${d.source} is undefined`);continue}if(!g){console.error(`Target node ${d.target} is undefined`);continue}v.degree+=1,g.degree+=1}}let o=Number.MAX_SAFE_INTEGER,s=0;for(const f of t.nodes)o=Math.min(o,f.degree),s=Math.max(s,f.degree);const u=s-o;if(u>0){const f=bz-Qw;for(const d of t.nodes)d.size=Math.round(Qw+f*Math.pow((d.degree-o)/u,.5))}n=new nU,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},V6=e=>{const t=new Ws;for(const n of(e==null?void 0:e.nodes)??[])t.addNode(n.id,{label:n.labels.join(", "),color:n.color,x:n.x,y:n.y,size:n.size,borderColor:mz,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},JA=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(s=>(t==null?void 0:t.getNode(s))||null,[t]),i=E.useCallback((s,u=!0)=>(t==null?void 0:t.getEdge(s,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const s=yt.getState();s.reset(),$6(e).then(u=>{s.setSigmaGraph(V6(u)),u==null||u.buildDynamicMap(),s.setRawGraph(u)})}}else{const s=yt.getState();s.reset(),s.setSigmaGraph(new Ws)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const s=new Ws;return yt.getState().setSigmaGraph(s),s},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),q6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=JA(),n=pr(),r=bA(),i=yA(),o=rB(),{assign:s}=GA({iterations:20}),{theme:u}=hT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(s(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[s,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?dz:void 0,x=g?vz:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=gz));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=hz):T.color=pz}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Zw):(v||m)&&(k===m?T.color=yz:k===v?T.color=Zw:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},Y6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=xA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:Hr,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:Hr,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(uP,{})}),S.jsx(Ot,{variant:Hr,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(AM,{})})]})},W6=()=>{const{isFullScreen:e,toggle:t}=iB();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(IM,{})}):S.jsx(Ot,{variant:Hr,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(PM,{})})})};function eR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oy="Checkbox",[X6,pK]=hr(Oy),[K6,Z6]=X6(Oy),tR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(K6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":la(C)?"mixed":C,"aria-required":s,"data-state":iR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>la(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(Q6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:la(o)?!1:o})]})});tR.displayName=Oy;var nR="CheckboxIndicator",rR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Z6(nR,n);return S.jsx(Zn,{present:r||la(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":iR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});rR.displayName=nR;var Q6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,s=E.useRef(null),u=eR(n),f=DC(t);E.useEffect(()=>{const p=s.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=la(n),g.call(p,la(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(la(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function la(e){return e==="indeterminate"}function iR(e){return la(e)?"indeterminate":e?"checked":"unchecked"}var aR=tR,J6=rR;const Bs=E.forwardRef(({className:e,...t},n)=>S.jsx(aR,{ref:n,className:Me("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",e),...t,children:S.jsx(J6,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Bs.displayName=aR.displayName;var eH="Separator",sE="horizontal",tH=["horizontal","vertical"],oR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=sE,...i}=e,o=nH(r)?r:sE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});oR.displayName=eH;function nH(e){return tH.includes(e)}var lR=oR;const Fs=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fs.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Bs,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function rH(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),s=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),z=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(fd,{open:e,onOpenChange:t,children:[S.jsx(dd,{asChild:!0,children:S.jsx(Ot,{variant:Hr,tooltip:"Settings",size:"icon",children:S.jsx(JM,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fs,{}),S.jsx(na,{checked:s,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fs,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fs,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fs,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:z,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}const iH="ENTRIES",sR="KEYS",uR="VALUES",sn="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===sn)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==sn).join("")}value(){return Wo(this._path).node.get(sn)}result(){switch(this._type){case uR:return this.value();case sR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],aH=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,s=new Uint8Array(o*i).fill(n+1);for(let u=0;u<i;++u)s[u]=u;for(let u=1;u<o;++u)s[u*i]=u;return cR(e,t,n,r,s,1,i,""),r},cR=(e,t,n,r,i,o,s,u)=>{const f=o*s;e:for(const d of e.keys())if(d===sn){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;m<d.length;++m,++p){const v=d[m],g=s*p,w=g-s;let x=i[g];const k=Math.max(0,p-n-1),C=Math.min(s-1,p+n);for(let _=k;_<C;++_){const T=v!==t[_],N=i[w+_]+ +T,D=i[w+_+1]+1,z=i[g+_]+1,R=i[g+_+1]=Math.min(N,D,z);R<x&&(x=R)}if(x>n)continue e}cR(e.get(d),t,n,r,i,p,s,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Df(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const s of i.keys())if(s!==sn&&s.startsWith(o)){const u=new Map;return u.set(s.slice(o.length),i.get(s)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,oH(this._tree,t)}entries(){return new Hm(this,iH)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return aH(this._tree,t,n)}get(t){const n=Zg(this._tree,t);return n!==void 0?n.get(sn):void 0}has(t){const n=Zg(this._tree,t);return n!==void 0&&n.has(sn)}keys(){return new Hm(this,sR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,$m(this._tree,t).set(sn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);return r.set(sn,n(r.get(sn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=$m(this._tree,t);let i=r.get(sn);return i===void 0&&r.set(sn,i=n()),i}values(){return new Hm(this,uR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Df=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==sn&&t.startsWith(r))return n.push([e,r]),Df(e.get(r),t.slice(r.length),n);return n.push([e,t]),Df(void 0,"",n)},Zg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==sn&&t.startsWith(n))return Zg(e.get(n),t.slice(n.length))},$m=(e,t)=>{const n=t.length;e:for(let r=0;e&&r<n;){for(const o of e.keys())if(o!==sn&&t[r]===o[0]){const s=Math.min(n-r,o.length);let u=1;for(;u<s&&t[r+u]===o[u];)++u;const f=e.get(o);if(u===o.length)e=f;else{const d=new Map;d.set(o.slice(u),f),e.set(t.slice(r,r+u),d),e.delete(o),e=d}r+=u;continue e}const i=new Map;return e.set(t.slice(r),i),i}return e},oH=(e,t)=>{const[n,r]=Df(e,t);if(n!==void 0){if(n.delete(sn),n.size===0)fR(r);else if(n.size===1){const[i,o]=n.entries().next().value;dR(r,i,o)}}},fR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)fR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==sn&&dR(e.slice(0,-1),r,i)}},dR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",hR="and",lH="and_not";class sa{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?Ym:t.autoVacuum;this._options={...qm,...t,autoVacuum:n,searchOptions:{...uE,...t.searchOptions||{}},autoSuggestOptions:{...dH,...t.autoSuggestOptions||{}}},this._index=new oa,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=Jg,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:s}=this._options,u=n(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:s}=this._options,u=i(t,s);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,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(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Jg,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Qg.batchSize,o=t.batchWait||Qg.batchWait;let s=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),s%i===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Ym.minDirtCount,r=r||Ym.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i={...r,...n},o=this.executeQuery(t,n),s=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&s.push(v)}return t===sa.wildcard&&i.boostDocument==null||s.sort(fE),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const u=s.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:s,count:1})}const i=[];for(const[o,{score:s,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:s/f});return i.sort(fE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(qm.hasOwnProperty(t))return Vm(qm,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(s);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static async loadJSAsync(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:s,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=await Yc(i),f._fieldLength=await Yc(o),f._storedFields=await Yc(s);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),await Yc(w))}++d%1e3===0&&await pR(0),f._index.set(p,v)}return f}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:s,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new sa(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===sa.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v={...n,...t,queries:void 0},g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,s={tokenize:r,processTerm:i,...o,...n},{tokenize:u,processTerm:f}=s,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(fH(s)).map(v=>this.executeQuerySpec(v,s));return this.combineResults(m,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},i=(r.fields||this._options.fields).reduce((x,k)=>({...x,[k]:Vm(r.boost,k)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}={...uE.weights,...s},m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[i,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:s,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=sH[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,s]of r)i[o]=Object.fromEntries(s);t.push([n,i])}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:t,serializationVersion:2}}termResults(t,n,r,i,o,s,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const m=s[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=cH(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,z=d.get(k);if(z){z.score+=D,hH(z.terms,t);const R=Vm(z.match,n);R?R.push(p):z.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,dE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,dE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;n<t.length;n++)this._fieldIds[t[n]]=n}addFieldLength(t,n,r,i){let o=this._fieldLength.get(t);o==null&&this._fieldLength.set(t,o=[]),o[n]=i;const u=(this._avgFieldLength[n]||0)*r+i;this._avgFieldLength[n]=u/(r+1)}removeFieldLength(t,n,r,i){if(r===1){this._avgFieldLength[n]=0;return}const o=this._avgFieldLength[n]*r-i;this._avgFieldLength[n]=o/(r-1)}saveStoredFields(t,n){const{storeFields:r,extractField:i}=this._options;if(r==null||r.length===0)return;let o=this._storedFields.get(t);o==null&&this._storedFields.set(t,o={});for(const s of r){const u=i(n,s);u!==void 0&&(o[s]=u)}}}sa.wildcard=Symbol("*");const Vm=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,sH={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:s}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,s),cE(r.terms,o)}}return e},[hR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:s,match:u}=t.get(r);cE(i.terms,s),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[lH]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},uH={k:1.2,b:.7,d:.5},cH=(e,t,n,r,i,o)=>{const{k:s,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(s+1)/(e+s*(1-u+u*r/i)))},fH=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:s}},qm={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(pH),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},uE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:uH},dH={combineWith:hR,prefix:(e,t,n)=>t===n.length-1},Qg={batchSize:1e3,batchWait:10},Jg={minDirtFactor:.1,minDirtCount:20},Ym={...Qg,...Jg},hH=(e,t)=>{e.includes(t)||e.push(t)},cE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},fE=({score:e},{score:t})=>t-e,dE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await pR(0);return t},pR=e=>new Promise(t=>setTimeout(t,e)),pH=/[\n\r\p{Z}\p{P}]+/u,mH={index:new sa({fields:[]})};E.createContext(mH);const ev=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),gH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(ev,Object.assign({},r,{labels:t}))},vH=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:s={}})=>be.createElement("div",{className:"edge"},be.createElement(ev,Object.assign({},n,{labels:s})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),be.createElement(ev,Object.assign({},r,{labels:s}))),yH=({id:e,labels:t})=>{const n=pr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),s?s(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(vH,Object.assign({},r,{labels:t}))};function jy(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function bH({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:s,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,z]=E.useState(!1),[R,B]=E.useState(null),[P,j]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=jy(I,t?0:150),[U,G]=E.useState([]);E.useEffect(()=>{k(!0),j(d)},[d]),E.useEffect(()=>{x||(async()=>{try{z(!0),B(null);const $=d!==null?await e(d):[];G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{z(!0),B(null);const $=await e(Z);G($),N($)}catch($){B($ instanceof Error?$.message:"Failed to fetch options")}finally{z(!1)}};x&&t?t&&N(Z?U.filter($=>n?n($,Z):!0):U):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(j(A),p(A)),_(!1)},[P,j,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(yd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Dy,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(s||S.jsx(xH,{})),!D&&!R&&T.length===0&&(o||S.jsx(Ny,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cl,{children:T.map((A,$)=>S.jsxs(S.Fragment,{children:[S.jsx(Tl,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${$}`),$!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},$)]}))})]})]})})}function xH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function wH(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(gH,{id:e.id}),e.type==="edges"&&S.jsx(yH,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Wm="__message_item",Wc={graph:null,searchEngine:null},SH=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const s=new sa({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return s.addAll(u),Wc.searchEngine=s,s},[r]),o=E.useCallback(async s=>{if(t&&t(null),!s||!i)return[];const u=i.search(s).map(f=>({id:f.id,type:"nodes"}));return u.length<=$p?u:[...u.slice(0,$p),{type:"message",id:Wm,message:`And ${u.length-$p} others`}]},[i,t]);return S.jsx(bH,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:wH,getOptionValue:s=>s.id,value:n&&n.type!=="message"?n.id:null,onChange:s=>{s!==Wm&&e(s?{id:s,type:"nodes"}:null)},onFocus:s=>{s!==Wm&&t&&t(s?{id:s,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},EH=({...e})=>S.jsx(SH,{...e});function _H({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:s,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,z]=E.useState(!1),[R,B]=E.useState([]),[P,j]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,U]=E.useState(null),[G,F]=E.useState(""),K=jy(G,t?0:150),[A,$]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&U(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{j(!0),q(null);const X=await e(p);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{j(!0),q(null);const X=await e(K);$(X),B(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{j(!1)}};T&&t?t&&B(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),U(R.find(re=>i(re)===X)||null),m(X),z(!1)},[I,m,_,R,i]);return S.jsxs(fd,{open:D,onOpenChange:z,children:[S.jsx(dd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(bM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(yd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Dy,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Sk,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(bd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(kH,{})),!P&&!V&&R.length===0&&(s||S.jsx(Ny,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cl,{children:R.map(O=>S.jsxs(Tl,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function kH(){return S.jsx(Cl,{children:S.jsx(Tl,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const CH=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await rM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new sa({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),s=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(_H,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:s})},Ln=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(WC,{delayDuration:200,children:S.jsxs(XC,{children:[S.jsx(KC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),TH=()=>{const{getNode:e,getEdge:t}=JA(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[s,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(AH(m)):u(RH(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),s?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(DH,{node:s}):S.jsx(NH,{edge:s})}):S.jsx(S.Fragment,{})},AH=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,s=o?i.target:i.source,u=t.rawGraph.getNode(s);u&&n.push({type:o?"Target":"Source",id:s,label:u.labels.join(", ")})}}return{...e,relationships:n}},RH=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Ur=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(Ln,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),DH=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),S.jsx(Ur,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Ur,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Ur,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),NH=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Ur,{name:"Id",value:e.id}),e.type&&S.jsx(Ur,{name:"Type",value:e.type}),S.jsx(Ur,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Ur,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Ur,{name:t,value:e.properties[t]},t))})]}),hE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:fA,curvedArrow:tU,curvedNoArrow:eU},nodeProgramClasses:{default:PB,circel:fu,point:fB},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},OH=()=>{const e=bA(),t=pr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},LH=()=>{const[e,t]=E.useState(hE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),s=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...hE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(aB,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(q6,{}),d&&S.jsx(OH,{}),S.jsx(iU,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(CH,{}),s&&S.jsx(EH,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(rH,{}),S.jsx(Y6,{}),S.jsx(S6,{}),S.jsx(W6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(TH,{})})]})},mR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));mR.displayName="Table";const gR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));gR.displayName="TableHeader";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));vR.displayName="TableBody";const zH=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));zH.displayName="TableFooter";const tv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));tv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const jH=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));jH.displayName="TableCaption";const Ks=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Ks.displayName="Card";const Nf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Nf.displayName="CardHeader";const Zs=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zs.displayName="CardTitle";const xd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));xd.displayName="CardDescription";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Of.displayName="CardContent";const MH=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));MH.displayName="CardFooter";function PH({title:e,description:t,icon:n=CM,action:r,className:i,...o}){return S.jsxs(Ks,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zs,{children:e}),t?S.jsx(xd,{children:t}):null]}),r||null]})}var Xm={exports:{}},Km,pE;function FH(){if(pE)return Km;pE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Zm,mE;function IH(){if(mE)return Zm;mE=1;var e=FH();function t(){}function n(){}return n.resetWarningCache=t,Zm=function(){function r(s,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Zm}var gE;function GH(){return gE||(gE=1,Xm.exports=IH()()),Xm.exports}var BH=GH();const Ct=fn(BH),UH=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function dl(e,t,n){const r=HH(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&vE(r,"path",o),vE(r,"relativePath",o),r}function HH(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=UH.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function vE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const $H=[".DS_Store","Thumbs.db"];function VH(e){return no(this,void 0,void 0,function*(){return Lf(e)&&qH(e.dataTransfer)?KH(e.dataTransfer,e.type):YH(e)?WH(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?XH(e):[]})}function qH(e){return Lf(e)}function YH(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function WH(e){return nv(e.target.files).map(t=>dl(t))}function XH(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>dl(n))})}function KH(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=nv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(ZH));return yE(yR(r))}return yE(nv(e.files).map(n=>dl(n)))})}function yE(e){return e.filter(t=>$H.indexOf(t.name)===-1)}function nv(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function ZH(e){if(typeof e.webkitGetAsEntry!="function")return bE(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?bR(t):bE(e,t)}function yR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?yR(n):[n]],[])}function bE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,dl(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return dl(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function QH(e){return no(this,void 0,void 0,function*(){return e.isDirectory?bR(e):JH(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(s=>no(this,void 0,void 0,function*(){if(s.length){const u=Promise.all(s.map(QH));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),s=>{r(s)})}o()})}function JH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=dl(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},xE;function e$(){return xE||(xE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var u=s.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var t$=e$();const Qm=fn(t$);function wE(e){return i$(e)||r$(e)||wR(e)||n$()}function n$(){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 r$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i$(e){if(Array.isArray(e))return rv(e)}function SE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SE(Object(n),!0).forEach(function(r){xR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qs(e,t){return l$(e)||o$(e,t)||wR(e,t)||a$()}function a$(){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 wR(e,t){if(e){if(typeof e=="string")return rv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rv(e,t)}}function rv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o$(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,u;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(f){o=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw u}}return r}}function l$(e){if(Array.isArray(e))return e}var s$=typeof Qm=="function"?Qm:Qm.default,u$="file-invalid-type",c$="file-too-large",f$="file-too-small",d$="too-many-files",h$=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:u$,message:"File type must be ".concat(r)}},_E=function(t){return{code:c$,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE=function(t){return{code:f$,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},p$={code:d$,message:"Too many files"};function SR(e,t){var n=e.type==="application/x-moz-file"||s$(e,t);return[n,n?null:h$(t)]}function ER(e,t,n){if($a(e.size))if($a(t)&&$a(n)){if(e.size>n)return[!1,_E(n)];if(e.size<t)return[!1,kE(t)]}else{if($a(t)&&e.size<t)return[!1,kE(t)];if($a(n)&&e.size>n)return[!1,_E(n)]}return[!0,null]}function $a(e){return e!=null}function m$(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(f){var d=SR(f,n),p=Qs(d,1),m=p[0],v=ER(f,r,i),g=Qs(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function CE(e){e.preventDefault()}function g$(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function v$(e){return e.indexOf("Edge/")!==-1}function y$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return g$(e)||v$(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(u){return!zf(r)&&u&&u.apply(void 0,[r].concat(o)),zf(r)})}}function b$(){return"showOpenFilePicker"in window}function x$(e){if($a(e)){var t=Object.entries(e).filter(function(n){var r=Qs(n,2),i=r[0],o=r[1],s=!0;return _R(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(kR))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=Qs(r,2),o=i[0],s=i[1];return EE(EE({},n),{},xR({},o,s))},{});return[{description:"Files",accept:t}]}return e}function w$(e){if($a(e))return Object.entries(e).reduce(function(t,n){var r=Qs(n,2),i=r[0],o=r[1];return[].concat(wE(t),[i],wE(o))},[]).filter(function(t){return _R(t)||kR(t)}).join(",")}function S$(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function E$(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function _R(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function kR(e){return/^.*\.[\w]+$/.test(e)}var _$=["children"],k$=["open"],C$=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],T$=["refKey","onChange","onClick"];function A$(e){return N$(e)||D$(e)||CR(e)||R$()}function R$(){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 D$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function N$(e){if(Array.isArray(e))return iv(e)}function Jm(e,t){return z$(e)||L$(e,t)||CR(e,t)||O$()}function O$(){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 CR(e,t){if(e){if(typeof e=="string")return iv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iv(e,t)}}function iv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L$(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,u;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(f){o=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw u}}return r}}function z$(e){if(Array.isArray(e))return e}function TE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TE(Object(n),!0).forEach(function(r){av(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function av(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jf(e,t){if(e==null)return{};var n=j$(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j$(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var wd=E.forwardRef(function(e,t){var n=e.children,r=jf(e,_$),i=M$(r),o=i.open,s=jf(i,k$);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(jt(jt({},s),{},{open:o})))});wd.displayName="Dropzone";var TR={disabled:!1,getFilesFromEvent:VH,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};wd.defaultProps=TR;wd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=jt(jt({},TR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,z=t.noDrag,R=t.noDragEventsBubbling,B=t.onError,P=t.validator,j=E.useMemo(function(){return w$(n)},[n]),V=E.useMemo(function(){return x$(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:AE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:AE},[x]),Y=E.useRef(null),Z=E.useRef(null),U=E.useReducer(P$,ov),G=Jm(U,2),F=G[0],K=G[1],A=F.isFocused,$=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&b$()),O=function(){!M.current&&$&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,$,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",CE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",CE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){B?B(ve):console.error(ve)},[B]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(A$(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&m$({files:Ne,accept:j,minSize:s,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,j,s,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var $e=SR(Oe,j),Ye=Jm($e,2),vt=Ye[0],Mt=Ye[1],bt=ER(Oe,s,o),rt=Jm(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[p$]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,j,s,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){S$(Ne)?(I(Ne),K({type:"closeDialog"})):E$(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(y$()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return z?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,$e=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=jf(ve,C$);return jt(jt(av({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir($e,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,z,r]),He=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,$e=jf(ve,T$),Ye=av({accept:j,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,He)),tabIndex:-1},te,Z);return jt(jt({},Ye),$e)}},[Z,n,u,Ee,r]);return jt(jt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function P$(e,t){switch(t.type){case"focus":return jt(jt({},e),{},{isFocused:!0});case"blur":return jt(jt({},e),{},{isFocused:!1});case"openDialog":return jt(jt({},ov),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return jt(jt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return jt({},ov);default:return e}}function AE(){}var My="Progress",Py=100,[F$,mK]=hr(My),[I$,G$]=F$(My),AR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=B$,...s}=e;(i||i===0)&&!RE(i)&&console.error(U$(`${i}`,"Progress"));const u=RE(i)?i:Py;r!==null&&!DE(r,u)&&console.error(H$(`${r}`,"Progress"));const f=DE(r,u)?r:null,d=Mf(f)?o(f,u):void 0;return S.jsx(I$,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Mf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":NR(f,u),"data-value":f??void 0,"data-max":u,...s,ref:t})})});AR.displayName=My;var RR="ProgressIndicator",DR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=G$(RR,n);return S.jsx(We.div,{"data-state":NR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});DR.displayName=RR;function B$(e,t){return`${Math.round(e/t*100)}%`}function NR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Mf(e){return typeof e=="number"}function RE(e){return Mf(e)&&!isNaN(e)&&e>0}function DE(e,t){return Mf(e)&&!isNaN(e)&&e<=t&&e>=0}function U$(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Py}\`.`}function H$(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${Py} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var OR=AR,$$=DR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(OR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx($$,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=OR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function V$(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Fy="ScrollArea",[zR,gK]=hr(Fy),[q$,mr]=zR(Fy),jR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,z]=E.useState(!1),[R,B]=E.useState(!1),P=dt(t,V=>f(V)),j=hd(i);return S.jsx(q$,{scope:n,type:r,dir:j,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:z,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:B,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:j,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});jR.displayName=Fy;var MR="ScrollAreaViewport",PR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,s=mr(MR,n),u=E.useRef(null),f=dt(t,u,s.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PR.displayName=MR;var Xr="ScrollAreaScrollbar",Iy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?S.jsx(Y$,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(W$,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(FR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Gy,{...r,ref:t}):null});Iy.displayName=Xr;var Y$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),[o,s]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),s(!0)},p=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Zn,{present:n||o,children:S.jsx(FR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),W$=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Ed(()=>f("SCROLL_END"),100),[u,f]=V$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),s()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,s]),S.jsx(Zn,{present:n||u!=="hidden",children:S.jsx(Gy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),FR=E.forwardRef((e,t)=>{const n=mr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=E.useState(!1),u=e.orientation==="horizontal",f=Ed(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;s(u?d:p)}},10);return hl(n.viewport,f),hl(n.content,f),S.jsx(Zn,{present:r||o,children:S.jsx(Gy,{"data-state":o?"visible":"hidden",...i,ref:t})})}),Gy=E.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=mr(Xr,e.__scopeScrollArea),o=E.useRef(null),s=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:v=>s.current=v};function m(v,g){return e9(v,s.current,u,g)}return n==="horizontal"?S.jsx(X$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=NE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(K$,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=NE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),X$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ff(s.paddingLeft),paddingEnd:Ff(s.paddingRight)}})}})}),K$=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=mr(Xr,e.__scopeScrollArea),[s,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(GR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),VR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ff(s.paddingTop),paddingEnd:Ff(s.paddingBottom)}})}})}),[Z$,IR]=zR(Xr),GR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=mr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),z=un(f),R=Ed(m,10);function B(P){if(C.current){const j=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:j,y:V})}}return E.useEffect(()=>{const P=j=>{const V=j.target;(w==null?void 0:w.contains(V))&&D(j,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(z,[r,z]),hl(w,R),hl(g.content,R),S.jsx(Z$,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(s),onThumbPositionChange:z,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),B(P))}),onPointerMove:qe(e.onPointerMove,B),onPointerUp:qe(e.onPointerUp,P=>{const j=P.target;j.hasPointerCapture(P.pointerId)&&j.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Pf="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=IR(Pf,e.__scopeScrollArea);return S.jsx(Zn,{present:n||i.hasThumb,children:S.jsx(Q$,{ref:t,...r})})}),Q$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=mr(Pf,n),s=IR(Pf,n),{onThumbPositionChange:u}=s,f=dt(t,m=>s.onThumbChange(m)),d=E.useRef(void 0),p=Ed(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=t9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;s.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,s.onThumbPointerUp)})});BR.displayName=Pf;var By="ScrollAreaCorner",UR=E.forwardRef((e,t)=>{const n=mr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(J$,{...e,ref:t}):null});UR.displayName=By;var J$=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=mr(By,n),[o,s]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hl(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hl(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),s(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ff(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Sd(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function e9(e,t,n,r="ltr"){const i=Sd(n),o=i/2,s=t||o,u=i-s,f=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return $R([f,d],m)(e)}function NE(e,t,n="ltr"){const r=Sd(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,s]:[s*-1,0],d=lv(e,f);return $R([0,s],[0,u])(d)}function $R(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VR(e,t){return e>0&&e<t}var t9=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,u=n.top!==o.top;(s||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ed(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hl(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var qR=jR,n9=PR,r9=UR;const YR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(qR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(n9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(WR,{}),S.jsx(r9,{})]}));YR.displayName=qR.displayName;const WR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Iy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));WR.displayName=Iy.displayName;function sv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const s=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,s)).toFixed(n)} ${r==="accurate"?o[s]??"Bytes":i[s]??"Bytes"}`}function i9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=wz,maxSize:s=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(z=>Object.assign(z,{preview:URL.createObjectURL(z)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:z})=>{vn.error(`File ${z.name} was rejected`)}),r&&D.length>0&&D.length<=u){const z=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${z}...`,success:()=>(w([]),`${z} uploaded`),error:`Failed to upload ${z}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{XR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(wd,{onDrop:x,accept:o,maxSize:s,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Ag,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u}
|
||
files (up to ${sv(s)} each)`:` a file with ${sv(s)}`,"Supported formats: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS"]})]})]})]})}),g!=null&&g.length?S.jsx(YR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(a9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function a9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[XR(e)?S.jsx(o9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:sv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(Ek,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function XR(e){return"preview"in e&&typeof e.preview=="string"}function o9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(_M,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),s=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await uM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success:
|
||
${f.name} uploaded successfully`):vn.error(`Upload Failed:
|
||
${f.name}
|
||
${d.message}`)}catch(d){vn.error(`Upload Failed:
|
||
${f.name}
|
||
${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed
|
||
`+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(KA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Ag,{})," Upload"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Upload documents"}),S.jsx(Ry,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(i9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOCX, PDF, PPTX, RTF, ODT, EPUB, HTML, HTM, TEX, JSON, XML, YAML, YML, CSV, LOG, CONF, INI, PROPERTIES, SQL, BAT, SH, C, CPP, PY, JAVA, JS, TS, SWIFT, GO, RB, PHP, CSS, SCSS, LESS",onUpload:s,progresses:i,disabled:n})]})]})}function s9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await cM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed:
|
||
${r.message}`)}catch(r){vn.error(`Clear Documents Failed:
|
||
`+Cr(r))}},[t]);return S.jsxs(KA,{open:e,onOpenChange:t,children:[S.jsx(ZA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(wk,{})," Clear"]})}),S.jsxs(Cy,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ty,{children:[S.jsx(Ay,{children:"Clear documents"}),S.jsx(Ry,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function u9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await aM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents
|
||
`+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await oM();vn.message(o)}catch(o){vn.error(`Failed to load documents
|
||
`+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(s){vn.error(`Failed to get scan progress
|
||
`+Cr(s))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Ks,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Nf,{children:S.jsx(Zs,{className:"text-lg",children:"Document Management"})}),S.jsxs(Of,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(YM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(s9,{}),S.jsx(l9,{})]}),S.jsxs(Ks,{children:[S.jsxs(Nf,{children:[S.jsx(Zs,{children:"Uploaded documents"}),S.jsx(xd,{children:"view the uploaded documents here"})]}),S.jsxs(Of,{children:[!t&&S.jsx(PH,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(mR,{children:[S.jsx(gR,{children:S.jsxs(tv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(vR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,s])=>s.map(u=>S.jsxs(tv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(Ln,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function KR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Js;(function(e){e.event="event",e.props="prop"})(Js||(Js={}));function aa(){}function c9(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,s){return o===t[s]})||(t=r,n=e.apply(void 0,r)),n}}function eu(e){return!!(e||"").match(/\d/)}function al(e){return e==null}function f9(e){return typeof e=="number"&&isNaN(e)}function ZR(e){return al(e)||f9(e)||typeof e=="number"&&!isFinite(e)}function QR(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function d9(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function h9(e,t,n){var r=d9(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function p9(e){var t=E.useRef(e);t.current=e;var n=E.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function Uy(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],s=i[1]||"";return{beforeDecimal:o,afterDecimal:s,hasNegation:n,addNegation:r}}function m9(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function JR(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function OE(e,t){return Array(t+1).join(e)}function e2(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var s=1+o,u=i.length;return s<0?i="0."+OE("0",Math.abs(s))+i:s>=u?i=i+OE("0",s-u):i=(i.substring(0,s)||"0")+"."+i.substring(s),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Uy(e),o=i.beforeDecimal,s=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(s||"0")),d=s.length<=t?"0."+s:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=JR(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t2=c9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function eg(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function b9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function x9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function w9(e,t,n,r,i,o,s){s===void 0&&(s=x9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g<d;g++){v[g]=-1;for(var w=0,x=p;w<x;w++){var k=s({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:g,formattedValueIndex:w});if(k&&m[w]!==!0){v[g]=w,m[w]=!0;break}}}for(var C=r;C<d&&(v[C]===-1||!o(n[C]));)C++;var _=C===d||v[C]===-1?p:v[C];for(C=r-1;C>0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=v9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(eu(e[n])||eu(e[n-1]));return t}function n2(e,t,n,r,i,o){o===void 0&&(o=aa);var s=p9(function(w,x){var k,C;return ZR(w)?(C="",k=""):typeof w=="number"||x?(C=typeof w=="number"?e2(w):w,k=r(C)):(C=i(w,void 0),k=r(C)),{formattedValue:k,numAsString:C}}),u=E.useState(function(){return s(al(e)?t:e,n)}),f=u[0],d=u[1],p=function(w,x){w.formattedValue!==f.formattedValue&&d({formattedValue:w.formattedValue,numAsString:w.value}),o(w,x)},m=e,v=n;al(e)&&(m=f.numAsString,v=!0);var g=s(m,v);return E.useMemo(function(){d(g)},[g.formattedValue]),[f,p]}function E9(e){return e.replace(/[^0-9]/g,"")}function _9(e){return e}function k9(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,s=e.format;s===void 0&&(s=_9);var u=e.removeFormatting;u===void 0&&(u=E9);var f=e.defaultValue,d=e.valueIsNumericString,p=e.onValueChange,m=e.isAllowed,v=e.onChange;v===void 0&&(v=aa);var g=e.onKeyDown;g===void 0&&(g=aa);var w=e.onMouseUp;w===void 0&&(w=aa);var x=e.onFocus;x===void 0&&(x=aa);var k=e.onBlur;k===void 0&&(k=aa);var C=e.value,_=e.getCaretBoundary;_===void 0&&(_=S9);var T=e.isValidInputCharacter;T===void 0&&(T=eu);var N=e.isCharacterSame,D=KR(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),z=n2(C,f,!!d,s,u,p),R=z[0],B=R.formattedValue,P=R.numAsString,j=z[1],V=E.useRef(),q=E.useRef({formattedValue:B,numAsString:P}),I=function(ce,Te){q.current={formattedValue:ce.formattedValue,numAsString:ce.value},j(ce,Te)},Y=E.useState(!1),Z=Y[0],U=Y[1],G=E.useRef(null),F=E.useRef({setCaretTimeout:null,focusTimeout:null});E.useEffect(function(){return U(!0),function(){clearTimeout(F.current.setCaretTimeout),clearTimeout(F.current.focusTimeout)}},[]);var K=s,A=function(ce,Te){var ge=parseFloat(Te);return{formattedValue:ce,value:Te,floatValue:isNaN(ge)?void 0:ge}},$=function(ce,Te,ge){ce.selectionStart===0&&ce.selectionEnd===ce.value.length||(Va(ce,Te),F.current.setCaretTimeout=setTimeout(function(){ce.value===ge&&ce.selectionStart!==Te&&Va(ce,Te)},0))},M=function(ce,Te,ge){return zE(ce,Te,_(ce),ge)},O=function(ce,Te,ge){var Se=_(Te),ie=w9(Te,B,ce,ge,Se,T,N);return ie=zE(Te,ie,Se),ie},X=function(ce){var Te=ce.formattedValue;Te===void 0&&(Te="");var ge=ce.input,Se=ce.source,ie=ce.event,He=ce.numAsString,Ge;if(ge){var ve=ce.inputValue||ge.value,Ne=eg(ge);ge.value=Te,Ge=O(ve,Te,Ne),Ge!==void 0&&$(ge,Ge,Te)}Te!==B&&I(A(Te,He),{event:ie,source:Se})};E.useEffect(function(){var ce=q.current,Te=ce.formattedValue,ge=ce.numAsString;(B!==Te||P!==ge)&&I(A(B,P),{event:void 0,source:Js.props})},[B,P]);var re=G.current?eg(G.current):void 0,ue=typeof window<"u"?E.useLayoutEffect:E.useEffect;ue(function(){var ce=G.current;if(B!==q.current.formattedValue&&ce){var Te=O(q.current.formattedValue,B,re);ce.value=B,$(ce,Te,B)}},[B]);var ae=function(ce,Te,ge){var Se=Te.target,ie=V.current?g9(V.current,Se.selectionEnd):t2(B,ce),He=Object.assign(Object.assign({},ie),{lastValue:B}),Ge=u(ce,He),ve=K(Ge);if(Ge=u(ve,void 0),m&&!m(A(ve,Ge))){var Ne=Te.target,te=eg(Ne),de=O(ce,B,te);return Ne.value=B,$(Ne,de,B),!1}return X({formattedValue:ve,numAsString:Ge,inputValue:ce,event:Te,source:ge,input:Te.target}),!0},oe=function(ce,Te){Te===void 0&&(Te=0);var ge=ce.selectionStart,Se=ce.selectionEnd;V.current={selectionStart:ge,selectionEnd:Se+Te}},Ce=function(ce){var Te=ce.target,ge=Te.value,Se=ae(ge,ce,Js.event);Se&&v(ce),V.current=void 0},he=function(ce){var Te=ce.target,ge=ce.key,Se=Te.selectionStart,ie=Te.selectionEnd,He=Te.value;He===void 0&&(He="");var Ge;ge==="ArrowLeft"||ge==="Backspace"?Ge=Math.max(Se-1,0):ge==="ArrowRight"?Ge=Math.min(Se+1,He.length):ge==="Delete"&&(Ge=Se);var ve=0;ge==="Delete"&&Se===ie&&(ve=1);var Ne=ge==="ArrowLeft"||ge==="ArrowRight";if(Ge===void 0||Se!==ie&&!Ne){g(ce),oe(Te,ve);return}var te=Ge;if(Ne){var de=ge==="ArrowLeft"?"left":"right";te=M(He,Ge,de),te!==Ge&&ce.preventDefault()}else ge==="Delete"&&!T(He[Ge])?te=M(He,Ge,"right"):ge==="Backspace"&&!T(He[Ge])&&(te=M(He,Ge,"left"));te!==Ge&&$(Te,te,He),g(ce),oe(Te,ve)},Ee=function(ce){var Te=ce.target,ge=function(){var Se=Te.selectionStart,ie=Te.selectionEnd,He=Te.value;if(He===void 0&&(He=""),Se===ie){var Ge=M(He,Se);Ge!==Se&&$(Te,Ge,He)}};ge(),requestAnimationFrame(function(){ge()}),w(ce),oe(Te)},we=function(ce){ce.persist&&ce.persist();var Te=ce.target,ge=ce.currentTarget;G.current=Te,F.current.focusTimeout=setTimeout(function(){var Se=Te.selectionStart,ie=Te.selectionEnd,He=Te.value;He===void 0&&(He="");var Ge=M(He,Se);Ge!==Se&&!(Se===0&&ie===He.length)&&$(Te,Ge,He),x(Object.assign(Object.assign({},ce),{currentTarget:ge}))},0)},Pe=function(ce){G.current=null,clearTimeout(F.current.focusTimeout),clearTimeout(F.current.setCaretTimeout),k(ce)},Ae=Z&&y9()?"numeric":void 0,xe=Object.assign({inputMode:Ae},D,{type:t,value:B,onChange:Ce,onKeyDown:he,onMouseUp:Ee,onFocus:we,onBlur:Pe});if(n==="text")return i?be.createElement(be.Fragment,null,i(B,D)||null):be.createElement("span",Object.assign({},D,{ref:o}),B);if(r){var ee=r;return be.createElement(ee,Object.assign({},xe,{ref:o}))}return be.createElement("input",Object.assign({},xe,{ref:o}))}function jE(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var s=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=_d(t),d=f.thousandSeparator,p=f.decimalSeparator,m=n!==0&&e.indexOf(".")!==-1||n&&r,v=Uy(e,s),g=v.beforeDecimal,w=v.afterDecimal,x=v.addNegation;return n!==void 0&&(w=JR(w,n,!!r)),d&&(g=h9(g,d,u)),i&&(g=i+g),o&&(w=w+o),x&&(g="-"+g),e=g+(m&&p||"")+w,e}function _d(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function C9(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function T9(e,t){return new RegExp("(^-)|[0-9]|"+QR(e),"g")}function A9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function R9(e,t,n){var r;t===void 0&&(t=b9(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var s=n.suffix;s===void 0&&(s="");var u=n.decimalScale,f=t.from,d=t.to,p=d.start,m=d.end,v=_d(n),g=v.allowedDecimalSeparators,w=v.decimalSeparator,x=e[m]===w;if(eu(e)&&(e===o||e===s)&&t.lastValue==="")return e;if(m-p===1&&g.indexOf(e[p])!==-1){var k=u===0?"":w;e=e.substring(0,p)+k+e.substring(p+1,e.length)}var C=function(G,F,K){var A=!1,$=!1;o.startsWith("-")?A=!1:G.startsWith("--")?(A=!1,$=!0):s.startsWith("-")&&G.length===s.length?A=!1:G[0]==="-"&&(A=!0);var M=A?1:0;return $&&(M=2),M&&(G=G.substring(M),F-=M,K-=M),{value:G,start:F,end:K,hasNegation:A}},_=C(e,p,m),T=_.hasNegation;r=_,e=r.value,p=r.start,m=r.end;var N=C(t.lastValue,f.start,f.end),D=N.start,z=N.end,R=N.value,B=e.substring(p,m);e.length&&R.length&&(D>R.length-s.length||z<o.length)&&!(B&&s.startsWith(B))&&(e=R);var P=0;e.startsWith(o)?P+=o.length:p<o.length&&(P=p),e=e.substring(P),m-=P;var j=e.length,V=e.length-s.length;e.endsWith(s)?j=V:(m>V||m>e.length-s.length)&&(j=m),e=e.substring(0,j),e=C9(T?"-"+e:e,i),e=(e.match(T9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(QR(w),"g"),function(G,F){return F===q?".":""});var I=Uy(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,U=I.addNegation;return d.end-d.start<f.end-f.start&&Y===""&&x&&!parseFloat(Z)&&(e=U?"-":""),e}function D9(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var s=e.length;return i.fill(!1,s-r.length+1,s+1),i}function N9(e){var t=_d(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
|
||
Decimal separator can't be same as thousand separator.
|
||
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
||
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
||
`);return i.startsWith("-")&&o&&(console.error(`
|
||
Prefix can't start with '-' when allowNegative is true.
|
||
prefix: `+i+`
|
||
allowNegative: `+o+`
|
||
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function O9(e){e=N9(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=aa);var o=e.onBlur;o===void 0&&(o=aa);var s=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,d=e.prefix;d===void 0&&(d="");var p=e.defaultValue,m=e.value,v=e.valueIsNumericString,g=e.onValueChange,w=KR(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),x=_d(e),k=x.decimalSeparator,C=x.allowedDecimalSeparators,_=function(U){return jE(U,e)},T=function(U,G){return R9(U,G,e)},N=al(m)?p:m,D=v??A9(N,d,t);al(m)?al(p)||(D=D||typeof p=="number"):D=D||typeof m=="number";var z=function(U){return ZR(U)?U:(typeof U=="number"&&(U=e2(U)),D&&typeof u=="number"?LE(U,u,!!f):U)},R=n2(z(m),z(p),!!D,_,T,g),B=R[0],P=B.numAsString,j=B.formattedValue,V=R[1],q=function(U){var G=U.target,F=U.key,K=G.selectionStart,A=G.selectionEnd,$=G.value;if($===void 0&&($=""),(F==="Backspace"||F==="Delete")&&A<d.length){U.preventDefault();return}if(K!==A){i(U);return}F==="Backspace"&&$[0]==="-"&&K===d.length+1&&n&&Va(G,1),u&&f&&(F==="Backspace"&&$[K-1]===k?(Va(G,K-1),U.preventDefault()):F==="Delete"&&$[K]===k&&U.preventDefault()),C!=null&&C.includes(F)&&$[K]===k&&Va(G,K+1);var M=s===!0?",":s;F==="Backspace"&&$[K-1]===M&&Va(G,K-1),F==="Delete"&&$[K]===M&&Va(G,K+1),i(U)},I=function(U){var G=P;if(G.match(/\d/g)||(G=""),r||(G=m9(G)),f&&u&&(G=LE(G,u,f)),G!==P){var F=jE(G,e);V({formattedValue:F,value:G,floatValue:parseFloat(G)},{event:U,source:Js.event})}o(U)},Y=function(U){return U===k?!0:eu(U)},Z=function(U){var G=U.currentValue,F=U.lastValue,K=U.formattedValue,A=U.currentValueIndex,$=U.formattedValueIndex,M=G[A],O=K[$],X=t2(F,G),re=X.to,ue=function(ae){return T(ae).indexOf(".")+d.length};return m===0&&f&&u&&G[re.start]===k&&ue(G)<A&&ue(K)>$?!1:A>=re.start&&A<re.end&&C&&C.includes(M)&&O===k?!0:M===O};return Object.assign(Object.assign({},w),{value:j,valueIsNumericString:!1,isValidInputCharacter:Y,isCharacterSame:Z,onValueChange:V,format:_,removeFormatting:T,getCaretBoundary:function(U){return D9(U,e)},onKeyDown:q,onBlur:I})}function L9(e){var t=O9(e);return be.createElement(k9,Object.assign({},t))}const Jo=E.forwardRef(({stepper:e,thousandSeparator:t,placeholder:n,defaultValue:r,min:i=-1/0,max:o=1/0,onValueChange:s,fixedDecimalScale:u=!1,decimalScale:f=0,className:d=void 0,suffix:p,prefix:m,value:v,...g},w)=>{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const z=D.floatValue===void 0?void 0:D.floatValue;k(z),s&&s(z)},N=()=>{x!==void 0&&(x<i?(k(i),w.current.value=String(i)):x>o&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(xk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],j9=[" ","Enter"],gu="Select",[kd,Cd,M9]=pT(gu),[Al,vK]=hr(gu,[M9,wl]),Td=wl(),[P9,pa]=Al(gu),[F9,I9]=Al(gu),r2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Td(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),z=hd(d),[R=!1,B]=_i({prop:r,defaultProp:i,onChange:o}),[P,j]=_i({prop:s,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(U=>U.props.value).join(";");return S.jsx(ny,{...x,children:S.jsxs(P9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:j,open:R,onOpenChange:B,dir:z,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(kd.Provider,{scope:t,children:S.jsx(F9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(U=>{Y(G=>new Set(G).add(U))},[]),onNativeOptionRemove:E.useCallback(U=>{Y(G=>{const F=new Set(G);return F.delete(U),F})},[]),children:n})}),q?S.jsxs(R2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:U=>j(U.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};r2.displayName=gu;var i2="SelectTrigger",a2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Td(n),s=pa(i2,n),u=s.disabled||r,f=dt(t,s.onTriggerChange),d=Cd(n),p=E.useRef("touch"),[m,v,g]=D2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===s.value),_=N2(k,x,C);_!==void 0&&s.onValueChange(_.value)}),w=x=>{u||(s.onOpenChange(!0),g()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(od,{asChild:!0,...o,children:S.jsx(We.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":A2(s.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});a2.displayName=i2;var o2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...u}=e,f=pa(o2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:A2(f.value)?S.jsx(S.Fragment,{children:s}):o})});l2.displayName=o2;var G9="SelectIcon",s2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});s2.displayName=G9;var B9="SelectPortal",u2=e=>S.jsx(Qf,{asChild:!0,...e});u2.displayName=B9;var eo="SelectContent",c2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(f2,{scope:e.__scopeSelect,children:S.jsx(kd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(d2,{...e,ref:t})});c2.displayName=eo;var _r=10,[f2,ma]=Al(eo),U9="SelectContentImpl",d2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,z]=E.useState(null),R=dt(t,ae=>N(ae)),[B,P]=E.useState(null),[j,V]=E.useState(null),q=Cd(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Pv(T)},[T]),Mv();const U=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>U([B,T]),[U,B,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,$]=D2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=N2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?uv:h2,ue=re===uv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(f2,{scope:n,content:T,viewport:D,onViewportChange:z,itemRefCallback:M,selectedItem:B,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:j,position:r,isPositioned:I,searchRef:A,children:S.jsx(ed,{as:ua,allowPinchZoom:!0,children:S.jsx(Zf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&$(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>U(he)),ae.preventDefault()}})})})})})})});d2.displayName=U9;var H9="SelectItemAlignedPosition",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),s=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Cd(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=s,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),B=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=j.left-B.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=B.right-j.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,B.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+U+I+F+G,A=Math.min(k.offsetHeight*5,K),$=window.getComputedStyle(x),M=parseInt($.paddingTop,10),O=parseInt($.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+U+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const z=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(V9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:z,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});h2.displayName=H9;var $9="SelectPopperPosition",uv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Td(n);return S.jsx(ry,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uv.displayName=$9;var[V9,Hy]=Al(eo,{}),cv="SelectViewport",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(cv,n),s=Hy(cv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),S.jsx(kd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C<w){const _=C+g,T=Math.min(w,_),N=_-T;m.style.height=T+"px",m.style.bottom==="0px"&&(p.scrollTop=N>0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});p2.displayName=cv;var m2="SelectGroup",[q9,Y9]=Al(m2),g2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(q9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});g2.displayName=m2;var v2="SelectLabel",y2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Y9(v2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});y2.displayName=v2;var If="SelectItem",[W9,b2]=Al(If),x2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,u=pa(If,n),f=ma(If,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(W9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(kd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:w,onFocus:qe(s.onFocus,()=>g(!0)),onBlur:qe(s.onBlur,()=>g(!1)),onClick:qe(s.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(s.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(s.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(s.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(s.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(s.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(j9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});x2.displayName=If;var Is="SelectItemText",w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=pa(Is,n),u=ma(Is,n),f=b2(Is,n),d=I9(Is,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?au.createPortal(o.children,s.valueNode):null]})});w2.displayName=Is;var S2="SelectItemIndicator",E2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b2(S2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});E2.displayName=S2;var fv="SelectScrollUpButton",_2=E.forwardRef((e,t)=>{const n=ma(fv,e.__scopeSelect),r=Hy(fv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});_2.displayName=fv;var dv="SelectScrollDownButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),s=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<d;o(p)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(C2,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});k2.displayName=dv;var C2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),s=E.useRef(null),u=Cd(n),f=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),X9="SelectSeparator",T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});T2.displayName=X9;var hv="SelectArrow",K9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Td(n),o=pa(hv,n),s=ma(hv,n);return o.open&&s.position==="popper"?S.jsx(iy,{...i,...r,ref:t}):null});K9.displayName=hv;function A2(e){return e===""||e===void 0}var R2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),s=eR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[s,n]),S.jsx(ay,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});R2.displayName="BubbleSelect";function D2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(s=>{const u=n.current+s;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function N2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=Z9(e,Math.max(o,0));i.length===1&&(s=s.filter(d=>d!==n));const f=s.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Z9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q9=r2,O2=a2,J9=l2,e8=s2,t8=u2,L2=c2,n8=p2,r8=g2,z2=y2,j2=x2,i8=w2,a8=E2,M2=_2,P2=k2,F2=T2;const ME=Q9,PE=r8,FE=J9,pv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(O2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(e8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));pv.displayName=O2.displayName;const I2=E.forwardRef(({className:e,...t},n)=>S.jsx(M2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(xk,{className:"h-4 w-4"})}));I2.displayName=M2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const mv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(t8,{children:S.jsxs(L2,{ref:i,className:Me("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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[S.jsx(I2,{}),S.jsx(n8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(G2,{})]})}));mv.displayName=L2.displayName;const o8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));o8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(a8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(i8,{children:t})]}));wi.displayName=j2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=F2.displayName;function s8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Ks,{className:"flex shrink-0 flex-col",children:[S.jsxs(Nf,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zs,{children:"Parameters"}),S.jsx(xd,{children:"Configure your query parameters"})]}),S.jsx(Of,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(ME,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(ME,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(pv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(FE,{})}),S.jsx(mv,{children:S.jsxs(PE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(Ln,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(s=>s.trim()).filter(s=>s!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ln,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Bs,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function u8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const c8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function IE(e,t){return(d8.jsx?f8:c8).test(e)}const h8=/[ \t\n\f\r]/g;function p8(e){return typeof e=="object"?e.type==="text"?GE(e.value):!1:GE(e)}function GE(e){return e.replace(h8,"")===""}class vu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vu.prototype.normal={};vu.prototype.property={};vu.prototype.space=void 0;function B2(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vu(n,r,t)}function gv(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let m8=0;const et=ro(),Vt=ro(),U2=ro(),Re=ro(),Nt=ro(),ol=ro(),qn=ro();function ro(){return 2**++m8}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Vt,commaOrSpaceSeparated:qn,commaSeparated:ol,number:Re,overloadedBoolean:U2,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),tg=Object.keys(vv);class $y extends Gn{constructor(t,n,r,i){let o=-1;if(super(t,n),BE(this,"space",i),typeof r=="number")for(;++o<tg.length;){const s=tg[o];BE(this,tg[o],(r&vv[s])===vv[s])}}}$y.prototype.defined=!0;function BE(e,t,n){n&&(e[t]=n)}function Rl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new $y(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[gv(r)]=r,n[gv(o.attribute)]=r}return new vu(t,n,e.space)}const H2=Rl({properties:{ariaActiveDescendant:null,ariaAtomic:Vt,ariaAutoComplete:null,ariaBusy:Vt,ariaChecked:Vt,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:Vt,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:Vt,ariaFlowTo:Nt,ariaGrabbed:Vt,ariaHasPopup:null,ariaHidden:Vt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:Re,ariaLive:null,ariaModal:Vt,ariaMultiLine:Vt,ariaMultiSelectable:Vt,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:Vt,ariaReadOnly:Vt,ariaRelevant:null,ariaRequired:Vt,ariaRoleDescription:Nt,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:Vt,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $2(e,t){return t in e?e[t]:t}function V2(e,t){return $2(e,t.toLowerCase())}const g8=Rl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ol,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:Nt,autoFocus:et,autoPlay:et,blocking:Nt,capture:null,charSet:null,checked:et,cite:null,className:Nt,cols:Re,colSpan:null,content:null,contentEditable:Vt,controls:et,controlsList:Nt,coords:Re|ol,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:U2,draggable:Vt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:Nt,height:Re,hidden:et,high:Re,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:et,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:et,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:et,optimum:Re,pattern:null,ping:Nt,placeholder:null,playsInline:et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:Nt,required:et,reversed:et,rows:Re,rowSpan:Re,sandbox:Nt,scope:null,scoped:et,seamless:et,selected:et,shadowRootClonable:et,shadowRootDelegatesFocus:et,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:Vt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:Vt,width:Re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:Vt,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:Re,security:null,unselectable:null},space:"html",transform:V2}),v8=Rl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:qn,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:Nt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ol,g2:ol,glyphName:ol,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qn,rev:qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qn,requiredFeatures:qn,requiredFonts:qn,requiredFormats:qn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qn,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$2}),q2=Rl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Y2=Rl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:V2}),W2=Rl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),y8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},b8=/[A-Z]/g,UE=/-[a-z]/g,x8=/^data[-\w.:]+$/i;function w8(e,t){const n=gv(t);let r=t,i=Gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(UE,E8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!UE.test(o)){let s=o.replace(b8,S8);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=$y}return new i(r,t)}function S8(e){return"-"+e.toLowerCase()}function E8(e){return e.charAt(1).toUpperCase()}const _8=B2([H2,g8,q2,Y2,W2],"html"),Vy=B2([H2,v8,q2,Y2,W2],"svg");function k8(e){return e.join(" ").trim()}var Xo={},ng,HE;function C8(){if(HE)return ng;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,f=`
|
||
`,d="/",p="*",m="",v="comment",g="declaration";ng=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),B(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function z(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function B(){R(n)}function P(I){var Y;for(I=I||[];Y=j();)Y!==!1&&I.push(Y);return I}function j(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return z("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(j(),!R(i))return z("property missing ':'");var Z=R(o),U=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(s),U}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return B(),q()};function w(x){return x?x.replace(u,m):m}return ng}var $E;function T8(){if($E)return Xo;$E=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(C8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var s=(0,t.default)(r),u=typeof i=="function";return s.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var A8=T8();const VE=fn(A8),R8=VE.default||VE,X2=K2("end"),qy=K2("start");function K2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D8(e){const t=qy(e),n=X2(e);if(t&&n)return{start:t,end:n}}function Us(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qE(e.position):"start"in e||"end"in e?qE(e):"line"in e||"column"in e?yv(e):""}function yv(e){return YE(e&&e.line)+":"+YE(e&&e.column)}function qE(e){return yv(e&&e.start)+"-"+yv(e&&e.end)}function YE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Us(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Yy={}.hasOwnProperty,N8=new Map,O8=/[A-Z]/g,L8=/-([a-z])/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),j8=new Set(["td","th"]),Z2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Q2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=U8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Vy:_8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=J2(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function J2(e,t,n){if(t.type==="element")return M8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return P8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I8(e,t,n);if(t.type==="mdxjsEsm")return F8(e,t);if(t.type==="root")return G8(e,t,n);if(t.type==="text")return B8(e,t)}function M8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=tD(e,t.tagName,!1),s=$8(e,t);let u=Xy(e,t);return z8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!p8(f):!0})),eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function P8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function F8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function I8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:tD(e,t.name,!0),s=V8(e,t),u=Xy(e,t);return eD(e,s,o,t),Wy(s,u),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function G8(e,t,n){const r={};return Wy(r,Xy(e,t)),e.create(t,e.Fragment,r,n)}function B8(e,t){return t.value}function eD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function U8(e,t,n){return r;function r(i,o,s,u){const d=Array.isArray(s.children)?n:t;return u?d(o,s,u):d(o,s)}}function H8(e,t){return n;function n(r,i,o,s){const u=Array.isArray(o.children),f=qy(r);return t(i,o,s,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function $8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Yy.call(t.properties,i)){const o=q8(e,i,t.properties[i]);if(o){const[s,u]=o;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&j8.has(t.tagName)?r=u:n[s]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function V8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:N8;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=i.get(f)||0;s=f+"-"+d,i.set(f,d+1)}}const u=J2(e,o,s);u!==void 0&&n.push(u)}return n}function q8(e,t,n){const r=w8(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?u8(n):k8(n)),r.property==="style"){let i=typeof n=="object"?n:Y8(e,String(n));return e.stylePropertyNameCase==="css"&&(i=W8(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?y8[r.property]||r.property:r.attribute,n]}}function Y8(e,t){const n={};try{R8(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=Z2+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(L8,K8)),n[s]=o}}function tD(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const u=IE(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(o&&u.type==="Literal"),optional:!1}:u}r=s}else r=IE(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Yy.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tu(e)}function tu(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Z2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function W8(e){const t={};let n;for(n in e)Yy.call(e,n)&&(t[X8(n)]=e[n]);return t}function X8(e){let t=e.replace(O8,Z8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function K8(e,t){return t.toUpperCase()}function Z8(e){return"-"+e.toLowerCase()}const rg={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Q8={};function Ky(e,t){const n=Q8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return nD(e,r,i)}function nD(e,t,n){if(J8(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return WE(e.children,t,n)}return Array.isArray(e)?WE(e,t,n):""}function WE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=nD(e[i],t,n);return r.join("")}function J8(e){return!!(e&&typeof e=="object")}const XE=document.createElement("i");function Zy(e){const t="&"+e+";";XE.innerHTML=t;const n=XE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Kn(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function fr(e,t){return e.length>0?(Kn(e,e.length,0,t),e):t}const KE={}.hasOwnProperty;function rD(e){const t={};let n=-1;for(;++n<e.length;)e7(t,e[n]);return t}function e7(e,t){let n;for(n in t){const i=(KE.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){KE.call(i,s)||(i[s]=[]);const u=o[s];t7(i[s],Array.isArray(u)?u:u?[u]:[])}}}function t7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Kn(e,0,0,r)}function iD(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"<22>":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),n7=ga(/[#-'*+\--9=?A-Z^-~]/);function Gf(e){return e!==null&&(e<32||e===127)}const bv=ga(/\d/),r7=ga(/[\dA-Fa-f]/),i7=ga(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Ad=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&yn(e.charCodeAt(n+1))&&yn(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(s=String.fromCharCode(o,u),i=1):s="<22>"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++<i?(e.consume(f),u):(e.exit(n),t(f))}}const a7={tokenize:o7};function o7(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),lt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),o(u)}function o(u){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,s(u)}function s(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ue(u)?(e.consume(u),e.exit("chunkText"),o):(e.consume(u),s)}}const l7={tokenize:s7},ZE={tokenize:u7};function s7(e){const t=this,n=[];let r=0,i,o,s;return u;function u(T){if(r<n.length){const N=n[r];return t.containerState=N[1],e.attempt(N[0].continuation,f,d)(T)}return d(T)}function f(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const N=t.events.length;let D=N,z;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){z=t.events[D][1].end;break}C(r);let R=N;for(;R<t.events.length;)t.events[R][1].end={...z},R++;return Kn(t.events,D+1,0,t.events.slice(N)),t.events.length=R,d(T)}return u(T)}function d(T){if(r===n.length){if(!i)return v(T);if(i.currentConstruct&&i.currentConstruct.concrete)return w(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ZE,p,m)(T)}function p(T){return i&&_(),C(r),v(T)}function m(T){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,w(T)}function v(T){return t.containerState={},e.attempt(ZE,g,w)(T)}function g(T){return r++,n.push([t.currentConstruct,t.containerState]),v(T)}function w(T){if(T===null){i&&_(),C(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(T)}function x(T){if(T===null){k(e.exit("chunkFlow"),!0),C(0),e.consume(T);return}return Ue(T)?(e.consume(T),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(T),x)}function k(T,N){const D=t.sliceStream(T);if(N&&D.push(null),T.previous=o,o&&(o.next=T),o=T,i.defineSkip(T.start),i.write(D),t.parser.lazy[T.start.line]){let z=i.events.length;for(;z--;)if(i.events[z][1].start.offset<s&&(!i.events[z][1].end||i.events[z][1].end.offset>s))return;const R=t.events.length;let B=R,P,j;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){j=t.events[B][1].end;break}P=!0}for(C(r),z=R;z<t.events.length;)t.events[z][1].end={...j},z++;Kn(t.events,B+1,0,t.events.slice(R)),t.events.length=z}}function C(T){let N=n.length;for(;N-- >T;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function u7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pl(e){if(e===null||Tt(e)||to(e))return 1;if(Ad(e))return 2}function Rd(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const xv={name:"attention",resolveAll:c7,tokenize:f7};function c7(e,t){let n=-1,r,i,o,s,u,f,d,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};QE(m,-f),QE(v,f),s={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=fr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=fr(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),d=fr(d,Rd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=fr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=fr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Kn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function f7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=pl(r);let o;return s;function s(f){return o=f,e.enter("attentionSequence"),u(f)}function u(f){if(f===o)return e.consume(f),u;const d=e.exit("attentionSequence"),p=pl(f),m=!p||p===2&&i||n.includes(f),v=!i||i===2&&p||n.includes(r);return d._open=!!(o===42?m:m&&(i||!v)),d._close=!!(o===42?v:v&&(p||!m)),t(f)}}function QE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const d7={name:"autolink",tokenize:h7};function h7(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return kn(g)?(e.consume(g),s):g===64?n(g):d(g)}function s(g){return g===43||g===45||g===46||yn(g)?(r=1,u(g)):d(g)}function u(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||yn(g))&&r++<32?(e.consume(g),u):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Gf(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),p):n7(g)?(e.consume(g),d):n(g)}function p(g){return yn(g)?m(g):n(g)}function m(g){return g===46?(e.consume(g),r=0,p):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):v(g)}function v(g){if((g===45||yn(g))&&r++<63){const w=g===45?v:m;return e.consume(g),w}return n(g)}}const yu={partial:!0,tokenize:p7};function p7(e,t,n){return r;function r(o){return ut(o)?lt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ue(o)?t(o):n(o)}}const aD={continuation:{tokenize:g7},exit:v7,name:"blockQuote",tokenize:m7};function m7(e,t,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ut(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function g7(e,t,n){const r=this;return i;function i(s){return ut(s)?lt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(aD,t,n)(s)}}function v7(e){e.exit("blockQuote")}const oD={name:"characterEscape",tokenize:y7};function y7(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return i7(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const lD={name:"characterReference",tokenize:b7};function b7(e,t,n){const r=this;let i=0,o,s;return u;function u(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,s=yn,p(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=r7,p):(e.enter("characterReferenceValue"),o=7,s=bv,p(m))}function p(m){if(m===59&&i){const v=e.exit("characterReferenceValue");return s===yn&&!Zy(r.sliceSerialize(v))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(m)&&i++<o?(e.consume(m),p):n(m)}}const JE={partial:!0,tokenize:w7},e_={concrete:!0,name:"codeFenced",tokenize:x7};function x7(e,t,n){const r=this,i={partial:!0,tokenize:D};let o=0,s=0,u;return f;function f(z){return d(z)}function d(z){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,u=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(z)}function p(z){return z===u?(s++,e.consume(z),p):s<3?n(z):(e.exit("codeFencedFenceSequence"),ut(z)?lt(e,m,"whitespace")(z):m(z))}function m(z){return z===null||Ue(z)?(e.exit("codeFencedFence"),r.interrupt?t(z):e.check(JE,x,N)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(z))}function v(z){return z===null||Ue(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(z)):ut(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,g,"whitespace")(z)):z===96&&z===u?n(z):(e.consume(z),v)}function g(z){return z===null||Ue(z)?m(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(z))}function w(z){return z===null||Ue(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(z)):z===96&&z===u?n(z):(e.consume(z),w)}function x(z){return e.attempt(i,N,k)(z)}function k(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),C}function C(z){return o>0&&ut(z)?lt(e,_,"linePrefix",o+1)(z):_(z)}function _(z){return z===null||Ue(z)?e.check(JE,x,N)(z):(e.enter("codeFlowValue"),T(z))}function T(z){return z===null||Ue(z)?(e.exit("codeFlowValue"),_(z)):(e.consume(z),T)}function N(z){return e.exit("codeFenced"),t(z)}function D(z,R,B){let P=0;return j;function j(Z){return z.enter("lineEnding"),z.consume(Z),z.exit("lineEnding"),V}function V(Z){return z.enter("codeFencedFence"),ut(Z)?lt(z,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(z.enter("codeFencedFenceSequence"),I(Z)):B(Z)}function I(Z){return Z===u?(P++,z.consume(Z),I):P>=s?(z.exit("codeFencedFenceSequence"),ut(Z)?lt(z,Y,"whitespace")(Z):Y(Z)):B(Z)}function Y(Z){return Z===null||Ue(Z)?(z.exit("codeFencedFence"),R(Z)):B(Z)}}}function w7(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ig={name:"codeIndented",tokenize:E7},S7={partial:!0,tokenize:_7};function E7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?f(d):Ue(d)?e.attempt(S7,s,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ue(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function _7(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):lt(e,o,"linePrefix",5)(s)}function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const k7={name:"codeText",previous:T7,resolve:C7,tokenize:A7};function C7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function T7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function A7(e,t,n){let r=0,i,o;return s;function s(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(o=e.enter("codeTextSequence"),i=0,p(m)):Ue(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||Ue(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),d)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(o.type="codeTextData",d(m))}}class R7{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&js(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),js(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),js(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);js(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);js(this.left,n.reverse())}}}function js(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function sD(e){const t={};let n=-1,r,i,o,s,u,f,d;const p=new R7(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,D7(p,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=p.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(s[1].type!=="linePrefix")break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return Kn(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function D7(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),u=s.events,f=[],d={};let p,m,v=-1,g=n,w=0,x=0;const k=[x];for(;g;){for(;e.get(++i)[1]!==g;);o.push(i),g._tokenizer||(p=r.sliceStream(g),g.next||p.push(null),m&&s.defineSkip(g.start),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(p),g._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),m=g,g=g.next}for(g=n;++v<u.length;)u[v][0]==="exit"&&u[v-1][0]==="enter"&&u[v][1].type===u[v-1][1].type&&u[v][1].start.line!==u[v][1].end.line&&(x=v+1,k.push(x),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(s.events=[],g?(g._tokenizer=void 0,g.previous=void 0):k.pop(),v=k.length;v--;){const C=u.slice(k[v],k[v+1]),_=o.pop();f.push([_,_+C.length-1]),e.splice(_,2,C)}for(f.reverse(),v=-1;++v<f.length;)d[w+f[v][0]]=w+f[v][1],w+=f[v][1]-f[v][0]-1;return d}const N7={resolve:L7,tokenize:z7},O7={partial:!0,tokenize:j7};function L7(e){return sD(e),e}function z7(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?o(u):Ue(u)?e.check(O7,s,o)(u):(e.consume(u),i)}function o(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function s(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function j7(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),lt(e,o,"linePrefix")}function o(s){if(s===null||Ue(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function uD(e,t,n,r,i,o,s,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Gf(C)?n(C):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Ue(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(C)):p<d&&C===40?(e.consume(C),p++,x):C===41?(e.consume(C),p--,x):C===null||C===32||C===40||Gf(C)?n(C):(e.consume(C),C===92?k:x)}function k(C){return C===40||C===41||C===92?(e.consume(C),x):x(C)}}function cD(e,t,n,r,i,o){const s=this;let u=0,f;return d;function d(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(o),p}function p(g){return u>999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Ue(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Ue(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function fD(e,t,n,r,i,o){let s;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),s=v===40?41:v,f):n(v)}function f(v){return v===s?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===s?(e.exit(o),f(s)):v===null?n(v):Ue(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),lt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===s||v===null||Ue(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===s||v===92?(e.consume(v),p):p(v)}}function Hs(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const M7={name:"definition",tokenize:F7},P7={partial:!0,tokenize:I7};function F7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),s(g)}function s(g){return cD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?Hs(e,d)(g):d(g)}function d(g){return uD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(P7,m,m)(g)}function m(g){return ut(g)?lt(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Ue(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function I7(e,t,n){return r;function r(u){return Tt(u)?Hs(e,i)(u):n(u)}function i(u){return fD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?lt(e,s,"whitespace")(u):s(u)}function s(u){return u===null||Ue(u)?t(u):n(u)}}const G7={name:"hardBreakEscape",tokenize:B7};function B7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ue(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const U7={name:"headingAtx",resolve:H7,tokenize:$7};function H7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Kn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):ut(p)?lt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],t_=["pre","script","style","textarea"],q7={concrete:!0,name:"htmlFlow",resolveTo:X7,tokenize:K7},Y7={partial:!0,tokenize:Q7},W7={partial:!0,tokenize:Z7};function X7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function K7(e,t,n){const r=this;let i,o,s,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),s=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=s.toLowerCase();return!X&&!o&&t_.includes(re)?(i=1,r.interrupt?t(O):q(O)):V7.includes(s.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),s+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):j(O)}function T(O){return O===47?(e.consume(O),j):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):j(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),z):ut(O)?(e.consume(O),D):T(O)}function z(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),z):B(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Ue(O)?n(O):(e.consume(O),R)}function B(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),B)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function j(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Ue(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),U):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),$):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Ue(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y7,M,I)(O)):O===null||Ue(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(W7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Ue(O)?I(O):(e.enter("htmlFlowData"),q(O))}function U(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),s="",F):q(O)}function F(O){if(O===62){const X=s.toLowerCase();return t_.includes(X)?(e.consume(O),$):q(O)}return kn(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),$):O===45&&i===2?(e.consume(O),A):q(O)}function $(O){return O===null||Ue(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),$)}function M(O){return e.exit("htmlFlow"),t(O)}}function Z7(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Q7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const J7={name:"htmlText",tokenize:eV};function eV(e,t,n){const r=this;let i,o,s;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Ue(A)?(s=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?U(A):A===45?v(A):m(A)}function w(A){const $="CDATA[";return A===$.charCodeAt(o++)?(e.consume(A),o===$.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Ue(A)?(s=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?U(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?U(A):Ue(A)?(s=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Ue(A)?(s=T,G(A)):(e.consume(A),T)}function N(A){return A===62?U(A):T(A)}function D(A){return kn(A)?(e.consume(A),z):n(A)}function z(A){return A===45||yn(A)?(e.consume(A),z):R(A)}function R(A){return Ue(A)?(s=R,G(A)):ut(A)?(e.consume(A),R):U(A)}function B(A){return A===45||yn(A)?(e.consume(A),B):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),U):A===58||A===95||kn(A)?(e.consume(A),j):Ue(A)?(s=P,G(A)):ut(A)?(e.consume(A),P):U(A)}function j(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),j):V(A)}function V(A){return A===61?(e.consume(A),q):Ue(A)?(s=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Ue(A)?(s=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Ue(A)?(s=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function U(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?lt(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),s(A)}}const Qy={name:"labelEnd",resolveAll:iV,resolveTo:aV,tokenize:oV},tV={tokenize:lV},nV={tokenize:sV},rV={tokenize:uV};function iV(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Kn(e,0,e.length,n),e}function aV(e,t){let n=e.length,r=0,i,o,s,u;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return u=[["enter",f,t],["enter",d,t]],u=fr(u,e.slice(o+1,o+r+3)),u=fr(u,[["enter",p,t]]),u=fr(u,Rd(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),u=fr(u,[["exit",p,t],e[s-2],e[s-1],["exit",d,t]]),u=fr(u,e.slice(s+1)),u=fr(u,[["exit",f,t]]),Kn(e,o,e.length,u),e}function oV(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return u;function u(v){return o?o._inactive?m(v):(s=r.parser.defined.includes(Tr(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),f):n(v)}function f(v){return v===40?e.attempt(tV,p,s?p:m)(v):v===91?e.attempt(nV,p,s?d:m)(v):s?p(v):m(v)}function d(v){return e.attempt(rV,p,m)(v)}function p(v){return t(v)}function m(v){return o._balanced=!0,n(v)}}function lV(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return Tt(m)?Hs(e,o)(m):o(m)}function o(m){return m===41?p(m):uD(e,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function s(m){return Tt(m)?Hs(e,f)(m):p(m)}function u(m){return n(m)}function f(m){return m===34||m===39||m===40?fD(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return Tt(m)?Hs(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function sV(e,t,n){const r=this;return i;function i(u){return cD.call(r,e,o,s,"reference","referenceMarker","referenceString")(u)}function o(u){return r.parser.defined.includes(Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function s(u){return n(u)}}function uV(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const cV={name:"labelStartImage",resolveAll:Qy.resolveAll,tokenize:fV};function fV(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),o}function o(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const dV={name:"labelStartLink",resolveAll:Qy.resolveAll,tokenize:hV};function hV(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ag={name:"lineEnding",tokenize:pV};function pV(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),lt(e,t,"linePrefix")}}const vf={name:"thematicBreak",tokenize:mV};function mV(e,t,n){let r=0,i;return o;function o(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,u(d)}function u(d){return d===i?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||Ue(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?lt(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:bV},exit:wV,name:"list",tokenize:yV},gV={partial:!0,tokenize:SV},vV={partial:!0,tokenize:xV};function yV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:bv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(vf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return bv(g)&&++s<10?(e.consume(g),f):(!r.interrupt||s<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(gV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function bV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vV,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function xV(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function wV(e){e.exit(this.containerState.type)}function SV(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ut(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const n_={name:"setextUnderline",resolveTo:EV,tokenize:_V};function EV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function _V(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?lt(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Ue(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const kV={tokenize:CV};function CV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(N7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TV={resolveAll:hD()},AV=dD("string"),RV=dD("text");function dD(e){return{resolveAll:hD(e==="text"?DV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,u);return s;function s(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v<m.length;){const g=m[v];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function hD(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function DV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,u=0,f;for(;o--;){const d=i[o];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(d===-2)f=!0,u++;else if(d!==-1){o++;break}}if(u){const d={type:n===e.length||f||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const NV={42:On,43:On,45:On,48:On,49:On,50:On,51:On,52:On,53:On,54:On,55:On,56:On,57:On,62:aD},OV={91:M7},LV={[-2]:ig,[-1]:ig,32:ig},zV={35:U7,42:vf,45:[n_,vf],60:q7,61:n_,95:vf,96:e_,126:e_},jV={38:lD,92:oD},MV={[-5]:ag,[-4]:ag,[-3]:ag,33:cV,38:lD,42:xv,60:[d7,J7],91:dV,92:[G7,oD],93:Qy,95:xv,96:k7},PV={null:[xv,TV]},FV={null:[42,95]},IV={null:[]},GV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FV,contentInitial:OV,disable:IV,document:NV,flow:zV,flowInitial:LV,insideSpan:PV,string:jV,text:MV},Symbol.toStringTag,{value:"Module"}));function BV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],u=[];const f={attempt:R(D),check:R(z),consume:_,enter:T,exit:N,interrupt:R(z,{interrupt:!0})},d={code:null,containerState:{},defineSkip:x,events:[],now:w,parser:e,previous:null,sliceSerialize:v,sliceStream:g,write:m};let p=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function m(V){return s=fr(s,V),k(),s[s.length-1]!==null?[]:(B(t,0),d.events=Rd(o,d.events,d),d.events)}function v(V,q){return HV(g(V),q)}function g(V){return UV(s,V)}function w(){const{_bufferIndex:V,_index:q,line:I,column:Y,offset:Z}=r;return{_bufferIndex:V,_index:q,line:I,column:Y,offset:Z}}function x(V){i[V.line]=V.column,j()}function k(){let V;for(;r._index<s.length;){const q=s[r._index];if(typeof q=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<q.length;)C(q.charCodeAt(r._bufferIndex));else C(q)}}function C(V){p=p(V)}function _(V){Ue(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,j()):V!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=V}function T(V,q){const I=q||{};return I.type=V,I.start=w(),d.events.push(["enter",I,d]),u.push(I),I}function N(V){const q=u.pop();return q.end=w(),d.events.push(["exit",q,d]),q}function D(V,q){B(V,q.from)}function z(V,q){q.restore()}function R(V,q){return I;function I(Y,Z,U){let G,F,K,A;return Array.isArray(Y)?M(Y):"tokenize"in Y?M([Y]):$(Y);function $(ue){return ae;function ae(oe){const Ce=oe!==null&&ue[oe],he=oe!==null&&ue.null,Ee=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(he)?he:he?[he]:[]];return M(Ee)(oe)}}function M(ue){return G=ue,F=0,ue.length===0?U:O(ue[F])}function O(ue){return ae;function ae(oe){return A=P(),K=ue,ue.partial||(d.currentConstruct=ue),ue.name&&d.parser.constructs.disable.null.includes(ue.name)?re():ue.tokenize.call(q?Object.assign(Object.create(d),q):d,f,X,re)(oe)}}function X(ue){return V(K,A),Z}function re(ue){return A.restore(),++F<G.length?O(G[F]):U}}}function B(V,q){V.resolveAll&&!o.includes(V)&&o.push(V),V.resolve&&Kn(d.events,q,d.events.length-q,V.resolve(d.events.slice(q),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function P(){const V=w(),q=d.previous,I=d.currentConstruct,Y=d.events.length,Z=Array.from(u);return{from:Y,restore:U};function U(){r=V,d.previous=q,d.currentConstruct=I,d.events.length=Y,u=Z,j()}}function j(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function UV(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function HV(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
||
`;break}case-3:{s=`\r
|
||
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function $V(e){const r={constructs:rD([GV,...(e||{}).extensions||[]]),content:i(a7),defined:[],document:i(l7),flow:i(kV),lazy:{},string:i(AV),text:i(RV)};return r;function i(o){return s;function s(u){return BV(r,o,u)}}}function VV(e){for(;!sD(e););return e}const r_=/[\0\t\n\r]/g;function qV(){let e=1,t="",n=!0,r;return i;function i(o,s,u){const f=[];let d,p,m,v,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),m=0,t="",n&&(o.charCodeAt(0)===65279&&m++,n=void 0);m<o.length;){if(r_.lastIndex=m,d=r_.exec(o),v=d&&d.index!==void 0?d.index:o.length,g=o.charCodeAt(v),!d){t=o.slice(m);break}if(g===10&&m===v&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),m<v&&(f.push(o.slice(m,v)),e+=v-m),g){case 0:{f.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,f.push(-2);e++<p;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}m=v+1}return u&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const YV=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function WV(e){return e.replace(YV,XV)}function XV(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return iD(n.slice(o?2:1),o?16:10)}return Zy(n)||e}const pD={}.hasOwnProperty;function KV(e,t,n){return typeof t!="string"&&(n=t,t=void 0),ZV(n)(VV($V(n).document().write(qV()(e,t,!0))))}function ZV(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ge),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(xe),blockQuote:o(he),characterEscape:P,characterReference:P,codeFenced:o(Ee),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ee,s),codeText:o(we,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(Pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ae),hardBreakEscape:o(ee),hardBreakTrailing:o(ee),htmlFlow:o(ce,s),htmlFlowData:P,htmlText:o(ce,s),htmlTextData:P,image:o(Te),label:s,link:o(ge),listItem:o(ie),listItemValue:v,listOrdered:o(Se,m),listUnordered:o(Se),paragraph:o(He),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(xe),strong:o(Ge),thematicBreak:o(Ne)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:Ce,autolinkProtocol:oe,blockQuote:f(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ue,characterReference:ae,codeFenced:f(k),codeFencedFence:x,codeFencedFenceInfo:g,codeFencedFenceMeta:w,codeFlowValue:j,codeIndented:f(C),codeText:f(Z),codeTextData:j,data:j,definition:f(),definitionDestinationString:N,definitionLabelString:_,definitionTitleString:T,emphasis:f(),hardBreakEscape:f(q),hardBreakTrailing:f(q),htmlFlow:f(I),htmlFlowData:j,htmlText:f(Y),htmlTextData:j,image:f(G),label:K,labelText:F,lineEnding:V,link:f(U),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:X,resourceDestinationString:A,resourceTitleString:$,resource:M,setextHeading:f(B),setextHeadingLineSequence:R,setextHeadingText:z,strong:f(),thematicBreak:f()}};mD(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let de={type:"root",children:[]};const Oe={stack:[de],tokenStack:[],config:t,enter:u,exit:d,buffer:s,resume:p,data:n},$e=[];let Ye=-1;for(;++Ye<te.length;)if(te[Ye][1].type==="listOrdered"||te[Ye][1].type==="listUnordered")if(te[Ye][0]==="enter")$e.push(Ye);else{const vt=$e.pop();Ye=i(te,vt,Ye)}for(Ye=-1;++Ye<te.length;){const vt=t[te[Ye][0]];pD.call(vt,te[Ye][1].type)&&vt[te[Ye][1].type].call(Object.assign({sliceSerialize:te[Ye][2].sliceSerialize},Oe),te[Ye][1])}if(Oe.tokenStack.length>0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||i_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)de=t.transforms[Ye](de)||de;return de}function i(te,de,Oe){let $e=de-1,Ye=-1,vt=!1,Mt,bt,rt,qt;for(;++$e<=Oe;){const at=te[$e];switch(at[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{at[0]==="enter"?Ye++:Ye--,qt=void 0;break}case"lineEndingBlank":{at[0]==="enter"&&(Mt&&!qt&&!Ye&&!rt&&(rt=$e),qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qt=void 0}if(!Ye&&at[0]==="enter"&&at[1].type==="listItemPrefix"||Ye===-1&&at[0]==="exit"&&(at[1].type==="listUnordered"||at[1].type==="listOrdered")){if(Mt){let At=$e;for(bt=void 0;At--;){const rn=te[At];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;bt&&(te[bt][1].type="lineEndingBlank",vt=!0),rn[1].type="lineEnding",bt=At}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}rt&&(!bt||rt<bt)&&(Mt._spread=!0),Mt.end=Object.assign({},bt?te[bt][1].start:at[1].end),te.splice(bt||$e,0,["exit",Mt,at[2]]),$e++,Oe++}if(at[1].type==="listItemPrefix"){const At={type:"listItem",_spread:!1,start:Object.assign({},at[1].start),end:void 0};Mt=At,te.splice($e,0,["enter",At,at[2]]),$e++,Oe++,rt=void 0,qt=!0}}}return te[de][1]._spread=vt,Oe}function o(te,de){return Oe;function Oe($e){u.call(this,te($e),$e),de&&de.call(this,$e)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(te,de,Oe){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([de,Oe||void 0]),te.position={start:ra(de.start),end:void 0}}function f(te){return de;function de(Oe){te&&te.call(this,Oe),d.call(this,Oe)}}function d(te,de){const Oe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==te.type&&(de?de.call(this,te,$e[0]):($e[1]||i_).call(this,te,$e[0]));else throw new Error("Cannot close `"+te.type+"` ("+Us({start:te.start,end:te.end})+"): it’s not open");Oe.position.end=ra(te.end)}function p(){return Ky(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function v(te){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function g(){const te=this.resume(),de=this.stack[this.stack.length-1];de.lang=te}function w(){const te=this.resume(),de=this.stack[this.stack.length-1];de.meta=te}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/(\r?\n|\r)$/g,"")}function _(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Tr(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function N(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function D(te){const de=this.stack[this.stack.length-1];if(!de.depth){const Oe=this.sliceSerialize(te).length;de.depth=Oe}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function R(te){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(te){const Oe=this.stack[this.stack.length-1].children;let $e=Oe[Oe.length-1];(!$e||$e.type!=="text")&&($e=ve(),$e.position={start:ra(te.start),end:void 0},Oe.push($e)),this.stack.push($e)}function j(te){const de=this.stack.pop();de.value+=this.sliceSerialize(te),de.position.end=ra(te.end)}function V(te){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=de.children[de.children.length-1];Oe.position.end=ra(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(P.call(this,te),j.call(this,te))}function q(){this.data.atHardBreak=!0}function I(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function Y(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function Z(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function U(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function G(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function F(te){const de=this.sliceSerialize(te),Oe=this.stack[this.stack.length-2];Oe.label=WV(de),Oe.identifier=Tr(de).toLowerCase()}function K(){const te=this.stack[this.stack.length-1],de=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const $e=te.children;Oe.children=$e}else Oe.alt=de}function A(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function $(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function M(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function X(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Tr(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function re(te){this.data.characterReferenceType=te.type}function ue(te){const de=this.sliceSerialize(te),Oe=this.data.characterReferenceType;let $e;Oe?($e=iD(de,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=Zy(de);const Ye=this.stack[this.stack.length-1];Ye.value+=$e}function ae(te){const de=this.stack.pop();de.position.end=ra(te.end)}function oe(te){j.call(this,te);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(te)}function Ce(te){j.call(this,te);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(te)}function he(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function ee(){return{type:"break"}}function ce(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function ge(){return{type:"link",title:null,url:"",children:[]}}function Se(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ie(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function He(){return{type:"paragraph",children:[]}}function Ge(){return{type:"strong",children:[]}}function ve(){return{type:"text",value:""}}function Ne(){return{type:"thematicBreak"}}}function ra(e){return{line:e.line,column:e.column,offset:e.offset}}function mD(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?mD(e,r):QV(e,r)}}function QV(e,t){let n;for(n in t)if(pD.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function i_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Us({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Us({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Us({start:t.start,end:t.end})+") is still open")}function JV(e){const t=this;t.parser=n;function n(r){return KV(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function eq(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function tq(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
||
`}]}function nq(e,t){const n=t.value?t.value+`
|
||
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function rq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Dl(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,u+=1,e.footnoteCounts.set(r,u);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function oq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function gD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function sq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={src:Dl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function uq(e,t){const n={src:Dl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function cq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return gD(e,t);const i={href:Dl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function dq(e,t){const n={href:Dl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function hq(e,t,n){const r=e.all(t),i=n?pq(n):vD(t),o={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&s.push({type:"text",value:`
|
||
`}),p.type==="element"&&p.tagName==="p"&&!i?s.push(...p.children):s.push(p)}const f=r[r.length-1];f&&(i||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
||
`});const d={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,d),e.applyData(t,d)}function pq(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=vD(n[r])}return t}function vD(e){const t=e.spread;return t??e.children.length>1}function mq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function gq(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vq(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yq(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bq(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=qy(t.children[1]),f=X2(t.children[t.children.length-1]);u&&f&&(s.position={start:u,end:f}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function xq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let f=-1;const d=[];for(;++f<u;){const m=t.children[f],v={},g=s?s[f]:void 0;g&&(v.align=g);let w={type:"element",tagName:o,properties:v,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),d.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,p),e.applyData(t,p)}function wq(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const a_=9,o_=32;function Sq(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(l_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===a_||o===o_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===a_||o===o_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Eq(e,t){const n={type:"text",value:Sq(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _q(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const kq={blockquote:eq,break:tq,code:nq,delete:rq,emphasis:iq,footnoteReference:aq,heading:oq,html:lq,imageReference:sq,image:uq,inlineCode:cq,linkReference:fq,link:dq,listItem:hq,list:mq,paragraph:gq,root:vq,strong:yq,table:bq,tableCell:wq,tableRow:xq,text:Eq,thematicBreak:_q,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const yD=-1,Dd=0,$s=1,Bf=2,Jy=3,eb=4,tb=5,nb=6,bD=7,xD=8,s_=typeof self=="object"?self:globalThis,Cq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Dd:case yD:return n(s,i);case $s:{const u=n([],i);for(const f of s)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of s)u[r(f)]=r(d);return u}case Jy:return n(new Date(s),i);case eb:{const{source:u,flags:f}=s;return n(new RegExp(u,f),i)}case tb:{const u=n(new Map,i);for(const[f,d]of s)u.set(r(f),r(d));return u}case nb:{const u=n(new Set,i);for(const f of s)u.add(r(f));return u}case bD:{const{name:u,message:f}=s;return n(new s_[u](f),i)}case xD:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new s_[o](s),i)};return r},u_=e=>Cq(new Map,e)(0),Ko="",{toString:Tq}={},{keys:Aq}=Object,Ms=e=>{const t=typeof e;if(t!=="object"||!e)return[Dd,t];const n=Tq.call(e).slice(8,-1);switch(n){case"Array":return[$s,Ko];case"Object":return[Bf,Ko];case"Date":return[Jy,Ko];case"RegExp":return[eb,Ko];case"Map":return[tb,Ko];case"Set":return[nb,Ko];case"DataView":return[$s,n]}return n.includes("Array")?[$s,n]:n.includes("Error")?[bD,n]:[Bf,n]},Qc=([e,t])=>e===Dd&&(t==="function"||t==="symbol"),Rq=(e,t,n,r)=>{const i=(s,u)=>{const f=r.push(s)-1;return n.set(u,f),f},o=s=>{if(n.has(s))return n.get(s);let[u,f]=Ms(s);switch(u){case Dd:{let p=s;switch(f){case"bigint":u=xD,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([yD],s)}return i([u,p],s)}case $s:{if(f){let v=s;return f==="DataView"?v=new Uint8Array(s.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(s)),i([f,[...v]],s)}const p=[],m=i([u,p],s);for(const v of s)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,s.toString()],s);case"Boolean":case"Number":case"String":return i([f,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const p=[],m=i([u,p],s);for(const v of Aq(s))(e||!Qc(Ms(s[v])))&&p.push([o(v),o(s[v])]);return m}case Jy:return i([u,s.toISOString()],s);case eb:{const{source:p,flags:m}=s;return i([u,{source:p,flags:m}],s)}case tb:{const p=[],m=i([u,p],s);for(const[v,g]of s)(e||!(Qc(Ms(v))||Qc(Ms(g))))&&p.push([o(v),o(g)]);return m}case nb:{const p=[],m=i([u,p],s);for(const v of s)(e||!Qc(Ms(v)))&&p.push(o(v));return m}}const{message:d}=s;return i([u,{name:f,message:d}],s)};return o},c_=(e,{json:t,lossy:n}={})=>{const r=[];return Rq(!(t||n),!!t,new Map,r)(e),r},Uf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?u_(c_(e,t)):structuredClone(e):(e,t)=>u_(c_(e,t));function Dq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Nq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Oq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Dq,r=e.options.footnoteBackLabel||Nq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const p=e.all(d),m=String(d.identifier).toUpperCase(),v=Dl(m.toLowerCase());let g=0;const w=[],x=e.footnoteCounts.get(m);for(;x!==void 0&&++g<=x;){w.length>0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Uf(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
||
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
||
`}]}}const Nd=function(e){if(e==null)return Mq;if(typeof e=="function")return Od(e);if(typeof e=="object")return Array.isArray(e)?Lq(e):zq(e);if(typeof e=="string")return jq(e);throw new Error("Expected function, string, or object as test")};function Lq(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Nd(e[n]);return Od(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function zq(e){const t=e;return Od(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function jq(e){return Od(t);function t(n){return n&&n.type===e}}function Od(e){return t;function t(n,r,i){return!!(Pq(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Mq(){return!0}function Pq(e){return e!==null&&typeof e=="object"&&"type"in e}const wD=[],Fq=!0,wv=!1,Iq="skip";function SD(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Nd(i),s=r?-1:1;u(e,void 0,[])();function u(f,d,p){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const g=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return v;function v(){let g=wD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Gq(n(f,p)),g[0]===wv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Iq)for(x=(r?C.children.length:-1)+s,k=p.concat(C);x>-1&&x<C.children.length;){const _=C.children[x];if(w=u(_,x,k)(),w[0]===wv)return w;x=typeof w[1]=="number"?w[1]:x+s}}return g}}}function Gq(e){return Array.isArray(e)?e:typeof e=="number"?[Fq,e]:e==null?wD:[e]}function rb(e,t,n,r){let i,o,s;typeof t=="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),SD(e,o,u,i);function u(f,d){const p=d[d.length-1],m=p?p.children.indexOf(f):void 0;return s(f,m,p)}}const Sv={}.hasOwnProperty,Bq={};function Uq(e,t){const n=t||Bq,r=new Map,i=new Map,o=new Map,s={...kq,...n.handlers},u={all:d,applyData:$q,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:f,options:n,patch:Hq,wrap:qq};return rb(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,v=String(p.identifier).toUpperCase();m.has(v)||m.set(v,p)}}),u;function f(p,m){const v=p.type,g=u.handlers[v];if(Sv.call(u.handlers,v)&&g)return g(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(v)){if("children"in p){const{children:x,...k}=p,C=Uf(k);return C.children=u.all(p),C}return Uf(p)}return(u.options.unknownHandler||Vq)(u,p,m)}function d(p){const m=[];if("children"in p){const v=p.children;let g=-1;for(;++g<v.length;){const w=u.one(v[g],p);if(w){if(g&&v[g-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=f_(w.value)),!Array.isArray(w)&&w.type==="element")){const x=w.children[0];x&&x.type==="text"&&(x.value=f_(x.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function Hq(e,t){e.position&&(t.position=D8(e))}function $q(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Uf(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Vq(e,t){const n=t.data||{},r="value"in t&&!(Sv.call(n,"hProperties")||Sv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qq(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
||
`});++r<e.length;)r&&n.push({type:"text",value:`
|
||
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
||
`}),n}function f_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function d_(e,t){const n=Uq(e,t),r=n.one(e,void 0),i=Oq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
||
`},i),o}function Yq(e,t){return e&&"run"in e?async function(n,r){const i=d_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return d_(n,{file:r,...e||t})}}function h_(e){if(e)throw e}var og,p_;function Wq(){if(p_)return og;p_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},s=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return og=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k<C;++k)if(d=arguments[k],d!=null)for(p in d)m=u(x,p),v=u(d,p),x!==v&&(_&&v&&(o(v)||(g=i(v)))?(g?(g=!1,w=m&&i(m)?m:[]):w=m&&o(m)?m:{},s(x,{name:p,newValue:f(_,w,v)})):typeof v<"u"&&s(x,{name:p,newValue:v}));return x},og}var Xq=Wq();const lg=fn(Xq);function Ev(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Kq(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(f,...d){const p=e[++o];let m=-1;if(f){s(f);return}for(;++m<i.length;)(d[m]===null||d[m]===void 0)&&(d[m]=i[m]);i=d,p?Zq(p,u)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Zq(e,t){let n;return r;function r(...s){const u=e.length>s.length;let f;u&&s.push(i);try{f=e.apply(this,s)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(s,...u){n||(n=!0,t(s,...u))}function o(s){i(null,s)}}const Gr={basename:Qq,dirname:Jq,extname:eY,join:tY,sep:"/"};function Qq(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Jq(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function eY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function tY(...e){let t=-1,n;for(;++t<e.length;)bu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":nY(n)}function nY(e){bu(e);const t=e.codePointAt(0)===47;let n=rY(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function rY(e,t){let n="",r=0,i=-1,o=0,s=-1,u,f;for(;++s<=e.length;){if(s<e.length)u=e.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const iY={cwd:aY};function aY(){return"/"}function _v(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function oY(e){if(typeof e=="string")e=new URL(e);else if(!_v(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lY(e)}function lY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const sg=["history","path","basename","stem","extname","dirname"];class ED{constructor(t){let n;t?_v(t)?n={path:t}:typeof t=="string"||sY(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":iY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sg.length;){const o=sg[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)sg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Gr.basename(this.path):void 0}set basename(t){cg(t,"basename"),ug(t,"basename"),this.path=Gr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gr.dirname(this.path):void 0}set dirname(t){m_(this.basename,"dirname"),this.path=Gr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gr.extname(this.path):void 0}set extname(t){if(ug(t,"extname"),m_(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){_v(t)&&(t=oY(t)),cg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gr.basename(this.path,this.extname):void 0}set stem(t){cg(t,"stem"),ug(t,"stem"),this.path=Gr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new wn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ug(e,t){if(e&&e.includes(Gr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gr.sep+"`")}function cg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function m_(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function sY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uY=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},cY={}.hasOwnProperty;class ib extends uY{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Kq()}copy(){const t=new ib;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(lg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hg("data",this.frozen),this.namespace[t]=n,this):cY.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Jc(t),r=this.parser||this.Parser;return fg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),fg("process",this.parser||this.Parser),dg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const u=Jc(t),f=r.parse(u);r.run(f,u,function(p,m,v){if(p||!m||!v)return d(p);const g=m,w=r.stringify(g,v);hY(w)?v.value=w:v.result=w,d(p,v)});function d(p,m){p||!m?s(p):o?o(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),fg("processSync",this.parser||this.Parser),dg("processSync",this.compiler||this.Compiler),this.process(t,i),v_("processSync","process",n),r;function i(o,s){n=!0,h_(o),r=s}}run(t,n,r){g_(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,u){const f=Jc(n);i.run(t,f,d);function d(p,m,v){const g=m||t;p?u(p):s?s(g):r(void 0,g,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),v_("runSync","run",r),i;function o(s,u){h_(s),i=u,r=!0}}stringify(t,n){this.freeze();const r=Jc(n),i=this.compiler||this.Compiler;return dg("stringify",i),g_(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(hg("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[p,...m]=d;f(p,m)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(i.settings=lg(!0,i.settings,d.settings))}function u(d){let p=-1;if(d!=null)if(Array.isArray(d))for(;++p<d.length;){const m=d[p];o(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,p){let m=-1,v=-1;for(;++m<r.length;)if(r[m][0]===d){v=m;break}if(v===-1)r.push([d,...p]);else if(p.length>0){let[g,...w]=p;const x=r[v][1];Ev(x)&&Ev(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const fY=new ib().freeze();function fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g_(e){if(!Ev(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function v_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return dY(e)?e:new ED(e)}function dY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function hY(e){return typeof e=="string"||pY(e)}function pY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",y_=[],b_={allowDangerousHtml:!0},gY=/^(https?|ircs?|mailto|xmpp)$/i,vY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,u=e.rehypePlugins||y_,f=e.remarkPlugins||y_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b_}:b_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||bY,g=fY().use(JV).use(f).use(Yq,d).use(u),w=new ED;typeof r=="string"&&(w.value=r);for(const _ of vY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+mY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),rb(k,C),Q2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in rg)if(Object.hasOwn(rg,D)&&Object.hasOwn(_.properties,D)){const z=_.properties[D],R=rg[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(z||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function bY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||gY.test(e.slice(0,t))?e:""}function x_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function xY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wY(e,t,n){const i=Nd((n||{}).ignore||[]),o=SY(t);let s=-1;for(;++s<o.length;)SD(e,"text",u);function u(d,p){let m=-1,v;for(;++m<p.length;){const g=p[m],w=v?v.children:void 0;if(i(g,w?w.indexOf(g):void 0,v))return;v=g}if(v)return f(d,p)}function f(d,p){const m=p[p.length-1],v=o[s][0],g=o[s][1];let w=0;const k=m.children.indexOf(d);let C=!1,_=[];v.lastIndex=0;let T=v.exec(d.value);for(;T;){const N=T.index,D={index:T.index,input:T.input,stack:[...p,d]};let z=g(...T,D);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(z)?_.push(...z):z&&_.push(z),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w<d.value.length&&_.push({type:"text",value:d.value.slice(w)}),m.children.splice(k,1,..._)):_=[d],k+_.length}}function SY(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([EY(i[0]),_Y(i[1])])}return t}function EY(e){return typeof e=="string"?new RegExp(xY(e),"g"):e}function _Y(e){return typeof e=="function"?e:function(){return e}}const pg="phrasing",mg=["autolink","link","image","label"];function kY(){return{transforms:[OY],enter:{literalAutolink:TY,literalAutolinkEmail:gg,literalAutolinkHttp:gg,literalAutolinkWww:gg},exit:{literalAutolink:NY,literalAutolinkEmail:DY,literalAutolinkHttp:AY,literalAutolinkWww:RY}}}function CY(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pg,notInConstruct:mg},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pg,notInConstruct:mg},{character:":",before:"[ps]",after:"\\/",inConstruct:pg,notInConstruct:mg}]}}function TY(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gg(e){this.config.enter.autolinkProtocol.call(this,e)}function AY(e){this.config.exit.autolinkProtocol.call(this,e)}function RY(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function DY(e){this.config.exit.autolinkEmail.call(this,e)}function NY(e){this.exit(e)}function OY(e){wY(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LY],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),zY]],{ignore:["link","linkReference"]})}function LY(e,t,n,r,i){let o="";if(!_D(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!jY(n)))return!1;const s=MY(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function zY(e,t,n,r){return!_D(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jY(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function MY(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=x_(e,"(");let o=x_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function _D(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Ad(n))&&(!t||n!==47)}kD.peek=VY;function PY(){this.buffer()}function FY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UY(e){this.exit(e)}function HY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $Y(e){this.exit(e)}function VY(){return"["}function kD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),s(),o+=i.move("]"),o}function qY(){return{enter:{gfmFootnoteCallString:PY,gfmFootnoteCall:FY,gfmFootnoteDefinitionLabelString:IY,gfmFootnoteDefinition:GY},exit:{gfmFootnoteCallString:BY,gfmFootnoteCall:UY,gfmFootnoteDefinitionLabelString:HY,gfmFootnoteDefinition:$Y}}}function YY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const u=o.createTracker(s);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?`
|
||
`:" ")+o.indentLines(o.containerFlow(r,u.current()),t?CD:WY))),d(),f}}function WY(e,t,n){return t===0?e:CD(e,t,n)}function CD(e,t,n){return(n?"":" ")+e}const XY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TD.peek=eW;function KY(){return{canContainEols:["delete"],enter:{strikethrough:QY},exit:{strikethrough:JY}}}function ZY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:XY}],handlers:{delete:TD}}}function QY(e){this.enter({type:"delete",children:[]},e)}function JY(e){this.exit(e)}function TD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function eW(){return"~"}function tW(e){return e.length}function nW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tW,o=[],s=[],u=[],f=[];let d=0,p=-1;for(;++p<e.length;){const x=[],k=[];let C=-1;for(e[p].length>d&&(d=e[p].length);++C<e[p].length;){const _=rW(e[p][C]);if(n.alignDelimiters!==!1){const T=i(_);k[C]=T,(f[C]===void 0||T>f[C])&&(f[C]=T)}x.push(_)}s[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<d;)o[m]=w_(r[m]);else{const x=w_(r);for(;++m<d;)o[m]=x}m=-1;const v=[],g=[];for(;++m<d;){const x=o[m];let k="",C="";x===99?(k=":",C=":"):x===108?k=":":x===114&&(C=":");let _=n.alignDelimiters===!1?1:Math.max(1,f[m]-k.length-C.length);const T=k+"-".repeat(_)+C;n.alignDelimiters!==!1&&(_=k.length+_+C.length,_>f[m]&&(f[m]=_),g[m]=_),v[m]=T}s.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p<s.length;){const x=s[p],k=u[p];m=-1;const C=[];for(;++m<d;){const _=x[m]||"";let T="",N="";if(n.alignDelimiters!==!1){const D=f[m]-(k[m]||0),z=o[m];z===114?T=" ".repeat(D):z===99?D%2?(T=" ".repeat(D/2+.5),N=" ".repeat(D/2-.5)):(T=" ".repeat(D/2),N=T):N=" ".repeat(D)}n.delimiterStart!==!1&&!m&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||m)&&C.push(" "),n.alignDelimiters!==!1&&C.push(T),C.push(_),n.alignDelimiters!==!1&&C.push(N),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||m!==d-1)&&C.push("|")}w.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return w.join(`
|
||
`)}function rW(e){return e==null?"":String(e)}function w_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function iW(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),aW);return i(),s}function aW(e,t,n){return">"+(n?"":" ")+e}function oW(e,t){return S_(e,t.inConstruct,!0)&&!S_(e,t.notInConstruct,!1)}function S_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function E_(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
||
`&&oW(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
||
`}function AD(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function lW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uW(e,t,n,r){const i=sW(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(lW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,cW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(AD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${s}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${s}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:`
|
||
`,encode:["`"],...u.current()})),m()}return p+=u.move(`
|
||
`),o&&(p+=u.move(o+`
|
||
`)),p+=u.move(f),d(),p}function cW(e,t,n){return(n?"":" ")+e}function ab(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fW(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
||
`,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),s(),d}function dW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=pl(e),i=pl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}RD.peek=hW;function RD(e,t,n,r){const i=dW(n),o=n.enter("emphasis"),s=n.createTracker(r),u=s.move(i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function hW(e,t,n){return n.options.emphasis||"*"}function pW(e,t){let n=!1;return rb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,wv}),!!((!e.depth||e.depth<3)&&Ky(e)&&(t.options.setext||n))}function mW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(pW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:`
|
||
`,after:`
|
||
`});return m(),p(),v+`
|
||
`+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
||
`))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(s+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
||
`,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?s+" "+d:s,n.options.closeAtx&&(d+=" "+s),f(),u(),d}DD.peek=gW;function DD(e){return e.value||""}function gW(){return"<"}ND.peek=vW;function ND(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),s(),d}function vW(){return"!"}OD.peek=yW;function OD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function yW(){return"!"}LD.peek=bW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const s=n.unsafe[o],u=n.compilePattern(s);let f;if(s.atBreak)for(;f=u.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return i+r+i}function bW(){return"`"}function zD(e,t){const n=Ky(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jD.peek=xW;function jD(e,t,n,r){const i=ab(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=s.move("<");return m+=s.move(n.containerPhrasing(e,{before:m,after:">",...s.current()})),m+=s.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=s.move("[");return d+=s.move(n.containerPhrasing(e,{before:d,after:"](",...s.current()})),d+=s.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=s.move("<"),d+=s.move(n.safe(e.url,{before:d,after:">",...s.current()})),d+=s.move(">")):(f=n.enter("destinationRaw"),d+=s.move(n.safe(e.url,{before:d,after:e.title?" ":")",...s.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=s.move(" "+i),d+=s.move(n.safe(e.title,{before:d,after:i,...s.current()})),d+=s.move(i),f()),d+=s.move(")"),u(),d}function xW(e,t,n){return zD(e,n)?"<":"["}MD.peek=wW;function MD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),s();const p=n.stack;n.stack=[],s=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return s(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function wW(){return"["}function ob(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function SW(e){const t=ob(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function EW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function PD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _W(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?EW(n):ob(n);const u=e.ordered?s==="."?")":".":SW(n);let f=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),PD(n)===s&&p){let m=-1;for(;++m<e.children.length;){const v=e.children[m];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(s=u),n.bulletCurrent=s;const d=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),d}function kW(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function CW(e,t,n,r){const i=kW(n);let o=n.bulletCurrent||ob(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(s-o.length)),u.shift(s);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(s))+m:(g?o:o+" ".repeat(s-o.length))+m}}function TW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const AW=Nd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function RW(e,t,n,r){return(e.children.some(function(s){return AW(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FD.peek=NW;function FD(e,t,n,r){const i=DW(n),o=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let f=s.move(n.containerPhrasing(e,{after:i,before:u,...s.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function NW(e,t,n){return n.options.strong||"*"}function OW(e,t,n,r){return n.safe(e.value,r)}function LW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zW(e,t,n){const r=(PD(n)+(n.options.ruleSpaces?" ":"")).repeat(LW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ID={blockquote:iW,break:E_,code:uW,definition:fW,emphasis:RD,hardBreak:E_,heading:mW,html:DD,image:ND,imageReference:OD,inlineCode:LD,link:jD,linkReference:MD,list:_W,listItem:CW,paragraph:TW,root:RW,strong:FD,text:OW,thematicBreak:zW};function jW(){return{enter:{table:MW,tableData:__,tableHeader:__,tableRow:FW},exit:{codeText:IW,table:PW,tableData:vg,tableHeader:vg,tableRow:vg}}}function MW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function PW(e){this.exit(e),this.data.inTable=void 0}function FW(e){this.enter({type:"tableRow",children:[]},e)}function vg(e){this.exit(e)}function __(e){this.enter({type:"tableCell",children:[]},e)}function IW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,GW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function GW(e,t){return t==="|"?t:e}function BW(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
||
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:s,tableCell:f,tableRow:u}};function s(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(`
|
||
`))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return nW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C<k.length;)_[C]=m(k[C],w,x);return T(),_}function m(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("tableRow");for(;++C<k.length;)_[C]=f(k[C],g,w,x);return T(),_}function v(g,w,x){let k=ID.inlineCode(g,w,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function UW(){return{exit:{taskListCheckValueChecked:k_,taskListCheckValueUnchecked:k_,paragraph:$W}}}function HW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VW}}}function k_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function $W(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,s;for(;++o<i.length;){const u=i[o];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function VW(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);o&&u.move(s);let f=ID.listItem(e,t,n,{...r,...u.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(p){return p+s}}function qW(){return[kY(),qY(),KY(),jW(),UW()]}function YW(e){return{extensions:[CY(),YY(e),ZY(),BW(e),HW()]}}const WW={tokenize:eX,partial:!0},GD={tokenize:tX,partial:!0},BD={tokenize:nX,partial:!0},UD={tokenize:rX,partial:!0},XW={tokenize:iX,partial:!0},HD={name:"wwwAutolink",tokenize:QW,previous:VD},$D={name:"protocolAutolink",tokenize:JW,previous:qD},Ri={name:"emailAutolink",tokenize:ZW,previous:YD},Kr={};function KW(){return{text:Kr}}let Ua=48;for(;Ua<123;)Kr[Ua]=Ri,Ua++,Ua===58?Ua=65:Ua===91&&(Ua=97);Kr[43]=Ri;Kr[45]=Ri;Kr[46]=Ri;Kr[95]=Ri;Kr[72]=[Ri,$D];Kr[104]=[Ri,$D];Kr[87]=[Ri,HD];Kr[119]=[Ri,HD];function ZW(e,t,n){const r=this;let i,o;return s;function s(m){return!kv(m)||!YD.call(r,r.previous)||lb(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(m))}function u(m){return kv(m)?(e.consume(m),u):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(XW,p,d)(m):m===45||m===95||yn(m)?(o=!0,e.consume(m),f):p(m)}function d(m){return e.consume(m),i=!0,f}function p(m){return o&&i&&kn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function QW(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!VD.call(r,r.previous)||lb(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WW,e.attempt(GD,e.attempt(BD,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function JW(e,t,n){const r=this;let i="",o=!1;return s;function s(m){return(m===72||m===104)&&qD.call(r,r.previous)&&!lb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(m),e.consume(m),u):n(m)}function u(m){if(kn(m)&&i.length<5)return i+=String.fromCodePoint(m),e.consume(m),u;if(m===58){const v=i.toLowerCase();if(v==="http"||v==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),o?d:(o=!0,f)):n(m)}function d(m){return m===null||Gf(m)||Tt(m)||to(m)||Ad(m)?n(m):e.attempt(GD,e.attempt(BD,p),n)(m)}function p(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function eX(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function tX(e,t,n){let r,i,o;return s;function s(d){return d===46||d===95?e.check(UD,f,u)(d):d===null||Tt(d)||to(d)||d!==45&&Ad(d)?f(d):(o=!0,e.consume(d),s)}function u(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),s}function f(d){return i||r||!o?n(d):t(d)}}function nX(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(UD,t,o)(s):s===null||Tt(s)||to(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function rX(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),o):u===93?(e.consume(u),i):u===60||u===null||Tt(u)||to(u)?t(u):n(u)}function i(u){return u===null||u===40||u===91||Tt(u)||to(u)?t(u):r(u)}function o(u){return kn(u)?s(u):n(u)}function s(u){return u===59?(e.consume(u),r):kn(u)?(e.consume(u),s):n(u)}}function iX(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return yn(o)?n(o):t(o)}}function VD(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tt(e)}function qD(e){return!kn(e)}function YD(e){return!(e===47||kv(e))}function kv(e){return e===43||e===45||e===46||e===95||yn(e)}function lb(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const aX={tokenize:hX,partial:!0};function oX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cX,continuation:{tokenize:fX},exit:dX}},text:{91:{name:"gfmFootnoteCall",tokenize:uX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lX,resolveTo:sX}}}}function lX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){s=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!s||!s._balanced)return n(f);const d=Tr(r.sliceSerialize({start:s.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function sX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function uX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!s||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(s=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function cX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(s>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),s++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),s++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),lt(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function fX(e,t,n){return e.check(yu,t,e.attempt(aX,t,n))}function dX(e){e.exit("gfmFootnoteDefinition")}function hX(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function pX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let f=-1;for(;++f<s.length;)if(s[f][0]==="enter"&&s[f][1].type==="strikethroughSequenceTemporary"&&s[f][1]._close){let d=f;for(;d--;)if(s[d][0]==="exit"&&s[d][1].type==="strikethroughSequenceTemporary"&&s[d][1]._open&&s[f][1].end.offset-s[f][1].start.offset===s[d][1].end.offset-s[d][1].start.offset){s[f][1].type="strikethroughSequence",s[d][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},s[d][1].start),end:Object.assign({},s[f][1].end)},m={type:"strikethroughText",start:Object.assign({},s[d][1].end),end:Object.assign({},s[f][1].start)},v=[["enter",p,u],["enter",s[d][1],u],["exit",s[d][1],u],["enter",m,u]],g=u.parser.constructs.insideSpan.null;g&&Kn(v,v.length,0,Rd(g,s.slice(d+1,f),u)),Kn(v,v.length,0,[["exit",m,u],["enter",s[f][1],u],["exit",s[f][1],u],["exit",p,u]]),Kn(s,d-1,f-d+3,v),f=d+v.length-2;break}}for(f=-1;++f<s.length;)s[f][1].type==="strikethroughSequenceTemporary"&&(s[f][1].type="data");return s}function o(s,u,f){const d=this.previous,p=this.events;let m=0;return v;function v(w){return d===126&&p[p.length-1][1].type!=="characterEscape"?f(w):(s.enter("strikethroughSequenceTemporary"),g(w))}function g(w){const x=pl(d);if(w===126)return m>1?f(w):(s.consume(w),m++,g);if(m<2&&!n)return f(w);const k=s.exit("strikethroughSequenceTemporary"),C=pl(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class mX{constructor(){this.map=[]}add(t,n,r){gX(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function vX(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function yX(){return{flow:{null:{name:"table",tokenize:bX,resolveAll:xX}}}}function bX(e,t,n){const r=this;let i=0,o=0,s;return u;function u(j){let V=r.events.length-1;for(;V>-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?z:f;return I===z&&r.parser.lazy[r.now().line]?n(j):I(j)}function f(j){return e.enter("tableHead"),e.enter("tableRow"),d(j)}function d(j){return j===124||(s=!0,o+=1),p(j)}function p(j){return j===null?n(j):Ue(j)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),g):n(j):ut(j)?lt(e,p,"whitespace")(j):(o+=1,s&&(s=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),s=!0,p):(e.enter("data"),m(j)))}function m(j){return j===null||j===124||Tt(j)?(e.exit("data"),p(j)):(e.consume(j),j===92?v:m)}function v(j){return j===92||j===124?(e.consume(j),m):m(j)}function g(j){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(j):(e.enter("tableDelimiterRow"),s=!1,ut(j)?lt(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):w(j))}function w(j){return j===45||j===58?k(j):j===124?(s=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),x):D(j)}function x(j){return ut(j)?lt(e,k,"whitespace")(j):k(j)}function k(j){return j===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),C):j===45?(o+=1,C(j)):j===null||Ue(j)?N(j):D(j)}function C(j){return j===45?(e.enter("tableDelimiterFiller"),_(j)):D(j)}function _(j){return j===45?(e.consume(j),_):j===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(j))}function T(j){return ut(j)?lt(e,N,"whitespace")(j):N(j)}function N(j){return j===124?w(j):j===null||Ue(j)?!s||i!==o?D(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):D(j)}function D(j){return n(j)}function z(j){return e.enter("tableRow"),R(j)}function R(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),R):j===null||Ue(j)?(e.exit("tableRow"),t(j)):ut(j)?lt(e,R,"whitespace")(j):(e.enter("data"),B(j))}function B(j){return j===null||j===124||Tt(j)?(e.exit("data"),R(j)):(e.consume(j),j===92?P:B)}function P(j){return j===92||j===124?(e.consume(j),B):B(j)}}function xX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],u=!1,f=0,d,p,m;const v=new mX;for(;++n<e.length;){const g=e[n],w=g[1];g[0]==="enter"?w.type==="tableHead"?(u=!1,f!==0&&(C_(v,t,f,d,p),p=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,p={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(n,0,[["enter",p,t]])),i=w.type==="tableDelimiterRow"?2:p?3:1):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],m=ef(v,t,o,i,void 0,m),o=[0,0,0,0]),s[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],m=ef(v,t,o,i,void 0,m)),o=s,s=[o[1],n,0,0])):w.type==="tableHead"?(u=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,o[1]!==0?(s[0]=s[1],m=ef(v,t,o,i,n,m)):s[1]!==0&&(m=ef(v,t,s,i,n,m)),i=0):i&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(s[3]=n)}for(f!==0&&C_(v,t,f,d,p),v.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=vX(t.events,n))}return e}function ef(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(o.end=Object.assign({},el(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=el(t.events,n[1]);if(o={type:s,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=el(t.events,n[2]),p=el(t.events,n[3]),m={type:u,start:Object.assign({},d),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const v=t.events[n[2]],g=t.events[n[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},el(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function C_(e,t,n,r,i){const o=[],s=el(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function el(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wX={name:"tasklistCheck",tokenize:EX};function SX(){return{text:{91:wX}}}function EX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),s):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),s):n(f)}function s(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Ue(f)?t(f):ut(f)?e.check({tokenize:_X},t,n)(f):n(f)}}function _X(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kX(e){return rD([KW(),oX(),pX(e),yX(),SX()])}const CX={};function TX(e){const t=this,n=e||CX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kX(n)),o.push(qW()),s.push(YW(n))}function AX(e){const t=this;t.compiler=n;function n(r,i){return Q2(r,{filePath:i.path,...e})}}function RX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:s,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function s(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function DX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
||
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,s,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(AD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:`
|
||
`,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(`
|
||
`),d&&(g+=p.move(d+`
|
||
`)),g+=p.move(m),v(),g}function r(o,s,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++m<u.unsafe.length;){const v=u.unsafe[m];if(!v.atBreak)continue;const g=u.compilePattern(v);let w;for(;w=g.exec(f);){let x=w.index;f.codePointAt(x)===10&&f.codePointAt(x-1)===13&&x--,f=f.slice(0,x)+" "+f.slice(w.index+1)}}return p+f+p}function i(){return"$"}}const NX={tokenize:OX,concrete:!0,name:"mathFlow"},T_={tokenize:LX,partial:!0};function OX(e,t,n){const r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0;return u;function u(_){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),f(_)}function f(_){return _===36?(e.consume(_),s++,f):s<2?n(_):(e.exit("mathFlowFenceSequence"),lt(e,d,"whitespace")(_))}function d(_){return _===null||Ue(_)?m(_):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===null||Ue(_)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(_)):_===36?n(_):(e.consume(_),p)}function m(_){return e.exit("mathFlowFence"),r.interrupt?t(_):e.attempt(T_,v,k)(_)}function v(_){return e.attempt({tokenize:C,partial:!0},k,g)(_)}function g(_){return(o?lt(e,w,"linePrefix",o+1):w)(_)}function w(_){return _===null?k(_):Ue(_)?e.attempt(T_,v,k)(_):(e.enter("mathFlowValue"),x(_))}function x(_){return _===null||Ue(_)?(e.exit("mathFlowValue"),w(_)):(e.consume(_),x)}function k(_){return e.exit("mathFlow"),t(_)}function C(_,T,N){let D=0;return lt(_,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function z(P){return _.enter("mathFlowFence"),_.enter("mathFlowFenceSequence"),R(P)}function R(P){return P===36?(D++,_.consume(P),R):D<s?N(P):(_.exit("mathFlowFenceSequence"),lt(_,B,"whitespace")(P))}function B(P){return P===null||Ue(P)?(_.exit("mathFlowFence"),T(P)):N(P)}}}function LX(e,t,n){const r=this;return i;function i(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function zX(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:r,resolve:jX,previous:MX,name:"mathText"};function r(i,o,s){let u=0,f,d;return p;function p(x){return i.enter("mathText"),i.enter("mathTextSequence"),m(x)}function m(x){return x===36?(i.consume(x),u++,m):u<2&&!n?s(x):(i.exit("mathTextSequence"),v(x))}function v(x){return x===null?s(x):x===36?(d=i.enter("mathTextSequence"),f=0,w(x)):x===32?(i.enter("space"),i.consume(x),i.exit("space"),v):Ue(x)?(i.enter("lineEnding"),i.consume(x),i.exit("lineEnding"),v):(i.enter("mathTextData"),g(x))}function g(x){return x===null||x===32||x===36||Ue(x)?(i.exit("mathTextData"),v(x)):(i.consume(x),g)}function w(x){return x===36?(i.consume(x),f++,w):f===u?(i.exit("mathTextSequence"),i.exit("mathText"),o(x)):(d.type="mathTextData",g(x))}}}function jX(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="mathTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function MX(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function PX(e){return{flow:{36:NX},text:{36:zX(e)}}}const FX={};function IX(e){const t=this,n=e||FX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(PX(n)),o.push(RX()),s.push(DX(n))}const GX=({message:e})=>S.jsx(yY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[TX,IX],rehypePlugins:[AX],skipHtml:!1,children:e.content});function BX(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),s=E.useRef(null),u=E.useCallback(()=>{var m;(m=s.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],z=D[D.length-1];return z.role==="assistant"&&(z.content=g.content,z.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await sM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+`
|
||
`+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response
|
||
${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=jy(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(GX,{message:m})}),m.content.length===0&&S.jsx(jM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:s,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(wk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(ZM,{}),"Send"]})]})]}),S.jsx(s8,{})]})}function UX(){return S.jsx("iframe",{src:G_+"/docs",className:"size-full"})}function HX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const s=setInterval(async()=>{await Mn.getState().check()},xz*1e3);return()=>clearInterval(s)},[t]);const o=E.useCallback(s=>Qe.getState().setCurrentTab(s),[]);return E.useEffect(()=>{if(e&&(e.includes(vk)||e.includes(yk))){i(!0);return}i(!1)},[e,i]),S.jsx(_z,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(C3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(A3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Ps,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(u9,{})}),S.jsx(Ps,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(LH,{})}),S.jsx(Ps,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(BX,{})}),S.jsx(Ps,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(UX,{})})]})]}),t&&S.jsx(s3,{}),e!==null&&!r&&S.jsx(cP,{}),r&&S.jsx(WI,{}),S.jsx(YI,{})]})})}vL.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(HX,{})}));
|