var bv=n=>{throw TypeError(n)};var vh=(n,e,o)=>e.has(n)||bv("Cannot "+o);var re=(n,e,o)=>(vh(n,e,"read from private field"),o?o.call(n):e.get(n)),Qe=(n,e,o)=>e.has(n)?bv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,o),Re=(n,e,o,r)=>(vh(n,e,"write to private field"),r?r.call(n,o):e.set(n,o),o),_n=(n,e,o)=>(vh(n,e,"access private method"),o);var Jc=(n,e,o,r)=>({set _(l){Re(n,e,l,o)},get _(){return re(n,e,r)}});function NS(n,e){for(var o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&!Array.isArray(r)){for(const l in r)if(l!=="default"&&!(l in n)){const c=Object.getOwnPropertyDescriptor(r,l);c&&Object.defineProperty(n,l,c.get?c:{enumerable:!0,get:()=>r[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function o(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=o(l);fetch(l.href,c)}})();function Y1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bh={exports:{}},tl={};/**
 * @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 wv;function kS(){if(wv)return tl;wv=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function o(r,l,c){var d=null;if(c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),"key"in l){c={};for(var p in l)p!=="key"&&(c[p]=l[p])}else c=l;return l=c.ref,{$$typeof:n,type:r,key:d,ref:l!==void 0?l:null,props:c}}return tl.Fragment=e,tl.jsx=o,tl.jsxs=o,tl}var xv;function TS(){return xv||(xv=1,bh.exports=kS()),bh.exports}var z=TS(),wh={exports:{}},je={};/**
 * @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 Sv;function DS(){if(Sv)return je;Sv=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function w(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,x={};function E(k,H,F){this.props=k,this.context=H,this.refs=x,this.updater=F||S}E.prototype.isReactComponent={},E.prototype.setState=function(k,H){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,H,"setState")},E.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function D(){}D.prototype=E.prototype;function R(k,H,F){this.props=k,this.context=H,this.refs=x,this.updater=F||S}var _=R.prototype=new D;_.constructor=R,A(_,E.prototype),_.isPureReactComponent=!0;var N=Array.isArray;function T(){}var O={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function $(k,H,F){var oe=F.ref;return{$$typeof:n,type:k,key:H,ref:oe!==void 0?oe:null,props:F}}function L(k,H){return $(k.type,H,k.props)}function X(k){return typeof k=="object"&&k!==null&&k.$$typeof===n}function ae(k){var H={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(F){return H[F]})}var te=/\/+/g;function me(k,H){return typeof k=="object"&&k!==null&&k.key!=null?ae(""+k.key):H.toString(36)}function ce(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(T,T):(k.status="pending",k.then(function(H){k.status==="pending"&&(k.status="fulfilled",k.value=H)},function(H){k.status==="pending"&&(k.status="rejected",k.reason=H)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function j(k,H,F,oe,J){var W=typeof k;(W==="undefined"||W==="boolean")&&(k=null);var ue=!1;if(k===null)ue=!0;else switch(W){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(k.$$typeof){case n:case e:ue=!0;break;case g:return ue=k._init,j(ue(k._payload),H,F,oe,J)}}if(ue)return J=J(k),ue=oe===""?"."+me(k,0):oe,N(J)?(F="",ue!=null&&(F=ue.replace(te,"$&/")+"/"),j(J,H,F,"",function(Te){return Te})):J!=null&&(X(J)&&(J=L(J,F+(J.key==null||k&&k.key===J.key?"":(""+J.key).replace(te,"$&/")+"/")+ue)),H.push(J)),1;ue=0;var xe=oe===""?".":oe+":";if(N(k))for(var de=0;de<k.length;de++)oe=k[de],W=xe+me(oe,de),ue+=j(oe,H,F,W,J);else if(de=w(k),typeof de=="function")for(k=de.call(k),de=0;!(oe=k.next()).done;)oe=oe.value,W=xe+me(oe,de++),ue+=j(oe,H,F,W,J);else if(W==="object"){if(typeof k.then=="function")return j(ce(k),H,F,oe,J);throw H=String(k),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ue}function I(k,H,F){if(k==null)return k;var oe=[],J=0;return j(k,oe,"","",function(W){return H.call(F,W,J++)}),oe}function G(k){if(k._status===-1){var H=k._result;H=H(),H.then(function(F){(k._status===0||k._status===-1)&&(k._status=1,k._result=F)},function(F){(k._status===0||k._status===-1)&&(k._status=2,k._result=F)}),k._status===-1&&(k._status=0,k._result=H)}if(k._status===1)return k._result.default;throw k._result}var Y=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},V={map:I,forEach:function(k,H,F){I(k,function(){H.apply(this,arguments)},F)},count:function(k){var H=0;return I(k,function(){H++}),H},toArray:function(k){return I(k,function(H){return H})||[]},only:function(k){if(!X(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return je.Activity=y,je.Children=V,je.Component=E,je.Fragment=o,je.Profiler=l,je.PureComponent=R,je.StrictMode=r,je.Suspense=m,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,je.__COMPILER_RUNTIME={__proto__:null,c:function(k){return O.H.useMemoCache(k)}},je.cache=function(k){return function(){return k.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(k,H,F){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var oe=A({},k.props),J=k.key;if(H!=null)for(W in H.key!==void 0&&(J=""+H.key),H)!M.call(H,W)||W==="key"||W==="__self"||W==="__source"||W==="ref"&&H.ref===void 0||(oe[W]=H[W]);var W=arguments.length-2;if(W===1)oe.children=F;else if(1<W){for(var ue=Array(W),xe=0;xe<W;xe++)ue[xe]=arguments[xe+2];oe.children=ue}return $(k.type,J,oe)},je.createContext=function(k){return k={$$typeof:d,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:c,_context:k},k},je.createElement=function(k,H,F){var oe,J={},W=null;if(H!=null)for(oe in H.key!==void 0&&(W=""+H.key),H)M.call(H,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(J[oe]=H[oe]);var ue=arguments.length-2;if(ue===1)J.children=F;else if(1<ue){for(var xe=Array(ue),de=0;de<ue;de++)xe[de]=arguments[de+2];J.children=xe}if(k&&k.defaultProps)for(oe in ue=k.defaultProps,ue)J[oe]===void 0&&(J[oe]=ue[oe]);return $(k,W,J)},je.createRef=function(){return{current:null}},je.forwardRef=function(k){return{$$typeof:p,render:k}},je.isValidElement=X,je.lazy=function(k){return{$$typeof:g,_payload:{_status:-1,_result:k},_init:G}},je.memo=function(k,H){return{$$typeof:h,type:k,compare:H===void 0?null:H}},je.startTransition=function(k){var H=O.T,F={};O.T=F;try{var oe=k(),J=O.S;J!==null&&J(F,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(T,Y)}catch(W){Y(W)}finally{H!==null&&F.types!==null&&(H.types=F.types),O.T=H}},je.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},je.use=function(k){return O.H.use(k)},je.useActionState=function(k,H,F){return O.H.useActionState(k,H,F)},je.useCallback=function(k,H){return O.H.useCallback(k,H)},je.useContext=function(k){return O.H.useContext(k)},je.useDebugValue=function(){},je.useDeferredValue=function(k,H){return O.H.useDeferredValue(k,H)},je.useEffect=function(k,H){return O.H.useEffect(k,H)},je.useEffectEvent=function(k){return O.H.useEffectEvent(k)},je.useId=function(){return O.H.useId()},je.useImperativeHandle=function(k,H,F){return O.H.useImperativeHandle(k,H,F)},je.useInsertionEffect=function(k,H){return O.H.useInsertionEffect(k,H)},je.useLayoutEffect=function(k,H){return O.H.useLayoutEffect(k,H)},je.useMemo=function(k,H){return O.H.useMemo(k,H)},je.useOptimistic=function(k,H){return O.H.useOptimistic(k,H)},je.useReducer=function(k,H,F){return O.H.useReducer(k,H,F)},je.useRef=function(k){return O.H.useRef(k)},je.useState=function(k){return O.H.useState(k)},je.useSyncExternalStore=function(k,H,F){return O.H.useSyncExternalStore(k,H,F)},je.useTransition=function(){return O.H.useTransition()},je.version="19.2.3",je}var Av;function Lu(){return Av||(Av=1,wh.exports=DS()),wh.exports}var ne=Lu();const Ji=Y1(ne),MS=NS({__proto__:null,default:Ji},[ne]);var xh={exports:{}},nl={},Sh={exports:{}},Ah={};/**
 * @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 _v;function zS(){return _v||(_v=1,(function(n){function e(j,I){var G=j.length;j.push(I);e:for(;0<G;){var Y=G-1>>>1,V=j[Y];if(0<l(V,I))j[Y]=I,j[G]=V,G=Y;else break e}}function o(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var I=j[0],G=j.pop();if(G!==I){j[0]=G;e:for(var Y=0,V=j.length,k=V>>>1;Y<k;){var H=2*(Y+1)-1,F=j[H],oe=H+1,J=j[oe];if(0>l(F,G))oe<V&&0>l(J,F)?(j[Y]=J,j[oe]=G,Y=oe):(j[Y]=F,j[H]=G,Y=H);else if(oe<V&&0>l(J,G))j[Y]=J,j[oe]=G,Y=oe;else break e}}return I}function l(j,I){var G=j.sortIndex-I.sortIndex;return G!==0?G:j.id-I.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var m=[],h=[],g=1,y=null,v=3,w=!1,S=!1,A=!1,x=!1,E=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(j){for(var I=o(h);I!==null;){if(I.callback===null)r(h);else if(I.startTime<=j)r(h),I.sortIndex=I.expirationTime,e(m,I);else break;I=o(h)}}function N(j){if(A=!1,_(j),!S)if(o(m)!==null)S=!0,T||(T=!0,ae());else{var I=o(h);I!==null&&ce(N,I.startTime-j)}}var T=!1,O=-1,M=5,$=-1;function L(){return x?!0:!(n.unstable_now()-$<M)}function X(){if(x=!1,T){var j=n.unstable_now();$=j;var I=!0;try{e:{S=!1,A&&(A=!1,D(O),O=-1),w=!0;var G=v;try{t:{for(_(j),y=o(m);y!==null&&!(y.expirationTime>j&&L());){var Y=y.callback;if(typeof Y=="function"){y.callback=null,v=y.priorityLevel;var V=Y(y.expirationTime<=j);if(j=n.unstable_now(),typeof V=="function"){y.callback=V,_(j),I=!0;break t}y===o(m)&&r(m),_(j)}else r(m);y=o(m)}if(y!==null)I=!0;else{var k=o(h);k!==null&&ce(N,k.startTime-j),I=!1}}break e}finally{y=null,v=G,w=!1}I=void 0}}finally{I?ae():T=!1}}}var ae;if(typeof R=="function")ae=function(){R(X)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,me=te.port2;te.port1.onmessage=X,ae=function(){me.postMessage(null)}}else ae=function(){E(X,0)};function ce(j,I){O=E(function(){j(n.unstable_now())},I)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(j){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var G=v;v=I;try{return j()}finally{v=G}},n.unstable_requestPaint=function(){x=!0},n.unstable_runWithPriority=function(j,I){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var G=v;v=j;try{return I()}finally{v=G}},n.unstable_scheduleCallback=function(j,I,G){var Y=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Y+G:Y):G=Y,j){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=G+V,j={id:g++,callback:I,priorityLevel:j,startTime:G,expirationTime:V,sortIndex:-1},G>Y?(j.sortIndex=G,e(h,j),o(m)===null&&j===o(h)&&(A?(D(O),O=-1):A=!0,ce(N,G-Y))):(j.sortIndex=V,e(m,j),S||w||(S=!0,T||(T=!0,ae()))),j},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(j){var I=v;return function(){var G=v;v=I;try{return j.apply(this,arguments)}finally{v=G}}}})(Ah)),Ah}var Cv;function OS(){return Cv||(Cv=1,Sh.exports=zS()),Sh.exports}var _h={exports:{}},Cn={};/**
 * @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 Ev;function RS(){if(Ev)return Cn;Ev=1;var n=Lu();function e(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var r={d:{f:o,r:function(){throw Error(e(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(m,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:m,containerInfo:h,implementation:g}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cn.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return c(m,h,null,g)},Cn.flushSync=function(m){var h=d.T,g=r.p;try{if(d.T=null,r.p=2,m)return m()}finally{d.T=h,r.p=g,r.d.f()}},Cn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},Cn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},Cn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,y=p(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:w}):g==="script"&&r.d.X(m,{crossOrigin:y,integrity:v,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Cn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=p(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},Cn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=p(g,h.crossOrigin);r.d.L(m,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Cn.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=p(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},Cn.requestFormReset=function(m){r.d.r(m)},Cn.unstable_batchedUpdates=function(m,h){return m(h)},Cn.useFormState=function(m,h,g){return d.H.useFormState(m,h,g)},Cn.useFormStatus=function(){return d.H.useHostTransitionStatus()},Cn.version="19.2.3",Cn}var Nv;function q1(){if(Nv)return _h.exports;Nv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),_h.exports=RS(),_h.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 kv;function jS(){if(kv)return nl;kv=1;var n=OS(),e=Lu(),o=q1();function r(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function d(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function p(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function m(t){if(c(t)!==t)throw Error(r(188))}function h(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(r(188));return i!==t?null:t}for(var a=t,s=i;;){var u=a.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){a=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===a)return m(u),t;if(f===s)return m(u),i;f=f.sibling}throw Error(r(188))}if(a.return!==s.return)a=u,s=f;else{for(var b=!1,C=u.child;C;){if(C===a){b=!0,a=u,s=f;break}if(C===s){b=!0,s=u,a=f;break}C=C.sibling}if(!b){for(C=f.child;C;){if(C===a){b=!0,a=f,s=u;break}if(C===s){b=!0,s=f,a=u;break}C=C.sibling}if(!b)throw Error(r(189))}}if(a.alternate!==s)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?t:i}function g(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=g(t),i!==null)return i;t=t.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),R=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function ae(t){return t===null||typeof t!="object"?null:(t=X&&t[X]||t["@@iterator"],typeof t=="function"?t:null)}var te=Symbol.for("react.client.reference");function me(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case E:return"Profiler";case x:return"StrictMode";case N:return"Suspense";case T:return"SuspenseList";case $:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case S:return"Portal";case R:return t.displayName||"Context";case D:return(t._context.displayName||"Context")+".Consumer";case _:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return i=t.displayName||null,i!==null?i:me(t.type)||"Memo";case M:i=t._payload,t=t._init;try{return me(t(i))}catch{}}return null}var ce=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},Y=[],V=-1;function k(t){return{current:t}}function H(t){0>V||(t.current=Y[V],Y[V]=null,V--)}function F(t,i){V++,Y[V]=t.current,t.current=i}var oe=k(null),J=k(null),W=k(null),ue=k(null);function xe(t,i){switch(F(W,i),F(J,t),F(oe,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Y0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Y0(i),t=q0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(oe),F(oe,t)}function de(){H(oe),H(J),H(W)}function Te(t){t.memoizedState!==null&&F(ue,t);var i=oe.current,a=q0(i,t.type);i!==a&&(F(J,t),F(oe,a))}function Ce(t){J.current===t&&(H(oe),H(J)),ue.current===t&&(H(ue),Ps._currentValue=G)}var Se,Ee;function Be(t){if(Se===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);Se=i&&i[1]||"",Ee=-1<a.stack.indexOf(`
    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Se+t+Ee}var et=!1;function ft(t,i){if(!t||et)return"";et=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(i){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ee){var P=ee}Reflect.construct(t,[],le)}else{try{le.call()}catch(ee){P=ee}t.call(le.prototype)}}else{try{throw Error()}catch(ee){P=ee}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ee){if(ee&&P&&typeof ee.stack=="string")return[ee.stack,P.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),b=f[0],C=f[1];if(b&&C){var U=b.split(`
`),Z=C.split(`
`);for(u=s=0;s<U.length&&!U[s].includes("DetermineComponentFrameRoot");)s++;for(;u<Z.length&&!Z[u].includes("DetermineComponentFrameRoot");)u++;if(s===U.length||u===Z.length)for(s=U.length-1,u=Z.length-1;1<=s&&0<=u&&U[s]!==Z[u];)u--;for(;1<=s&&0<=u;s--,u--)if(U[s]!==Z[u]){if(s!==1||u!==1)do if(s--,u--,0>u||U[s]!==Z[u]){var ie=`
`+U[s].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=s&&0<=u);break}}}finally{et=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Be(a):""}function un(t,i){switch(t.tag){case 26:case 27:case 5:return Be(t.type);case 16:return Be("Lazy");case 13:return t.child!==i&&i!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return ft(t.type,!1);case 11:return ft(t.type.render,!1);case 1:return ft(t.type,!0);case 31:return Be("Activity");default:return""}}function St(t){try{var i="",a=null;do i+=un(t,a),a=t,t=t.return;while(t);return i}catch(s){return`
Error generating stack: `+s.message+`
`+s.stack}}var ht=Object.prototype.hasOwnProperty,zt=n.unstable_scheduleCallback,Gt=n.unstable_cancelCallback,on=n.unstable_shouldYield,rn=n.unstable_requestPaint,Ve=n.unstable_now,Bt=n.unstable_getCurrentPriorityLevel,wn=n.unstable_ImmediatePriority,xn=n.unstable_UserBlockingPriority,dt=n.unstable_NormalPriority,In=n.unstable_LowPriority,Ei=n.unstable_IdlePriority,Fn=n.log,Hi=n.unstable_setDisableYieldValue,Dn=null,Ot=null;function dn(t){if(typeof Fn=="function"&&Hi(t),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(Dn,t)}catch{}}var vt=Math.clz32?Math.clz32:Jn,Pn=Math.log,Oo=Math.LN2;function Jn(t){return t>>>=0,t===0?32:31-(Pn(t)/Oo|0)|0}var Mn=256,Sn=262144,Ni=4194304;function It(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function $i(t,i,a){var s=t.pendingLanes;if(s===0)return 0;var u=0,f=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var C=s&134217727;return C!==0?(s=C&~f,s!==0?u=It(s):(b&=C,b!==0?u=It(b):a||(a=C&~t,a!==0&&(u=It(a))))):(C=s&~f,C!==0?u=It(C):b!==0?u=It(b):a||(a=s&~t,a!==0&&(u=It(a)))),u===0?0:i!==0&&i!==u&&(i&f)===0&&(f=u&-u,a=i&-i,f>=a||f===32&&(a&4194048)!==0)?i:u}function fn(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Yi(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+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 Gn(){var t=Ni;return Ni<<=1,(Ni&62914560)===0&&(Ni=4194304),t}function qi(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function be(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Xe(t,i,a,s,u,f){var b=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var C=t.entanglements,U=t.expirationTimes,Z=t.hiddenUpdates;for(a=b&~a;0<a;){var ie=31-vt(a),le=1<<ie;C[ie]=0,U[ie]=-1;var P=Z[ie];if(P!==null)for(Z[ie]=null,ie=0;ie<P.length;ie++){var ee=P[ie];ee!==null&&(ee.lane&=-536870913)}a&=~le}s!==0&&ct(t,s,0),f!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=f&~(b&~i))}function ct(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var s=31-vt(i);t.entangledLanes|=i,t.entanglements[s]=t.entanglements[s]|1073741824|a&261930}function bt(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var s=31-vt(a),u=1<<s;u&i|t[s]&i&&(t[s]|=i),a&=~u}}function Rt(t,i){var a=i&-i;return a=(a&42)!==0?1:At(a),(a&(t.suspendedLanes|i))!==0?0:a}function At(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Ht(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function zn(){var t=I.p;return t!==0?t:(t=window.event,t===void 0?32:fv(t.type))}function Bn(t,i){var a=I.p;try{return I.p=t,i()}finally{I.p=a}}var $t=Math.random().toString(36).slice(2),nt="__reactFiber$"+$t,wt="__reactProps$"+$t,An="__reactContainer$"+$t,hn="__reactEvents$"+$t,Hn="__reactListeners$"+$t,Pe="__reactHandles$"+$t,Ct="__reactResources$"+$t,Ft="__reactMarker$"+$t;function Ro(t){delete t[nt],delete t[wt],delete t[hn],delete t[Hn],delete t[Pe]}function pn(t){var i=t[nt];if(i)return i;for(var a=t.parentNode;a;){if(i=a[An]||a[nt]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=F0(t);t!==null;){if(a=t[nt])return a;t=F0(t)}return i}t=a,a=t.parentNode}return null}function Ar(t){if(t=t[nt]||t[An]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function jo(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(r(33))}function Wi(t){var i=t[Ct];return i||(i=t[Ct]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function jt(t){t[Ft]=!0}var hs=new Set,Mm={};function _r(t,i){oa(t,i),oa(t+"Capture",i)}function oa(t,i){for(Mm[t]=i,t=0;t<i.length;t++)hs.add(i[t])}var vw=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]*$"),zm={},Om={};function bw(t){return ht.call(Om,t)?!0:ht.call(zm,t)?!1:vw.test(t)?Om[t]=!0:(zm[t]=!0,!1)}function Hl(t,i,a){if(bw(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var s=i.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function $l(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function eo(t,i,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+s)}}function ci(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Rm(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ww(t,i,a){var s=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,f=s.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return u.call(this)},set:function(b){a=""+b,f.call(this,b)}}),Object.defineProperty(t,i,{enumerable:s.enumerable}),{getValue:function(){return a},setValue:function(b){a=""+b},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function ud(t){if(!t._valueTracker){var i=Rm(t)?"checked":"value";t._valueTracker=ww(t,i,""+t[i])}}function jm(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),s="";return t&&(s=Rm(t)?t.checked?"true":"false":t.value),t=s,t!==a?(i.setValue(t),!0):!1}function Yl(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var xw=/[\n"\\]/g;function ui(t){return t.replace(xw,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function dd(t,i,a,s,u,f,b,C){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),i!=null?b==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+ci(i)):t.value!==""+ci(i)&&(t.value=""+ci(i)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),i!=null?fd(t,b,ci(i)):a!=null?fd(t,b,ci(a)):s!=null&&t.removeAttribute("value"),u==null&&f!=null&&(t.defaultChecked=!!f),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.name=""+ci(C):t.removeAttribute("name")}function Lm(t,i,a,s,u,f,b,C){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.type=f),i!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||i!=null)){ud(t);return}a=a!=null?""+ci(a):"",i=i!=null?""+ci(i):a,C||i===t.value||(t.value=i),t.defaultValue=i}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=C?t.checked:!!s,t.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),ud(t)}function fd(t,i,a){i==="number"&&Yl(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ra(t,i,a,s){if(t=t.options,i){i={};for(var u=0;u<a.length;u++)i["$"+a[u]]=!0;for(a=0;a<t.length;a++)u=i.hasOwnProperty("$"+t[a].value),t[a].selected!==u&&(t[a].selected=u),u&&s&&(t[a].defaultSelected=!0)}else{for(a=""+ci(a),i=null,u=0;u<t.length;u++){if(t[u].value===a){t[u].selected=!0,s&&(t[u].defaultSelected=!0);return}i!==null||t[u].disabled||(i=t[u])}i!==null&&(i.selected=!0)}}function Um(t,i,a){if(i!=null&&(i=""+ci(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+ci(a):""}function Gm(t,i,a,s){if(i==null){if(s!=null){if(a!=null)throw Error(r(92));if(ce(s)){if(1<s.length)throw Error(r(93));s=s[0]}a=s}a==null&&(a=""),i=a}a=ci(i),t.defaultValue=a,s=t.textContent,s===a&&s!==""&&s!==null&&(t.value=s),ud(t)}function aa(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var Sw=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 Bm(t,i,a){var s=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?s?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":s?t.setProperty(i,a):typeof a!="number"||a===0||Sw.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function Hm(t,i,a){if(i!=null&&typeof i!="object")throw Error(r(62));if(t=t.style,a!=null){for(var s in a)!a.hasOwnProperty(s)||i!=null&&i.hasOwnProperty(s)||(s.indexOf("--")===0?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="");for(var u in i)s=i[u],i.hasOwnProperty(u)&&a[u]!==s&&Bm(t,u,s)}else for(var f in i)i.hasOwnProperty(f)&&Bm(t,f,i[f])}function hd(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Aw=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"]]),_w=/^[\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 ql(t){return _w.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function to(){}var pd=null;function md(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var sa=null,la=null;function $m(t){var i=Ar(t);if(i&&(t=i.stateNode)){var a=t[wt]||null;e:switch(t=i.stateNode,i.type){case"input":if(dd(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ui(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var s=a[i];if(s!==t&&s.form===t.form){var u=s[wt]||null;if(!u)throw Error(r(90));dd(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(i=0;i<a.length;i++)s=a[i],s.form===t.form&&jm(s)}break e;case"textarea":Um(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&ra(t,!!a.multiple,i,!1)}}}var gd=!1;function Ym(t,i,a){if(gd)return t(i,a);gd=!0;try{var s=t(i);return s}finally{if(gd=!1,(sa!==null||la!==null)&&(Dc(),sa&&(i=sa,t=la,la=sa=null,$m(i),t)))for(i=0;i<t.length;i++)$m(t[i])}}function ps(t,i){var a=t.stateNode;if(a===null)return null;var s=a[wt]||null;if(s===null)return null;a=s[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(r(231,i,typeof a));return a}var no=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yd=!1;if(no)try{var ms={};Object.defineProperty(ms,"passive",{get:function(){yd=!0}}),window.addEventListener("test",ms,ms),window.removeEventListener("test",ms,ms)}catch{yd=!1}var Lo=null,vd=null,Vl=null;function qm(){if(Vl)return Vl;var t,i=vd,a=i.length,s,u="value"in Lo?Lo.value:Lo.textContent,f=u.length;for(t=0;t<a&&i[t]===u[t];t++);var b=a-t;for(s=1;s<=b&&i[a-s]===u[f-s];s++);return Vl=u.slice(t,1<s?1-s:void 0)}function Xl(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Kl(){return!0}function Vm(){return!1}function $n(t){function i(a,s,u,f,b){this._reactName=a,this._targetInst=u,this.type=s,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var C in t)t.hasOwnProperty(C)&&(a=t[C],this[C]=a?a(f):f[C]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Kl:Vm,this.isPropagationStopped=Vm,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Kl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Kl)},persist:function(){},isPersistent:Kl}),i}var Cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ql=$n(Cr),gs=y({},Cr,{view:0,detail:0}),Cw=$n(gs),bd,wd,ys,Zl=y({},gs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sd,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ys&&(ys&&t.type==="mousemove"?(bd=t.screenX-ys.screenX,wd=t.screenY-ys.screenY):wd=bd=0,ys=t),bd)},movementY:function(t){return"movementY"in t?t.movementY:wd}}),Xm=$n(Zl),Ew=y({},Zl,{dataTransfer:0}),Nw=$n(Ew),kw=y({},gs,{relatedTarget:0}),xd=$n(kw),Tw=y({},Cr,{animationName:0,elapsedTime:0,pseudoElement:0}),Dw=$n(Tw),Mw=y({},Cr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),zw=$n(Mw),Ow=y({},Cr,{data:0}),Km=$n(Ow),Rw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jw={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"},Lw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uw(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Lw[t])?!!i[t]:!1}function Sd(){return Uw}var Gw=y({},gs,{key:function(t){if(t.key){var i=Rw[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Xl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?jw[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sd,charCode:function(t){return t.type==="keypress"?Xl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Xl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Bw=$n(Gw),Hw=y({},Zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qm=$n(Hw),$w=y({},gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sd}),Yw=$n($w),qw=y({},Cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vw=$n(qw),Xw=y({},Zl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Kw=$n(Xw),Qw=y({},Cr,{newState:0,oldState:0}),Zw=$n(Qw),Iw=[9,13,27,32],Ad=no&&"CompositionEvent"in window,vs=null;no&&"documentMode"in document&&(vs=document.documentMode);var Fw=no&&"TextEvent"in window&&!vs,Zm=no&&(!Ad||vs&&8<vs&&11>=vs),Im=" ",Fm=!1;function Pm(t,i){switch(t){case"keyup":return Iw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ca=!1;function Pw(t,i){switch(t){case"compositionend":return Jm(i);case"keypress":return i.which!==32?null:(Fm=!0,Im);case"textInput":return t=i.data,t===Im&&Fm?null:t;default:return null}}function Jw(t,i){if(ca)return t==="compositionend"||!Ad&&Pm(t,i)?(t=qm(),Vl=vd=Lo=null,ca=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Zm&&i.locale!=="ko"?null:i.data;default:return null}}var Ww={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 Wm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Ww[t.type]:i==="textarea"}function eg(t,i,a,s){sa?la?la.push(s):la=[s]:sa=s,i=Uc(i,"onChange"),0<i.length&&(a=new Ql("onChange","change",null,a,s),t.push({event:a,listeners:i}))}var bs=null,ws=null;function ex(t){L0(t,0)}function Il(t){var i=jo(t);if(jm(i))return t}function tg(t,i){if(t==="change")return i}var ng=!1;if(no){var _d;if(no){var Cd="oninput"in document;if(!Cd){var ig=document.createElement("div");ig.setAttribute("oninput","return;"),Cd=typeof ig.oninput=="function"}_d=Cd}else _d=!1;ng=_d&&(!document.documentMode||9<document.documentMode)}function og(){bs&&(bs.detachEvent("onpropertychange",rg),ws=bs=null)}function rg(t){if(t.propertyName==="value"&&Il(ws)){var i=[];eg(i,ws,t,md(t)),Ym(ex,i)}}function tx(t,i,a){t==="focusin"?(og(),bs=i,ws=a,bs.attachEvent("onpropertychange",rg)):t==="focusout"&&og()}function nx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Il(ws)}function ix(t,i){if(t==="click")return Il(i)}function ox(t,i){if(t==="input"||t==="change")return Il(i)}function rx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Wn=typeof Object.is=="function"?Object.is:rx;function xs(t,i){if(Wn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),s=Object.keys(i);if(a.length!==s.length)return!1;for(s=0;s<a.length;s++){var u=a[s];if(!ht.call(i,u)||!Wn(t[u],i[u]))return!1}return!0}function ag(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function sg(t,i){var a=ag(t);t=0;for(var s;a;){if(a.nodeType===3){if(s=t+a.textContent.length,t<=i&&s>=i)return{node:a,offset:i-t};t=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ag(a)}}function lg(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?lg(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function cg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Yl(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=Yl(t.document)}return i}function Ed(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var ax=no&&"documentMode"in document&&11>=document.documentMode,ua=null,Nd=null,Ss=null,kd=!1;function ug(t,i,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;kd||ua==null||ua!==Yl(s)||(s=ua,"selectionStart"in s&&Ed(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ss&&xs(Ss,s)||(Ss=s,s=Uc(Nd,"onSelect"),0<s.length&&(i=new Ql("onSelect","select",null,i,a),t.push({event:i,listeners:s}),i.target=ua)))}function Er(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var da={animationend:Er("Animation","AnimationEnd"),animationiteration:Er("Animation","AnimationIteration"),animationstart:Er("Animation","AnimationStart"),transitionrun:Er("Transition","TransitionRun"),transitionstart:Er("Transition","TransitionStart"),transitioncancel:Er("Transition","TransitionCancel"),transitionend:Er("Transition","TransitionEnd")},Td={},dg={};no&&(dg=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function Nr(t){if(Td[t])return Td[t];if(!da[t])return t;var i=da[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in dg)return Td[t]=i[a];return t}var fg=Nr("animationend"),hg=Nr("animationiteration"),pg=Nr("animationstart"),sx=Nr("transitionrun"),lx=Nr("transitionstart"),cx=Nr("transitioncancel"),mg=Nr("transitionend"),gg=new Map,Dd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Dd.push("scrollEnd");function ki(t,i){gg.set(t,i),_r(i,[t])}var Fl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},di=[],fa=0,Md=0;function Pl(){for(var t=fa,i=Md=fa=0;i<t;){var a=di[i];di[i++]=null;var s=di[i];di[i++]=null;var u=di[i];di[i++]=null;var f=di[i];if(di[i++]=null,s!==null&&u!==null){var b=s.pending;b===null?u.next=u:(u.next=b.next,b.next=u),s.pending=u}f!==0&&yg(a,u,f)}}function Jl(t,i,a,s){di[fa++]=t,di[fa++]=i,di[fa++]=a,di[fa++]=s,Md|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function zd(t,i,a,s){return Jl(t,i,a,s),Wl(t)}function kr(t,i){return Jl(t,null,null,i),Wl(t)}function yg(t,i,a){t.lanes|=a;var s=t.alternate;s!==null&&(s.lanes|=a);for(var u=!1,f=t.return;f!==null;)f.childLanes|=a,s=f.alternate,s!==null&&(s.childLanes|=a),f.tag===22&&(t=f.stateNode,t===null||t._visibility&1||(u=!0)),t=f,f=f.return;return t.tag===3?(f=t.stateNode,u&&i!==null&&(u=31-vt(a),t=f.hiddenUpdates,s=t[u],s===null?t[u]=[i]:s.push(i),i.lane=a|536870912),f):null}function Wl(t){if(50<Vs)throw Vs=0,Yf=null,Error(r(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ha={};function ux(t,i,a,s){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ei(t,i,a,s){return new ux(t,i,a,s)}function Od(t){return t=t.prototype,!(!t||!t.isReactComponent)}function io(t,i){var a=t.alternate;return a===null?(a=ei(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function vg(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function ec(t,i,a,s,u,f){var b=0;if(s=t,typeof t=="function")Od(t)&&(b=1);else if(typeof t=="string")b=mS(t,a,oe.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case $:return t=ei(31,a,i,u),t.elementType=$,t.lanes=f,t;case A:return Tr(a.children,u,f,i);case x:b=8,u|=24;break;case E:return t=ei(12,a,i,u|2),t.elementType=E,t.lanes=f,t;case N:return t=ei(13,a,i,u),t.elementType=N,t.lanes=f,t;case T:return t=ei(19,a,i,u),t.elementType=T,t.lanes=f,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:b=10;break e;case D:b=9;break e;case _:b=11;break e;case O:b=14;break e;case M:b=16,s=null;break e}b=29,a=Error(r(130,t===null?"null":typeof t,"")),s=null}return i=ei(b,a,i,u),i.elementType=t,i.type=s,i.lanes=f,i}function Tr(t,i,a,s){return t=ei(7,t,s,i),t.lanes=a,t}function Rd(t,i,a){return t=ei(6,t,null,i),t.lanes=a,t}function bg(t){var i=ei(18,null,null,0);return i.stateNode=t,i}function jd(t,i,a){return i=ei(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var wg=new WeakMap;function fi(t,i){if(typeof t=="object"&&t!==null){var a=wg.get(t);return a!==void 0?a:(i={value:t,source:i,stack:St(i)},wg.set(t,i),i)}return{value:t,source:i,stack:St(i)}}var pa=[],ma=0,tc=null,As=0,hi=[],pi=0,Uo=null,Vi=1,Xi="";function oo(t,i){pa[ma++]=As,pa[ma++]=tc,tc=t,As=i}function xg(t,i,a){hi[pi++]=Vi,hi[pi++]=Xi,hi[pi++]=Uo,Uo=t;var s=Vi;t=Xi;var u=32-vt(s)-1;s&=~(1<<u),a+=1;var f=32-vt(i)+u;if(30<f){var b=u-u%5;f=(s&(1<<b)-1).toString(32),s>>=b,u-=b,Vi=1<<32-vt(i)+u|a<<u|s,Xi=f+t}else Vi=1<<f|a<<u|s,Xi=t}function Ld(t){t.return!==null&&(oo(t,1),xg(t,1,0))}function Ud(t){for(;t===tc;)tc=pa[--ma],pa[ma]=null,As=pa[--ma],pa[ma]=null;for(;t===Uo;)Uo=hi[--pi],hi[pi]=null,Xi=hi[--pi],hi[pi]=null,Vi=hi[--pi],hi[pi]=null}function Sg(t,i){hi[pi++]=Vi,hi[pi++]=Xi,hi[pi++]=Uo,Vi=i.id,Xi=i.overflow,Uo=t}var mn=null,pt=null,Ke=!1,Go=null,mi=!1,Gd=Error(r(519));function Bo(t){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _s(fi(i,t)),Gd}function Ag(t){var i=t.stateNode,a=t.type,s=t.memoizedProps;switch(i[nt]=t,i[wt]=s,a){case"dialog":$e("cancel",i),$e("close",i);break;case"iframe":case"object":case"embed":$e("load",i);break;case"video":case"audio":for(a=0;a<Ks.length;a++)$e(Ks[a],i);break;case"source":$e("error",i);break;case"img":case"image":case"link":$e("error",i),$e("load",i);break;case"details":$e("toggle",i);break;case"input":$e("invalid",i),Lm(i,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":$e("invalid",i);break;case"textarea":$e("invalid",i),Gm(i,s.value,s.defaultValue,s.children)}a=s.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||s.suppressHydrationWarning===!0||H0(i.textContent,a)?(s.popover!=null&&($e("beforetoggle",i),$e("toggle",i)),s.onScroll!=null&&$e("scroll",i),s.onScrollEnd!=null&&$e("scrollend",i),s.onClick!=null&&(i.onclick=to),i=!0):i=!1,i||Bo(t,!0)}function _g(t){for(mn=t.return;mn;)switch(mn.tag){case 5:case 31:case 13:mi=!1;return;case 27:case 3:mi=!0;return;default:mn=mn.return}}function ga(t){if(t!==mn)return!1;if(!Ke)return _g(t),Ke=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||ih(t.type,t.memoizedProps)),a=!a),a&&pt&&Bo(t),_g(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));pt=I0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));pt=I0(t)}else i===27?(i=pt,Wo(t.type)?(t=lh,lh=null,pt=t):pt=i):pt=mn?yi(t.stateNode.nextSibling):null;return!0}function Dr(){pt=mn=null,Ke=!1}function Bd(){var t=Go;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),Go=null),t}function _s(t){Go===null?Go=[t]:Go.push(t)}var Hd=k(null),Mr=null,ro=null;function Ho(t,i,a){F(Hd,i._currentValue),i._currentValue=a}function ao(t){t._currentValue=Hd.current,H(Hd)}function $d(t,i,a){for(;t!==null;){var s=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,s!==null&&(s.childLanes|=i)):s!==null&&(s.childLanes&i)!==i&&(s.childLanes|=i),t===a)break;t=t.return}}function Yd(t,i,a,s){var u=t.child;for(u!==null&&(u.return=t);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var C=f;f=u;for(var U=0;U<i.length;U++)if(C.context===i[U]){f.lanes|=a,C=f.alternate,C!==null&&(C.lanes|=a),$d(f.return,a,t),s||(b=null);break e}f=C.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(r(341));b.lanes|=a,f=b.alternate,f!==null&&(f.lanes|=a),$d(b,a,t),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===t){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function ya(t,i,a,s){t=null;for(var u=i,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(r(387));if(b=b.memoizedProps,b!==null){var C=u.type;Wn(u.pendingProps.value,b.value)||(t!==null?t.push(C):t=[C])}}else if(u===ue.current){if(b=u.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(Ps):t=[Ps])}u=u.return}t!==null&&Yd(i,t,a,s),i.flags|=262144}function nc(t){for(t=t.firstContext;t!==null;){if(!Wn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zr(t){Mr=t,ro=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function gn(t){return Cg(Mr,t)}function ic(t,i){return Mr===null&&zr(t),Cg(t,i)}function Cg(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},ro===null){if(t===null)throw Error(r(308));ro=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else ro=ro.next=i;return a}var dx=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,s){t.push(s)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},fx=n.unstable_scheduleCallback,hx=n.unstable_NormalPriority,Yt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qd(){return{controller:new dx,data:new Map,refCount:0}}function Cs(t){t.refCount--,t.refCount===0&&fx(hx,function(){t.controller.abort()})}var Es=null,Vd=0,va=0,ba=null;function px(t,i){if(Es===null){var a=Es=[];Vd=0,va=Zf(),ba={status:"pending",value:void 0,then:function(s){a.push(s)}}}return Vd++,i.then(Eg,Eg),i}function Eg(){if(--Vd===0&&Es!==null){ba!==null&&(ba.status="fulfilled");var t=Es;Es=null,va=0,ba=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function mx(t,i){var a=[],s={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return t.then(function(){s.status="fulfilled",s.value=i;for(var u=0;u<a.length;u++)(0,a[u])(i)},function(u){for(s.status="rejected",s.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),s}var Ng=j.S;j.S=function(t,i){u0=Ve(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&px(t,i),Ng!==null&&Ng(t,i)};var Or=k(null);function Xd(){var t=Or.current;return t!==null?t:ut.pooledCache}function oc(t,i){i===null?F(Or,Or.current):F(Or,i.pool)}function kg(){var t=Xd();return t===null?null:{parent:Yt._currentValue,pool:t}}var wa=Error(r(460)),Kd=Error(r(474)),rc=Error(r(542)),ac={then:function(){}};function Tg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Dg(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then(to,to),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,zg(t),t;default:if(typeof i.status=="string")i.then(to,to);else{if(t=ut,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=i,t.status="pending",t.then(function(s){if(i.status==="pending"){var u=i;u.status="fulfilled",u.value=s}},function(s){if(i.status==="pending"){var u=i;u.status="rejected",u.reason=s}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,zg(t),t}throw jr=i,wa}}function Rr(t){try{var i=t._init;return i(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(jr=a,wa):a}}var jr=null;function Mg(){if(jr===null)throw Error(r(459));var t=jr;return jr=null,t}function zg(t){if(t===wa||t===rc)throw Error(r(483))}var xa=null,Ns=0;function sc(t){var i=Ns;return Ns+=1,xa===null&&(xa=[]),Dg(xa,t,i)}function ks(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function lc(t,i){throw i.$$typeof===v?Error(r(525)):(t=Object.prototype.toString.call(i),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Og(t){function i(q,B){if(t){var Q=q.deletions;Q===null?(q.deletions=[B],q.flags|=16):Q.push(B)}}function a(q,B){if(!t)return null;for(;B!==null;)i(q,B),B=B.sibling;return null}function s(q){for(var B=new Map;q!==null;)q.key!==null?B.set(q.key,q):B.set(q.index,q),q=q.sibling;return B}function u(q,B){return q=io(q,B),q.index=0,q.sibling=null,q}function f(q,B,Q){return q.index=Q,t?(Q=q.alternate,Q!==null?(Q=Q.index,Q<B?(q.flags|=67108866,B):Q):(q.flags|=67108866,B)):(q.flags|=1048576,B)}function b(q){return t&&q.alternate===null&&(q.flags|=67108866),q}function C(q,B,Q,se){return B===null||B.tag!==6?(B=Rd(Q,q.mode,se),B.return=q,B):(B=u(B,Q),B.return=q,B)}function U(q,B,Q,se){var ke=Q.type;return ke===A?ie(q,B,Q.props.children,se,Q.key):B!==null&&(B.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===M&&Rr(ke)===B.type)?(B=u(B,Q.props),ks(B,Q),B.return=q,B):(B=ec(Q.type,Q.key,Q.props,null,q.mode,se),ks(B,Q),B.return=q,B)}function Z(q,B,Q,se){return B===null||B.tag!==4||B.stateNode.containerInfo!==Q.containerInfo||B.stateNode.implementation!==Q.implementation?(B=jd(Q,q.mode,se),B.return=q,B):(B=u(B,Q.children||[]),B.return=q,B)}function ie(q,B,Q,se,ke){return B===null||B.tag!==7?(B=Tr(Q,q.mode,se,ke),B.return=q,B):(B=u(B,Q),B.return=q,B)}function le(q,B,Q){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Rd(""+B,q.mode,Q),B.return=q,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return Q=ec(B.type,B.key,B.props,null,q.mode,Q),ks(Q,B),Q.return=q,Q;case S:return B=jd(B,q.mode,Q),B.return=q,B;case M:return B=Rr(B),le(q,B,Q)}if(ce(B)||ae(B))return B=Tr(B,q.mode,Q,null),B.return=q,B;if(typeof B.then=="function")return le(q,sc(B),Q);if(B.$$typeof===R)return le(q,ic(q,B),Q);lc(q,B)}return null}function P(q,B,Q,se){var ke=B!==null?B.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return ke!==null?null:C(q,B,""+Q,se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:return Q.key===ke?U(q,B,Q,se):null;case S:return Q.key===ke?Z(q,B,Q,se):null;case M:return Q=Rr(Q),P(q,B,Q,se)}if(ce(Q)||ae(Q))return ke!==null?null:ie(q,B,Q,se,null);if(typeof Q.then=="function")return P(q,B,sc(Q),se);if(Q.$$typeof===R)return P(q,B,ic(q,Q),se);lc(q,Q)}return null}function ee(q,B,Q,se,ke){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return q=q.get(Q)||null,C(B,q,""+se,ke);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return q=q.get(se.key===null?Q:se.key)||null,U(B,q,se,ke);case S:return q=q.get(se.key===null?Q:se.key)||null,Z(B,q,se,ke);case M:return se=Rr(se),ee(q,B,Q,se,ke)}if(ce(se)||ae(se))return q=q.get(Q)||null,ie(B,q,se,ke,null);if(typeof se.then=="function")return ee(q,B,Q,sc(se),ke);if(se.$$typeof===R)return ee(q,B,Q,ic(B,se),ke);lc(B,se)}return null}function ve(q,B,Q,se){for(var ke=null,Ie=null,_e=B,Ue=B=0,qe=null;_e!==null&&Ue<Q.length;Ue++){_e.index>Ue?(qe=_e,_e=null):qe=_e.sibling;var Fe=P(q,_e,Q[Ue],se);if(Fe===null){_e===null&&(_e=qe);break}t&&_e&&Fe.alternate===null&&i(q,_e),B=f(Fe,B,Ue),Ie===null?ke=Fe:Ie.sibling=Fe,Ie=Fe,_e=qe}if(Ue===Q.length)return a(q,_e),Ke&&oo(q,Ue),ke;if(_e===null){for(;Ue<Q.length;Ue++)_e=le(q,Q[Ue],se),_e!==null&&(B=f(_e,B,Ue),Ie===null?ke=_e:Ie.sibling=_e,Ie=_e);return Ke&&oo(q,Ue),ke}for(_e=s(_e);Ue<Q.length;Ue++)qe=ee(_e,q,Ue,Q[Ue],se),qe!==null&&(t&&qe.alternate!==null&&_e.delete(qe.key===null?Ue:qe.key),B=f(qe,B,Ue),Ie===null?ke=qe:Ie.sibling=qe,Ie=qe);return t&&_e.forEach(function(or){return i(q,or)}),Ke&&oo(q,Ue),ke}function De(q,B,Q,se){if(Q==null)throw Error(r(151));for(var ke=null,Ie=null,_e=B,Ue=B=0,qe=null,Fe=Q.next();_e!==null&&!Fe.done;Ue++,Fe=Q.next()){_e.index>Ue?(qe=_e,_e=null):qe=_e.sibling;var or=P(q,_e,Fe.value,se);if(or===null){_e===null&&(_e=qe);break}t&&_e&&or.alternate===null&&i(q,_e),B=f(or,B,Ue),Ie===null?ke=or:Ie.sibling=or,Ie=or,_e=qe}if(Fe.done)return a(q,_e),Ke&&oo(q,Ue),ke;if(_e===null){for(;!Fe.done;Ue++,Fe=Q.next())Fe=le(q,Fe.value,se),Fe!==null&&(B=f(Fe,B,Ue),Ie===null?ke=Fe:Ie.sibling=Fe,Ie=Fe);return Ke&&oo(q,Ue),ke}for(_e=s(_e);!Fe.done;Ue++,Fe=Q.next())Fe=ee(_e,q,Ue,Fe.value,se),Fe!==null&&(t&&Fe.alternate!==null&&_e.delete(Fe.key===null?Ue:Fe.key),B=f(Fe,B,Ue),Ie===null?ke=Fe:Ie.sibling=Fe,Ie=Fe);return t&&_e.forEach(function(ES){return i(q,ES)}),Ke&&oo(q,Ue),ke}function st(q,B,Q,se){if(typeof Q=="object"&&Q!==null&&Q.type===A&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case w:e:{for(var ke=Q.key;B!==null;){if(B.key===ke){if(ke=Q.type,ke===A){if(B.tag===7){a(q,B.sibling),se=u(B,Q.props.children),se.return=q,q=se;break e}}else if(B.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===M&&Rr(ke)===B.type){a(q,B.sibling),se=u(B,Q.props),ks(se,Q),se.return=q,q=se;break e}a(q,B);break}else i(q,B);B=B.sibling}Q.type===A?(se=Tr(Q.props.children,q.mode,se,Q.key),se.return=q,q=se):(se=ec(Q.type,Q.key,Q.props,null,q.mode,se),ks(se,Q),se.return=q,q=se)}return b(q);case S:e:{for(ke=Q.key;B!==null;){if(B.key===ke)if(B.tag===4&&B.stateNode.containerInfo===Q.containerInfo&&B.stateNode.implementation===Q.implementation){a(q,B.sibling),se=u(B,Q.children||[]),se.return=q,q=se;break e}else{a(q,B);break}else i(q,B);B=B.sibling}se=jd(Q,q.mode,se),se.return=q,q=se}return b(q);case M:return Q=Rr(Q),st(q,B,Q,se)}if(ce(Q))return ve(q,B,Q,se);if(ae(Q)){if(ke=ae(Q),typeof ke!="function")throw Error(r(150));return Q=ke.call(Q),De(q,B,Q,se)}if(typeof Q.then=="function")return st(q,B,sc(Q),se);if(Q.$$typeof===R)return st(q,B,ic(q,Q),se);lc(q,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,B!==null&&B.tag===6?(a(q,B.sibling),se=u(B,Q),se.return=q,q=se):(a(q,B),se=Rd(Q,q.mode,se),se.return=q,q=se),b(q)):a(q,B)}return function(q,B,Q,se){try{Ns=0;var ke=st(q,B,Q,se);return xa=null,ke}catch(_e){if(_e===wa||_e===rc)throw _e;var Ie=ei(29,_e,null,q.mode);return Ie.lanes=se,Ie.return=q,Ie}finally{}}}var Lr=Og(!0),Rg=Og(!1),$o=!1;function Qd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Zd(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Yo(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function qo(t,i,a){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(Je&2)!==0){var u=s.pending;return u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i,i=Wl(t),yg(t,null,a),i}return Jl(t,s,i,a),Wl(t)}function Ts(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var s=i.lanes;s&=t.pendingLanes,a|=s,i.lanes=a,bt(t,a)}}function Id(t,i){var a=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,a=a.next}while(a!==null);f===null?u=f=i:f=f.next=i}else u=f=i;a={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var Fd=!1;function Ds(){if(Fd){var t=ba;if(t!==null)throw t}}function Ms(t,i,a,s){Fd=!1;var u=t.updateQueue;$o=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,C=u.shared.pending;if(C!==null){u.shared.pending=null;var U=C,Z=U.next;U.next=null,b===null?f=Z:b.next=Z,b=U;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,C=ie.lastBaseUpdate,C!==b&&(C===null?ie.firstBaseUpdate=Z:C.next=Z,ie.lastBaseUpdate=U))}if(f!==null){var le=u.baseState;b=0,ie=Z=U=null,C=f;do{var P=C.lane&-536870913,ee=P!==C.lane;if(ee?(Ye&P)===P:(s&P)===P){P!==0&&P===va&&(Fd=!0),ie!==null&&(ie=ie.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var ve=t,De=C;P=i;var st=a;switch(De.tag){case 1:if(ve=De.payload,typeof ve=="function"){le=ve.call(st,le,P);break e}le=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=De.payload,P=typeof ve=="function"?ve.call(st,le,P):ve,P==null)break e;le=y({},le,P);break e;case 2:$o=!0}}P=C.callback,P!==null&&(t.flags|=64,ee&&(t.flags|=8192),ee=u.callbacks,ee===null?u.callbacks=[P]:ee.push(P))}else ee={lane:P,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ie===null?(Z=ie=ee,U=le):ie=ie.next=ee,b|=P;if(C=C.next,C===null){if(C=u.shared.pending,C===null)break;ee=C,C=ee.next,ee.next=null,u.lastBaseUpdate=ee,u.shared.pending=null}}while(!0);ie===null&&(U=le),u.baseState=U,u.firstBaseUpdate=Z,u.lastBaseUpdate=ie,f===null&&(u.shared.lanes=0),Zo|=b,t.lanes=b,t.memoizedState=le}}function jg(t,i){if(typeof t!="function")throw Error(r(191,t));t.call(i)}function Lg(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)jg(a[t],i)}var Sa=k(null),cc=k(0);function Ug(t,i){t=go,F(cc,t),F(Sa,i),go=t|i.baseLanes}function Pd(){F(cc,go),F(Sa,Sa.current)}function Jd(){go=cc.current,H(Sa),H(cc)}var ti=k(null),gi=null;function Vo(t){var i=t.alternate;F(Lt,Lt.current&1),F(ti,t),gi===null&&(i===null||Sa.current!==null||i.memoizedState!==null)&&(gi=t)}function Wd(t){F(Lt,Lt.current),F(ti,t),gi===null&&(gi=t)}function Gg(t){t.tag===22?(F(Lt,Lt.current),F(ti,t),gi===null&&(gi=t)):Xo()}function Xo(){F(Lt,Lt.current),F(ti,ti.current)}function ni(t){H(ti),gi===t&&(gi=null),H(Lt)}var Lt=k(0);function uc(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ah(a)||sh(a)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var so=0,Le=null,rt=null,qt=null,dc=!1,Aa=!1,Ur=!1,fc=0,zs=0,_a=null,gx=0;function Et(){throw Error(r(321))}function ef(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!Wn(t[a],i[a]))return!1;return!0}function tf(t,i,a,s,u,f){return so=f,Le=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,j.H=t===null||t.memoizedState===null?xy:yf,Ur=!1,f=a(s,u),Ur=!1,Aa&&(f=Hg(i,a,s,u)),Bg(t),f}function Bg(t){j.H=js;var i=rt!==null&&rt.next!==null;if(so=0,qt=rt=Le=null,dc=!1,zs=0,_a=null,i)throw Error(r(300));t===null||Vt||(t=t.dependencies,t!==null&&nc(t)&&(Vt=!0))}function Hg(t,i,a,s){Le=t;var u=0;do{if(Aa&&(_a=null),zs=0,Aa=!1,25<=u)throw Error(r(301));if(u+=1,qt=rt=null,t.updateQueue!=null){var f=t.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}j.H=Sy,f=i(a,s)}while(Aa);return f}function yx(){var t=j.H,i=t.useState()[0];return i=typeof i.then=="function"?Os(i):i,t=t.useState()[0],(rt!==null?rt.memoizedState:null)!==t&&(Le.flags|=1024),i}function nf(){var t=fc!==0;return fc=0,t}function of(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function rf(t){if(dc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}dc=!1}so=0,qt=rt=Le=null,Aa=!1,zs=fc=0,_a=null}function On(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Le.memoizedState=qt=t:qt=qt.next=t,qt}function Ut(){if(rt===null){var t=Le.alternate;t=t!==null?t.memoizedState:null}else t=rt.next;var i=qt===null?Le.memoizedState:qt.next;if(i!==null)qt=i,rt=t;else{if(t===null)throw Le.alternate===null?Error(r(467)):Error(r(310));rt=t,t={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},qt===null?Le.memoizedState=qt=t:qt=qt.next=t}return qt}function hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Os(t){var i=zs;return zs+=1,_a===null&&(_a=[]),t=Dg(_a,t,i),i=Le,(qt===null?i.memoizedState:qt.next)===null&&(i=i.alternate,j.H=i===null||i.memoizedState===null?xy:yf),t}function pc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Os(t);if(t.$$typeof===R)return gn(t)}throw Error(r(438,String(t)))}function af(t){var i=null,a=Le.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var s=Le.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(i={data:s.data.map(function(u){return u.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=hc(),Le.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),s=0;s<t;s++)a[s]=L;return i.index++,a}function lo(t,i){return typeof i=="function"?i(t):i}function mc(t){var i=Ut();return sf(i,rt,t)}function sf(t,i,a){var s=t.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=a;var u=t.baseQueue,f=s.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}i.baseQueue=u=f,s.pending=null}if(f=t.baseState,u===null)t.memoizedState=f;else{i=u.next;var C=b=null,U=null,Z=i,ie=!1;do{var le=Z.lane&-536870913;if(le!==Z.lane?(Ye&le)===le:(so&le)===le){var P=Z.revertLane;if(P===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),le===va&&(ie=!0);else if((so&P)===P){Z=Z.next,P===va&&(ie=!0);continue}else le={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},U===null?(C=U=le,b=f):U=U.next=le,Le.lanes|=P,Zo|=P;le=Z.action,Ur&&a(f,le),f=Z.hasEagerState?Z.eagerState:a(f,le)}else P={lane:le,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},U===null?(C=U=P,b=f):U=U.next=P,Le.lanes|=le,Zo|=le;Z=Z.next}while(Z!==null&&Z!==i);if(U===null?b=f:U.next=C,!Wn(f,t.memoizedState)&&(Vt=!0,ie&&(a=ba,a!==null)))throw a;t.memoizedState=f,t.baseState=b,t.baseQueue=U,s.lastRenderedState=f}return u===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function lf(t){var i=Ut(),a=i.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var s=a.dispatch,u=a.pending,f=i.memoizedState;if(u!==null){a.pending=null;var b=u=u.next;do f=t(f,b.action),b=b.next;while(b!==u);Wn(f,i.memoizedState)||(Vt=!0),i.memoizedState=f,i.baseQueue===null&&(i.baseState=f),a.lastRenderedState=f}return[f,s]}function $g(t,i,a){var s=Le,u=Ut(),f=Ke;if(f){if(a===void 0)throw Error(r(407));a=a()}else a=i();var b=!Wn((rt||u).memoizedState,a);if(b&&(u.memoizedState=a,Vt=!0),u=u.queue,df(Vg.bind(null,s,u,t),[t]),u.getSnapshot!==i||b||qt!==null&&qt.memoizedState.tag&1){if(s.flags|=2048,Ca(9,{destroy:void 0},qg.bind(null,s,u,a,i),null),ut===null)throw Error(r(349));f||(so&127)!==0||Yg(s,i,a)}return a}function Yg(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=Le.updateQueue,i===null?(i=hc(),Le.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function qg(t,i,a,s){i.value=a,i.getSnapshot=s,Xg(i)&&Kg(t)}function Vg(t,i,a){return a(function(){Xg(i)&&Kg(t)})}function Xg(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!Wn(t,a)}catch{return!0}}function Kg(t){var i=kr(t,2);i!==null&&Kn(i,t,2)}function cf(t){var i=On();if(typeof t=="function"){var a=t;if(t=a(),Ur){dn(!0);try{a()}finally{dn(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lo,lastRenderedState:t},i}function Qg(t,i,a,s){return t.baseState=a,sf(t,rt,typeof s=="function"?s:lo)}function vx(t,i,a,s,u){if(vc(t))throw Error(r(485));if(t=i.action,t!==null){var f={payload:u,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};j.T!==null?a(!0):f.isTransition=!1,s(f),a=i.pending,a===null?(f.next=i.pending=f,Zg(i,f)):(f.next=a.next,i.pending=a.next=f)}}function Zg(t,i){var a=i.action,s=i.payload,u=t.state;if(i.isTransition){var f=j.T,b={};j.T=b;try{var C=a(u,s),U=j.S;U!==null&&U(b,C),Ig(t,i,C)}catch(Z){uf(t,i,Z)}finally{f!==null&&b.types!==null&&(f.types=b.types),j.T=f}}else try{f=a(u,s),Ig(t,i,f)}catch(Z){uf(t,i,Z)}}function Ig(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(s){Fg(t,i,s)},function(s){return uf(t,i,s)}):Fg(t,i,a)}function Fg(t,i,a){i.status="fulfilled",i.value=a,Pg(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,Zg(t,a)))}function uf(t,i,a){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do i.status="rejected",i.reason=a,Pg(i),i=i.next;while(i!==s)}t.action=null}function Pg(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Jg(t,i){return i}function Wg(t,i){if(Ke){var a=ut.formState;if(a!==null){e:{var s=Le;if(Ke){if(pt){t:{for(var u=pt,f=mi;u.nodeType!==8;){if(!f){u=null;break t}if(u=yi(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){pt=yi(u.nextSibling),s=u.data==="F!";break e}}Bo(s)}s=!1}s&&(i=a[0])}}return a=On(),a.memoizedState=a.baseState=i,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jg,lastRenderedState:i},a.queue=s,a=vy.bind(null,Le,s),s.dispatch=a,s=cf(!1),f=gf.bind(null,Le,!1,s.queue),s=On(),u={state:i,dispatch:null,action:t,pending:null},s.queue=u,a=vx.bind(null,Le,u,f,a),u.dispatch=a,s.memoizedState=t,[i,a,!1]}function ey(t){var i=Ut();return ty(i,rt,t)}function ty(t,i,a){if(i=sf(t,i,Jg)[0],t=mc(lo)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var s=Os(i)}catch(b){throw b===wa?rc:b}else s=i;i=Ut();var u=i.queue,f=u.dispatch;return a!==i.memoizedState&&(Le.flags|=2048,Ca(9,{destroy:void 0},bx.bind(null,u,a),null)),[s,f,t]}function bx(t,i){t.action=i}function ny(t){var i=Ut(),a=rt;if(a!==null)return ty(i,a,t);Ut(),i=i.memoizedState,a=Ut();var s=a.queue.dispatch;return a.memoizedState=t,[i,s,!1]}function Ca(t,i,a,s){return t={tag:t,create:a,deps:s,inst:i,next:null},i=Le.updateQueue,i===null&&(i=hc(),Le.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(s=a.next,a.next=t,t.next=s,i.lastEffect=t),t}function iy(){return Ut().memoizedState}function gc(t,i,a,s){var u=On();Le.flags|=t,u.memoizedState=Ca(1|i,{destroy:void 0},a,s===void 0?null:s)}function yc(t,i,a,s){var u=Ut();s=s===void 0?null:s;var f=u.memoizedState.inst;rt!==null&&s!==null&&ef(s,rt.memoizedState.deps)?u.memoizedState=Ca(i,f,a,s):(Le.flags|=t,u.memoizedState=Ca(1|i,f,a,s))}function oy(t,i){gc(8390656,8,t,i)}function df(t,i){yc(2048,8,t,i)}function wx(t){Le.flags|=4;var i=Le.updateQueue;if(i===null)i=hc(),Le.updateQueue=i,i.events=[t];else{var a=i.events;a===null?i.events=[t]:a.push(t)}}function ry(t){var i=Ut().memoizedState;return wx({ref:i,nextImpl:t}),function(){if((Je&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function ay(t,i){return yc(4,2,t,i)}function sy(t,i){return yc(4,4,t,i)}function ly(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function cy(t,i,a){a=a!=null?a.concat([t]):null,yc(4,4,ly.bind(null,i,t),a)}function ff(){}function uy(t,i){var a=Ut();i=i===void 0?null:i;var s=a.memoizedState;return i!==null&&ef(i,s[1])?s[0]:(a.memoizedState=[t,i],t)}function dy(t,i){var a=Ut();i=i===void 0?null:i;var s=a.memoizedState;if(i!==null&&ef(i,s[1]))return s[0];if(s=t(),Ur){dn(!0);try{t()}finally{dn(!1)}}return a.memoizedState=[s,i],s}function hf(t,i,a){return a===void 0||(so&1073741824)!==0&&(Ye&261930)===0?t.memoizedState=i:(t.memoizedState=a,t=f0(),Le.lanes|=t,Zo|=t,a)}function fy(t,i,a,s){return Wn(a,i)?a:Sa.current!==null?(t=hf(t,a,s),Wn(t,i)||(Vt=!0),t):(so&42)===0||(so&1073741824)!==0&&(Ye&261930)===0?(Vt=!0,t.memoizedState=a):(t=f0(),Le.lanes|=t,Zo|=t,i)}function hy(t,i,a,s,u){var f=I.p;I.p=f!==0&&8>f?f:8;var b=j.T,C={};j.T=C,gf(t,!1,i,a);try{var U=u(),Z=j.S;if(Z!==null&&Z(C,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=mx(U,s);Rs(t,i,ie,ri(t))}else Rs(t,i,s,ri(t))}catch(le){Rs(t,i,{then:function(){},status:"rejected",reason:le},ri())}finally{I.p=f,b!==null&&C.types!==null&&(b.types=C.types),j.T=b}}function xx(){}function pf(t,i,a,s){if(t.tag!==5)throw Error(r(476));var u=py(t).queue;hy(t,u,i,G,a===null?xx:function(){return my(t),a(s)})}function py(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lo,lastRenderedState:G},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lo,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function my(t){var i=py(t);i.next===null&&(i=t.alternate.memoizedState),Rs(t,i.next.queue,{},ri())}function mf(){return gn(Ps)}function gy(){return Ut().memoizedState}function yy(){return Ut().memoizedState}function Sx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=ri();t=Yo(a);var s=qo(i,t,a);s!==null&&(Kn(s,i,a),Ts(s,i,a)),i={cache:qd()},t.payload=i;return}i=i.return}}function Ax(t,i,a){var s=ri();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vc(t)?by(i,a):(a=zd(t,i,a,s),a!==null&&(Kn(a,t,s),wy(a,i,s)))}function vy(t,i,a){var s=ri();Rs(t,i,a,s)}function Rs(t,i,a,s){var u={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(vc(t))by(i,u);else{var f=t.alternate;if(t.lanes===0&&(f===null||f.lanes===0)&&(f=i.lastRenderedReducer,f!==null))try{var b=i.lastRenderedState,C=f(b,a);if(u.hasEagerState=!0,u.eagerState=C,Wn(C,b))return Jl(t,i,u,0),ut===null&&Pl(),!1}catch{}finally{}if(a=zd(t,i,u,s),a!==null)return Kn(a,t,s),wy(a,i,s),!0}return!1}function gf(t,i,a,s){if(s={lane:2,revertLane:Zf(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},vc(t)){if(i)throw Error(r(479))}else i=zd(t,a,s,2),i!==null&&Kn(i,t,2)}function vc(t){var i=t.alternate;return t===Le||i!==null&&i===Le}function by(t,i){Aa=dc=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function wy(t,i,a){if((a&4194048)!==0){var s=i.lanes;s&=t.pendingLanes,a|=s,i.lanes=a,bt(t,a)}}var js={readContext:gn,use:pc,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};js.useEffectEvent=Et;var xy={readContext:gn,use:pc,useCallback:function(t,i){return On().memoizedState=[t,i===void 0?null:i],t},useContext:gn,useEffect:oy,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,gc(4194308,4,ly.bind(null,i,t),a)},useLayoutEffect:function(t,i){return gc(4194308,4,t,i)},useInsertionEffect:function(t,i){gc(4,2,t,i)},useMemo:function(t,i){var a=On();i=i===void 0?null:i;var s=t();if(Ur){dn(!0);try{t()}finally{dn(!1)}}return a.memoizedState=[s,i],s},useReducer:function(t,i,a){var s=On();if(a!==void 0){var u=a(i);if(Ur){dn(!0);try{a(i)}finally{dn(!1)}}}else u=i;return s.memoizedState=s.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},s.queue=t,t=t.dispatch=Ax.bind(null,Le,t),[s.memoizedState,t]},useRef:function(t){var i=On();return t={current:t},i.memoizedState=t},useState:function(t){t=cf(t);var i=t.queue,a=vy.bind(null,Le,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:ff,useDeferredValue:function(t,i){var a=On();return hf(a,t,i)},useTransition:function(){var t=cf(!1);return t=hy.bind(null,Le,t.queue,!0,!1),On().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var s=Le,u=On();if(Ke){if(a===void 0)throw Error(r(407));a=a()}else{if(a=i(),ut===null)throw Error(r(349));(Ye&127)!==0||Yg(s,i,a)}u.memoizedState=a;var f={value:a,getSnapshot:i};return u.queue=f,oy(Vg.bind(null,s,f,t),[t]),s.flags|=2048,Ca(9,{destroy:void 0},qg.bind(null,s,f,a,i),null),a},useId:function(){var t=On(),i=ut.identifierPrefix;if(Ke){var a=Xi,s=Vi;a=(s&~(1<<32-vt(s)-1)).toString(32)+a,i="_"+i+"R_"+a,a=fc++,0<a&&(i+="H"+a.toString(32)),i+="_"}else a=gx++,i="_"+i+"r_"+a.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:mf,useFormState:Wg,useActionState:Wg,useOptimistic:function(t){var i=On();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=gf.bind(null,Le,!0,a),a.dispatch=i,[t,i]},useMemoCache:af,useCacheRefresh:function(){return On().memoizedState=Sx.bind(null,Le)},useEffectEvent:function(t){var i=On(),a={impl:t};return i.memoizedState=a,function(){if((Je&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},yf={readContext:gn,use:pc,useCallback:uy,useContext:gn,useEffect:df,useImperativeHandle:cy,useInsertionEffect:ay,useLayoutEffect:sy,useMemo:dy,useReducer:mc,useRef:iy,useState:function(){return mc(lo)},useDebugValue:ff,useDeferredValue:function(t,i){var a=Ut();return fy(a,rt.memoizedState,t,i)},useTransition:function(){var t=mc(lo)[0],i=Ut().memoizedState;return[typeof t=="boolean"?t:Os(t),i]},useSyncExternalStore:$g,useId:gy,useHostTransitionStatus:mf,useFormState:ey,useActionState:ey,useOptimistic:function(t,i){var a=Ut();return Qg(a,rt,t,i)},useMemoCache:af,useCacheRefresh:yy};yf.useEffectEvent=ry;var Sy={readContext:gn,use:pc,useCallback:uy,useContext:gn,useEffect:df,useImperativeHandle:cy,useInsertionEffect:ay,useLayoutEffect:sy,useMemo:dy,useReducer:lf,useRef:iy,useState:function(){return lf(lo)},useDebugValue:ff,useDeferredValue:function(t,i){var a=Ut();return rt===null?hf(a,t,i):fy(a,rt.memoizedState,t,i)},useTransition:function(){var t=lf(lo)[0],i=Ut().memoizedState;return[typeof t=="boolean"?t:Os(t),i]},useSyncExternalStore:$g,useId:gy,useHostTransitionStatus:mf,useFormState:ny,useActionState:ny,useOptimistic:function(t,i){var a=Ut();return rt!==null?Qg(a,rt,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:af,useCacheRefresh:yy};Sy.useEffectEvent=ry;function vf(t,i,a,s){i=t.memoizedState,a=a(s,i),a=a==null?i:y({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var bf={enqueueSetState:function(t,i,a){t=t._reactInternals;var s=ri(),u=Yo(s);u.payload=i,a!=null&&(u.callback=a),i=qo(t,u,s),i!==null&&(Kn(i,t,s),Ts(i,t,s))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var s=ri(),u=Yo(s);u.tag=1,u.payload=i,a!=null&&(u.callback=a),i=qo(t,u,s),i!==null&&(Kn(i,t,s),Ts(i,t,s))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=ri(),s=Yo(a);s.tag=2,i!=null&&(s.callback=i),i=qo(t,s,a),i!==null&&(Kn(i,t,a),Ts(i,t,a))}};function Ay(t,i,a,s,u,f,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,f,b):i.prototype&&i.prototype.isPureReactComponent?!xs(a,s)||!xs(u,f):!0}function _y(t,i,a,s){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,s),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,s),i.state!==t&&bf.enqueueReplaceState(i,i.state,null)}function Gr(t,i){var a=i;if("ref"in i){a={};for(var s in i)s!=="ref"&&(a[s]=i[s])}if(t=t.defaultProps){a===i&&(a=y({},a));for(var u in t)a[u]===void 0&&(a[u]=t[u])}return a}function Cy(t){Fl(t)}function Ey(t){console.error(t)}function Ny(t){Fl(t)}function bc(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(s){setTimeout(function(){throw s})}}function ky(t,i,a){try{var s=t.onCaughtError;s(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function wf(t,i,a){return a=Yo(a),a.tag=3,a.payload={element:null},a.callback=function(){bc(t,i)},a}function Ty(t){return t=Yo(t),t.tag=3,t}function Dy(t,i,a,s){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;t.payload=function(){return u(f)},t.callback=function(){ky(i,a,s)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){ky(i,a,s),typeof u!="function"&&(Io===null?Io=new Set([this]):Io.add(this));var C=s.stack;this.componentDidCatch(s.value,{componentStack:C!==null?C:""})})}function _x(t,i,a,s,u){if(a.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(i=a.alternate,i!==null&&ya(i,a,u,!0),a=ti.current,a!==null){switch(a.tag){case 31:case 13:return gi===null?Mc():a.alternate===null&&Nt===0&&(Nt=3),a.flags&=-257,a.flags|=65536,a.lanes=u,s===ac?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([s]):i.add(s),Xf(t,s,u)),!1;case 22:return a.flags|=65536,s===ac?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([s])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([s]):a.add(s)),Xf(t,s,u)),!1}throw Error(r(435,a.tag))}return Xf(t,s,u),Mc(),!1}if(Ke)return i=ti.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=u,s!==Gd&&(t=Error(r(422),{cause:s}),_s(fi(t,a)))):(s!==Gd&&(i=Error(r(423),{cause:s}),_s(fi(i,a))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,s=fi(s,a),u=wf(t.stateNode,s,u),Id(t,u),Nt!==4&&(Nt=2)),!1;var f=Error(r(520),{cause:s});if(f=fi(f,a),qs===null?qs=[f]:qs.push(f),Nt!==4&&(Nt=2),i===null)return!0;s=fi(s,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=u&-u,a.lanes|=t,t=wf(a.stateNode,s,t),Id(a,t),!1;case 1:if(i=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Io===null||!Io.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Ty(u),Dy(u,t,a,s),Id(a,u),!1}a=a.return}while(a!==null);return!1}var xf=Error(r(461)),Vt=!1;function yn(t,i,a,s){i.child=t===null?Rg(i,null,a,s):Lr(i,t.child,a,s)}function My(t,i,a,s,u){a=a.render;var f=i.ref;if("ref"in s){var b={};for(var C in s)C!=="ref"&&(b[C]=s[C])}else b=s;return zr(i),s=tf(t,i,a,b,f,u),C=nf(),t!==null&&!Vt?(of(t,i,u),co(t,i,u)):(Ke&&C&&Ld(i),i.flags|=1,yn(t,i,s,u),i.child)}function zy(t,i,a,s,u){if(t===null){var f=a.type;return typeof f=="function"&&!Od(f)&&f.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=f,Oy(t,i,f,s,u)):(t=ec(a.type,null,s,i,i.mode,u),t.ref=i.ref,t.return=i,i.child=t)}if(f=t.child,!Tf(t,u)){var b=f.memoizedProps;if(a=a.compare,a=a!==null?a:xs,a(b,s)&&t.ref===i.ref)return co(t,i,u)}return i.flags|=1,t=io(f,s),t.ref=i.ref,t.return=i,i.child=t}function Oy(t,i,a,s,u){if(t!==null){var f=t.memoizedProps;if(xs(f,s)&&t.ref===i.ref)if(Vt=!1,i.pendingProps=s=f,Tf(t,u))(t.flags&131072)!==0&&(Vt=!0);else return i.lanes=t.lanes,co(t,i,u)}return Sf(t,i,a,s,u)}function Ry(t,i,a,s){var u=s.children,f=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((i.flags&128)!==0){if(f=f!==null?f.baseLanes|a:a,t!==null){for(s=i.child=t.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~f}else s=0,i.child=null;return jy(t,i,f,a,s)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&oc(i,f!==null?f.cachePool:null),f!==null?Ug(i,f):Pd(),Gg(i);else return s=i.lanes=536870912,jy(t,i,f!==null?f.baseLanes|a:a,a,s)}else f!==null?(oc(i,f.cachePool),Ug(i,f),Xo(),i.memoizedState=null):(t!==null&&oc(i,null),Pd(),Xo());return yn(t,i,u,a),i.child}function Ls(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function jy(t,i,a,s,u){var f=Xd();return f=f===null?null:{parent:Yt._currentValue,pool:f},i.memoizedState={baseLanes:a,cachePool:f},t!==null&&oc(i,null),Pd(),Gg(i),t!==null&&ya(t,i,s,!0),i.childLanes=u,null}function wc(t,i){return i=Sc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Ly(t,i,a){return Lr(i,t.child,null,a),t=wc(i,i.pendingProps),t.flags|=2,ni(i),i.memoizedState=null,t}function Cx(t,i,a){var s=i.pendingProps,u=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(Ke){if(s.mode==="hidden")return t=wc(i,s),i.lanes=536870912,Ls(null,t);if(Wd(i),(t=pt)?(t=Z0(t,mi),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Uo!==null?{id:Vi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},a=bg(t),a.return=i,i.child=a,mn=i,pt=null)):t=null,t===null)throw Bo(i);return i.lanes=536870912,null}return wc(i,s)}var f=t.memoizedState;if(f!==null){var b=f.dehydrated;if(Wd(i),u)if(i.flags&256)i.flags&=-257,i=Ly(t,i,a);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(r(558));else if(Vt||ya(t,i,a,!1),u=(a&t.childLanes)!==0,Vt||u){if(s=ut,s!==null&&(b=Rt(s,a),b!==0&&b!==f.retryLane))throw f.retryLane=b,kr(t,b),Kn(s,t,b),xf;Mc(),i=Ly(t,i,a)}else t=f.treeContext,pt=yi(b.nextSibling),mn=i,Ke=!0,Go=null,mi=!1,t!==null&&Sg(i,t),i=wc(i,s),i.flags|=4096;return i}return t=io(t.child,{mode:s.mode,children:s.children}),t.ref=i.ref,i.child=t,t.return=i,t}function xc(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function Sf(t,i,a,s,u){return zr(i),a=tf(t,i,a,s,void 0,u),s=nf(),t!==null&&!Vt?(of(t,i,u),co(t,i,u)):(Ke&&s&&Ld(i),i.flags|=1,yn(t,i,a,u),i.child)}function Uy(t,i,a,s,u,f){return zr(i),i.updateQueue=null,a=Hg(i,s,a,u),Bg(t),s=nf(),t!==null&&!Vt?(of(t,i,f),co(t,i,f)):(Ke&&s&&Ld(i),i.flags|=1,yn(t,i,a,f),i.child)}function Gy(t,i,a,s,u){if(zr(i),i.stateNode===null){var f=ha,b=a.contextType;typeof b=="object"&&b!==null&&(f=gn(b)),f=new a(s,f),i.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=bf,i.stateNode=f,f._reactInternals=i,f=i.stateNode,f.props=s,f.state=i.memoizedState,f.refs={},Qd(i),b=a.contextType,f.context=typeof b=="object"&&b!==null?gn(b):ha,f.state=i.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(vf(i,a,b,s),f.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&bf.enqueueReplaceState(f,f.state,null),Ms(i,s,f,u),Ds(),f.state=i.memoizedState),typeof f.componentDidMount=="function"&&(i.flags|=4194308),s=!0}else if(t===null){f=i.stateNode;var C=i.memoizedProps,U=Gr(a,C);f.props=U;var Z=f.context,ie=a.contextType;b=ha,typeof ie=="object"&&ie!==null&&(b=gn(ie));var le=a.getDerivedStateFromProps;ie=typeof le=="function"||typeof f.getSnapshotBeforeUpdate=="function",C=i.pendingProps!==C,ie||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(C||Z!==b)&&_y(i,f,s,b),$o=!1;var P=i.memoizedState;f.state=P,Ms(i,s,f,u),Ds(),Z=i.memoizedState,C||P!==Z||$o?(typeof le=="function"&&(vf(i,a,le,s),Z=i.memoizedState),(U=$o||Ay(i,a,U,s,P,Z,b))?(ie||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(i.flags|=4194308)):(typeof f.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=s,i.memoizedState=Z),f.props=s,f.state=Z,f.context=b,s=U):(typeof f.componentDidMount=="function"&&(i.flags|=4194308),s=!1)}else{f=i.stateNode,Zd(t,i),b=i.memoizedProps,ie=Gr(a,b),f.props=ie,le=i.pendingProps,P=f.context,Z=a.contextType,U=ha,typeof Z=="object"&&Z!==null&&(U=gn(Z)),C=a.getDerivedStateFromProps,(Z=typeof C=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==le||P!==U)&&_y(i,f,s,U),$o=!1,P=i.memoizedState,f.state=P,Ms(i,s,f,u),Ds();var ee=i.memoizedState;b!==le||P!==ee||$o||t!==null&&t.dependencies!==null&&nc(t.dependencies)?(typeof C=="function"&&(vf(i,a,C,s),ee=i.memoizedState),(ie=$o||Ay(i,a,ie,s,P,ee,U)||t!==null&&t.dependencies!==null&&nc(t.dependencies))?(Z||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,ee,U),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,ee,U)),typeof f.componentDidUpdate=="function"&&(i.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=1024),i.memoizedProps=s,i.memoizedState=ee),f.props=s,f.state=ee,f.context=U,s=ie):(typeof f.componentDidUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=1024),s=!1)}return f=s,xc(t,i),s=(i.flags&128)!==0,f||s?(f=i.stateNode,a=s&&typeof a.getDerivedStateFromError!="function"?null:f.render(),i.flags|=1,t!==null&&s?(i.child=Lr(i,t.child,null,u),i.child=Lr(i,null,a,u)):yn(t,i,a,u),i.memoizedState=f.state,t=i.child):t=co(t,i,u),t}function By(t,i,a,s){return Dr(),i.flags|=256,yn(t,i,a,s),i.child}var Af={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _f(t){return{baseLanes:t,cachePool:kg()}}function Cf(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=oi),t}function Hy(t,i,a){var s=i.pendingProps,u=!1,f=(i.flags&128)!==0,b;if((b=f)||(b=t!==null&&t.memoizedState===null?!1:(Lt.current&2)!==0),b&&(u=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,t===null){if(Ke){if(u?Vo(i):Xo(),(t=pt)?(t=Z0(t,mi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Uo!==null?{id:Vi,overflow:Xi}:null,retryLane:536870912,hydrationErrors:null},a=bg(t),a.return=i,i.child=a,mn=i,pt=null)):t=null,t===null)throw Bo(i);return sh(t)?i.lanes=32:i.lanes=536870912,null}var C=s.children;return s=s.fallback,u?(Xo(),u=i.mode,C=Sc({mode:"hidden",children:C},u),s=Tr(s,u,a,null),C.return=i,s.return=i,C.sibling=s,i.child=C,s=i.child,s.memoizedState=_f(a),s.childLanes=Cf(t,b,a),i.memoizedState=Af,Ls(null,s)):(Vo(i),Ef(i,C))}var U=t.memoizedState;if(U!==null&&(C=U.dehydrated,C!==null)){if(f)i.flags&256?(Vo(i),i.flags&=-257,i=Nf(t,i,a)):i.memoizedState!==null?(Xo(),i.child=t.child,i.flags|=128,i=null):(Xo(),C=s.fallback,u=i.mode,s=Sc({mode:"visible",children:s.children},u),C=Tr(C,u,a,null),C.flags|=2,s.return=i,C.return=i,s.sibling=C,i.child=s,Lr(i,t.child,null,a),s=i.child,s.memoizedState=_f(a),s.childLanes=Cf(t,b,a),i.memoizedState=Af,i=Ls(null,s));else if(Vo(i),sh(C)){if(b=C.nextSibling&&C.nextSibling.dataset,b)var Z=b.dgst;b=Z,s=Error(r(419)),s.stack="",s.digest=b,_s({value:s,source:null,stack:null}),i=Nf(t,i,a)}else if(Vt||ya(t,i,a,!1),b=(a&t.childLanes)!==0,Vt||b){if(b=ut,b!==null&&(s=Rt(b,a),s!==0&&s!==U.retryLane))throw U.retryLane=s,kr(t,s),Kn(b,t,s),xf;ah(C)||Mc(),i=Nf(t,i,a)}else ah(C)?(i.flags|=192,i.child=t.child,i=null):(t=U.treeContext,pt=yi(C.nextSibling),mn=i,Ke=!0,Go=null,mi=!1,t!==null&&Sg(i,t),i=Ef(i,s.children),i.flags|=4096);return i}return u?(Xo(),C=s.fallback,u=i.mode,U=t.child,Z=U.sibling,s=io(U,{mode:"hidden",children:s.children}),s.subtreeFlags=U.subtreeFlags&65011712,Z!==null?C=io(Z,C):(C=Tr(C,u,a,null),C.flags|=2),C.return=i,s.return=i,s.sibling=C,i.child=s,Ls(null,s),s=i.child,C=t.child.memoizedState,C===null?C=_f(a):(u=C.cachePool,u!==null?(U=Yt._currentValue,u=u.parent!==U?{parent:U,pool:U}:u):u=kg(),C={baseLanes:C.baseLanes|a,cachePool:u}),s.memoizedState=C,s.childLanes=Cf(t,b,a),i.memoizedState=Af,Ls(t.child,s)):(Vo(i),a=t.child,t=a.sibling,a=io(a,{mode:"visible",children:s.children}),a.return=i,a.sibling=null,t!==null&&(b=i.deletions,b===null?(i.deletions=[t],i.flags|=16):b.push(t)),i.child=a,i.memoizedState=null,a)}function Ef(t,i){return i=Sc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Sc(t,i){return t=ei(22,t,null,i),t.lanes=0,t}function Nf(t,i,a){return Lr(i,t.child,null,a),t=Ef(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function $y(t,i,a){t.lanes|=i;var s=t.alternate;s!==null&&(s.lanes|=i),$d(t.return,i,a)}function kf(t,i,a,s,u,f){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:s,tail:a,tailMode:u,treeForkCount:f}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=a,b.tailMode=u,b.treeForkCount=f)}function Yy(t,i,a){var s=i.pendingProps,u=s.revealOrder,f=s.tail;s=s.children;var b=Lt.current,C=(b&2)!==0;if(C?(b=b&1|2,i.flags|=128):b&=1,F(Lt,b),yn(t,i,s,a),s=Ke?As:0,!C&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$y(t,a,i);else if(t.tag===19)$y(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"forwards":for(a=i.child,u=null;a!==null;)t=a.alternate,t!==null&&uc(t)===null&&(u=a),a=a.sibling;a=u,a===null?(u=i.child,i.child=null):(u=a.sibling,a.sibling=null),kf(i,!1,u,a,f,s);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=i.child,i.child=null;u!==null;){if(t=u.alternate,t!==null&&uc(t)===null){i.child=u;break}t=u.sibling,u.sibling=a,a=u,u=t}kf(i,!0,a,null,f,s);break;case"together":kf(i,!1,null,null,void 0,s);break;default:i.memoizedState=null}return i.child}function co(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Zo|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(ya(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(r(153));if(i.child!==null){for(t=i.child,a=io(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=io(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function Tf(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&nc(t)))}function Ex(t,i,a){switch(i.tag){case 3:xe(i,i.stateNode.containerInfo),Ho(i,Yt,t.memoizedState.cache),Dr();break;case 27:case 5:Te(i);break;case 4:xe(i,i.stateNode.containerInfo);break;case 10:Ho(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Wd(i),null;break;case 13:var s=i.memoizedState;if(s!==null)return s.dehydrated!==null?(Vo(i),i.flags|=128,null):(a&i.child.childLanes)!==0?Hy(t,i,a):(Vo(i),t=co(t,i,a),t!==null?t.sibling:null);Vo(i);break;case 19:var u=(t.flags&128)!==0;if(s=(a&i.childLanes)!==0,s||(ya(t,i,a,!1),s=(a&i.childLanes)!==0),u){if(s)return Yy(t,i,a);i.flags|=128}if(u=i.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),F(Lt,Lt.current),s)break;return null;case 22:return i.lanes=0,Ry(t,i,a,i.pendingProps);case 24:Ho(i,Yt,t.memoizedState.cache)}return co(t,i,a)}function qy(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)Vt=!0;else{if(!Tf(t,a)&&(i.flags&128)===0)return Vt=!1,Ex(t,i,a);Vt=(t.flags&131072)!==0}else Vt=!1,Ke&&(i.flags&1048576)!==0&&xg(i,As,i.index);switch(i.lanes=0,i.tag){case 16:e:{var s=i.pendingProps;if(t=Rr(i.elementType),i.type=t,typeof t=="function")Od(t)?(s=Gr(t,s),i.tag=1,i=Gy(null,i,t,s,a)):(i.tag=0,i=Sf(null,i,t,s,a));else{if(t!=null){var u=t.$$typeof;if(u===_){i.tag=11,i=My(null,i,t,s,a);break e}else if(u===O){i.tag=14,i=zy(null,i,t,s,a);break e}}throw i=me(t)||t,Error(r(306,i,""))}}return i;case 0:return Sf(t,i,i.type,i.pendingProps,a);case 1:return s=i.type,u=Gr(s,i.pendingProps),Gy(t,i,s,u,a);case 3:e:{if(xe(i,i.stateNode.containerInfo),t===null)throw Error(r(387));s=i.pendingProps;var f=i.memoizedState;u=f.element,Zd(t,i),Ms(i,s,null,a);var b=i.memoizedState;if(s=b.cache,Ho(i,Yt,s),s!==f.cache&&Yd(i,[Yt],a,!0),Ds(),s=b.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:b.cache},i.updateQueue.baseState=f,i.memoizedState=f,i.flags&256){i=By(t,i,s,a);break e}else if(s!==u){u=fi(Error(r(424)),i),_s(u),i=By(t,i,s,a);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(pt=yi(t.firstChild),mn=i,Ke=!0,Go=null,mi=!0,a=Rg(i,null,s,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Dr(),s===u){i=co(t,i,a);break e}yn(t,i,s,a)}i=i.child}return i;case 26:return xc(t,i),t===null?(a=ev(i.type,null,i.pendingProps,null))?i.memoizedState=a:Ke||(a=i.type,t=i.pendingProps,s=Gc(W.current).createElement(a),s[nt]=i,s[wt]=t,vn(s,a,t),jt(s),i.stateNode=s):i.memoizedState=ev(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Te(i),t===null&&Ke&&(s=i.stateNode=P0(i.type,i.pendingProps,W.current),mn=i,mi=!0,u=pt,Wo(i.type)?(lh=u,pt=yi(s.firstChild)):pt=u),yn(t,i,i.pendingProps.children,a),xc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&Ke&&((u=s=pt)&&(s=nS(s,i.type,i.pendingProps,mi),s!==null?(i.stateNode=s,mn=i,pt=yi(s.firstChild),mi=!1,u=!0):u=!1),u||Bo(i)),Te(i),u=i.type,f=i.pendingProps,b=t!==null?t.memoizedProps:null,s=f.children,ih(u,f)?s=null:b!==null&&ih(u,b)&&(i.flags|=32),i.memoizedState!==null&&(u=tf(t,i,yx,null,null,a),Ps._currentValue=u),xc(t,i),yn(t,i,s,a),i.child;case 6:return t===null&&Ke&&((t=a=pt)&&(a=iS(a,i.pendingProps,mi),a!==null?(i.stateNode=a,mn=i,pt=null,t=!0):t=!1),t||Bo(i)),null;case 13:return Hy(t,i,a);case 4:return xe(i,i.stateNode.containerInfo),s=i.pendingProps,t===null?i.child=Lr(i,null,s,a):yn(t,i,s,a),i.child;case 11:return My(t,i,i.type,i.pendingProps,a);case 7:return yn(t,i,i.pendingProps,a),i.child;case 8:return yn(t,i,i.pendingProps.children,a),i.child;case 12:return yn(t,i,i.pendingProps.children,a),i.child;case 10:return s=i.pendingProps,Ho(i,i.type,s.value),yn(t,i,s.children,a),i.child;case 9:return u=i.type._context,s=i.pendingProps.children,zr(i),u=gn(u),s=s(u),i.flags|=1,yn(t,i,s,a),i.child;case 14:return zy(t,i,i.type,i.pendingProps,a);case 15:return Oy(t,i,i.type,i.pendingProps,a);case 19:return Yy(t,i,a);case 31:return Cx(t,i,a);case 22:return Ry(t,i,a,i.pendingProps);case 24:return zr(i),s=gn(Yt),t===null?(u=Xd(),u===null&&(u=ut,f=qd(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),i.memoizedState={parent:s,cache:u},Qd(i),Ho(i,Yt,u)):((t.lanes&a)!==0&&(Zd(t,i),Ms(i,null,null,a),Ds()),u=t.memoizedState,f=i.memoizedState,u.parent!==s?(u={parent:s,cache:s},i.memoizedState=u,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=u),Ho(i,Yt,s)):(s=f.cache,Ho(i,Yt,s),s!==u.cache&&Yd(i,[Yt],a,!0))),yn(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function uo(t){t.flags|=4}function Df(t,i,a,s,u){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(g0())t.flags|=8192;else throw jr=ac,Kd}else t.flags&=-16777217}function Vy(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!rv(i))if(g0())t.flags|=8192;else throw jr=ac,Kd}function Ac(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Gn():536870912,t.lanes|=i,Ta|=i)}function Us(t,i){if(!Ke)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function mt(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,s=0;if(i)for(var u=t.child;u!==null;)a|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)a|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=s,t.childLanes=a,i}function Nx(t,i,a){var s=i.pendingProps;switch(Ud(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return a=i.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ao(Yt),de(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(ga(i)?uo(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Bd())),mt(i),null;case 26:var u=i.type,f=i.memoizedState;return t===null?(uo(i),f!==null?(mt(i),Vy(i,f)):(mt(i),Df(i,u,null,s,a))):f?f!==t.memoizedState?(uo(i),mt(i),Vy(i,f)):(mt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==s&&uo(i),mt(i),Df(i,u,t,s,a)),null;case 27:if(Ce(i),a=W.current,u=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==s&&uo(i);else{if(!s){if(i.stateNode===null)throw Error(r(166));return mt(i),null}t=oe.current,ga(i)?Ag(i):(t=P0(u,s,a),i.stateNode=t,uo(i))}return mt(i),null;case 5:if(Ce(i),u=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==s&&uo(i);else{if(!s){if(i.stateNode===null)throw Error(r(166));return mt(i),null}if(f=oe.current,ga(i))Ag(i);else{var b=Gc(W.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?b.createElement(u,{is:s.is}):b.createElement(u)}}f[nt]=i,f[wt]=s;e:for(b=i.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===i)break e;for(;b.sibling===null;){if(b.return===null||b.return===i)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}i.stateNode=f;e:switch(vn(f,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&uo(i)}}return mt(i),Df(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,a),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==s&&uo(i);else{if(typeof s!="string"&&i.stateNode===null)throw Error(r(166));if(t=W.current,ga(i)){if(t=i.stateNode,a=i.memoizedProps,s=null,u=mn,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}t[nt]=i,t=!!(t.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||H0(t.nodeValue,a)),t||Bo(i,!0)}else t=Gc(t).createTextNode(s),t[nt]=i,i.stateNode=t}return mt(i),null;case 31:if(a=i.memoizedState,t===null||t.memoizedState!==null){if(s=ga(i),a!==null){if(t===null){if(!s)throw Error(r(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[nt]=i}else Dr(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),t=!1}else a=Bd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return i.flags&256?(ni(i),i):(ni(i),null);if((i.flags&128)!==0)throw Error(r(558))}return mt(i),null;case 13:if(s=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=ga(i),s!==null&&s.dehydrated!==null){if(t===null){if(!u)throw Error(r(318));if(u=i.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[nt]=i}else Dr(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),u=!1}else u=Bd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return i.flags&256?(ni(i),i):(ni(i),null)}return ni(i),(i.flags&128)!==0?(i.lanes=a,i):(a=s!==null,t=t!==null&&t.memoizedState!==null,a&&(s=i.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048)),a!==t&&a&&(i.child.flags|=8192),Ac(i,i.updateQueue),mt(i),null);case 4:return de(),t===null&&Jf(i.stateNode.containerInfo),mt(i),null;case 10:return ao(i.type),mt(i),null;case 19:if(H(Lt),s=i.memoizedState,s===null)return mt(i),null;if(u=(i.flags&128)!==0,f=s.rendering,f===null)if(u)Us(s,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(f=uc(t),f!==null){for(i.flags|=128,Us(s,!1),t=f.updateQueue,i.updateQueue=t,Ac(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)vg(a,t),a=a.sibling;return F(Lt,Lt.current&1|2),Ke&&oo(i,s.treeForkCount),i.child}t=t.sibling}s.tail!==null&&Ve()>kc&&(i.flags|=128,u=!0,Us(s,!1),i.lanes=4194304)}else{if(!u)if(t=uc(f),t!==null){if(i.flags|=128,u=!0,t=t.updateQueue,i.updateQueue=t,Ac(i,t),Us(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Ke)return mt(i),null}else 2*Ve()-s.renderingStartTime>kc&&a!==536870912&&(i.flags|=128,u=!0,Us(s,!1),i.lanes=4194304);s.isBackwards?(f.sibling=i.child,i.child=f):(t=s.last,t!==null?t.sibling=f:i.child=f,s.last=f)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ve(),t.sibling=null,a=Lt.current,F(Lt,u?a&1|2:a&1),Ke&&oo(i,s.treeForkCount),t):(mt(i),null);case 22:case 23:return ni(i),Jd(),s=i.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(i.flags|=8192):s&&(i.flags|=8192),s?(a&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),a=i.updateQueue,a!==null&&Ac(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==a&&(i.flags|=2048),t!==null&&H(Or),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),ao(Yt),mt(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function kx(t,i){switch(Ud(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return ao(Yt),de(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Ce(i),null;case 31:if(i.memoizedState!==null){if(ni(i),i.alternate===null)throw Error(r(340));Dr()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(ni(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Dr()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return H(Lt),null;case 4:return de(),null;case 10:return ao(i.type),null;case 22:case 23:return ni(i),Jd(),t!==null&&H(Or),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return ao(Yt),null;case 25:return null;default:return null}}function Xy(t,i){switch(Ud(i),i.tag){case 3:ao(Yt),de();break;case 26:case 27:case 5:Ce(i);break;case 4:de();break;case 31:i.memoizedState!==null&&ni(i);break;case 13:ni(i);break;case 19:H(Lt);break;case 10:ao(i.type);break;case 22:case 23:ni(i),Jd(),t!==null&&H(Or);break;case 24:ao(Yt)}}function Gs(t,i){try{var a=i.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var u=s.next;a=u;do{if((a.tag&t)===t){s=void 0;var f=a.create,b=a.inst;s=f(),b.destroy=s}a=a.next}while(a!==u)}}catch(C){ot(i,i.return,C)}}function Ko(t,i,a){try{var s=i.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&t)===t){var b=s.inst,C=b.destroy;if(C!==void 0){b.destroy=void 0,u=i;var U=a,Z=C;try{Z()}catch(ie){ot(u,U,ie)}}}s=s.next}while(s!==f)}}catch(ie){ot(i,i.return,ie)}}function Ky(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{Lg(i,a)}catch(s){ot(t,t.return,s)}}}function Qy(t,i,a){a.props=Gr(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(s){ot(t,i,s)}}function Bs(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof a=="function"?t.refCleanup=a(s):a.current=s}}catch(u){ot(t,i,u)}}function Ki(t,i){var a=t.ref,s=t.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(u){ot(t,i,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){ot(t,i,u)}else a.current=null}function Zy(t){var i=t.type,a=t.memoizedProps,s=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break e;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(u){ot(t,t.return,u)}}function Mf(t,i,a){try{var s=t.stateNode;Fx(s,t.type,a,i),s[wt]=i}catch(u){ot(t,t.return,u)}}function Iy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Wo(t.type)||t.tag===4}function zf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Iy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Wo(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Of(t,i,a){var s=t.tag;if(s===5||s===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=to));else if(s!==4&&(s===27&&Wo(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(Of(t,i,a),t=t.sibling;t!==null;)Of(t,i,a),t=t.sibling}function _c(t,i,a){var s=t.tag;if(s===5||s===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(s!==4&&(s===27&&Wo(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(_c(t,i,a),t=t.sibling;t!==null;)_c(t,i,a),t=t.sibling}function Fy(t){var i=t.stateNode,a=t.memoizedProps;try{for(var s=t.type,u=i.attributes;u.length;)i.removeAttributeNode(u[0]);vn(i,s,a),i[nt]=t,i[wt]=a}catch(f){ot(t,t.return,f)}}var fo=!1,Xt=!1,Rf=!1,Py=typeof WeakSet=="function"?WeakSet:Set,an=null;function Tx(t,i){if(t=t.containerInfo,th=Xc,t=cg(t),Ed(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var b=0,C=-1,U=-1,Z=0,ie=0,le=t,P=null;t:for(;;){for(var ee;le!==a||u!==0&&le.nodeType!==3||(C=b+u),le!==f||s!==0&&le.nodeType!==3||(U=b+s),le.nodeType===3&&(b+=le.nodeValue.length),(ee=le.firstChild)!==null;)P=le,le=ee;for(;;){if(le===t)break t;if(P===a&&++Z===u&&(C=b),P===f&&++ie===s&&(U=b),(ee=le.nextSibling)!==null)break;le=P,P=le.parentNode}le=ee}a=C===-1||U===-1?null:{start:C,end:U}}else a=null}a=a||{start:0,end:0}}else a=null;for(nh={focusedElem:t,selectionRange:a},Xc=!1,an=i;an!==null;)if(i=an,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,an=t;else for(;an!==null;){switch(i=an,f=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)u=t[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&f!==null){t=void 0,a=i,u=f.memoizedProps,f=f.memoizedState,s=a.stateNode;try{var ve=Gr(a.type,u);t=s.getSnapshotBeforeUpdate(ve,f),s.__reactInternalSnapshotBeforeUpdate=t}catch(De){ot(a,a.return,De)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)rh(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":rh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=i.sibling,t!==null){t.return=i.return,an=t;break}an=i.return}}function Jy(t,i,a){var s=a.flags;switch(a.tag){case 0:case 11:case 15:po(t,a),s&4&&Gs(5,a);break;case 1:if(po(t,a),s&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(b){ot(a,a.return,b)}else{var u=Gr(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(u,i,t.__reactInternalSnapshotBeforeUpdate)}catch(b){ot(a,a.return,b)}}s&64&&Ky(a),s&512&&Bs(a,a.return);break;case 3:if(po(t,a),s&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{Lg(t,i)}catch(b){ot(a,a.return,b)}}break;case 27:i===null&&s&4&&Fy(a);case 26:case 5:po(t,a),i===null&&s&4&&Zy(a),s&512&&Bs(a,a.return);break;case 12:po(t,a);break;case 31:po(t,a),s&4&&t0(t,a);break;case 13:po(t,a),s&4&&n0(t,a),s&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=Gx.bind(null,a),oS(t,a))));break;case 22:if(s=a.memoizedState!==null||fo,!s){i=i!==null&&i.memoizedState!==null||Xt,u=fo;var f=Xt;fo=s,(Xt=i)&&!f?mo(t,a,(a.subtreeFlags&8772)!==0):po(t,a),fo=u,Xt=f}break;case 30:break;default:po(t,a)}}function Wy(t){var i=t.alternate;i!==null&&(t.alternate=null,Wy(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Ro(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var xt=null,Yn=!1;function ho(t,i,a){for(a=a.child;a!==null;)e0(t,i,a),a=a.sibling}function e0(t,i,a){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(Dn,a)}catch{}switch(a.tag){case 26:Xt||Ki(a,i),ho(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Xt||Ki(a,i);var s=xt,u=Yn;Wo(a.type)&&(xt=a.stateNode,Yn=!1),ho(t,i,a),Zs(a.stateNode),xt=s,Yn=u;break;case 5:Xt||Ki(a,i);case 6:if(s=xt,u=Yn,xt=null,ho(t,i,a),xt=s,Yn=u,xt!==null)if(Yn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(a.stateNode)}catch(f){ot(a,i,f)}else try{xt.removeChild(a.stateNode)}catch(f){ot(a,i,f)}break;case 18:xt!==null&&(Yn?(t=xt,K0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Ua(t)):K0(xt,a.stateNode));break;case 4:s=xt,u=Yn,xt=a.stateNode.containerInfo,Yn=!0,ho(t,i,a),xt=s,Yn=u;break;case 0:case 11:case 14:case 15:Ko(2,a,i),Xt||Ko(4,a,i),ho(t,i,a);break;case 1:Xt||(Ki(a,i),s=a.stateNode,typeof s.componentWillUnmount=="function"&&Qy(a,i,s)),ho(t,i,a);break;case 21:ho(t,i,a);break;case 22:Xt=(s=Xt)||a.memoizedState!==null,ho(t,i,a),Xt=s;break;default:ho(t,i,a)}}function t0(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ua(t)}catch(a){ot(i,i.return,a)}}}function n0(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ua(t)}catch(a){ot(i,i.return,a)}}function Dx(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Py),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Py),i;default:throw Error(r(435,t.tag))}}function Cc(t,i){var a=Dx(t);i.forEach(function(s){if(!a.has(s)){a.add(s);var u=Bx.bind(null,t,s);s.then(u,u)}})}function qn(t,i){var a=i.deletions;if(a!==null)for(var s=0;s<a.length;s++){var u=a[s],f=t,b=i,C=b;e:for(;C!==null;){switch(C.tag){case 27:if(Wo(C.type)){xt=C.stateNode,Yn=!1;break e}break;case 5:xt=C.stateNode,Yn=!1;break e;case 3:case 4:xt=C.stateNode.containerInfo,Yn=!0;break e}C=C.return}if(xt===null)throw Error(r(160));e0(f,b,u),xt=null,Yn=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)i0(i,t),i=i.sibling}var Ti=null;function i0(t,i){var a=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:qn(i,t),Vn(t),s&4&&(Ko(3,t,t.return),Gs(3,t),Ko(5,t,t.return));break;case 1:qn(i,t),Vn(t),s&512&&(Xt||a===null||Ki(a,a.return)),s&64&&fo&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?s:a.concat(s))));break;case 26:var u=Ti;if(qn(i,t),Vn(t),s&512&&(Xt||a===null||Ki(a,a.return)),s&4){var f=a!==null?a.memoizedState:null;if(s=t.memoizedState,a===null)if(s===null)if(t.stateNode===null){e:{s=t.type,a=t.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Ft]||f[nt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(s),u.head.insertBefore(f,u.querySelector("head > title"))),vn(f,s,a),f[nt]=t,jt(f),s=f;break e;case"link":var b=iv("link","href",u).get(s+(a.href||""));if(b){for(var C=0;C<b.length;C++)if(f=b[C],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(C,1);break t}}f=u.createElement(s),vn(f,s,a),u.head.appendChild(f);break;case"meta":if(b=iv("meta","content",u).get(s+(a.content||""))){for(C=0;C<b.length;C++)if(f=b[C],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(C,1);break t}}f=u.createElement(s),vn(f,s,a),u.head.appendChild(f);break;default:throw Error(r(468,s))}f[nt]=t,jt(f),s=f}t.stateNode=s}else ov(u,t.type,t.stateNode);else t.stateNode=nv(u,s,t.memoizedProps);else f!==s?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,s===null?ov(u,t.type,t.stateNode):nv(u,s,t.memoizedProps)):s===null&&t.stateNode!==null&&Mf(t,t.memoizedProps,a.memoizedProps)}break;case 27:qn(i,t),Vn(t),s&512&&(Xt||a===null||Ki(a,a.return)),a!==null&&s&4&&Mf(t,t.memoizedProps,a.memoizedProps);break;case 5:if(qn(i,t),Vn(t),s&512&&(Xt||a===null||Ki(a,a.return)),t.flags&32){u=t.stateNode;try{aa(u,"")}catch(ve){ot(t,t.return,ve)}}s&4&&t.stateNode!=null&&(u=t.memoizedProps,Mf(t,u,a!==null?a.memoizedProps:u)),s&1024&&(Rf=!0);break;case 6:if(qn(i,t),Vn(t),s&4){if(t.stateNode===null)throw Error(r(162));s=t.memoizedProps,a=t.stateNode;try{a.nodeValue=s}catch(ve){ot(t,t.return,ve)}}break;case 3:if($c=null,u=Ti,Ti=Bc(i.containerInfo),qn(i,t),Ti=u,Vn(t),s&4&&a!==null&&a.memoizedState.isDehydrated)try{Ua(i.containerInfo)}catch(ve){ot(t,t.return,ve)}Rf&&(Rf=!1,o0(t));break;case 4:s=Ti,Ti=Bc(t.stateNode.containerInfo),qn(i,t),Vn(t),Ti=s;break;case 12:qn(i,t),Vn(t);break;case 31:qn(i,t),Vn(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Cc(t,s)));break;case 13:qn(i,t),Vn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Nc=Ve()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Cc(t,s)));break;case 22:u=t.memoizedState!==null;var U=a!==null&&a.memoizedState!==null,Z=fo,ie=Xt;if(fo=Z||u,Xt=ie||U,qn(i,t),Xt=ie,fo=Z,Vn(t),s&8192)e:for(i=t.stateNode,i._visibility=u?i._visibility&-2:i._visibility|1,u&&(a===null||U||fo||Xt||Br(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){U=a=i;try{if(f=U.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{C=U.stateNode;var le=U.memoizedProps.style,P=le!=null&&le.hasOwnProperty("display")?le.display:null;C.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(ve){ot(U,U.return,ve)}}}else if(i.tag===6){if(a===null){U=i;try{U.stateNode.nodeValue=u?"":U.memoizedProps}catch(ve){ot(U,U.return,ve)}}}else if(i.tag===18){if(a===null){U=i;try{var ee=U.stateNode;u?Q0(ee,!0):Q0(U.stateNode,!1)}catch(ve){ot(U,U.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}s&4&&(s=t.updateQueue,s!==null&&(a=s.retryQueue,a!==null&&(s.retryQueue=null,Cc(t,a))));break;case 19:qn(i,t),Vn(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Cc(t,s)));break;case 30:break;case 21:break;default:qn(i,t),Vn(t)}}function Vn(t){var i=t.flags;if(i&2){try{for(var a,s=t.return;s!==null;){if(Iy(s)){a=s;break}s=s.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var u=a.stateNode,f=zf(t);_c(t,f,u);break;case 5:var b=a.stateNode;a.flags&32&&(aa(b,""),a.flags&=-33);var C=zf(t);_c(t,C,b);break;case 3:case 4:var U=a.stateNode.containerInfo,Z=zf(t);Of(t,Z,U);break;default:throw Error(r(161))}}catch(ie){ot(t,t.return,ie)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function o0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;o0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function po(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Jy(t,i.alternate,i),i=i.sibling}function Br(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Ko(4,i,i.return),Br(i);break;case 1:Ki(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Qy(i,i.return,a),Br(i);break;case 27:Zs(i.stateNode);case 26:case 5:Ki(i,i.return),Br(i);break;case 22:i.memoizedState===null&&Br(i);break;case 30:Br(i);break;default:Br(i)}t=t.sibling}}function mo(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var s=i.alternate,u=t,f=i,b=f.flags;switch(f.tag){case 0:case 11:case 15:mo(u,f,a),Gs(4,f);break;case 1:if(mo(u,f,a),s=f,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(Z){ot(s,s.return,Z)}if(s=f,u=s.updateQueue,u!==null){var C=s.stateNode;try{var U=u.shared.hiddenCallbacks;if(U!==null)for(u.shared.hiddenCallbacks=null,u=0;u<U.length;u++)jg(U[u],C)}catch(Z){ot(s,s.return,Z)}}a&&b&64&&Ky(f),Bs(f,f.return);break;case 27:Fy(f);case 26:case 5:mo(u,f,a),a&&s===null&&b&4&&Zy(f),Bs(f,f.return);break;case 12:mo(u,f,a);break;case 31:mo(u,f,a),a&&b&4&&t0(u,f);break;case 13:mo(u,f,a),a&&b&4&&n0(u,f);break;case 22:f.memoizedState===null&&mo(u,f,a),Bs(f,f.return);break;case 30:break;default:mo(u,f,a)}i=i.sibling}}function jf(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Cs(a))}function Lf(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Cs(t))}function Di(t,i,a,s){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)r0(t,i,a,s),i=i.sibling}function r0(t,i,a,s){var u=i.flags;switch(i.tag){case 0:case 11:case 15:Di(t,i,a,s),u&2048&&Gs(9,i);break;case 1:Di(t,i,a,s);break;case 3:Di(t,i,a,s),u&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Cs(t)));break;case 12:if(u&2048){Di(t,i,a,s),t=i.stateNode;try{var f=i.memoizedProps,b=f.id,C=f.onPostCommit;typeof C=="function"&&C(b,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){ot(i,i.return,U)}}else Di(t,i,a,s);break;case 31:Di(t,i,a,s);break;case 13:Di(t,i,a,s);break;case 23:break;case 22:f=i.stateNode,b=i.alternate,i.memoizedState!==null?f._visibility&2?Di(t,i,a,s):Hs(t,i):f._visibility&2?Di(t,i,a,s):(f._visibility|=2,Ea(t,i,a,s,(i.subtreeFlags&10256)!==0||!1)),u&2048&&jf(b,i);break;case 24:Di(t,i,a,s),u&2048&&Lf(i.alternate,i);break;default:Di(t,i,a,s)}}function Ea(t,i,a,s,u){for(u=u&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var f=t,b=i,C=a,U=s,Z=b.flags;switch(b.tag){case 0:case 11:case 15:Ea(f,b,C,U,u),Gs(8,b);break;case 23:break;case 22:var ie=b.stateNode;b.memoizedState!==null?ie._visibility&2?Ea(f,b,C,U,u):Hs(f,b):(ie._visibility|=2,Ea(f,b,C,U,u)),u&&Z&2048&&jf(b.alternate,b);break;case 24:Ea(f,b,C,U,u),u&&Z&2048&&Lf(b.alternate,b);break;default:Ea(f,b,C,U,u)}i=i.sibling}}function Hs(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,s=i,u=s.flags;switch(s.tag){case 22:Hs(a,s),u&2048&&jf(s.alternate,s);break;case 24:Hs(a,s),u&2048&&Lf(s.alternate,s);break;default:Hs(a,s)}i=i.sibling}}var $s=8192;function Na(t,i,a){if(t.subtreeFlags&$s)for(t=t.child;t!==null;)a0(t,i,a),t=t.sibling}function a0(t,i,a){switch(t.tag){case 26:Na(t,i,a),t.flags&$s&&t.memoizedState!==null&&gS(a,Ti,t.memoizedState,t.memoizedProps);break;case 5:Na(t,i,a);break;case 3:case 4:var s=Ti;Ti=Bc(t.stateNode.containerInfo),Na(t,i,a),Ti=s;break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=$s,$s=16777216,Na(t,i,a),$s=s):Na(t,i,a));break;default:Na(t,i,a)}}function s0(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Ys(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var s=i[a];an=s,c0(s,t)}s0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)l0(t),t=t.sibling}function l0(t){switch(t.tag){case 0:case 11:case 15:Ys(t),t.flags&2048&&Ko(9,t,t.return);break;case 3:Ys(t);break;case 12:Ys(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Ec(t)):Ys(t);break;default:Ys(t)}}function Ec(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var s=i[a];an=s,c0(s,t)}s0(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Ko(8,i,i.return),Ec(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,Ec(i));break;default:Ec(i)}t=t.sibling}}function c0(t,i){for(;an!==null;){var a=an;switch(a.tag){case 0:case 11:case 15:Ko(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var s=a.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Cs(a.memoizedState.cache)}if(s=a.child,s!==null)s.return=a,an=s;else e:for(a=t;an!==null;){s=an;var u=s.sibling,f=s.return;if(Wy(s),s===a){an=null;break e}if(u!==null){u.return=f,an=u;break e}an=f}}}var Mx={getCacheForType:function(t){var i=gn(Yt),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a},cacheSignal:function(){return gn(Yt).controller.signal}},zx=typeof WeakMap=="function"?WeakMap:Map,Je=0,ut=null,He=null,Ye=0,it=0,ii=null,Qo=!1,ka=!1,Uf=!1,go=0,Nt=0,Zo=0,Hr=0,Gf=0,oi=0,Ta=0,qs=null,Xn=null,Bf=!1,Nc=0,u0=0,kc=1/0,Tc=null,Io=null,Pt=0,Fo=null,Da=null,yo=0,Hf=0,$f=null,d0=null,Vs=0,Yf=null;function ri(){return(Je&2)!==0&&Ye!==0?Ye&-Ye:j.T!==null?Zf():zn()}function f0(){if(oi===0)if((Ye&536870912)===0||Ke){var t=Sn;Sn<<=1,(Sn&3932160)===0&&(Sn=262144),oi=t}else oi=536870912;return t=ti.current,t!==null&&(t.flags|=32),oi}function Kn(t,i,a){(t===ut&&(it===2||it===9)||t.cancelPendingCommit!==null)&&(Ma(t,0),Po(t,Ye,oi,!1)),be(t,a),((Je&2)===0||t!==ut)&&(t===ut&&((Je&2)===0&&(Hr|=a),Nt===4&&Po(t,Ye,oi,!1)),Qi(t))}function h0(t,i,a){if((Je&6)!==0)throw Error(r(327));var s=!a&&(i&127)===0&&(i&t.expiredLanes)===0||fn(t,i),u=s?jx(t,i):Vf(t,i,!0),f=s;do{if(u===0){ka&&!s&&Po(t,i,0,!1);break}else{if(a=t.current.alternate,f&&!Ox(a)){u=Vf(t,i,!1),f=!1;continue}if(u===2){if(f=i,t.errorRecoveryDisabledLanes&f)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;e:{var C=t;u=qs;var U=C.current.memoizedState.isDehydrated;if(U&&(Ma(C,b).flags|=256),b=Vf(C,b,!1),b!==2){if(Uf&&!U){C.errorRecoveryDisabledLanes|=f,Hr|=f,u=4;break e}f=Xn,Xn=u,f!==null&&(Xn===null?Xn=f:Xn.push.apply(Xn,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){Ma(t,0),Po(t,i,0,!0);break}e:{switch(s=t,f=u,f){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:Po(s,i,oi,!Qo);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(u=Nc+300-Ve(),10<u)){if(Po(s,i,oi,!Qo),$i(s,0,!0)!==0)break e;yo=i,s.timeoutHandle=V0(p0.bind(null,s,a,Xn,Tc,Bf,i,oi,Hr,Ta,Qo,f,"Throttled",-0,0),u);break e}p0(s,a,Xn,Tc,Bf,i,oi,Hr,Ta,Qo,f,null,-0,0)}}break}while(!0);Qi(t)}function p0(t,i,a,s,u,f,b,C,U,Z,ie,le,P,ee){if(t.timeoutHandle=-1,le=i.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:to},a0(i,f,le);var ve=(f&62914560)===f?Nc-Ve():(f&4194048)===f?u0-Ve():0;if(ve=yS(le,ve),ve!==null){yo=f,t.cancelPendingCommit=ve(S0.bind(null,t,i,f,a,s,u,b,C,U,ie,le,null,P,ee)),Po(t,f,b,!Z);return}}S0(t,i,f,a,s,u,b,C,U)}function Ox(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var s=0;s<a.length;s++){var u=a[s],f=u.getSnapshot;u=u.value;try{if(!Wn(f(),u))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Po(t,i,a,s){i&=~Gf,i&=~Hr,t.suspendedLanes|=i,t.pingedLanes&=~i,s&&(t.warmLanes|=i),s=t.expirationTimes;for(var u=i;0<u;){var f=31-vt(u),b=1<<f;s[f]=-1,u&=~b}a!==0&&ct(t,a,i)}function Dc(){return(Je&6)===0?(Xs(0),!1):!0}function qf(){if(He!==null){if(it===0)var t=He.return;else t=He,ro=Mr=null,rf(t),xa=null,Ns=0,t=He;for(;t!==null;)Xy(t.alternate,t),t=t.return;He=null}}function Ma(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,Wx(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),yo=0,qf(),ut=t,He=a=io(t.current,null),Ye=i,it=0,ii=null,Qo=!1,ka=fn(t,i),Uf=!1,Ta=oi=Gf=Hr=Zo=Nt=0,Xn=qs=null,Bf=!1,(i&8)!==0&&(i|=i&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=i;0<s;){var u=31-vt(s),f=1<<u;i|=t[u],s&=~f}return go=i,Pl(),a}function m0(t,i){Le=null,j.H=js,i===wa||i===rc?(i=Mg(),it=3):i===Kd?(i=Mg(),it=4):it=i===xf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ii=i,He===null&&(Nt=1,bc(t,fi(i,t.current)))}function g0(){var t=ti.current;return t===null?!0:(Ye&4194048)===Ye?gi===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?t===gi:!1}function y0(){var t=j.H;return j.H=js,t===null?js:t}function v0(){var t=j.A;return j.A=Mx,t}function Mc(){Nt=4,Qo||(Ye&4194048)!==Ye&&ti.current!==null||(ka=!0),(Zo&134217727)===0&&(Hr&134217727)===0||ut===null||Po(ut,Ye,oi,!1)}function Vf(t,i,a){var s=Je;Je|=2;var u=y0(),f=v0();(ut!==t||Ye!==i)&&(Tc=null,Ma(t,i)),i=!1;var b=Nt;e:do try{if(it!==0&&He!==null){var C=He,U=ii;switch(it){case 8:qf(),b=6;break e;case 3:case 2:case 9:case 6:ti.current===null&&(i=!0);var Z=it;if(it=0,ii=null,za(t,C,U,Z),a&&ka){b=0;break e}break;default:Z=it,it=0,ii=null,za(t,C,U,Z)}}Rx(),b=Nt;break}catch(ie){m0(t,ie)}while(!0);return i&&t.shellSuspendCounter++,ro=Mr=null,Je=s,j.H=u,j.A=f,He===null&&(ut=null,Ye=0,Pl()),b}function Rx(){for(;He!==null;)b0(He)}function jx(t,i){var a=Je;Je|=2;var s=y0(),u=v0();ut!==t||Ye!==i?(Tc=null,kc=Ve()+500,Ma(t,i)):ka=fn(t,i);e:do try{if(it!==0&&He!==null){i=He;var f=ii;t:switch(it){case 1:it=0,ii=null,za(t,i,f,1);break;case 2:case 9:if(Tg(f)){it=0,ii=null,w0(i);break}i=function(){it!==2&&it!==9||ut!==t||(it=7),Qi(t)},f.then(i,i);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:Tg(f)?(it=0,ii=null,w0(i)):(it=0,ii=null,za(t,i,f,7));break;case 5:var b=null;switch(He.tag){case 26:b=He.memoizedState;case 5:case 27:var C=He;if(b?rv(b):C.stateNode.complete){it=0,ii=null;var U=C.sibling;if(U!==null)He=U;else{var Z=C.return;Z!==null?(He=Z,zc(Z)):He=null}break t}}it=0,ii=null,za(t,i,f,5);break;case 6:it=0,ii=null,za(t,i,f,6);break;case 8:qf(),Nt=6;break e;default:throw Error(r(462))}}Lx();break}catch(ie){m0(t,ie)}while(!0);return ro=Mr=null,j.H=s,j.A=u,Je=a,He!==null?0:(ut=null,Ye=0,Pl(),Nt)}function Lx(){for(;He!==null&&!on();)b0(He)}function b0(t){var i=qy(t.alternate,t,go);t.memoizedProps=t.pendingProps,i===null?zc(t):He=i}function w0(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=Uy(a,i,i.pendingProps,i.type,void 0,Ye);break;case 11:i=Uy(a,i,i.pendingProps,i.type.render,i.ref,Ye);break;case 5:rf(i);default:Xy(a,i),i=He=vg(i,go),i=qy(a,i,go)}t.memoizedProps=t.pendingProps,i===null?zc(t):He=i}function za(t,i,a,s){ro=Mr=null,rf(i),xa=null,Ns=0;var u=i.return;try{if(_x(t,u,i,a,Ye)){Nt=1,bc(t,fi(a,t.current)),He=null;return}}catch(f){if(u!==null)throw He=u,f;Nt=1,bc(t,fi(a,t.current)),He=null;return}i.flags&32768?(Ke||s===1?t=!0:ka||(Ye&536870912)!==0?t=!1:(Qo=t=!0,(s===2||s===9||s===3||s===6)&&(s=ti.current,s!==null&&s.tag===13&&(s.flags|=16384))),x0(i,t)):zc(i)}function zc(t){var i=t;do{if((i.flags&32768)!==0){x0(i,Qo);return}t=i.return;var a=Nx(i.alternate,i,go);if(a!==null){He=a;return}if(i=i.sibling,i!==null){He=i;return}He=i=t}while(i!==null);Nt===0&&(Nt=5)}function x0(t,i){do{var a=kx(t.alternate,t);if(a!==null){a.flags&=32767,He=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){He=t;return}He=t=a}while(t!==null);Nt=6,He=null}function S0(t,i,a,s,u,f,b,C,U){t.cancelPendingCommit=null;do Oc();while(Pt!==0);if((Je&6)!==0)throw Error(r(327));if(i!==null){if(i===t.current)throw Error(r(177));if(f=i.lanes|i.childLanes,f|=Md,Xe(t,a,f,b,C,U),t===ut&&(He=ut=null,Ye=0),Da=i,Fo=t,yo=a,Hf=f,$f=u,d0=s,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Hx(dt,function(){return N0(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||s){s=j.T,j.T=null,u=I.p,I.p=2,b=Je,Je|=4;try{Tx(t,i,a)}finally{Je=b,I.p=u,j.T=s}}Pt=1,A0(),_0(),C0()}}function A0(){if(Pt===1){Pt=0;var t=Fo,i=Da,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=j.T,j.T=null;var s=I.p;I.p=2;var u=Je;Je|=4;try{i0(i,t);var f=nh,b=cg(t.containerInfo),C=f.focusedElem,U=f.selectionRange;if(b!==C&&C&&C.ownerDocument&&lg(C.ownerDocument.documentElement,C)){if(U!==null&&Ed(C)){var Z=U.start,ie=U.end;if(ie===void 0&&(ie=Z),"selectionStart"in C)C.selectionStart=Z,C.selectionEnd=Math.min(ie,C.value.length);else{var le=C.ownerDocument||document,P=le&&le.defaultView||window;if(P.getSelection){var ee=P.getSelection(),ve=C.textContent.length,De=Math.min(U.start,ve),st=U.end===void 0?De:Math.min(U.end,ve);!ee.extend&&De>st&&(b=st,st=De,De=b);var q=sg(C,De),B=sg(C,st);if(q&&B&&(ee.rangeCount!==1||ee.anchorNode!==q.node||ee.anchorOffset!==q.offset||ee.focusNode!==B.node||ee.focusOffset!==B.offset)){var Q=le.createRange();Q.setStart(q.node,q.offset),ee.removeAllRanges(),De>st?(ee.addRange(Q),ee.extend(B.node,B.offset)):(Q.setEnd(B.node,B.offset),ee.addRange(Q))}}}}for(le=[],ee=C;ee=ee.parentNode;)ee.nodeType===1&&le.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<le.length;C++){var se=le[C];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Xc=!!th,nh=th=null}finally{Je=u,I.p=s,j.T=a}}t.current=i,Pt=2}}function _0(){if(Pt===2){Pt=0;var t=Fo,i=Da,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=j.T,j.T=null;var s=I.p;I.p=2;var u=Je;Je|=4;try{Jy(t,i.alternate,i)}finally{Je=u,I.p=s,j.T=a}}Pt=3}}function C0(){if(Pt===4||Pt===3){Pt=0,rn();var t=Fo,i=Da,a=yo,s=d0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Pt=5:(Pt=0,Da=Fo=null,E0(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Io=null),Ht(a),i=i.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(Dn,i,void 0,(i.current.flags&128)===128)}catch{}if(s!==null){i=j.T,u=I.p,I.p=2,j.T=null;try{for(var f=t.onRecoverableError,b=0;b<s.length;b++){var C=s[b];f(C.value,{componentStack:C.stack})}}finally{j.T=i,I.p=u}}(yo&3)!==0&&Oc(),Qi(t),u=t.pendingLanes,(a&261930)!==0&&(u&42)!==0?t===Yf?Vs++:(Vs=0,Yf=t):Vs=0,Xs(0)}}function E0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Cs(i)))}function Oc(){return A0(),_0(),C0(),N0()}function N0(){if(Pt!==5)return!1;var t=Fo,i=Hf;Hf=0;var a=Ht(yo),s=j.T,u=I.p;try{I.p=32>a?32:a,j.T=null,a=$f,$f=null;var f=Fo,b=yo;if(Pt=0,Da=Fo=null,yo=0,(Je&6)!==0)throw Error(r(331));var C=Je;if(Je|=4,l0(f.current),r0(f,f.current,b,a),Je=C,Xs(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(Dn,f)}catch{}return!0}finally{I.p=u,j.T=s,E0(t,i)}}function k0(t,i,a){i=fi(a,i),i=wf(t.stateNode,i,2),t=qo(t,i,2),t!==null&&(be(t,2),Qi(t))}function ot(t,i,a){if(t.tag===3)k0(t,t,a);else for(;i!==null;){if(i.tag===3){k0(i,t,a);break}else if(i.tag===1){var s=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Io===null||!Io.has(s))){t=fi(a,t),a=Ty(2),s=qo(i,a,2),s!==null&&(Dy(a,s,i,t),be(s,2),Qi(s));break}}i=i.return}}function Xf(t,i,a){var s=t.pingCache;if(s===null){s=t.pingCache=new zx;var u=new Set;s.set(i,u)}else u=s.get(i),u===void 0&&(u=new Set,s.set(i,u));u.has(a)||(Uf=!0,u.add(a),t=Ux.bind(null,t,i,a),i.then(t,t))}function Ux(t,i,a){var s=t.pingCache;s!==null&&s.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,ut===t&&(Ye&a)===a&&(Nt===4||Nt===3&&(Ye&62914560)===Ye&&300>Ve()-Nc?(Je&2)===0&&Ma(t,0):Gf|=a,Ta===Ye&&(Ta=0)),Qi(t)}function T0(t,i){i===0&&(i=Gn()),t=kr(t,i),t!==null&&(be(t,i),Qi(t))}function Gx(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),T0(t,a)}function Bx(t,i){var a=0;switch(t.tag){case 31:case 13:var s=t.stateNode,u=t.memoizedState;u!==null&&(a=u.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(i),T0(t,a)}function Hx(t,i){return zt(t,i)}var Rc=null,Oa=null,Kf=!1,jc=!1,Qf=!1,Jo=0;function Qi(t){t!==Oa&&t.next===null&&(Oa===null?Rc=Oa=t:Oa=Oa.next=t),jc=!0,Kf||(Kf=!0,Yx())}function Xs(t,i){if(!Qf&&jc){Qf=!0;do for(var a=!1,s=Rc;s!==null;){if(t!==0){var u=s.pendingLanes;if(u===0)var f=0;else{var b=s.suspendedLanes,C=s.pingedLanes;f=(1<<31-vt(42|t)+1)-1,f&=u&~(b&~C),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,O0(s,f))}else f=Ye,f=$i(s,s===ut?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||fn(s,f)||(a=!0,O0(s,f));s=s.next}while(a);Qf=!1}}function $x(){D0()}function D0(){jc=Kf=!1;var t=0;Jo!==0&&Jx()&&(t=Jo);for(var i=Ve(),a=null,s=Rc;s!==null;){var u=s.next,f=M0(s,i);f===0?(s.next=null,a===null?Rc=u:a.next=u,u===null&&(Oa=a)):(a=s,(t!==0||(f&3)!==0)&&(jc=!0)),s=u}Pt!==0&&Pt!==5||Xs(t),Jo!==0&&(Jo=0)}function M0(t,i){for(var a=t.suspendedLanes,s=t.pingedLanes,u=t.expirationTimes,f=t.pendingLanes&-62914561;0<f;){var b=31-vt(f),C=1<<b,U=u[b];U===-1?((C&a)===0||(C&s)!==0)&&(u[b]=Yi(C,i)):U<=i&&(t.expiredLanes|=C),f&=~C}if(i=ut,a=Ye,a=$i(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s=t.callbackNode,a===0||t===i&&(it===2||it===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&Gt(s),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||fn(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(s!==null&&Gt(s),Ht(a)){case 2:case 8:a=xn;break;case 32:a=dt;break;case 268435456:a=Ei;break;default:a=dt}return s=z0.bind(null,t),a=zt(a,s),t.callbackPriority=i,t.callbackNode=a,i}return s!==null&&s!==null&&Gt(s),t.callbackPriority=2,t.callbackNode=null,2}function z0(t,i){if(Pt!==0&&Pt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Oc()&&t.callbackNode!==a)return null;var s=Ye;return s=$i(t,t===ut?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),s===0?null:(h0(t,s,i),M0(t,Ve()),t.callbackNode!=null&&t.callbackNode===a?z0.bind(null,t):null)}function O0(t,i){if(Oc())return null;h0(t,i,!0)}function Yx(){eS(function(){(Je&6)!==0?zt(wn,$x):D0()})}function Zf(){if(Jo===0){var t=va;t===0&&(t=Mn,Mn<<=1,(Mn&261888)===0&&(Mn=256)),Jo=t}return Jo}function R0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ql(""+t)}function j0(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function qx(t,i,a,s,u){if(i==="submit"&&a&&a.stateNode===u){var f=R0((u[wt]||null).action),b=s.submitter;b&&(i=(i=b[wt]||null)?R0(i.formAction):b.getAttribute("formAction"),i!==null&&(f=i,b=null));var C=new Ql("action","action",null,s,u);t.push({event:C,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Jo!==0){var U=b?j0(u,b):new FormData(u);pf(a,{pending:!0,data:U,method:u.method,action:f},null,U)}}else typeof f=="function"&&(C.preventDefault(),U=b?j0(u,b):new FormData(u),pf(a,{pending:!0,data:U,method:u.method,action:f},f,U))},currentTarget:u}]})}}for(var If=0;If<Dd.length;If++){var Ff=Dd[If],Vx=Ff.toLowerCase(),Xx=Ff[0].toUpperCase()+Ff.slice(1);ki(Vx,"on"+Xx)}ki(fg,"onAnimationEnd"),ki(hg,"onAnimationIteration"),ki(pg,"onAnimationStart"),ki("dblclick","onDoubleClick"),ki("focusin","onFocus"),ki("focusout","onBlur"),ki(sx,"onTransitionRun"),ki(lx,"onTransitionStart"),ki(cx,"onTransitionCancel"),ki(mg,"onTransitionEnd"),oa("onMouseEnter",["mouseout","mouseover"]),oa("onMouseLeave",["mouseout","mouseover"]),oa("onPointerEnter",["pointerout","pointerover"]),oa("onPointerLeave",["pointerout","pointerover"]),_r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_r("onBeforeInput",["compositionend","keypress","textInput","paste"]),_r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="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(" "),Kx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ks));function L0(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var s=t[a],u=s.event;s=s.listeners;e:{var f=void 0;if(i)for(var b=s.length-1;0<=b;b--){var C=s[b],U=C.instance,Z=C.currentTarget;if(C=C.listener,U!==f&&u.isPropagationStopped())break e;f=C,u.currentTarget=Z;try{f(u)}catch(ie){Fl(ie)}u.currentTarget=null,f=U}else for(b=0;b<s.length;b++){if(C=s[b],U=C.instance,Z=C.currentTarget,C=C.listener,U!==f&&u.isPropagationStopped())break e;f=C,u.currentTarget=Z;try{f(u)}catch(ie){Fl(ie)}u.currentTarget=null,f=U}}}}function $e(t,i){var a=i[hn];a===void 0&&(a=i[hn]=new Set);var s=t+"__bubble";a.has(s)||(U0(i,t,2,!1),a.add(s))}function Pf(t,i,a){var s=0;i&&(s|=4),U0(a,t,s,i)}var Lc="_reactListening"+Math.random().toString(36).slice(2);function Jf(t){if(!t[Lc]){t[Lc]=!0,hs.forEach(function(a){a!=="selectionchange"&&(Kx.has(a)||Pf(a,!1,t),Pf(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Lc]||(i[Lc]=!0,Pf("selectionchange",!1,i))}}function U0(t,i,a,s){switch(fv(i)){case 2:var u=wS;break;case 8:u=xS;break;default:u=hh}a=u.bind(null,i,a,t),u=void 0,!yd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(u=!0),s?u!==void 0?t.addEventListener(i,a,{capture:!0,passive:u}):t.addEventListener(i,a,!0):u!==void 0?t.addEventListener(i,a,{passive:u}):t.addEventListener(i,a,!1)}function Wf(t,i,a,s,u){var f=s;if((i&1)===0&&(i&2)===0&&s!==null)e:for(;;){if(s===null)return;var b=s.tag;if(b===3||b===4){var C=s.stateNode.containerInfo;if(C===u)break;if(b===4)for(b=s.return;b!==null;){var U=b.tag;if((U===3||U===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;C!==null;){if(b=pn(C),b===null)return;if(U=b.tag,U===5||U===6||U===26||U===27){s=f=b;continue e}C=C.parentNode}}s=s.return}Ym(function(){var Z=f,ie=md(a),le=[];e:{var P=gg.get(t);if(P!==void 0){var ee=Ql,ve=t;switch(t){case"keypress":if(Xl(a)===0)break e;case"keydown":case"keyup":ee=Bw;break;case"focusin":ve="focus",ee=xd;break;case"focusout":ve="blur",ee=xd;break;case"beforeblur":case"afterblur":ee=xd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Xm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Nw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Yw;break;case fg:case hg:case pg:ee=Dw;break;case mg:ee=Vw;break;case"scroll":case"scrollend":ee=Cw;break;case"wheel":ee=Kw;break;case"copy":case"cut":case"paste":ee=zw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Qm;break;case"toggle":case"beforetoggle":ee=Zw}var De=(i&4)!==0,st=!De&&(t==="scroll"||t==="scrollend"),q=De?P!==null?P+"Capture":null:P;De=[];for(var B=Z,Q;B!==null;){var se=B;if(Q=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Q===null||q===null||(se=ps(B,q),se!=null&&De.push(Qs(B,se,Q))),st)break;B=B.return}0<De.length&&(P=new ee(P,ve,null,a,ie),le.push({event:P,listeners:De}))}}if((i&7)===0){e:{if(P=t==="mouseover"||t==="pointerover",ee=t==="mouseout"||t==="pointerout",P&&a!==pd&&(ve=a.relatedTarget||a.fromElement)&&(pn(ve)||ve[An]))break e;if((ee||P)&&(P=ie.window===ie?ie:(P=ie.ownerDocument)?P.defaultView||P.parentWindow:window,ee?(ve=a.relatedTarget||a.toElement,ee=Z,ve=ve?pn(ve):null,ve!==null&&(st=c(ve),De=ve.tag,ve!==st||De!==5&&De!==27&&De!==6)&&(ve=null)):(ee=null,ve=Z),ee!==ve)){if(De=Xm,se="onMouseLeave",q="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(De=Qm,se="onPointerLeave",q="onPointerEnter",B="pointer"),st=ee==null?P:jo(ee),Q=ve==null?P:jo(ve),P=new De(se,B+"leave",ee,a,ie),P.target=st,P.relatedTarget=Q,se=null,pn(ie)===Z&&(De=new De(q,B+"enter",ve,a,ie),De.target=Q,De.relatedTarget=st,se=De),st=se,ee&&ve)t:{for(De=Qx,q=ee,B=ve,Q=0,se=q;se;se=De(se))Q++;se=0;for(var ke=B;ke;ke=De(ke))se++;for(;0<Q-se;)q=De(q),Q--;for(;0<se-Q;)B=De(B),se--;for(;Q--;){if(q===B||B!==null&&q===B.alternate){De=q;break t}q=De(q),B=De(B)}De=null}else De=null;ee!==null&&G0(le,P,ee,De,!1),ve!==null&&st!==null&&G0(le,st,ve,De,!0)}}e:{if(P=Z?jo(Z):window,ee=P.nodeName&&P.nodeName.toLowerCase(),ee==="select"||ee==="input"&&P.type==="file")var Ie=tg;else if(Wm(P))if(ng)Ie=ox;else{Ie=nx;var _e=tx}else ee=P.nodeName,!ee||ee.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?Z&&hd(Z.elementType)&&(Ie=tg):Ie=ix;if(Ie&&(Ie=Ie(t,Z))){eg(le,Ie,a,ie);break e}_e&&_e(t,P,Z),t==="focusout"&&Z&&P.type==="number"&&Z.memoizedProps.value!=null&&fd(P,"number",P.value)}switch(_e=Z?jo(Z):window,t){case"focusin":(Wm(_e)||_e.contentEditable==="true")&&(ua=_e,Nd=Z,Ss=null);break;case"focusout":Ss=Nd=ua=null;break;case"mousedown":kd=!0;break;case"contextmenu":case"mouseup":case"dragend":kd=!1,ug(le,a,ie);break;case"selectionchange":if(ax)break;case"keydown":case"keyup":ug(le,a,ie)}var Ue;if(Ad)e:{switch(t){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else ca?Pm(t,a)&&(qe="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(qe="onCompositionStart");qe&&(Zm&&a.locale!=="ko"&&(ca||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&ca&&(Ue=qm()):(Lo=ie,vd="value"in Lo?Lo.value:Lo.textContent,ca=!0)),_e=Uc(Z,qe),0<_e.length&&(qe=new Km(qe,t,null,a,ie),le.push({event:qe,listeners:_e}),Ue?qe.data=Ue:(Ue=Jm(a),Ue!==null&&(qe.data=Ue)))),(Ue=Fw?Pw(t,a):Jw(t,a))&&(qe=Uc(Z,"onBeforeInput"),0<qe.length&&(_e=new Km("onBeforeInput","beforeinput",null,a,ie),le.push({event:_e,listeners:qe}),_e.data=Ue)),qx(le,t,Z,a,ie)}L0(le,i)})}function Qs(t,i,a){return{instance:t,listener:i,currentTarget:a}}function Uc(t,i){for(var a=i+"Capture",s=[];t!==null;){var u=t,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=ps(t,a),u!=null&&s.unshift(Qs(t,u,f)),u=ps(t,i),u!=null&&s.push(Qs(t,u,f))),t.tag===3)return s;t=t.return}return[]}function Qx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function G0(t,i,a,s,u){for(var f=i._reactName,b=[];a!==null&&a!==s;){var C=a,U=C.alternate,Z=C.stateNode;if(C=C.tag,U!==null&&U===s)break;C!==5&&C!==26&&C!==27||Z===null||(U=Z,u?(Z=ps(a,f),Z!=null&&b.unshift(Qs(a,Z,U))):u||(Z=ps(a,f),Z!=null&&b.push(Qs(a,Z,U)))),a=a.return}b.length!==0&&t.push({event:i,listeners:b})}var Zx=/\r\n?/g,Ix=/\u0000|\uFFFD/g;function B0(t){return(typeof t=="string"?t:""+t).replace(Zx,`
`).replace(Ix,"")}function H0(t,i){return i=B0(i),B0(t)===i}function at(t,i,a,s,u,f){switch(a){case"children":typeof s=="string"?i==="body"||i==="textarea"&&s===""||aa(t,s):(typeof s=="number"||typeof s=="bigint")&&i!=="body"&&aa(t,""+s);break;case"className":$l(t,"class",s);break;case"tabIndex":$l(t,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":$l(t,a,s);break;case"style":Hm(t,s,f);break;case"data":if(i!=="object"){$l(t,"data",s);break}case"src":case"href":if(s===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(a);break}s=ql(""+s),t.setAttribute(a,s);break;case"action":case"formAction":if(typeof s=="function"){t.setAttribute(a,"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 f=="function"&&(a==="formAction"?(i!=="input"&&at(t,i,"name",u.name,u,null),at(t,i,"formEncType",u.formEncType,u,null),at(t,i,"formMethod",u.formMethod,u,null),at(t,i,"formTarget",u.formTarget,u,null)):(at(t,i,"encType",u.encType,u,null),at(t,i,"method",u.method,u,null),at(t,i,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){t.removeAttribute(a);break}s=ql(""+s),t.setAttribute(a,s);break;case"onClick":s!=null&&(t.onclick=to);break;case"onScroll":s!=null&&$e("scroll",t);break;case"onScrollEnd":s!=null&&$e("scrollend",t);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(a=s.__html,a!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"multiple":t.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":t.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){t.removeAttribute("xlink:href");break}a=ql(""+s),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(a,""+s):t.removeAttribute(a);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":s&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":s===!0?t.setAttribute(a,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?t.setAttribute(a,s):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?t.setAttribute(a,s):t.removeAttribute(a);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?t.removeAttribute(a):t.setAttribute(a,s);break;case"popover":$e("beforetoggle",t),$e("toggle",t),Hl(t,"popover",s);break;case"xlinkActuate":eo(t,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":eo(t,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":eo(t,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":eo(t,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":eo(t,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":eo(t,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":eo(t,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":eo(t,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":eo(t,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Hl(t,"is",s);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Aw.get(a)||a,Hl(t,a,s))}}function eh(t,i,a,s,u,f){switch(a){case"style":Hm(t,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(a=s.__html,a!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"children":typeof s=="string"?aa(t,s):(typeof s=="number"||typeof s=="bigint")&&aa(t,""+s);break;case"onScroll":s!=null&&$e("scroll",t);break;case"onScrollEnd":s!=null&&$e("scrollend",t);break;case"onClick":s!=null&&(t.onclick=to);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mm.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),i=a.slice(2,u?a.length-7:void 0),f=t[wt]||null,f=f!=null?f[a]:null,typeof f=="function"&&t.removeEventListener(i,f,u),typeof s=="function")){typeof f!="function"&&f!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,s,u);break e}a in t?t[a]=s:s===!0?t.setAttribute(a,""):Hl(t,a,s)}}}function vn(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",t),$e("load",t);var s=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var b=a[f];if(b!=null)switch(f){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:at(t,i,f,b,a,null)}}u&&at(t,i,"srcSet",a.srcSet,a,null),s&&at(t,i,"src",a.src,a,null);return;case"input":$e("invalid",t);var C=f=b=u=null,U=null,Z=null;for(s in a)if(a.hasOwnProperty(s)){var ie=a[s];if(ie!=null)switch(s){case"name":u=ie;break;case"type":b=ie;break;case"checked":U=ie;break;case"defaultChecked":Z=ie;break;case"value":f=ie;break;case"defaultValue":C=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,i));break;default:at(t,i,s,ie,a,null)}}Lm(t,f,C,U,Z,b,u,!1);return;case"select":$e("invalid",t),s=b=f=null;for(u in a)if(a.hasOwnProperty(u)&&(C=a[u],C!=null))switch(u){case"value":f=C;break;case"defaultValue":b=C;break;case"multiple":s=C;default:at(t,i,u,C,a,null)}i=f,a=b,t.multiple=!!s,i!=null?ra(t,!!s,i,!1):a!=null&&ra(t,!!s,a,!0);return;case"textarea":$e("invalid",t),f=u=s=null;for(b in a)if(a.hasOwnProperty(b)&&(C=a[b],C!=null))switch(b){case"value":s=C;break;case"defaultValue":u=C;break;case"children":f=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:at(t,i,b,C,a,null)}Gm(t,s,u,f);return;case"option":for(U in a)if(a.hasOwnProperty(U)&&(s=a[U],s!=null))switch(U){case"selected":t.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:at(t,i,U,s,a,null)}return;case"dialog":$e("beforetoggle",t),$e("toggle",t),$e("cancel",t),$e("close",t);break;case"iframe":case"object":$e("load",t);break;case"video":case"audio":for(s=0;s<Ks.length;s++)$e(Ks[s],t);break;case"image":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"embed":case"source":case"link":$e("error",t),$e("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in a)if(a.hasOwnProperty(Z)&&(s=a[Z],s!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:at(t,i,Z,s,a,null)}return;default:if(hd(i)){for(ie in a)a.hasOwnProperty(ie)&&(s=a[ie],s!==void 0&&eh(t,i,ie,s,a,void 0));return}}for(C in a)a.hasOwnProperty(C)&&(s=a[C],s!=null&&at(t,i,C,s,a,null))}function Fx(t,i,a,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,C=null,U=null,Z=null,ie=null;for(ee in a){var le=a[ee];if(a.hasOwnProperty(ee)&&le!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":U=le;default:s.hasOwnProperty(ee)||at(t,i,ee,null,s,le)}}for(var P in s){var ee=s[P];if(le=a[P],s.hasOwnProperty(P)&&(ee!=null||le!=null))switch(P){case"type":f=ee;break;case"name":u=ee;break;case"checked":Z=ee;break;case"defaultChecked":ie=ee;break;case"value":b=ee;break;case"defaultValue":C=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,i));break;default:ee!==le&&at(t,i,P,ee,s,le)}}dd(t,b,C,U,Z,ie,f,u);return;case"select":ee=b=C=P=null;for(f in a)if(U=a[f],a.hasOwnProperty(f)&&U!=null)switch(f){case"value":break;case"multiple":ee=U;default:s.hasOwnProperty(f)||at(t,i,f,null,s,U)}for(u in s)if(f=s[u],U=a[u],s.hasOwnProperty(u)&&(f!=null||U!=null))switch(u){case"value":P=f;break;case"defaultValue":C=f;break;case"multiple":b=f;default:f!==U&&at(t,i,u,f,s,U)}i=C,a=b,s=ee,P!=null?ra(t,!!a,P,!1):!!s!=!!a&&(i!=null?ra(t,!!a,i,!0):ra(t,!!a,a?[]:"",!1));return;case"textarea":ee=P=null;for(C in a)if(u=a[C],a.hasOwnProperty(C)&&u!=null&&!s.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:at(t,i,C,null,s,u)}for(b in s)if(u=s[b],f=a[b],s.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":P=u;break;case"defaultValue":ee=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==f&&at(t,i,b,u,s,f)}Um(t,P,ee);return;case"option":for(var ve in a)if(P=a[ve],a.hasOwnProperty(ve)&&P!=null&&!s.hasOwnProperty(ve))switch(ve){case"selected":t.selected=!1;break;default:at(t,i,ve,null,s,P)}for(U in s)if(P=s[U],ee=a[U],s.hasOwnProperty(U)&&P!==ee&&(P!=null||ee!=null))switch(U){case"selected":t.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:at(t,i,U,P,s,ee)}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 De in a)P=a[De],a.hasOwnProperty(De)&&P!=null&&!s.hasOwnProperty(De)&&at(t,i,De,null,s,P);for(Z in s)if(P=s[Z],ee=a[Z],s.hasOwnProperty(Z)&&P!==ee&&(P!=null||ee!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(137,i));break;default:at(t,i,Z,P,s,ee)}return;default:if(hd(i)){for(var st in a)P=a[st],a.hasOwnProperty(st)&&P!==void 0&&!s.hasOwnProperty(st)&&eh(t,i,st,void 0,s,P);for(ie in s)P=s[ie],ee=a[ie],!s.hasOwnProperty(ie)||P===ee||P===void 0&&ee===void 0||eh(t,i,ie,P,s,ee);return}}for(var q in a)P=a[q],a.hasOwnProperty(q)&&P!=null&&!s.hasOwnProperty(q)&&at(t,i,q,null,s,P);for(le in s)P=s[le],ee=a[le],!s.hasOwnProperty(le)||P===ee||P==null&&ee==null||at(t,i,le,P,s,ee)}function $0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Px(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,a=performance.getEntriesByType("resource"),s=0;s<a.length;s++){var u=a[s],f=u.transferSize,b=u.initiatorType,C=u.duration;if(f&&C&&$0(b)){for(b=0,C=u.responseEnd,s+=1;s<a.length;s++){var U=a[s],Z=U.startTime;if(Z>C)break;var ie=U.transferSize,le=U.initiatorType;ie&&$0(le)&&(U=U.responseEnd,b+=ie*(U<C?1:(C-Z)/(U-Z)))}if(--s,i+=8*(f+b)/(u.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var th=null,nh=null;function Gc(t){return t.nodeType===9?t:t.ownerDocument}function Y0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function q0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function ih(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var oh=null;function Jx(){var t=window.event;return t&&t.type==="popstate"?t===oh?!1:(oh=t,!0):(oh=null,!1)}var V0=typeof setTimeout=="function"?setTimeout:void 0,Wx=typeof clearTimeout=="function"?clearTimeout:void 0,X0=typeof Promise=="function"?Promise:void 0,eS=typeof queueMicrotask=="function"?queueMicrotask:typeof X0<"u"?function(t){return X0.resolve(null).then(t).catch(tS)}:V0;function tS(t){setTimeout(function(){throw t})}function Wo(t){return t==="head"}function K0(t,i){var a=i,s=0;do{var u=a.nextSibling;if(t.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(s===0){t.removeChild(u),Ua(i);return}s--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")s++;else if(a==="html")Zs(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Zs(a);for(var f=a.firstChild;f;){var b=f.nextSibling,C=f.nodeName;f[Ft]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=b}}else a==="body"&&Zs(t.ownerDocument.body);a=u}while(a);Ua(i)}function Q0(t,i){var a=t;t=0;do{var s=a.nextSibling;if(a.nodeType===1?i?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(i?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),s&&s.nodeType===8)if(a=s.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=s}while(a)}function rh(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":rh(a),Ro(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function nS(t,i,a,s){for(;t.nodeType===1;){var u=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!s&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(s){if(!t[Ft])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(f=t.getAttribute("rel"),f==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(f!==u.rel||t.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||t.getAttribute("title")!==(u.title==null?null:u.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(f=t.getAttribute("src"),(f!==(u.src==null?null:u.src)||t.getAttribute("type")!==(u.type==null?null:u.type)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&t.getAttribute("name")===f)return t}else return t;if(t=yi(t.nextSibling),t===null)break}return null}function iS(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=yi(t.nextSibling),t===null))return null;return t}function Z0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=yi(t.nextSibling),t===null))return null;return t}function ah(t){return t.data==="$?"||t.data==="$~"}function sh(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function oS(t,i){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||a.readyState!=="loading")i();else{var s=function(){i(),a.removeEventListener("DOMContentLoaded",s)};a.addEventListener("DOMContentLoaded",s),t._reactRetry=s}}function yi(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var lh=null;function I0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(i===0)return yi(t.nextSibling);i--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||i++}t=t.nextSibling}return null}function F0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(i===0)return t;i--}else a!=="/$"&&a!=="/&"||i++}t=t.previousSibling}return null}function P0(t,i,a){switch(i=Gc(a),t){case"html":if(t=i.documentElement,!t)throw Error(r(452));return t;case"head":if(t=i.head,!t)throw Error(r(453));return t;case"body":if(t=i.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Zs(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ro(t)}var vi=new Map,J0=new Set;function Bc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var vo=I.d;I.d={f:rS,r:aS,D:sS,C:lS,L:cS,m:uS,X:fS,S:dS,M:hS};function rS(){var t=vo.f(),i=Dc();return t||i}function aS(t){var i=Ar(t);i!==null&&i.tag===5&&i.type==="form"?my(i):vo.r(t)}var Ra=typeof document>"u"?null:document;function W0(t,i,a){var s=Ra;if(s&&typeof i=="string"&&i){var u=ui(i);u='link[rel="'+t+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),J0.has(u)||(J0.add(u),t={rel:t,crossOrigin:a,href:i},s.querySelector(u)===null&&(i=s.createElement("link"),vn(i,"link",t),jt(i),s.head.appendChild(i)))}}function sS(t){vo.D(t),W0("dns-prefetch",t,null)}function lS(t,i){vo.C(t,i),W0("preconnect",t,i)}function cS(t,i,a){vo.L(t,i,a);var s=Ra;if(s&&t&&i){var u='link[rel="preload"][as="'+ui(i)+'"]';i==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+ui(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+ui(a.imageSizes)+'"]')):u+='[href="'+ui(t)+'"]';var f=u;switch(i){case"style":f=ja(t);break;case"script":f=La(t)}vi.has(f)||(t=y({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),vi.set(f,t),s.querySelector(u)!==null||i==="style"&&s.querySelector(Is(f))||i==="script"&&s.querySelector(Fs(f))||(i=s.createElement("link"),vn(i,"link",t),jt(i),s.head.appendChild(i)))}}function uS(t,i){vo.m(t,i);var a=Ra;if(a&&t){var s=i&&typeof i.as=="string"?i.as:"script",u='link[rel="modulepreload"][as="'+ui(s)+'"][href="'+ui(t)+'"]',f=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=La(t)}if(!vi.has(f)&&(t=y({rel:"modulepreload",href:t},i),vi.set(f,t),a.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Fs(f)))return}s=a.createElement("link"),vn(s,"link",t),jt(s),a.head.appendChild(s)}}}function dS(t,i,a){vo.S(t,i,a);var s=Ra;if(s&&t){var u=Wi(s).hoistableStyles,f=ja(t);i=i||"default";var b=u.get(f);if(!b){var C={loading:0,preload:null};if(b=s.querySelector(Is(f)))C.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":i},a),(a=vi.get(f))&&ch(t,a);var U=b=s.createElement("link");jt(U),vn(U,"link",t),U._p=new Promise(function(Z,ie){U.onload=Z,U.onerror=ie}),U.addEventListener("load",function(){C.loading|=1}),U.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Hc(b,i,s)}b={type:"stylesheet",instance:b,count:1,state:C},u.set(f,b)}}}function fS(t,i){vo.X(t,i);var a=Ra;if(a&&t){var s=Wi(a).hoistableScripts,u=La(t),f=s.get(u);f||(f=a.querySelector(Fs(u)),f||(t=y({src:t,async:!0},i),(i=vi.get(u))&&uh(t,i),f=a.createElement("script"),jt(f),vn(f,"link",t),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function hS(t,i){vo.M(t,i);var a=Ra;if(a&&t){var s=Wi(a).hoistableScripts,u=La(t),f=s.get(u);f||(f=a.querySelector(Fs(u)),f||(t=y({src:t,async:!0,type:"module"},i),(i=vi.get(u))&&uh(t,i),f=a.createElement("script"),jt(f),vn(f,"link",t),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function ev(t,i,a,s){var u=(u=W.current)?Bc(u):null;if(!u)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=ja(a.href),a=Wi(u).hoistableStyles,s=a.get(i),s||(s={type:"style",instance:null,count:0,state:null},a.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ja(a.href);var f=Wi(u).hoistableStyles,b=f.get(t);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(t,b),(f=u.querySelector(Is(t)))&&!f._p&&(b.instance=f,b.state.loading=5),vi.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vi.set(t,a),f||pS(u,t,a,b.state))),i&&s===null)throw Error(r(528,""));return b}if(i&&s!==null)throw Error(r(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=La(a),a=Wi(u).hoistableScripts,s=a.get(i),s||(s={type:"script",instance:null,count:0,state:null},a.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function ja(t){return'href="'+ui(t)+'"'}function Is(t){return'link[rel="stylesheet"]['+t+"]"}function tv(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function pS(t,i,a,s){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?s.loading=1:(i=t.createElement("link"),s.preload=i,i.addEventListener("load",function(){return s.loading|=1}),i.addEventListener("error",function(){return s.loading|=2}),vn(i,"link",a),jt(i),t.head.appendChild(i))}function La(t){return'[src="'+ui(t)+'"]'}function Fs(t){return"script[async]"+t}function nv(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var s=t.querySelector('style[data-href~="'+ui(a.href)+'"]');if(s)return i.instance=s,jt(s),s;var u=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),jt(s),vn(s,"style",u),Hc(s,a.precedence,t),i.instance=s;case"stylesheet":u=ja(a.href);var f=t.querySelector(Is(u));if(f)return i.state.loading|=4,i.instance=f,jt(f),f;s=tv(a),(u=vi.get(u))&&ch(s,u),f=(t.ownerDocument||t).createElement("link"),jt(f);var b=f;return b._p=new Promise(function(C,U){b.onload=C,b.onerror=U}),vn(f,"link",s),i.state.loading|=4,Hc(f,a.precedence,t),i.instance=f;case"script":return f=La(a.src),(u=t.querySelector(Fs(f)))?(i.instance=u,jt(u),u):(s=a,(u=vi.get(f))&&(s=y({},a),uh(s,u)),t=t.ownerDocument||t,u=t.createElement("script"),jt(u),vn(u,"link",s),t.head.appendChild(u),i.instance=u);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(s=i.instance,i.state.loading|=4,Hc(s,a.precedence,t));return i.instance}function Hc(t,i,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,f=u,b=0;b<s.length;b++){var C=s[b];if(C.dataset.precedence===i)f=C;else if(f!==u)break}f?f.parentNode.insertBefore(t,f.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function ch(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function uh(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var $c=null;function iv(t,i,a){if($c===null){var s=new Map,u=$c=new Map;u.set(a,s)}else u=$c,s=u.get(a),s||(s=new Map,u.set(a,s));if(s.has(t))return s;for(s.set(t,null),a=a.getElementsByTagName(t),u=0;u<a.length;u++){var f=a[u];if(!(f[Ft]||f[nt]||t==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(i)||"";b=t+b;var C=s.get(b);C?C.push(f):s.set(b,[f])}}return s}function ov(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function mS(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function rv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gS(t,i,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=ja(s.href),f=i.querySelector(Is(u));if(f){i=f._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Yc.bind(t),i.then(t,t)),a.state.loading|=4,a.instance=f,jt(f);return}f=i.ownerDocument||i,s=tv(s),(u=vi.get(u))&&ch(s,u),f=f.createElement("link"),jt(f);var b=f;b._p=new Promise(function(C,U){b.onload=C,b.onerror=U}),vn(f,"link",s),a.instance=f}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,i),(i=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Yc.bind(t),i.addEventListener("load",a),i.addEventListener("error",a))}}var dh=0;function yS(t,i){return t.stylesheets&&t.count===0&&Vc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var s=setTimeout(function(){if(t.stylesheets&&Vc(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4+i);0<t.imgBytes&&dh===0&&(dh=62500*Px());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Vc(t,t.stylesheets),t.unsuspend)){var f=t.unsuspend;t.unsuspend=null,f()}},(t.imgBytes>dh?50:800)+i);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function Yc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var qc=null;function Vc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,qc=new Map,i.forEach(vS,t),qc=null,Yc.call(t))}function vS(t,i){if(!(i.state.loading&4)){var a=qc.get(t);if(a)var s=a.get(null);else{a=new Map,qc.set(t,a);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),s=b)}s&&a.set(null,s)}u=i.instance,b=u.getAttribute("data-precedence"),f=a.get(b)||s,f===s&&a.set(null,u),a.set(b,u),this.count++,s=Yc.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),f?f.parentNode.insertBefore(u,f.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(u,t.firstChild)),i.state.loading|=4}}var Ps={$$typeof:R,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function bS(t,i,a,s,u,f,b,C,U){this.tag=1,this.containerInfo=t,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=qi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qi(0),this.hiddenUpdates=qi(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function av(t,i,a,s,u,f,b,C,U,Z,ie,le){return t=new bS(t,i,a,b,U,Z,ie,le,C),i=1,f===!0&&(i|=24),f=ei(3,null,null,i),t.current=f,f.stateNode=t,i=qd(),i.refCount++,t.pooledCache=i,i.refCount++,f.memoizedState={element:s,isDehydrated:a,cache:i},Qd(f),t}function sv(t){return t?(t=ha,t):ha}function lv(t,i,a,s,u,f){u=sv(u),s.context===null?s.context=u:s.pendingContext=u,s=Yo(i),s.payload={element:a},f=f===void 0?null:f,f!==null&&(s.callback=f),a=qo(t,s,i),a!==null&&(Kn(a,t,i),Ts(a,t,i))}function cv(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function fh(t,i){cv(t,i),(t=t.alternate)&&cv(t,i)}function uv(t){if(t.tag===13||t.tag===31){var i=kr(t,67108864);i!==null&&Kn(i,t,67108864),fh(t,67108864)}}function dv(t){if(t.tag===13||t.tag===31){var i=ri();i=At(i);var a=kr(t,i);a!==null&&Kn(a,t,i),fh(t,i)}}var Xc=!0;function wS(t,i,a,s){var u=j.T;j.T=null;var f=I.p;try{I.p=2,hh(t,i,a,s)}finally{I.p=f,j.T=u}}function xS(t,i,a,s){var u=j.T;j.T=null;var f=I.p;try{I.p=8,hh(t,i,a,s)}finally{I.p=f,j.T=u}}function hh(t,i,a,s){if(Xc){var u=ph(s);if(u===null)Wf(t,i,s,Kc,a),hv(t,s);else if(AS(u,t,i,a,s))s.stopPropagation();else if(hv(t,s),i&4&&-1<SS.indexOf(t)){for(;u!==null;){var f=Ar(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=It(f.pendingLanes);if(b!==0){var C=f;for(C.pendingLanes|=2,C.entangledLanes|=2;b;){var U=1<<31-vt(b);C.entanglements[1]|=U,b&=~U}Qi(f),(Je&6)===0&&(kc=Ve()+500,Xs(0))}}break;case 31:case 13:C=kr(f,2),C!==null&&Kn(C,f,2),Dc(),fh(f,2)}if(f=ph(s),f===null&&Wf(t,i,s,Kc,a),f===u)break;u=f}u!==null&&s.stopPropagation()}else Wf(t,i,s,null,a)}}function ph(t){return t=md(t),mh(t)}var Kc=null;function mh(t){if(Kc=null,t=pn(t),t!==null){var i=c(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=d(i),t!==null)return t;t=null}else if(a===31){if(t=p(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Kc=t,null}function fv(t){switch(t){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(Bt()){case wn:return 2;case xn:return 8;case dt:case In:return 32;case Ei:return 268435456;default:return 32}default:return 32}}var gh=!1,er=null,tr=null,nr=null,Js=new Map,Ws=new Map,ir=[],SS="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 hv(t,i){switch(t){case"focusin":case"focusout":er=null;break;case"dragenter":case"dragleave":tr=null;break;case"mouseover":case"mouseout":nr=null;break;case"pointerover":case"pointerout":Js.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ws.delete(i.pointerId)}}function el(t,i,a,s,u,f){return t===null||t.nativeEvent!==f?(t={blockedOn:i,domEventName:a,eventSystemFlags:s,nativeEvent:f,targetContainers:[u]},i!==null&&(i=Ar(i),i!==null&&uv(i)),t):(t.eventSystemFlags|=s,i=t.targetContainers,u!==null&&i.indexOf(u)===-1&&i.push(u),t)}function AS(t,i,a,s,u){switch(i){case"focusin":return er=el(er,t,i,a,s,u),!0;case"dragenter":return tr=el(tr,t,i,a,s,u),!0;case"mouseover":return nr=el(nr,t,i,a,s,u),!0;case"pointerover":var f=u.pointerId;return Js.set(f,el(Js.get(f)||null,t,i,a,s,u)),!0;case"gotpointercapture":return f=u.pointerId,Ws.set(f,el(Ws.get(f)||null,t,i,a,s,u)),!0}return!1}function pv(t){var i=pn(t.target);if(i!==null){var a=c(i);if(a!==null){if(i=a.tag,i===13){if(i=d(a),i!==null){t.blockedOn=i,Bn(t.priority,function(){dv(a)});return}}else if(i===31){if(i=p(a),i!==null){t.blockedOn=i,Bn(t.priority,function(){dv(a)});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Qc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=ph(t.nativeEvent);if(a===null){a=t.nativeEvent;var s=new a.constructor(a.type,a);pd=s,a.target.dispatchEvent(s),pd=null}else return i=Ar(a),i!==null&&uv(i),t.blockedOn=a,!1;i.shift()}return!0}function mv(t,i,a){Qc(t)&&a.delete(i)}function _S(){gh=!1,er!==null&&Qc(er)&&(er=null),tr!==null&&Qc(tr)&&(tr=null),nr!==null&&Qc(nr)&&(nr=null),Js.forEach(mv),Ws.forEach(mv)}function Zc(t,i){t.blockedOn===i&&(t.blockedOn=null,gh||(gh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,_S)))}var Ic=null;function gv(t){Ic!==t&&(Ic=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ic===t&&(Ic=null);for(var i=0;i<t.length;i+=3){var a=t[i],s=t[i+1],u=t[i+2];if(typeof s!="function"){if(mh(s||a)===null)continue;break}var f=Ar(a);f!==null&&(t.splice(i,3),i-=3,pf(f,{pending:!0,data:u,method:a.method,action:s},s,u))}}))}function Ua(t){function i(U){return Zc(U,t)}er!==null&&Zc(er,t),tr!==null&&Zc(tr,t),nr!==null&&Zc(nr,t),Js.forEach(i),Ws.forEach(i);for(var a=0;a<ir.length;a++){var s=ir[a];s.blockedOn===t&&(s.blockedOn=null)}for(;0<ir.length&&(a=ir[0],a.blockedOn===null);)pv(a),a.blockedOn===null&&ir.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(s=0;s<a.length;s+=3){var u=a[s],f=a[s+1],b=u[wt]||null;if(typeof f=="function")b||gv(a);else if(b){var C=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[wt]||null)C=b.formAction;else if(mh(u)!==null)continue}else C=b.action;typeof C=="function"?a[s+1]=C:(a.splice(s,3),s-=3),gv(a)}}}function yv(){function t(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function i(){u!==null&&(u(),u=null),s||setTimeout(a,20)}function a(){if(!s&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,u=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(a,100),function(){s=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),u!==null&&(u(),u=null)}}}function yh(t){this._internalRoot=t}Fc.prototype.render=yh.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(r(409));var a=i.current,s=ri();lv(a,s,t,i,null,null)},Fc.prototype.unmount=yh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;lv(t.current,2,null,t,null,null),Dc(),i[An]=null}};function Fc(t){this._internalRoot=t}Fc.prototype.unstable_scheduleHydration=function(t){if(t){var i=zn();t={blockedOn:null,target:t,priority:i};for(var a=0;a<ir.length&&i!==0&&i<ir[a].priority;a++);ir.splice(a,0,t),a===0&&pv(t)}};var vv=e.version;if(vv!=="19.2.3")throw Error(r(527,vv,"19.2.3"));I.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=h(i),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var CS={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pc.isDisabled&&Pc.supportsFiber)try{Dn=Pc.inject(CS),Ot=Pc}catch{}}return nl.createRoot=function(t,i){if(!l(t))throw Error(r(299));var a=!1,s="",u=Cy,f=Ey,b=Ny;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(s=i.identifierPrefix),i.onUncaughtError!==void 0&&(u=i.onUncaughtError),i.onCaughtError!==void 0&&(f=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=av(t,1,!1,null,null,a,s,null,u,f,b,yv),t[An]=i.current,Jf(t),new yh(i)},nl.hydrateRoot=function(t,i,a){if(!l(t))throw Error(r(299));var s=!1,u="",f=Cy,b=Ey,C=Ny,U=null;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError),a.formState!==void 0&&(U=a.formState)),i=av(t,1,!0,i,a??null,s,u,U,f,b,C,yv),i.context=sv(null),a=i.current,s=ri(),s=At(s),u=Yo(s),u.callback=null,qo(a,u,s),a=s,i.current.lanes=a,be(i,a),Qi(i),t[An]=i.current,Jf(t),new Fc(i)},nl.version="19.2.3",nl}var Tv;function LS(){if(Tv)return xh.exports;Tv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),xh.exports=jS(),xh.exports}var US=LS();const Co={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function V1(n){return"init"in n}function qh(n){return!!n.write}function Dv(n){return"v"in n||"e"in n}function hu(n){if("e"in n)throw n.e;if((Co?"production":void 0)!=="production"&&!("v"in n))throw new Error("[Bug] atom state is not initialized");return n.v}const pu=new WeakMap;function X1(n){var e;return mu(n)&&!!((e=pu.get(n))!=null&&e[0])}function GS(n){const e=pu.get(n);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(o=>o()))}function Vh(n,e){let o=pu.get(n);if(!o){o=[!0,new Set],pu.set(n,o);const r=()=>{o[0]=!1};n.then(r,r)}o[1].add(e)}function mu(n){return typeof(n==null?void 0:n.then)=="function"}function K1(n,e,o){if(!o.p.has(n)){o.p.add(n);const r=()=>o.p.delete(n);e.then(r,r)}}function Q1(n,e,o){var r;const l=new Set;for(const c of((r=o.get(n))==null?void 0:r.t)||[])l.add(c);for(const c of e.p)l.add(c);return l}const BS=(n,e,...o)=>e.read(...o),HS=(n,e,...o)=>e.write(...o),$S=(n,e)=>{if(e.INTERNAL_onInit)return e.INTERNAL_onInit(n);if(e.unstable_onInit)return console.warn("[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit."),e.unstable_onInit(n)},YS=(n,e,o)=>{var r;return(r=e.onMount)==null?void 0:r.call(e,o)},qS=(n,e)=>{var o;const r=Nn(n),l=r[0],c=r[6],d=r[9];if((Co?"production":void 0)!=="production"&&!e)throw new Error("Atom is undefined or null");let p=l.get(e);return p||(p={d:new Map,p:new Set,n:0},l.set(e,p),(o=c.i)==null||o.call(c,e),d==null||d(n,e)),p},VS=n=>{const e=Nn(n),o=e[1],r=e[3],l=e[4],c=e[5],d=e[6],p=e[13],m=[],h=g=>{try{g()}catch(y){m.push(y)}};do{d.f&&h(d.f);const g=new Set,y=g.add.bind(g);r.forEach(v=>{var w;return(w=o.get(v))==null?void 0:w.l.forEach(y)}),r.clear(),c.forEach(y),c.clear(),l.forEach(y),l.clear(),g.forEach(h),r.size&&p(n)}while(r.size||c.size||l.size);if(m.length)throw new AggregateError(m)},XS=n=>{const e=Nn(n),o=e[1],r=e[2],l=e[3],c=e[11],d=e[14],p=e[17],m=[],h=new WeakSet,g=new WeakSet,y=Array.from(l);for(;y.length;){const v=y[y.length-1],w=c(n,v);if(g.has(v)){y.pop();continue}if(h.has(v)){if(r.get(v)===w.n)m.push([v,w]);else if((Co?"production":void 0)!=="production"&&r.has(v))throw new Error("[Bug] invalidated atom exists");g.add(v),y.pop();continue}h.add(v);for(const S of Q1(v,w,o))h.has(S)||y.push(S)}for(let v=m.length-1;v>=0;--v){const[w,S]=m[v];let A=!1;for(const x of S.d.keys())if(x!==w&&l.has(x)){A=!0;break}A&&(d(n,w),p(n,w)),r.delete(w)}},Xh=new WeakSet,KS=(n,e)=>{var o,r;const l=Nn(n),c=l[1],d=l[2],p=l[3],m=l[6],h=l[7],g=l[11],y=l[12],v=l[13],w=l[14],S=l[16],A=l[17],x=g(n,e);if(Dv(x)){if(c.has(e)&&d.get(e)!==x.n)return x;let M=!1;for(const[$,L]of x.d)if(w(n,$).n!==L){M=!0;break}if(!M)return x}x.d.clear();let E=!0;function D(){c.has(e)&&(A(n,e),v(n),y(n))}function R(M){var $;if(M===e){const X=g(n,M);if(!Dv(X))if(V1(M))gu(n,M,M.init);else throw new Error("no atom init");return hu(X)}const L=w(n,M);try{return hu(L)}finally{x.d.set(M,L.n),X1(x.v)&&K1(e,x.v,L),c.has(e)&&(($=c.get(M))==null||$.t.add(e)),E||D()}}let _,N;const T={get signal(){return _||(_=new AbortController),_.signal},get setSelf(){return(Co?"production":void 0)!=="production"&&!qh(e)&&console.warn("setSelf function cannot be used with read-only atom"),!N&&qh(e)&&(N=(...M)=>{if((Co?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)try{return S(n,e,...M)}finally{v(n),y(n)}}),N}},O=x.n;try{(Co?"production":void 0)!=="production"&&Xh.delete(n);const M=h(n,e,R,T);return(Co?"production":void 0)!=="production"&&Xh.has(n)&&console.warn("Detected store mutation during atom read. This is not supported."),gu(n,e,M),mu(M)&&(Vh(M,()=>_==null?void 0:_.abort()),M.then(D,D)),(o=m.r)==null||o.call(m,e),x}catch(M){return delete x.v,x.e=M,++x.n,x}finally{E=!1,O!==x.n&&d.get(e)===O&&(d.set(e,x.n),p.add(e),(r=m.c)==null||r.call(m,e))}},QS=(n,e)=>{const o=Nn(n),r=o[1],l=o[2],c=o[11],d=[e];for(;d.length;){const p=d.pop(),m=c(n,p);for(const h of Q1(p,m,r)){const g=c(n,h);l.set(h,g.n),d.push(h)}}},Z1=(n,e,...o)=>{const r=Nn(n),l=r[3],c=r[6],d=r[8],p=r[11],m=r[12],h=r[13],g=r[14],y=r[15],v=r[17];let w=!0;const S=x=>hu(g(n,x)),A=(x,...E)=>{var D;const R=p(n,x);try{if(x===e){if(!V1(x))throw new Error("atom not writable");(Co?"production":void 0)!=="production"&&Xh.add(n);const _=R.n,N=E[0];gu(n,x,N),v(n,x),_!==R.n&&(l.add(x),y(n,x),(D=c.c)==null||D.call(c,x));return}else return Z1(n,x,...E)}finally{w||(h(n),m(n))}};try{return d(n,e,S,A,...o)}finally{w=!1}},ZS=(n,e)=>{var o;const r=Nn(n),l=r[1],c=r[3],d=r[6],p=r[11],m=r[15],h=r[18],g=r[19],y=p(n,e),v=l.get(e);if(v&&!X1(y.v)){for(const[w,S]of y.d)if(!v.d.has(w)){const A=p(n,w);h(n,w).t.add(e),v.d.add(w),S!==A.n&&(c.add(w),m(n,w),(o=d.c)==null||o.call(d,w))}for(const w of v.d)if(!y.d.has(w)){v.d.delete(w);const S=g(n,w);S==null||S.t.delete(e)}}},I1=(n,e)=>{var o;const r=Nn(n),l=r[1],c=r[4],d=r[6],p=r[10],m=r[11],h=r[12],g=r[13],y=r[14],v=r[16],w=m(n,e);let S=l.get(e);if(!S){y(n,e);for(const A of w.d.keys())I1(n,A).t.add(e);if(S={l:new Set,d:new Set(w.d.keys()),t:new Set},l.set(e,S),qh(e)){const A=()=>{let x=!0;const E=(...D)=>{try{return v(n,e,...D)}finally{x||(g(n),h(n))}};try{const D=p(n,e,E);D&&(S.u=()=>{x=!0;try{D()}finally{x=!1}})}finally{x=!1}};c.add(A)}(o=d.m)==null||o.call(d,e)}return S},IS=(n,e)=>{var o,r;const l=Nn(n),c=l[1],d=l[5],p=l[6],m=l[11],h=l[19],g=m(n,e);let y=c.get(e);if(!y||y.l.size)return y;let v=!1;for(const w of y.t)if((o=c.get(w))!=null&&o.d.has(e)){v=!0;break}if(!v){y.u&&d.add(y.u),y=void 0,c.delete(e);for(const w of g.d.keys()){const S=h(n,w);S==null||S.t.delete(e)}(r=p.u)==null||r.call(p,e);return}return y},gu=(n,e,o)=>{const r=Nn(n)[11],l=r(n,e),c="v"in l,d=l.v;if(mu(o))for(const p of l.d.keys())K1(e,o,r(n,p));l.v=o,delete l.e,(!c||!Object.is(d,l.v))&&(++l.n,mu(d)&&GS(d))},FS=(n,e)=>{const o=Nn(n)[14];return hu(o(n,e))},PS=(n,e,...o)=>{const r=Nn(n),l=r[12],c=r[13],d=r[16];try{return d(n,e,...o)}finally{c(n),l(n)}},JS=(n,e,o)=>{const r=Nn(n),l=r[12],c=r[18],d=r[19],m=c(n,e).l;return m.add(o),l(n),()=>{m.delete(o),d(n,e),l(n)}},F1=new WeakMap,Nn=n=>{const e=F1.get(n);if((Co?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");return e};function WS(...n){const e={get(r){const l=Nn(e)[21];return l(e,r)},set(r,...l){const c=Nn(e)[22];return c(e,r,...l)},sub(r,l){const c=Nn(e)[23];return c(e,r,l)}},o=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},BS,HS,$S,YS,qS,VS,XS,KS,QS,Z1,ZS,I1,IS,gu,FS,PS,JS,void 0].map((r,l)=>n[l]||r);return F1.set(e,Object.freeze(o)),e}const eA={};function P1(){return WS()}let il;function tA(){return il||(il=P1(),(eA?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=il),globalThis.__JOTAI_DEFAULT_STORE__!==il&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),il}const nA={},Kh=ne.createContext(void 0);function J1(n){return ne.useContext(Kh)||tA()}function iA({children:n,store:e}){const o=ne.useRef(null);return e?ne.createElement(Kh.Provider,{value:e},n):(o.current===null&&(o.current=P1()),ne.createElement(Kh.Provider,{value:o.current},n))}const Qh=n=>typeof(n==null?void 0:n.then)=="function",Zh=n=>{n.status||(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}))},oA=Ji.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(Zh(n),n)}),Ch=new WeakMap,Mv=(n,e)=>{let o=Ch.get(n);return o||(o=new Promise((r,l)=>{let c=n;const d=h=>g=>{c===h&&r(g)},p=h=>g=>{c===h&&l(g)},m=()=>{try{const h=e();Qh(h)?(Ch.set(h,o),c=h,h.then(d(h),p(h)),Vh(h,m)):r(h)}catch(h){l(h)}};n.then(d(n),p(n)),Vh(n,m)}),Ch.set(n,o)),o};function Ih(n,e){const{delay:o,unstable_promiseStatus:r=!Ji.use}={},l=J1(),[[c,d,p],m]=ne.useReducer(g=>{const y=l.get(n);return Object.is(g[0],y)&&g[1]===l&&g[2]===n?g:[y,l,n]},void 0,()=>[l.get(n),l,n]);let h=c;if((d!==l||p!==n)&&(m(),h=l.get(n)),ne.useEffect(()=>{const g=l.sub(n,()=>{if(r)try{const y=l.get(n);Qh(y)&&Zh(Mv(y,()=>l.get(n)))}catch{}if(typeof o=="number"){setTimeout(m,o);return}m()});return m(),g},[l,n,o,r]),ne.useDebugValue(h),Qh(h)){const g=Mv(h,()=>l.get(n));return r&&Zh(g),oA(g)}return h}function Ka(n,e){const o=J1();return ne.useCallback((...l)=>{if((nA?"production":void 0)!=="production"&&!("write"in n))throw new Error("not writable atom");return o.set(n,...l)},[o,n])}function rA(n,e){return[Ih(n),Ka(n)]}var Wc={exports:{}},zv;function aA(){if(zv)return Wc.exports;zv=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(N,T,O){return Function.prototype.apply.call(N,T,O)},o;n&&typeof n.ownKeys=="function"?o=n.ownKeys:Object.getOwnPropertySymbols?o=function(N){return Object.getOwnPropertyNames(N).concat(Object.getOwnPropertySymbols(N))}:o=function(N){return Object.getOwnPropertyNames(N)};function r(_){console&&console.warn&&console.warn(_)}var l=Number.isNaN||function(N){return N!==N};function c(){c.init.call(this)}Wc.exports=c,Wc.exports.once=E,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var d=10;function p(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return d},set:function(_){if(typeof _!="number"||_<0||l(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");d=_}}),c.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},c.prototype.setMaxListeners=function(N){if(typeof N!="number"||N<0||l(N))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+N+".");return this._maxListeners=N,this};function m(_){return _._maxListeners===void 0?c.defaultMaxListeners:_._maxListeners}c.prototype.getMaxListeners=function(){return m(this)},c.prototype.emit=function(N){for(var T=[],O=1;O<arguments.length;O++)T.push(arguments[O]);var M=N==="error",$=this._events;if($!==void 0)M=M&&$.error===void 0;else if(!M)return!1;if(M){var L;if(T.length>0&&(L=T[0]),L instanceof Error)throw L;var X=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw X.context=L,X}var ae=$[N];if(ae===void 0)return!1;if(typeof ae=="function")e(ae,this,T);else for(var te=ae.length,me=S(ae,te),O=0;O<te;++O)e(me[O],this,T);return!0};function h(_,N,T,O){var M,$,L;if(p(T),$=_._events,$===void 0?($=_._events=Object.create(null),_._eventsCount=0):($.newListener!==void 0&&(_.emit("newListener",N,T.listener?T.listener:T),$=_._events),L=$[N]),L===void 0)L=$[N]=T,++_._eventsCount;else if(typeof L=="function"?L=$[N]=O?[T,L]:[L,T]:O?L.unshift(T):L.push(T),M=m(_),M>0&&L.length>M&&!L.warned){L.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(N)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=_,X.type=N,X.count=L.length,r(X)}return _}c.prototype.addListener=function(N,T){return h(this,N,T,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(N,T){return h(this,N,T,!0)};function g(){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 y(_,N,T){var O={fired:!1,wrapFn:void 0,target:_,type:N,listener:T},M=g.bind(O);return M.listener=T,O.wrapFn=M,M}c.prototype.once=function(N,T){return p(T),this.on(N,y(this,N,T)),this},c.prototype.prependOnceListener=function(N,T){return p(T),this.prependListener(N,y(this,N,T)),this},c.prototype.removeListener=function(N,T){var O,M,$,L,X;if(p(T),M=this._events,M===void 0)return this;if(O=M[N],O===void 0)return this;if(O===T||O.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete M[N],M.removeListener&&this.emit("removeListener",N,O.listener||T));else if(typeof O!="function"){for($=-1,L=O.length-1;L>=0;L--)if(O[L]===T||O[L].listener===T){X=O[L].listener,$=L;break}if($<0)return this;$===0?O.shift():A(O,$),O.length===1&&(M[N]=O[0]),M.removeListener!==void 0&&this.emit("removeListener",N,X||T)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(N){var T,O,M;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[N]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[N]),this;if(arguments.length===0){var $=Object.keys(O),L;for(M=0;M<$.length;++M)L=$[M],L!=="removeListener"&&this.removeAllListeners(L);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=O[N],typeof T=="function")this.removeListener(N,T);else if(T!==void 0)for(M=T.length-1;M>=0;M--)this.removeListener(N,T[M]);return this};function v(_,N,T){var O=_._events;if(O===void 0)return[];var M=O[N];return M===void 0?[]:typeof M=="function"?T?[M.listener||M]:[M]:T?x(M):S(M,M.length)}c.prototype.listeners=function(N){return v(this,N,!0)},c.prototype.rawListeners=function(N){return v(this,N,!1)},c.listenerCount=function(_,N){return typeof _.listenerCount=="function"?_.listenerCount(N):w.call(_,N)},c.prototype.listenerCount=w;function w(_){var N=this._events;if(N!==void 0){var T=N[_];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]};function S(_,N){for(var T=new Array(N),O=0;O<N;++O)T[O]=_[O];return T}function A(_,N){for(;N+1<_.length;N++)_[N]=_[N+1];_.pop()}function x(_){for(var N=new Array(_.length),T=0;T<N.length;++T)N[T]=_[T].listener||_[T];return N}function E(_,N){return new Promise(function(T,O){function M(L){_.removeListener(N,$),O(L)}function $(){typeof _.removeListener=="function"&&_.removeListener("error",M),T([].slice.call(arguments))}R(_,N,$,{once:!0}),N!=="error"&&D(_,M,{once:!0})})}function D(_,N,T){typeof _.on=="function"&&R(_,"error",N,T)}function R(_,N,T,O){if(typeof _.on=="function")O.once?_.once(N,T):_.on(N,T);else if(typeof _.addEventListener=="function")_.addEventListener(N,function M($){O.once&&_.removeEventListener(N,M),T($)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return Wc.exports}var sA=aA();function lA(){const n=arguments[0];for(let e=1,o=arguments.length;e<o;e++)if(arguments[e])for(const r in arguments[e])n[r]=arguments[e][r];return n}let tn=lA;typeof Object.assign=="function"&&(tn=Object.assign);function _i(n,e,o,r){const l=n._nodes.get(e);let c=null;return l&&(r==="mixed"?c=l.out&&l.out[o]||l.undirected&&l.undirected[o]:r==="directed"?c=l.out&&l.out[o]:c=l.undirected&&l.undirected[o]),c}function bn(n){return typeof n=="object"&&n!==null}function W1(n){let e;for(e in n)return!1;return!0}function bi(n,e,o){Object.defineProperty(n,e,{enumerable:!1,configurable:!1,writable:!0,value:o})}function Mi(n,e,o){const r={enumerable:!0,configurable:!0};typeof o=="function"?r.get=o:(r.value=o,r.writable=!1),Object.defineProperty(n,e,r)}function Ov(n){return!(!bn(n)||n.attributes&&!Array.isArray(n.attributes))}function cA(){let n=Math.floor(Math.random()*256)&255;return()=>n++}function ko(){const n=arguments;let e=null,o=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(e===null){if(o++,o>=n.length)return{done:!0};e=n[o][Symbol.iterator]()}if(r=e.next(),r.done){e=null;continue}break}while(!0);return r}}}function rs(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Sp extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class ye extends Sp{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ye.prototype.constructor)}}class pe extends Sp{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,pe.prototype.constructor)}}class Me extends Sp{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Me.prototype.constructor)}}function eb(n,e){this.key=n,this.attributes=e,this.clear()}eb.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 tb(n,e){this.key=n,this.attributes=e,this.clear()}tb.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function nb(n,e){this.key=n,this.attributes=e,this.clear()}nb.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function as(n,e,o,r,l){this.key=e,this.attributes=l,this.undirected=n,this.source=o,this.target=r}as.prototype.attach=function(){let n="out",e="in";this.undirected&&(n=e="undirected");const o=this.source.key,r=this.target.key;this.source[n][r]=this,!(this.undirected&&o===r)&&(this.target[e][o]=this)};as.prototype.attachMulti=function(){let n="out",e="in";const o=this.source.key,r=this.target.key;this.undirected&&(n=e="undirected");const l=this.source[n],c=l[r];if(typeof c>"u"){l[r]=this,this.undirected&&o===r||(this.target[e][o]=this);return}c.previous=this,this.next=c,l[r]=this,this.target[e][o]=this};as.prototype.detach=function(){const n=this.source.key,e=this.target.key;let o="out",r="in";this.undirected&&(o=r="undirected"),delete this.source[o][e],delete this.target[r][n]};as.prototype.detachMulti=function(){const n=this.source.key,e=this.target.key;let o="out",r="in";this.undirected&&(o=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[o][e],delete this.target[r][n]):(this.next.previous=void 0,this.source[o][e]=this.next,this.target[r][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const ib=0,ob=1,uA=2,rb=3;function Do(n,e,o,r,l,c,d){let p,m,h,g;if(r=""+r,o===ib){if(p=n._nodes.get(r),!p)throw new pe(`Graph.${e}: could not find the "${r}" node in the graph.`);h=l,g=c}else if(o===rb){if(l=""+l,m=n._edges.get(l),!m)throw new pe(`Graph.${e}: could not find the "${l}" edge in the graph.`);const y=m.source.key,v=m.target.key;if(r===y)p=m.target;else if(r===v)p=m.source;else throw new pe(`Graph.${e}: the "${r}" node is not attached to the "${l}" edge (${y}, ${v}).`);h=c,g=d}else{if(m=n._edges.get(r),!m)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`);o===ob?p=m.source:p=m.target,h=l,g=c}return[p,h,g]}function dA(n,e,o){n.prototype[e]=function(r,l,c){const[d,p]=Do(this,e,o,r,l,c);return d.attributes[p]}}function fA(n,e,o){n.prototype[e]=function(r,l){const[c]=Do(this,e,o,r,l);return c.attributes}}function hA(n,e,o){n.prototype[e]=function(r,l,c){const[d,p]=Do(this,e,o,r,l,c);return d.attributes.hasOwnProperty(p)}}function pA(n,e,o){n.prototype[e]=function(r,l,c,d){const[p,m,h]=Do(this,e,o,r,l,c,d);return p.attributes[m]=h,this.emit("nodeAttributesUpdated",{key:p.key,type:"set",attributes:p.attributes,name:m}),this}}function mA(n,e,o){n.prototype[e]=function(r,l,c,d){const[p,m,h]=Do(this,e,o,r,l,c,d);if(typeof h!="function")throw new ye(`Graph.${e}: updater should be a function.`);const g=p.attributes,y=h(g[m]);return g[m]=y,this.emit("nodeAttributesUpdated",{key:p.key,type:"set",attributes:p.attributes,name:m}),this}}function gA(n,e,o){n.prototype[e]=function(r,l,c){const[d,p]=Do(this,e,o,r,l,c);return delete d.attributes[p],this.emit("nodeAttributesUpdated",{key:d.key,type:"remove",attributes:d.attributes,name:p}),this}}function yA(n,e,o){n.prototype[e]=function(r,l,c){const[d,p]=Do(this,e,o,r,l,c);if(!bn(p))throw new ye(`Graph.${e}: provided attributes are not a plain object.`);return d.attributes=p,this.emit("nodeAttributesUpdated",{key:d.key,type:"replace",attributes:d.attributes}),this}}function vA(n,e,o){n.prototype[e]=function(r,l,c){const[d,p]=Do(this,e,o,r,l,c);if(!bn(p))throw new ye(`Graph.${e}: provided attributes are not a plain object.`);return tn(d.attributes,p),this.emit("nodeAttributesUpdated",{key:d.key,type:"merge",attributes:d.attributes,data:p}),this}}function bA(n,e,o){n.prototype[e]=function(r,l,c){const[d,p]=Do(this,e,o,r,l,c);if(typeof p!="function")throw new ye(`Graph.${e}: provided updater is not a function.`);return d.attributes=p(d.attributes),this.emit("nodeAttributesUpdated",{key:d.key,type:"update",attributes:d.attributes}),this}}const wA=[{name:n=>`get${n}Attribute`,attacher:dA},{name:n=>`get${n}Attributes`,attacher:fA},{name:n=>`has${n}Attribute`,attacher:hA},{name:n=>`set${n}Attribute`,attacher:pA},{name:n=>`update${n}Attribute`,attacher:mA},{name:n=>`remove${n}Attribute`,attacher:gA},{name:n=>`replace${n}Attributes`,attacher:yA},{name:n=>`merge${n}Attributes`,attacher:vA},{name:n=>`update${n}Attributes`,attacher:bA}];function xA(n){wA.forEach(function({name:e,attacher:o}){o(n,e("Node"),ib),o(n,e("Source"),ob),o(n,e("Target"),uA),o(n,e("Opposite"),rb)})}function SA(n,e,o){n.prototype[e]=function(r,l){let c;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Me(`Graph.${e}: 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 d=""+r,p=""+l;if(l=arguments[2],c=_i(this,d,p,o),!c)throw new pe(`Graph.${e}: could not find an edge for the given path ("${d}" - "${p}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,c=this._edges.get(r),!c)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return c.attributes[l]}}function AA(n,e,o){n.prototype[e]=function(r){let l;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Me(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const c=""+r,d=""+arguments[1];if(l=_i(this,c,d,o),!l)throw new pe(`Graph.${e}: could not find an edge for the given path ("${c}" - "${d}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,l=this._edges.get(r),!l)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return l.attributes}}function _A(n,e,o){n.prototype[e]=function(r,l){let c;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Me(`Graph.${e}: 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 d=""+r,p=""+l;if(l=arguments[2],c=_i(this,d,p,o),!c)throw new pe(`Graph.${e}: could not find an edge for the given path ("${d}" - "${p}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,c=this._edges.get(r),!c)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return c.attributes.hasOwnProperty(l)}}function CA(n,e,o){n.prototype[e]=function(r,l,c){let d;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Me(`Graph.${e}: 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 p=""+r,m=""+l;if(l=arguments[2],c=arguments[3],d=_i(this,p,m,o),!d)throw new pe(`Graph.${e}: could not find an edge for the given path ("${p}" - "${m}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,d=this._edges.get(r),!d)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return d.attributes[l]=c,this.emit("edgeAttributesUpdated",{key:d.key,type:"set",attributes:d.attributes,name:l}),this}}function EA(n,e,o){n.prototype[e]=function(r,l,c){let d;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Me(`Graph.${e}: 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 p=""+r,m=""+l;if(l=arguments[2],c=arguments[3],d=_i(this,p,m,o),!d)throw new pe(`Graph.${e}: could not find an edge for the given path ("${p}" - "${m}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,d=this._edges.get(r),!d)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof c!="function")throw new ye(`Graph.${e}: updater should be a function.`);return d.attributes[l]=c(d.attributes[l]),this.emit("edgeAttributesUpdated",{key:d.key,type:"set",attributes:d.attributes,name:l}),this}}function NA(n,e,o){n.prototype[e]=function(r,l){let c;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Me(`Graph.${e}: 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 d=""+r,p=""+l;if(l=arguments[2],c=_i(this,d,p,o),!c)throw new pe(`Graph.${e}: could not find an edge for the given path ("${d}" - "${p}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,c=this._edges.get(r),!c)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete c.attributes[l],this.emit("edgeAttributesUpdated",{key:c.key,type:"remove",attributes:c.attributes,name:l}),this}}function kA(n,e,o){n.prototype[e]=function(r,l){let c;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Me(`Graph.${e}: 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 d=""+r,p=""+l;if(l=arguments[2],c=_i(this,d,p,o),!c)throw new pe(`Graph.${e}: could not find an edge for the given path ("${d}" - "${p}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,c=this._edges.get(r),!c)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!bn(l))throw new ye(`Graph.${e}: provided attributes are not a plain object.`);return c.attributes=l,this.emit("edgeAttributesUpdated",{key:c.key,type:"replace",attributes:c.attributes}),this}}function TA(n,e,o){n.prototype[e]=function(r,l){let c;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Me(`Graph.${e}: 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 d=""+r,p=""+l;if(l=arguments[2],c=_i(this,d,p,o),!c)throw new pe(`Graph.${e}: could not find an edge for the given path ("${d}" - "${p}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,c=this._edges.get(r),!c)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!bn(l))throw new ye(`Graph.${e}: provided attributes are not a plain object.`);return tn(c.attributes,l),this.emit("edgeAttributesUpdated",{key:c.key,type:"merge",attributes:c.attributes,data:l}),this}}function DA(n,e,o){n.prototype[e]=function(r,l){let c;if(this.type!=="mixed"&&o!=="mixed"&&o!==this.type)throw new Me(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Me(`Graph.${e}: 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 d=""+r,p=""+l;if(l=arguments[2],c=_i(this,d,p,o),!c)throw new pe(`Graph.${e}: could not find an edge for the given path ("${d}" - "${p}").`)}else{if(o!=="mixed")throw new Me(`Graph.${e}: 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,c=this._edges.get(r),!c)throw new pe(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof l!="function")throw new ye(`Graph.${e}: provided updater is not a function.`);return c.attributes=l(c.attributes),this.emit("edgeAttributesUpdated",{key:c.key,type:"update",attributes:c.attributes}),this}}const MA=[{name:n=>`get${n}Attribute`,attacher:SA},{name:n=>`get${n}Attributes`,attacher:AA},{name:n=>`has${n}Attribute`,attacher:_A},{name:n=>`set${n}Attribute`,attacher:CA},{name:n=>`update${n}Attribute`,attacher:EA},{name:n=>`remove${n}Attribute`,attacher:NA},{name:n=>`replace${n}Attributes`,attacher:kA},{name:n=>`merge${n}Attributes`,attacher:TA},{name:n=>`update${n}Attributes`,attacher:DA}];function zA(n){MA.forEach(function({name:e,attacher:o}){o(n,e("Edge"),"mixed"),o(n,e("DirectedEdge"),"directed"),o(n,e("UndirectedEdge"),"undirected")})}const OA=[{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 RA(n,e,o,r){let l=!1;for(const c in e){if(c===r)continue;const d=e[c];if(l=o(d.key,d.attributes,d.source.key,d.target.key,d.source.attributes,d.target.attributes,d.undirected),n&&l)return d.key}}function jA(n,e,o,r){let l,c,d,p=!1;for(const m in e)if(m!==r){l=e[m];do{if(c=l.source,d=l.target,p=o(l.key,l.attributes,c.key,d.key,c.attributes,d.attributes,l.undirected),n&&p)return l.key;l=l.next}while(l!==void 0)}}function Eh(n,e){const o=Object.keys(n),r=o.length;let l,c=0;return{[Symbol.iterator](){return this},next(){do if(l)l=l.next;else{if(c>=r)return{done:!0};const d=o[c++];if(d===e){l=void 0;continue}l=n[d]}while(!l);return{done:!1,value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected}}}}}function LA(n,e,o,r){const l=e[o];if(!l)return;const c=l.source,d=l.target;if(r(l.key,l.attributes,c.key,d.key,c.attributes,d.attributes,l.undirected)&&n)return l.key}function UA(n,e,o,r){let l=e[o];if(!l)return;let c=!1;do{if(c=r(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),n&&c)return l.key;l=l.next}while(l!==void 0)}function Nh(n,e){let o=n[e];if(o.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!o)return{done:!0};const l={edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected};return o=o.next,{done:!1,value:l}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected}})}}}function GA(n,e){if(n.size===0)return[];if(e==="mixed"||e===n.type)return Array.from(n._edges.keys());const o=e==="undirected"?n.undirectedSize:n.directedSize,r=new Array(o),l=e==="undirected",c=n._edges.values();let d=0,p,m;for(;p=c.next(),p.done!==!0;)m=p.value,m.undirected===l&&(r[d++]=m.key);return r}function ab(n,e,o,r){if(e.size===0)return;const l=o!=="mixed"&&o!==e.type,c=o==="undirected";let d,p,m=!1;const h=e._edges.values();for(;d=h.next(),d.done!==!0;){if(p=d.value,l&&p.undirected!==c)continue;const{key:g,attributes:y,source:v,target:w}=p;if(m=r(g,y,v.key,w.key,v.attributes,w.attributes,p.undirected),n&&m)return g}}function BA(n,e){if(n.size===0)return rs();const o=e!=="mixed"&&e!==n.type,r=e==="undirected",l=n._edges.values();return{[Symbol.iterator](){return this},next(){let c,d;for(;;){if(c=l.next(),c.done)return c;if(d=c.value,!(o&&d.undirected!==r))break}return{value:{edge:d.key,attributes:d.attributes,source:d.source.key,target:d.target.key,sourceAttributes:d.source.attributes,targetAttributes:d.target.attributes,undirected:d.undirected},done:!1}}}}function Ap(n,e,o,r,l,c){const d=e?jA:RA;let p;if(o!=="undirected"&&(r!=="out"&&(p=d(n,l.in,c),n&&p)||r!=="in"&&(p=d(n,l.out,c,r?void 0:l.key),n&&p))||o!=="directed"&&(p=d(n,l.undirected,c),n&&p))return p}function HA(n,e,o,r){const l=[];return Ap(!1,n,e,o,r,function(c){l.push(c)}),l}function $A(n,e,o){let r=rs();return n!=="undirected"&&(e!=="out"&&typeof o.in<"u"&&(r=ko(r,Eh(o.in))),e!=="in"&&typeof o.out<"u"&&(r=ko(r,Eh(o.out,e?void 0:o.key)))),n!=="directed"&&typeof o.undirected<"u"&&(r=ko(r,Eh(o.undirected))),r}function _p(n,e,o,r,l,c,d){const p=o?UA:LA;let m;if(e!=="undirected"&&(typeof l.in<"u"&&r!=="out"&&(m=p(n,l.in,c,d),n&&m)||typeof l.out<"u"&&r!=="in"&&(r||l.key!==c)&&(m=p(n,l.out,c,d),n&&m))||e!=="directed"&&typeof l.undirected<"u"&&(m=p(n,l.undirected,c,d),n&&m))return m}function YA(n,e,o,r,l){const c=[];return _p(!1,n,e,o,r,l,function(d){c.push(d)}),c}function qA(n,e,o,r){let l=rs();return n!=="undirected"&&(typeof o.in<"u"&&e!=="out"&&r in o.in&&(l=ko(l,Nh(o.in,r))),typeof o.out<"u"&&e!=="in"&&r in o.out&&(e||o.key!==r)&&(l=ko(l,Nh(o.out,r)))),n!=="directed"&&typeof o.undirected<"u"&&r in o.undirected&&(l=ko(l,Nh(o.undirected,r))),l}function VA(n,e){const{name:o,type:r,direction:l}=e;n.prototype[o]=function(c,d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return GA(this,r);if(arguments.length===1){c=""+c;const p=this._nodes.get(c);if(typeof p>"u")throw new pe(`Graph.${o}: could not find the "${c}" node in the graph.`);return HA(this.multi,r==="mixed"?this.type:r,l,p)}if(arguments.length===2){c=""+c,d=""+d;const p=this._nodes.get(c);if(!p)throw new pe(`Graph.${o}:  could not find the "${c}" source node in the graph.`);if(!this._nodes.has(d))throw new pe(`Graph.${o}:  could not find the "${d}" target node in the graph.`);return YA(r,this.multi,l,p,d)}throw new ye(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function XA(n,e){const{name:o,type:r,direction:l}=e,c="forEach"+o[0].toUpperCase()+o.slice(1,-1);n.prototype[c]=function(h,g,y){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return y=h,ab(!1,this,r,y);if(arguments.length===2){h=""+h,y=g;const v=this._nodes.get(h);if(typeof v>"u")throw new pe(`Graph.${c}: could not find the "${h}" node in the graph.`);return Ap(!1,this.multi,r==="mixed"?this.type:r,l,v,y)}if(arguments.length===3){h=""+h,g=""+g;const v=this._nodes.get(h);if(!v)throw new pe(`Graph.${c}:  could not find the "${h}" source node in the graph.`);if(!this._nodes.has(g))throw new pe(`Graph.${c}:  could not find the "${g}" target node in the graph.`);return _p(!1,r,this.multi,l,v,g,y)}throw new ye(`Graph.${c}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const d="map"+o[0].toUpperCase()+o.slice(1);n.prototype[d]=function(){const h=Array.prototype.slice.call(arguments),g=h.pop();let y;if(h.length===0){let v=0;r!=="directed"&&(v+=this.undirectedSize),r!=="undirected"&&(v+=this.directedSize),y=new Array(v);let w=0;h.push((S,A,x,E,D,R,_)=>{y[w++]=g(S,A,x,E,D,R,_)})}else y=[],h.push((v,w,S,A,x,E,D)=>{y.push(g(v,w,S,A,x,E,D))});return this[c].apply(this,h),y};const p="filter"+o[0].toUpperCase()+o.slice(1);n.prototype[p]=function(){const h=Array.prototype.slice.call(arguments),g=h.pop(),y=[];return h.push((v,w,S,A,x,E,D)=>{g(v,w,S,A,x,E,D)&&y.push(v)}),this[c].apply(this,h),y};const m="reduce"+o[0].toUpperCase()+o.slice(1);n.prototype[m]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new ye(`Graph.${m}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new ye(`Graph.${m}: 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 g,y;h.length===2?(g=h[0],y=h[1],h=[]):h.length===3?(g=h[1],y=h[2],h=[h[0]]):h.length===4&&(g=h[2],y=h[3],h=[h[0],h[1]]);let v=y;return h.push((w,S,A,x,E,D,R)=>{v=g(v,w,S,A,x,E,D,R)}),this[c].apply(this,h),v}}function KA(n,e){const{name:o,type:r,direction:l}=e,c="find"+o[0].toUpperCase()+o.slice(1,-1);n.prototype[c]=function(m,h,g){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return g=m,ab(!0,this,r,g);if(arguments.length===2){m=""+m,g=h;const y=this._nodes.get(m);if(typeof y>"u")throw new pe(`Graph.${c}: could not find the "${m}" node in the graph.`);return Ap(!0,this.multi,r==="mixed"?this.type:r,l,y,g)}if(arguments.length===3){m=""+m,h=""+h;const y=this._nodes.get(m);if(!y)throw new pe(`Graph.${c}:  could not find the "${m}" source node in the graph.`);if(!this._nodes.has(h))throw new pe(`Graph.${c}:  could not find the "${h}" target node in the graph.`);return _p(!0,r,this.multi,l,y,h,g)}throw new ye(`Graph.${c}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const d="some"+o[0].toUpperCase()+o.slice(1,-1);n.prototype[d]=function(){const m=Array.prototype.slice.call(arguments),h=m.pop();return m.push((y,v,w,S,A,x,E)=>h(y,v,w,S,A,x,E)),!!this[c].apply(this,m)};const p="every"+o[0].toUpperCase()+o.slice(1,-1);n.prototype[p]=function(){const m=Array.prototype.slice.call(arguments),h=m.pop();return m.push((y,v,w,S,A,x,E)=>!h(y,v,w,S,A,x,E)),!this[c].apply(this,m)}}function QA(n,e){const{name:o,type:r,direction:l}=e,c=o.slice(0,-1)+"Entries";n.prototype[c]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return rs();if(!arguments.length)return BA(this,r);if(arguments.length===1){d=""+d;const m=this._nodes.get(d);if(!m)throw new pe(`Graph.${c}: could not find the "${d}" node in the graph.`);return $A(r,l,m)}if(arguments.length===2){d=""+d,p=""+p;const m=this._nodes.get(d);if(!m)throw new pe(`Graph.${c}:  could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new pe(`Graph.${c}:  could not find the "${p}" target node in the graph.`);return qA(r,l,m,p)}throw new ye(`Graph.${c}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function ZA(n){OA.forEach(e=>{VA(n,e),XA(n,e),KA(n,e),QA(n,e)})}const IA=[{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 Uu(){this.A=null,this.B=null}Uu.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};Uu.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function ol(n,e,o,r,l){for(const c in r){const d=r[c],p=d.source,m=d.target,h=p===o?m:p;if(e&&e.has(h.key))continue;const g=l(h.key,h.attributes);if(n&&g)return h.key}}function Cp(n,e,o,r,l){if(e!=="mixed"){if(e==="undirected")return ol(n,null,r,r.undirected,l);if(typeof o=="string")return ol(n,null,r,r[o],l)}const c=new Uu;let d;if(e!=="undirected"){if(o!=="out"){if(d=ol(n,null,r,r.in,l),n&&d)return d;c.wrap(r.in)}if(o!=="in"){if(d=ol(n,c,r,r.out,l),n&&d)return d;c.wrap(r.out)}}if(e!=="directed"&&(d=ol(n,c,r,r.undirected,l),n&&d))return d}function FA(n,e,o){if(n!=="mixed"){if(n==="undirected")return Object.keys(o.undirected);if(typeof e=="string")return Object.keys(o[e])}const r=[];return Cp(!1,n,e,o,function(l){r.push(l)}),r}function rl(n,e,o){const r=Object.keys(o),l=r.length;let c=0;return{[Symbol.iterator](){return this},next(){let d=null;do{if(c>=l)return n&&n.wrap(o),{done:!0};const p=o[r[c++]],m=p.source,h=p.target;if(d=m===e?h:m,n&&n.has(d.key)){d=null;continue}}while(d===null);return{done:!1,value:{neighbor:d.key,attributes:d.attributes}}}}}function PA(n,e,o){if(n!=="mixed"){if(n==="undirected")return rl(null,o,o.undirected);if(typeof e=="string")return rl(null,o,o[e])}let r=rs();const l=new Uu;return n!=="undirected"&&(e!=="out"&&(r=ko(r,rl(l,o,o.in))),e!=="in"&&(r=ko(r,rl(l,o,o.out)))),n!=="directed"&&(r=ko(r,rl(l,o,o.undirected))),r}function JA(n,e){const{name:o,type:r,direction:l}=e;n.prototype[o]=function(c){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new pe(`Graph.${o}: could not find the "${c}" node in the graph.`);return FA(r==="mixed"?this.type:r,l,d)}}function WA(n,e){const{name:o,type:r,direction:l}=e,c="forEach"+o[0].toUpperCase()+o.slice(1,-1);n.prototype[c]=function(h,g){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;h=""+h;const y=this._nodes.get(h);if(typeof y>"u")throw new pe(`Graph.${c}: could not find the "${h}" node in the graph.`);Cp(!1,r==="mixed"?this.type:r,l,y,g)};const d="map"+o[0].toUpperCase()+o.slice(1);n.prototype[d]=function(h,g){const y=[];return this[c](h,(v,w)=>{y.push(g(v,w))}),y};const p="filter"+o[0].toUpperCase()+o.slice(1);n.prototype[p]=function(h,g){const y=[];return this[c](h,(v,w)=>{g(v,w)&&y.push(v)}),y};const m="reduce"+o[0].toUpperCase()+o.slice(1);n.prototype[m]=function(h,g,y){if(arguments.length<3)throw new ye(`Graph.${m}: 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=y;return this[c](h,(w,S)=>{v=g(v,w,S)}),v}}function e3(n,e){const{name:o,type:r,direction:l}=e,c=o[0].toUpperCase()+o.slice(1,-1),d="find"+c;n.prototype[d]=function(h,g){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;h=""+h;const y=this._nodes.get(h);if(typeof y>"u")throw new pe(`Graph.${d}: could not find the "${h}" node in the graph.`);return Cp(!0,r==="mixed"?this.type:r,l,y,g)};const p="some"+c;n.prototype[p]=function(h,g){return!!this[d](h,g)};const m="every"+c;n.prototype[m]=function(h,g){return!this[d](h,(v,w)=>!g(v,w))}}function t3(n,e){const{name:o,type:r,direction:l}=e,c=o.slice(0,-1)+"Entries";n.prototype[c]=function(d){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return rs();d=""+d;const p=this._nodes.get(d);if(typeof p>"u")throw new pe(`Graph.${c}: could not find the "${d}" node in the graph.`);return PA(r==="mixed"?this.type:r,l,p)}}function n3(n){IA.forEach(e=>{JA(n,e),WA(n,e),e3(n,e),t3(n,e)})}function eu(n,e,o,r,l){const c=r._nodes.values(),d=r.type;let p,m,h,g,y,v;for(;p=c.next(),p.done!==!0;){let w=!1;if(m=p.value,d!=="undirected"){g=m.out;for(h in g){y=g[h];do v=y.target,w=!0,l(m.key,v.key,m.attributes,v.attributes,y.key,y.attributes,y.undirected),y=y.next;while(y)}}if(d!=="directed"){g=m.undirected;for(h in g)if(!(e&&m.key>h)){y=g[h];do v=y.target,v.key!==h&&(v=y.source),w=!0,l(m.key,v.key,m.attributes,v.attributes,y.key,y.attributes,y.undirected),y=y.next;while(y)}}o&&!w&&l(m.key,null,m.attributes,null,null,null,null)}}function i3(n,e){const o={key:n};return W1(e.attributes)||(o.attributes=tn({},e.attributes)),o}function o3(n,e,o){const r={key:e,source:o.source.key,target:o.target.key};return W1(o.attributes)||(r.attributes=tn({},o.attributes)),n==="mixed"&&o.undirected&&(r.undirected=!0),r}function r3(n){if(!bn(n))throw new ye('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new ye("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!bn(n.attributes)||n.attributes===null))throw new ye("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function a3(n){if(!bn(n))throw new ye('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new ye("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new ye("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!bn(n.attributes)||n.attributes===null))throw new ye("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new ye("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const s3=cA(),l3=new Set(["directed","undirected","mixed"]),Rv=new Set(["domain","_events","_eventsCount","_maxListeners"]),c3=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],u3={allowSelfLoops:!0,multi:!1,type:"mixed"};function d3(n,e,o){if(o&&!bn(o))throw new ye(`Graph.addNode: invalid attributes. Expecting an object but got "${o}"`);if(e=""+e,o=o||{},n._nodes.has(e))throw new Me(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new n.NodeDataClass(e,o);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:o}),r}function jv(n,e,o){const r=new n.NodeDataClass(e,o);return n._nodes.set(e,r),n.emit("nodeAdded",{key:e,attributes:o}),r}function sb(n,e,o,r,l,c,d,p){if(!r&&n.type==="undirected")throw new Me(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new Me(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(p&&!bn(p))throw new ye(`Graph.${e}: invalid attributes. Expecting an object but got "${p}"`);if(c=""+c,d=""+d,p=p||{},!n.allowSelfLoops&&c===d)throw new Me(`Graph.${e}: source & target are the same ("${c}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const m=n._nodes.get(c),h=n._nodes.get(d);if(!m)throw new pe(`Graph.${e}: source node "${c}" not found.`);if(!h)throw new pe(`Graph.${e}: target node "${d}" not found.`);const g={key:null,undirected:r,source:c,target:d,attributes:p};if(o)l=n._edgeKeyGenerator();else if(l=""+l,n._edges.has(l))throw new Me(`Graph.${e}: the "${l}" edge already exists in the graph.`);if(!n.multi&&(r?typeof m.undirected[d]<"u":typeof m.out[d]<"u"))throw new Me(`Graph.${e}: an edge linking "${c}" to "${d}" 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 y=new as(r,l,m,h,p);n._edges.set(l,y);const v=c===d;return r?(m.undirectedDegree++,h.undirectedDegree++,v&&(m.undirectedLoops++,n._undirectedSelfLoopCount++)):(m.outDegree++,h.inDegree++,v&&(m.directedLoops++,n._directedSelfLoopCount++)),n.multi?y.attachMulti():y.attach(),r?n._undirectedSize++:n._directedSize++,g.key=l,n.emit("edgeAdded",g),l}function f3(n,e,o,r,l,c,d,p,m){if(!r&&n.type==="undirected")throw new Me(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&n.type==="directed")throw new Me(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(p){if(m){if(typeof p!="function")throw new ye(`Graph.${e}: invalid updater function. Expecting a function but got "${p}"`)}else if(!bn(p))throw new ye(`Graph.${e}: invalid attributes. Expecting an object but got "${p}"`)}c=""+c,d=""+d;let h;if(m&&(h=p,p=void 0),!n.allowSelfLoops&&c===d)throw new Me(`Graph.${e}: source & target are the same ("${c}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let g=n._nodes.get(c),y=n._nodes.get(d),v,w;if(!o&&(v=n._edges.get(l),v)){if((v.source.key!==c||v.target.key!==d)&&(!r||v.source.key!==d||v.target.key!==c))throw new Me(`Graph.${e}: inconsistency detected when attempting to merge the "${l}" edge with "${c}" source & "${d}" target vs. ("${v.source.key}", "${v.target.key}").`);w=v}if(!w&&!n.multi&&g&&(w=r?g.undirected[d]:g.out[d]),w){const D=[w.key,!1,!1,!1];if(m?!h:!p)return D;if(m){const R=w.attributes;w.attributes=h(R),n.emit("edgeAttributesUpdated",{type:"replace",key:w.key,attributes:w.attributes})}else tn(w.attributes,p),n.emit("edgeAttributesUpdated",{type:"merge",key:w.key,attributes:w.attributes,data:p});return D}p=p||{},m&&h&&(p=h(p));const S={key:null,undirected:r,source:c,target:d,attributes:p};if(o)l=n._edgeKeyGenerator();else if(l=""+l,n._edges.has(l))throw new Me(`Graph.${e}: the "${l}" edge already exists in the graph.`);let A=!1,x=!1;g||(g=jv(n,c,{}),A=!0,c===d&&(y=g,x=!0)),y||(y=jv(n,d,{}),x=!0),v=new as(r,l,g,y,p),n._edges.set(l,v);const E=c===d;return r?(g.undirectedDegree++,y.undirectedDegree++,E&&(g.undirectedLoops++,n._undirectedSelfLoopCount++)):(g.outDegree++,y.inDegree++,E&&(g.directedLoops++,n._directedSelfLoopCount++)),n.multi?v.attachMulti():v.attach(),r?n._undirectedSize++:n._directedSize++,S.key=l,n.emit("edgeAdded",S),[l,!0,A,x]}function Ga(n,e){n._edges.delete(e.key);const{source:o,target:r,attributes:l}=e,c=e.undirected,d=o===r;c?(o.undirectedDegree--,r.undirectedDegree--,d&&(o.undirectedLoops--,n._undirectedSelfLoopCount--)):(o.outDegree--,r.inDegree--,d&&(o.directedLoops--,n._directedSelfLoopCount--)),n.multi?e.detachMulti():e.detach(),c?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:e.key,attributes:l,source:o.key,target:r.key,undirected:c})}class We extends sA.EventEmitter{constructor(e){if(super(),e=tn({},u3,e),typeof e.multi!="boolean")throw new ye(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!l3.has(e.type))throw new ye(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new ye(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const o=e.type==="mixed"?eb:e.type==="directed"?tb:nb;bi(this,"NodeDataClass",o);const r="geid_"+s3()+"_";let l=0;const c=()=>{let d;do d=r+l++;while(this._edges.has(d));return d};bi(this,"_attributes",{}),bi(this,"_nodes",new Map),bi(this,"_edges",new Map),bi(this,"_directedSize",0),bi(this,"_undirectedSize",0),bi(this,"_directedSelfLoopCount",0),bi(this,"_undirectedSelfLoopCount",0),bi(this,"_edgeKeyGenerator",c),bi(this,"_options",e),Rv.forEach(d=>bi(this,d,this[d])),Mi(this,"order",()=>this._nodes.size),Mi(this,"size",()=>this._edges.size),Mi(this,"directedSize",()=>this._directedSize),Mi(this,"undirectedSize",()=>this._undirectedSize),Mi(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Mi(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Mi(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Mi(this,"multi",this._options.multi),Mi(this,"type",this._options.type),Mi(this,"allowSelfLoops",this._options.allowSelfLoops),Mi(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,o){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+e,l=this._edges.get(r);return!!l&&!l.undirected}else if(arguments.length===2){e=""+e,o=""+o;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(o):!1}throw new ye(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,o){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+e,l=this._edges.get(r);return!!l&&l.undirected}else if(arguments.length===2){e=""+e,o=""+o;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(o):!1}throw new ye(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,o){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,o=""+o;const r=this._nodes.get(e);return r?typeof r.out<"u"&&r.out.hasOwnProperty(o)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(o):!1}throw new ye(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,o){if(this.type==="undirected")return;if(e=""+e,o=""+o,this.multi)throw new Me("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(e);if(!r)throw new pe(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(o))throw new pe(`Graph.directedEdge: could not find the "${o}" target node in the graph.`);const l=r.out&&r.out[o]||void 0;if(l)return l.key}undirectedEdge(e,o){if(this.type==="directed")return;if(e=""+e,o=""+o,this.multi)throw new Me("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(e);if(!r)throw new pe(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(o))throw new pe(`Graph.undirectedEdge: could not find the "${o}" target node in the graph.`);const l=r.undirected&&r.undirected[o]||void 0;if(l)return l.key}edge(e,o){if(this.multi)throw new Me("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(o))throw new pe(`Graph.edge: could not find the "${o}" target node in the graph.`);const l=r.out&&r.out[o]||r.undirected&&r.undirected[o]||void 0;if(l)return l.key}areDirectedNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:o in r.in||o in r.out}areOutNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:o in r.out}areInNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:o in r.in}areUndirectedNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:o in r.undirected}areNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(o in r.in||o in r.out)||this.type!=="directed"&&o in r.undirected}areInboundNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&o in r.in||this.type!=="directed"&&o in r.undirected}areOutboundNeighbors(e,o){e=""+e,o=""+o;const r=this._nodes.get(e);if(!r)throw new pe(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&o in r.out||this.type!=="directed"&&o in r.undirected}inDegree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:o.inDegree}outDegree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:o.outDegree}directedDegree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:o.inDegree+o.outDegree}undirectedDegree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:o.undirectedDegree}inboundDegree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=o.undirectedDegree),this.type!=="undirected"&&(r+=o.inDegree),r}outboundDegree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=o.undirectedDegree),this.type!=="undirected"&&(r+=o.outDegree),r}degree(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=o.undirectedDegree),this.type!=="undirected"&&(r+=o.inDegree+o.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:o.inDegree-o.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:o.outDegree-o.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:o.inDegree+o.outDegree-o.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:o.undirectedDegree-o.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,l=0;return this.type!=="directed"&&(r+=o.undirectedDegree,l+=o.undirectedLoops*2),this.type!=="undirected"&&(r+=o.inDegree,l+=o.directedLoops),r-l}outboundDegreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,l=0;return this.type!=="directed"&&(r+=o.undirectedDegree,l+=o.undirectedLoops*2),this.type!=="undirected"&&(r+=o.outDegree,l+=o.directedLoops),r-l}degreeWithoutSelfLoops(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,l=0;return this.type!=="directed"&&(r+=o.undirectedDegree,l+=o.undirectedLoops*2),this.type!=="undirected"&&(r+=o.inDegree+o.outDegree,l+=o.directedLoops*2),r-l}source(e){e=""+e;const o=this._edges.get(e);if(!o)throw new pe(`Graph.source: could not find the "${e}" edge in the graph.`);return o.source.key}target(e){e=""+e;const o=this._edges.get(e);if(!o)throw new pe(`Graph.target: could not find the "${e}" edge in the graph.`);return o.target.key}extremities(e){e=""+e;const o=this._edges.get(e);if(!o)throw new pe(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[o.source.key,o.target.key]}opposite(e,o){e=""+e,o=""+o;const r=this._edges.get(o);if(!r)throw new pe(`Graph.opposite: could not find the "${o}" edge in the graph.`);const l=r.source.key,c=r.target.key;if(e===l)return c;if(e===c)return l;throw new pe(`Graph.opposite: the "${e}" node is not attached to the "${o}" edge (${l}, ${c}).`)}hasExtremity(e,o){e=""+e,o=""+o;const r=this._edges.get(e);if(!r)throw new pe(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===o||r.target.key===o}isUndirected(e){e=""+e;const o=this._edges.get(e);if(!o)throw new pe(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return o.undirected}isDirected(e){e=""+e;const o=this._edges.get(e);if(!o)throw new pe(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!o.undirected}isSelfLoop(e){e=""+e;const o=this._edges.get(e);if(!o)throw new pe(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return o.source===o.target}addNode(e,o){return d3(this,e,o).key}mergeNode(e,o){if(o&&!bn(o))throw new ye(`Graph.mergeNode: invalid attributes. Expecting an object but got "${o}"`);e=""+e,o=o||{};let r=this._nodes.get(e);return r?(o&&(tn(r.attributes,o),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.attributes,data:o})),[e,!1]):(r=new this.NodeDataClass(e,o),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:o}),[e,!0])}updateNode(e,o){if(o&&typeof o!="function")throw new ye(`Graph.updateNode: invalid updater function. Expecting a function but got "${o}"`);e=""+e;let r=this._nodes.get(e);if(r){if(o){const c=r.attributes;r.attributes=o(c),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const l=o?o({}):{};return r=new this.NodeDataClass(e,l),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:l}),[e,!0]}dropNode(e){e=""+e;const o=this._nodes.get(e);if(!o)throw new pe(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const l in o.out){r=o.out[l];do Ga(this,r),r=r.next;while(r)}for(const l in o.in){r=o.in[l];do Ga(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const l in o.undirected){r=o.undirected[l];do Ga(this,r),r=r.next;while(r)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:o.attributes})}dropEdge(e){let o;if(arguments.length>1){const r=""+arguments[0],l=""+arguments[1];if(o=_i(this,r,l,this.type),!o)throw new pe(`Graph.dropEdge: could not find the "${r}" -> "${l}" edge in the graph.`)}else if(e=""+e,o=this._edges.get(e),!o)throw new pe(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Ga(this,o),this}dropDirectedEdge(e,o){if(arguments.length<2)throw new Me("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 Me("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.");e=""+e,o=""+o;const r=_i(this,e,o,"directed");if(!r)throw new pe(`Graph.dropDirectedEdge: could not find a "${e}" -> "${o}" edge in the graph.`);return Ga(this,r),this}dropUndirectedEdge(e,o){if(arguments.length<2)throw new Me("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 Me("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=_i(this,e,o,"undirected");if(!r)throw new pe(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${o}" edge in the graph.`);return Ga(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let o;for(;o=e.next(),o.done!==!0;)o.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,o){return this._attributes[e]=o,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,o){if(typeof o!="function")throw new ye("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=o(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!bn(e))throw new ye("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!bn(e))throw new ye("Graph.mergeAttributes: provided attributes are not a plain object.");return tn(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new ye("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,o){if(typeof e!="function")throw new ye("Graph.updateEachNodeAttributes: expecting an updater function.");if(o&&!Ov(o))throw new ye("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let l,c;for(;l=r.next(),l.done!==!0;)c=l.value,c.attributes=e(c.key,c.attributes);this.emit("eachNodeAttributesUpdated",{hints:o||null})}updateEachEdgeAttributes(e,o){if(typeof e!="function")throw new ye("Graph.updateEachEdgeAttributes: expecting an updater function.");if(o&&!Ov(o))throw new ye("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let l,c,d,p;for(;l=r.next(),l.done!==!0;)c=l.value,d=c.source,p=c.target,c.attributes=e(c.key,c.attributes,d.key,p.key,d.attributes,p.attributes,c.undirected);this.emit("eachEdgeAttributesUpdated",{hints:o||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new ye("Graph.forEachAdjacencyEntry: expecting a callback.");eu(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ye("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");eu(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new ye("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");eu(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new ye("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");eu(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!="function")throw new ye("Graph.forEachNode: expecting a callback.");const o=this._nodes.values();let r,l;for(;r=o.next(),r.done!==!0;)l=r.value,e(l.key,l.attributes)}findNode(e){if(typeof e!="function")throw new ye("Graph.findNode: expecting a callback.");const o=this._nodes.values();let r,l;for(;r=o.next(),r.done!==!0;)if(l=r.value,e(l.key,l.attributes))return l.key}mapNodes(e){if(typeof e!="function")throw new ye("Graph.mapNode: expecting a callback.");const o=this._nodes.values();let r,l;const c=new Array(this.order);let d=0;for(;r=o.next(),r.done!==!0;)l=r.value,c[d++]=e(l.key,l.attributes);return c}someNode(e){if(typeof e!="function")throw new ye("Graph.someNode: expecting a callback.");const o=this._nodes.values();let r,l;for(;r=o.next(),r.done!==!0;)if(l=r.value,e(l.key,l.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new ye("Graph.everyNode: expecting a callback.");const o=this._nodes.values();let r,l;for(;r=o.next(),r.done!==!0;)if(l=r.value,!e(l.key,l.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new ye("Graph.filterNodes: expecting a callback.");const o=this._nodes.values();let r,l;const c=[];for(;r=o.next(),r.done!==!0;)l=r.value,e(l.key,l.attributes)&&c.push(l.key);return c}reduceNodes(e,o){if(typeof e!="function")throw new ye("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new ye("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=o;const l=this._nodes.values();let c,d;for(;c=l.next(),c.done!==!0;)d=c.value,r=e(r,d.key,d.attributes);return r}nodeEntries(){const e=this._nodes.values();return{[Symbol.iterator](){return this},next(){const o=e.next();if(o.done)return o;const r=o.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const e=new Array(this._nodes.size);let o=0;this._nodes.forEach((l,c)=>{e[o++]=i3(c,l)});const r=new Array(this._edges.size);return o=0,this._edges.forEach((l,c)=>{r[o++]=o3(this.type,c,l)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,o=!1){if(e instanceof We)return e.forEachNode((m,h)=>{o?this.mergeNode(m,h):this.addNode(m,h)}),e.forEachEdge((m,h,g,y,v,w,S)=>{o?S?this.mergeUndirectedEdgeWithKey(m,g,y,h):this.mergeDirectedEdgeWithKey(m,g,y,h):S?this.addUndirectedEdgeWithKey(m,g,y,h):this.addDirectedEdgeWithKey(m,g,y,h)}),this;if(!bn(e))throw new ye("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!bn(e.attributes))throw new ye("Graph.import: invalid attributes. Expecting a plain object.");o?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,l,c,d,p;if(e.nodes){if(c=e.nodes,!Array.isArray(c))throw new ye("Graph.import: invalid nodes. Expecting an array.");for(r=0,l=c.length;r<l;r++){d=c[r],r3(d);const{key:m,attributes:h}=d;o?this.mergeNode(m,h):this.addNode(m,h)}}if(e.edges){let m=!1;if(this.type==="undirected"&&(m=!0),c=e.edges,!Array.isArray(c))throw new ye("Graph.import: invalid edges. Expecting an array.");for(r=0,l=c.length;r<l;r++){p=c[r],a3(p);const{source:h,target:g,attributes:y,undirected:v=m}=p;let w;"key"in p?(w=o?v?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:v?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,w.call(this,p.key,h,g,y)):(w=o?v?this.mergeUndirectedEdge:this.mergeDirectedEdge:v?this.addUndirectedEdge:this.addDirectedEdge,w.call(this,h,g,y))}}return this}nullCopy(e){const o=new We(tn({},this._options,e));return o.replaceAttributes(tn({},this.getAttributes())),o}emptyCopy(e){const o=this.nullCopy(e);return this._nodes.forEach((r,l)=>{const c=tn({},r.attributes);r=new o.NodeDataClass(l,c),o._nodes.set(l,r)}),o}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new Me(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new Me("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 e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Me("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 o=this.emptyCopy(e),r=this._edges.values();let l,c;for(;l=r.next(),l.done!==!0;)c=l.value,sb(o,"copy",!1,c.undirected,c.key,c.source.key,c.target.key,tn({},c.attributes));return o}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((c,d)=>{e[d]=c.attributes});const o={},r={};this._edges.forEach((c,d)=>{const p=c.undirected?"--":"->";let m="",h=c.source.key,g=c.target.key,y;c.undirected&&h>g&&(y=h,h=g,g=y);const v=`(${h})${p}(${g})`;d.startsWith("geid_")?this.multi&&(typeof r[v]>"u"?r[v]=0:r[v]++,m+=`${r[v]}. `):m+=`[${d}]: `,m+=v,o[m]=c.attributes});const l={};for(const c in this)this.hasOwnProperty(c)&&!Rv.has(c)&&typeof this[c]!="function"&&typeof c!="symbol"&&(l[c]=this[c]);return l.attributes=this._attributes,l.nodes=e,l.edges=o,bi(l,"constructor",this.constructor),l}}typeof Symbol<"u"&&(We.prototype[Symbol.for("nodejs.util.inspect.custom")]=We.prototype.inspect);c3.forEach(n=>{["add","merge","update"].forEach(e=>{const o=n.name(e),r=e==="add"?sb:f3;n.generateKey?We.prototype[o]=function(l,c,d){return r(this,o,!0,(n.type||this.type)==="undirected",null,l,c,d,e==="update")}:We.prototype[o]=function(l,c,d,p){return r(this,o,!1,(n.type||this.type)==="undirected",l,c,d,p,e==="update")}})});xA(We);zA(We);ZA(We);n3(We);class lb extends We{constructor(e){const o=tn({type:"directed"},e);if("multi"in o&&o.multi!==!1)throw new ye("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(o.type!=="directed")throw new ye('DirectedGraph.from: inconsistent "'+o.type+'" type in given options!');super(o)}}class cb extends We{constructor(e){const o=tn({type:"undirected"},e);if("multi"in o&&o.multi!==!1)throw new ye("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(o.type!=="undirected")throw new ye('UndirectedGraph.from: inconsistent "'+o.type+'" type in given options!');super(o)}}class ub extends We{constructor(e){const o=tn({multi:!0},e);if("multi"in o&&o.multi!==!0)throw new ye("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(o)}}class db extends We{constructor(e){const o=tn({type:"directed",multi:!0},e);if("multi"in o&&o.multi!==!0)throw new ye("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(o.type!=="directed")throw new ye('MultiDirectedGraph.from: inconsistent "'+o.type+'" type in given options!');super(o)}}class fb extends We{constructor(e){const o=tn({type:"undirected",multi:!0},e);if("multi"in o&&o.multi!==!0)throw new ye("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(o.type!=="undirected")throw new ye('MultiUndirectedGraph.from: inconsistent "'+o.type+'" type in given options!');super(o)}}function ss(n){n.from=function(e,o){const r=tn({},e.options,o),l=new n(r);return l.import(e),l}}ss(We);ss(lb);ss(cb);ss(ub);ss(db);ss(fb);We.Graph=We;We.DirectedGraph=lb;We.UndirectedGraph=cb;We.MultiGraph=ub;We.MultiDirectedGraph=db;We.MultiUndirectedGraph=fb;We.InvalidArgumentsGraphError=ye;We.NotFoundGraphError=pe;We.UsageGraphError=Me;const Eo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function hb(n){return"init"in n}function Fh(n){return!!n.write}function Lv(n){return"v"in n||"e"in n}function yu(n){if("e"in n)throw n.e;if((Eo?"production":void 0)!=="production"&&!("v"in n))throw new Error("[Bug] atom state is not initialized");return n.v}const vu=new WeakMap;function pb(n){var e;return bu(n)&&!!((e=vu.get(n))!=null&&e[0])}function h3(n){const e=vu.get(n);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(o=>o()))}function Ph(n,e){let o=vu.get(n);if(!o){o=[!0,new Set],vu.set(n,o);const r=()=>{o[0]=!1};n.then(r,r)}o[1].add(e)}function bu(n){return typeof(n==null?void 0:n.then)=="function"}function mb(n,e,o){if(!o.p.has(n)){o.p.add(n);const r=()=>o.p.delete(n);e.then(r,r)}}function gb(n,e,o){var r;const l=new Set;for(const c of((r=o.get(n))==null?void 0:r.t)||[])l.add(c);for(const c of e.p)l.add(c);return l}const p3=(n,e,...o)=>e.read(...o),m3=(n,e,...o)=>e.write(...o),g3=(n,e)=>{if(e.INTERNAL_onInit)return e.INTERNAL_onInit(n);if(e.unstable_onInit)return console.warn("[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit."),e.unstable_onInit(n)},y3=(n,e,o)=>{var r;return(r=e.onMount)==null?void 0:r.call(e,o)},v3=(n,e)=>{var o;const r=kn(n),l=r[0],c=r[6],d=r[9];if((Eo?"production":void 0)!=="production"&&!e)throw new Error("Atom is undefined or null");let p=l.get(e);return p||(p={d:new Map,p:new Set,n:0},l.set(e,p),(o=c.i)==null||o.call(c,e),d==null||d(n,e)),p},b3=n=>{const e=kn(n),o=e[1],r=e[3],l=e[4],c=e[5],d=e[6],p=e[13],m=[],h=g=>{try{g()}catch(y){m.push(y)}};do{d.f&&h(d.f);const g=new Set,y=g.add.bind(g);r.forEach(v=>{var w;return(w=o.get(v))==null?void 0:w.l.forEach(y)}),r.clear(),c.forEach(y),c.clear(),l.forEach(y),l.clear(),g.forEach(h),r.size&&p(n)}while(r.size||c.size||l.size);if(m.length)throw new AggregateError(m)},w3=n=>{const e=kn(n),o=e[1],r=e[2],l=e[3],c=e[11],d=e[14],p=e[17],m=[],h=new WeakSet,g=new WeakSet,y=Array.from(l);for(;y.length;){const v=y[y.length-1],w=c(n,v);if(g.has(v)){y.pop();continue}if(h.has(v)){if(r.get(v)===w.n)m.push([v,w]);else if((Eo?"production":void 0)!=="production"&&r.has(v))throw new Error("[Bug] invalidated atom exists");g.add(v),y.pop();continue}h.add(v);for(const S of gb(v,w,o))h.has(S)||y.push(S)}for(let v=m.length-1;v>=0;--v){const[w,S]=m[v];let A=!1;for(const x of S.d.keys())if(x!==w&&l.has(x)){A=!0;break}A&&(d(n,w),p(n,w)),r.delete(w)}},Jh=new WeakSet,x3=(n,e)=>{var o,r;const l=kn(n),c=l[1],d=l[2],p=l[3],m=l[6],h=l[7],g=l[11],y=l[12],v=l[13],w=l[14],S=l[16],A=l[17],x=g(n,e);if(Lv(x)){if(c.has(e)&&d.get(e)!==x.n)return x;let M=!1;for(const[$,L]of x.d)if(w(n,$).n!==L){M=!0;break}if(!M)return x}x.d.clear();let E=!0;function D(){c.has(e)&&(A(n,e),v(n),y(n))}function R(M){var $;if(M===e){const X=g(n,M);if(!Lv(X))if(hb(M))wu(n,M,M.init);else throw new Error("no atom init");return yu(X)}const L=w(n,M);try{return yu(L)}finally{x.d.set(M,L.n),pb(x.v)&&mb(e,x.v,L),c.has(e)&&(($=c.get(M))==null||$.t.add(e)),E||D()}}let _,N;const T={get signal(){return _||(_=new AbortController),_.signal},get setSelf(){return(Eo?"production":void 0)!=="production"&&!Fh(e)&&console.warn("setSelf function cannot be used with read-only atom"),!N&&Fh(e)&&(N=(...M)=>{if((Eo?"production":void 0)!=="production"&&E&&console.warn("setSelf function cannot be called in sync"),!E)try{return S(n,e,...M)}finally{v(n),y(n)}}),N}},O=x.n;try{(Eo?"production":void 0)!=="production"&&Jh.delete(n);const M=h(n,e,R,T);return(Eo?"production":void 0)!=="production"&&Jh.has(n)&&console.warn("Detected store mutation during atom read. This is not supported."),wu(n,e,M),bu(M)&&(Ph(M,()=>_==null?void 0:_.abort()),M.then(D,D)),(o=m.r)==null||o.call(m,e),x}catch(M){return delete x.v,x.e=M,++x.n,x}finally{E=!1,O!==x.n&&d.get(e)===O&&(d.set(e,x.n),p.add(e),(r=m.c)==null||r.call(m,e))}},S3=(n,e)=>{const o=kn(n),r=o[1],l=o[2],c=o[11],d=[e];for(;d.length;){const p=d.pop(),m=c(n,p);for(const h of gb(p,m,r)){const g=c(n,h);l.set(h,g.n),d.push(h)}}},yb=(n,e,...o)=>{const r=kn(n),l=r[3],c=r[6],d=r[8],p=r[11],m=r[12],h=r[13],g=r[14],y=r[15],v=r[17];let w=!0;const S=x=>yu(g(n,x)),A=(x,...E)=>{var D;const R=p(n,x);try{if(x===e){if(!hb(x))throw new Error("atom not writable");(Eo?"production":void 0)!=="production"&&Jh.add(n);const _=R.n,N=E[0];wu(n,x,N),v(n,x),_!==R.n&&(l.add(x),y(n,x),(D=c.c)==null||D.call(c,x));return}else return yb(n,x,...E)}finally{w||(h(n),m(n))}};try{return d(n,e,S,A,...o)}finally{w=!1}},A3=(n,e)=>{var o;const r=kn(n),l=r[1],c=r[3],d=r[6],p=r[11],m=r[15],h=r[18],g=r[19],y=p(n,e),v=l.get(e);if(v&&!pb(y.v)){for(const[w,S]of y.d)if(!v.d.has(w)){const A=p(n,w);h(n,w).t.add(e),v.d.add(w),S!==A.n&&(c.add(w),m(n,w),(o=d.c)==null||o.call(d,w))}for(const w of v.d)if(!y.d.has(w)){v.d.delete(w);const S=g(n,w);S==null||S.t.delete(e)}}},vb=(n,e)=>{var o;const r=kn(n),l=r[1],c=r[4],d=r[6],p=r[10],m=r[11],h=r[12],g=r[13],y=r[14],v=r[16],w=m(n,e);let S=l.get(e);if(!S){y(n,e);for(const A of w.d.keys())vb(n,A).t.add(e);if(S={l:new Set,d:new Set(w.d.keys()),t:new Set},l.set(e,S),Fh(e)){const A=()=>{let x=!0;const E=(...D)=>{try{return v(n,e,...D)}finally{x||(g(n),h(n))}};try{const D=p(n,e,E);D&&(S.u=()=>{x=!0;try{D()}finally{x=!1}})}finally{x=!1}};c.add(A)}(o=d.m)==null||o.call(d,e)}return S},_3=(n,e)=>{var o,r;const l=kn(n),c=l[1],d=l[5],p=l[6],m=l[11],h=l[19],g=m(n,e);let y=c.get(e);if(!y||y.l.size)return y;let v=!1;for(const w of y.t)if((o=c.get(w))!=null&&o.d.has(e)){v=!0;break}if(!v){y.u&&d.add(y.u),y=void 0,c.delete(e);for(const w of g.d.keys()){const S=h(n,w);S==null||S.t.delete(e)}(r=p.u)==null||r.call(p,e);return}return y},wu=(n,e,o)=>{const r=kn(n)[11],l=r(n,e),c="v"in l,d=l.v;if(bu(o))for(const p of l.d.keys())mb(e,o,r(n,p));l.v=o,delete l.e,(!c||!Object.is(d,l.v))&&(++l.n,bu(d)&&h3(d))},C3=(n,e)=>{const o=kn(n)[14];return yu(o(n,e))},E3=(n,e,...o)=>{const r=kn(n),l=r[12],c=r[13],d=r[16];try{return d(n,e,...o)}finally{c(n),l(n)}},N3=(n,e,o)=>{const r=kn(n),l=r[12],c=r[18],d=r[19],m=c(n,e).l;return m.add(o),l(n),()=>{m.delete(o),d(n,e),l(n)}},bb=new WeakMap,kn=n=>{const e=bb.get(n);if((Eo?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");return e};function k3(...n){const e={get(r){const l=kn(e)[21];return l(e,r)},set(r,...l){const c=kn(e)[22];return c(e,r,...l)},sub(r,l){const c=kn(e)[23];return c(e,r,l)}},o=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},p3,m3,g3,y3,v3,b3,w3,x3,S3,yb,A3,vb,_3,wu,C3,E3,N3,void 0].map((r,l)=>n[l]||r);return bb.set(e,Object.freeze(o)),e}const wb={};let T3=0;function K(n,e){const o=`atom${++T3}`,r={toString(){return(wb?"production":void 0)!=="production"&&this.debugLabel?o+":"+this.debugLabel:o}};return typeof n=="function"?r.read=n:(r.init=n,r.read=D3,r.write=M3),e&&(r.write=e),r}function D3(n){return n(this)}function M3(n,e,o){return e(this,typeof o=="function"?o(n(this)):o)}function z3(){return k3()}let al;function O3(){return al||(al=z3(),(wb?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=al),globalThis.__JOTAI_DEFAULT_STORE__!==al&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),al}const R3={},j3=ne.createContext(void 0);function Tl(n){return ne.useContext(j3)||O3()}const Wh=n=>typeof(n==null?void 0:n.then)=="function",ep=n=>{n.status||(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}))},L3=Ji.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(ep(n),n)}),kh=new WeakMap,Uv=(n,e)=>{let o=kh.get(n);return o||(o=new Promise((r,l)=>{let c=n;const d=h=>g=>{c===h&&r(g)},p=h=>g=>{c===h&&l(g)},m=()=>{try{const h=e();Wh(h)?(kh.set(h,o),c=h,h.then(d(h),p(h)),Ph(h,m)):r(h)}catch(h){l(h)}};n.then(d(n),p(n)),Ph(n,m)}),kh.set(n,o)),o};function he(n,e){const{delay:o,unstable_promiseStatus:r=!Ji.use}={},l=Tl(),[[c,d,p],m]=ne.useReducer(g=>{const y=l.get(n);return Object.is(g[0],y)&&g[1]===l&&g[2]===n?g:[y,l,n]},void 0,()=>[l.get(n),l,n]);let h=c;if((d!==l||p!==n)&&(m(),h=l.get(n)),ne.useEffect(()=>{const g=l.sub(n,()=>{if(r)try{const y=l.get(n);Wh(y)&&ep(Uv(y,()=>l.get(n)))}catch{}if(typeof o=="number"){setTimeout(m,o);return}m()});return m(),g},[l,n,o,r]),ne.useDebugValue(h),Wh(h)){const g=Uv(h,()=>l.get(n));return r&&ep(g),L3(g)}return h}function ge(n,e){const o=Tl();return ne.useCallback((...l)=>{if((R3?"production":void 0)!=="production"&&!("write"in n))throw new Error("not writable atom");return o.set(n,...l)},[o,n])}function Ci(n,e){return[he(n),ge(n)]}var tu={exports:{}},Th,Gv;function U3(){if(Gv)return Th;Gv=1;var n=1e3,e=n*60,o=e*60,r=o*24,l=r*7,c=r*365.25;Th=function(g,y){y=y||{};var v=typeof g;if(v==="string"&&g.length>0)return d(g);if(v==="number"&&isFinite(g))return y.long?m(g):p(g);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(g))};function d(g){if(g=String(g),!(g.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(g);if(y){var v=parseFloat(y[1]),w=(y[2]||"ms").toLowerCase();switch(w){case"years":case"year":case"yrs":case"yr":case"y":return v*c;case"weeks":case"week":case"w":return v*l;case"days":case"day":case"d":return v*r;case"hours":case"hour":case"hrs":case"hr":case"h":return v*o;case"minutes":case"minute":case"mins":case"min":case"m":return v*e;case"seconds":case"second":case"secs":case"sec":case"s":return v*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return v;default:return}}}}function p(g){var y=Math.abs(g);return y>=r?Math.round(g/r)+"d":y>=o?Math.round(g/o)+"h":y>=e?Math.round(g/e)+"m":y>=n?Math.round(g/n)+"s":g+"ms"}function m(g){var y=Math.abs(g);return y>=r?h(g,y,r,"day"):y>=o?h(g,y,o,"hour"):y>=e?h(g,y,e,"minute"):y>=n?h(g,y,n,"second"):g+" ms"}function h(g,y,v,w){var S=y>=v*1.5;return Math.round(g/v)+" "+w+(S?"s":"")}return Th}var Dh,Bv;function G3(){if(Bv)return Dh;Bv=1;function n(e){r.debug=r,r.default=r,r.coerce=h,r.disable=p,r.enable=c,r.enabled=m,r.humanize=U3(),r.destroy=g,Object.keys(e).forEach(y=>{r[y]=e[y]}),r.names=[],r.skips=[],r.formatters={};function o(y){let v=0;for(let w=0;w<y.length;w++)v=(v<<5)-v+y.charCodeAt(w),v|=0;return r.colors[Math.abs(v)%r.colors.length]}r.selectColor=o;function r(y){let v,w=null,S,A;function x(...E){if(!x.enabled)return;const D=x,R=Number(new Date),_=R-(v||R);D.diff=_,D.prev=v,D.curr=R,v=R,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let N=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(O,M)=>{if(O==="%%")return"%";N++;const $=r.formatters[M];if(typeof $=="function"){const L=E[N];O=$.call(D,L),E.splice(N,1),N--}return O}),r.formatArgs.call(D,E),(D.log||r.log).apply(D,E)}return x.namespace=y,x.useColors=r.useColors(),x.color=r.selectColor(y),x.extend=l,x.destroy=r.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(S!==r.namespaces&&(S=r.namespaces,A=r.enabled(y)),A),set:E=>{w=E}}),typeof r.init=="function"&&r.init(x),x}function l(y,v){const w=r(this.namespace+(typeof v>"u"?":":v)+y);return w.log=this.log,w}function c(y){r.save(y),r.namespaces=y,r.names=[],r.skips=[];const v=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const w of v)w[0]==="-"?r.skips.push(w.slice(1)):r.names.push(w)}function d(y,v){let w=0,S=0,A=-1,x=0;for(;w<y.length;)if(S<v.length&&(v[S]===y[w]||v[S]==="*"))v[S]==="*"?(A=S,x=w,S++):(w++,S++);else if(A!==-1)S=A+1,x++,w=x;else return!1;for(;S<v.length&&v[S]==="*";)S++;return S===v.length}function p(){const y=[...r.names,...r.skips.map(v=>"-"+v)].join(",");return r.enable(""),y}function m(y){for(const v of r.skips)if(d(y,v))return!1;for(const v of r.names)if(d(y,v))return!0;return!1}function h(y){return y instanceof Error?y.stack||y.message:y}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}return Dh=n,Dh}var Hv;function B3(){return Hv||(Hv=1,(function(n,e){var o={};e.formatArgs=l,e.save=c,e.load=d,e.useColors=r,e.storage=p(),e.destroy=(()=>{let h=!1;return()=>{h||(h=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let h;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(h=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(h[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function l(h){if(h[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+h[0]+(this.useColors?"%c ":" ")+"+"+n.exports.humanize(this.diff),!this.useColors)return;const g="color: "+this.color;h.splice(1,0,g,"color: inherit");let y=0,v=0;h[0].replace(/%[a-zA-Z%]/g,w=>{w!=="%%"&&(y++,w==="%c"&&(v=y))}),h.splice(v,0,g)}e.log=console.debug||console.log||(()=>{});function c(h){try{h?e.storage.setItem("debug",h):e.storage.removeItem("debug")}catch{}}function d(){let h;try{h=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!h&&typeof process<"u"&&"env"in process&&(h=o.DEBUG),h}function p(){try{return localStorage}catch{}}n.exports=G3()(e);const{formatters:m}=n.exports;m.j=function(h){try{return JSON.stringify(h)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}})(tu,tu.exports)),tu.exports}var H3=B3();const $3=Y1(H3),Gu={},Y3=Symbol((Gu?"production":void 0)!=="production"?"RESET":"");let $v=!1;function Mh(n,e){(Gu?"production":void 0)!=="production"&&!$v&&(console.warn("[DEPRECATED] atomFamily is deprecated and will be removed in v3. Please use the `jotai-family` package instead: https://github.com/jotaijs/jotai-family"),$v=!0);let o=null;const r=new Map,l=new Set,c=p=>{let m;if(e===void 0)m=r.get(p);else for(const[g,y]of r)if(e(g,p)){m=y;break}if(m!==void 0)if(o!=null&&o(m[1],p))c.remove(p);else return m[0];const h=n(p);return r.set(p,[h,Date.now()]),d("CREATE",p,h),h},d=(p,m,h)=>{for(const g of l)g({type:p,param:m,atom:h})};return c.unstable_listen=p=>(l.add(p),()=>{l.delete(p)}),c.getParams=()=>r.keys(),c.remove=p=>{if(e===void 0){if(!r.has(p))return;const[m]=r.get(p);r.delete(p),d("REMOVE",p,m)}else for(const[m,[h]]of r)if(e(m,p)){r.delete(m),d("REMOVE",m,h);break}},c.setShouldRemove=p=>{if(o=p,!!o)for(const[m,[h,g]]of r)o(g,m)&&(r.delete(m),d("REMOVE",m,h))},c}const xb=n=>typeof(n==null?void 0:n.then)=="function";function q3(n=()=>{try{return window.localStorage}catch(o){(Gu?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(o);return}},e){var o;let r,l;const c={getItem:(m,h)=>{var g,y;const v=S=>{if(S=S||"",r!==S){try{l=JSON.parse(S,e==null?void 0:e.reviver)}catch{return h}r=S}return l},w=(y=(g=n())==null?void 0:g.getItem(m))!=null?y:null;return xb(w)?w.then(v):v(w)},setItem:(m,h)=>{var g;return(g=n())==null?void 0:g.setItem(m,JSON.stringify(h,void 0))},removeItem:m=>{var h;return(h=n())==null?void 0:h.removeItem(m)}},d=m=>(h,g,y)=>m(h,v=>{let w;try{w=JSON.parse(v||"")}catch{w=y}g(w)});let p;try{p=(o=n())==null?void 0:o.subscribe}catch{}return!p&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(p=(m,h)=>{if(!(n()instanceof window.Storage))return()=>{};const g=y=>{y.storageArea===n()&&y.key===m&&h(y.newValue)};return window.addEventListener("storage",g),()=>{window.removeEventListener("storage",g)}}),p&&(c.subscribe=d(p)),c}const V3=q3();function Sb(n,e,o=V3,r){const l=K(e);return(Gu?"production":void 0)!=="production"&&(l.debugPrivate=!0),l.onMount=d=>{d(o.getItem(n,e));let p;return o.subscribe&&(p=o.subscribe(n,d,e)),p},K(d=>d(l),(d,p,m)=>{const h=typeof m=="function"?m(d(l)):m;return h===Y3?(p(l,e),o.removeItem(n)):xb(h)?h.then(g=>(p(l,g),o.setItem(n,g))):(p(l,h),o.setItem(n,h))})}var zh={exports:{}},Oh={};/**
 * @license React
 * react-compiler-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 Yv;function X3(){if(Yv)return Oh;Yv=1;var n=Lu().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Oh.c=function(e){return n.H.useMemoCache(e)},Oh}var qv;function K3(){return qv||(qv=1,zh.exports=X3()),zh.exports}var Oe=K3();function Q3(n,e,o){return Math.max(e,Math.min(n,o))}const yt={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function Vv(n,e,o){return e===0||Math.abs(e)===1/0?Math.pow(n,o*5):n*e*o/(e+o*n)}function Xv(n,e,o,r=.15){return r===0?Q3(n,e,o):n<e?-Vv(e-n,o-e,r)+e:n>o?+Vv(n-o,o-e,r)+o:n}function Z3(n,[e,o],[r,l]){const[[c,d],[p,m]]=n;return[Xv(e,c,d,r),Xv(o,p,m,l)]}function I3(n,e){if(typeof n!="object"||n===null)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var r=o.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function F3(n){var e=I3(n,"string");return typeof e=="symbol"?e:String(e)}function Qt(n,e,o){return e=F3(e),e in n?Object.defineProperty(n,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[e]=o,n}function Kv(n,e){var o=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),o.push.apply(o,r)}return o}function _t(n){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Kv(Object(o),!0).forEach(function(r){Qt(n,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):Kv(Object(o)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(o,r))})}return n}const Ab={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function Qv(n){return n?n[0].toUpperCase()+n.slice(1):""}const P3=["enter","leave"];function J3(n=!1,e){return n&&!P3.includes(e)}function W3(n,e="",o=!1){const r=Ab[n],l=r&&r[e]||e;return"on"+Qv(n)+Qv(l)+(J3(o,l)?"Capture":"")}const e_=["gotpointercapture","lostpointercapture"];function t_(n){let e=n.substring(2).toLowerCase();const o=!!~e.indexOf("passive");o&&(e=e.replace("passive",""));const r=e_.includes(e)?"capturecapture":"capture",l=!!~e.indexOf(r);return l&&(e=e.replace("capture","")),{device:e,capture:l,passive:o}}function n_(n,e=""){const o=Ab[n],r=o&&o[e]||e;return n+r}function Bu(n){return"touches"in n}function _b(n){return Bu(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function i_(n){return Array.from(n.touches).filter(e=>{var o,r;return e.target===n.currentTarget||((o=n.currentTarget)===null||o===void 0||(r=o.contains)===null||r===void 0?void 0:r.call(o,e.target))})}function o_(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Cb(n){return Bu(n)?o_(n)[0]:n}function tp(n,e){try{const o=e.clientX-n.clientX,r=e.clientY-n.clientY,l=(e.clientX+n.clientX)/2,c=(e.clientY+n.clientY)/2,d=Math.hypot(o,r);return{angle:-(Math.atan2(o,r)*180)/Math.PI,distance:d,origin:[l,c]}}catch{}return null}function r_(n){return i_(n).map(e=>e.identifier)}function Zv(n,e){const[o,r]=Array.from(n.touches).filter(l=>e.includes(l.identifier));return tp(o,r)}function Rh(n){const e=Cb(n);return Bu(n)?e.identifier:e.pointerId}function is(n){const e=Cb(n);return[e.clientX,e.clientY]}const Iv=40,Fv=800;function Eb(n){let{deltaX:e,deltaY:o,deltaMode:r}=n;return r===1?(e*=Iv,o*=Iv):r===2&&(e*=Fv,o*=Fv),[e,o]}function a_(n){var e,o;const{scrollX:r,scrollY:l,scrollLeft:c,scrollTop:d}=n.currentTarget;return[(e=r??c)!==null&&e!==void 0?e:0,(o=l??d)!==null&&o!==void 0?o:0]}function s_(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:o,altKey:r,metaKey:l,ctrlKey:c}=n;Object.assign(e,{shiftKey:o,altKey:r,metaKey:l,ctrlKey:c})}return e}function xu(n,...e){return typeof n=="function"?n(...e):n}function l_(){}function c_(...n){return n.length===0?l_:n.length===1?n[0]:function(){let e;for(const o of n)e=o.apply(this,arguments)||e;return e}}function Pv(n,e){return Object.assign({},e,n||{})}const u_=32;class Nb{constructor(e,o,r){this.ctrl=e,this.args=o,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:o,ingKey:r,args:l}=this;o[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=l,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const o=this.state,r=this.config;o._active||(this.reset(),this.computeInitial(),o._active=!0,o.target=e.target,o.currentTarget=e.currentTarget,o.lastOffset=r.from?xu(r.from,o):o.offset,o.offset=o.lastOffset,o.startTime=o.timeStamp=e.timeStamp)}computeValues(e){const o=this.state;o._values=e,o.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:o,config:r,shared:l}=this;o.args=this.args;let c=0;if(e&&(o.event=e,r.preventDefault&&e.cancelable&&o.event.preventDefault(),o.type=e.type,l.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,l.locked=!!document.pointerLockElement,Object.assign(l,s_(e)),l.down=l.pressed=l.buttons%2===1||l.touches>0,c=e.timeStamp-o.timeStamp,o.timeStamp=e.timeStamp,o.elapsedTime=o.timeStamp-o.startTime),o._active){const T=o._delta.map(Math.abs);yt.addTo(o._distance,T)}this.axisIntent&&this.axisIntent(e);const[d,p]=o._movement,[m,h]=r.threshold,{_step:g,values:y}=o;if(r.hasCustomTransform?(g[0]===!1&&(g[0]=Math.abs(d)>=m&&y[0]),g[1]===!1&&(g[1]=Math.abs(p)>=h&&y[1])):(g[0]===!1&&(g[0]=Math.abs(d)>=m&&Math.sign(d)*m),g[1]===!1&&(g[1]=Math.abs(p)>=h&&Math.sign(p)*h)),o.intentional=g[0]!==!1||g[1]!==!1,!o.intentional)return;const v=[0,0];if(r.hasCustomTransform){const[T,O]=y;v[0]=g[0]!==!1?T-g[0]:0,v[1]=g[1]!==!1?O-g[1]:0}else v[0]=g[0]!==!1?d-g[0]:0,v[1]=g[1]!==!1?p-g[1]:0;this.restrictToAxis&&!o._blocked&&this.restrictToAxis(v);const w=o.offset,S=o._active&&!o._blocked||o.active;S&&(o.first=o._active&&!o.active,o.last=!o._active&&o.active,o.active=l[this.ingKey]=o._active,e&&(o.first&&("bounds"in r&&(o._bounds=xu(r.bounds,o)),this.setup&&this.setup()),o.movement=v,this.computeOffset()));const[A,x]=o.offset,[[E,D],[R,_]]=o._bounds;o.overflow=[A<E?-1:A>D?1:0,x<R?-1:x>_?1:0],o._movementBound[0]=o.overflow[0]?o._movementBound[0]===!1?o._movement[0]:o._movementBound[0]:!1,o._movementBound[1]=o.overflow[1]?o._movementBound[1]===!1?o._movement[1]:o._movementBound[1]:!1;const N=o._active?r.rubberband||[0,0]:[0,0];if(o.offset=Z3(o._bounds,o.offset,N),o.delta=yt.sub(o.offset,w),this.computeMovement(),S&&(!o.last||c>u_)){o.delta=yt.sub(o.offset,w);const T=o.delta.map(Math.abs);yt.addTo(o.distance,T),o.direction=o.delta.map(Math.sign),o._direction=o._delta.map(Math.sign),!o.first&&c>0&&(o.velocity=[T[0]/c,T[1]/c],o.timeDelta=c)}}emit(){const e=this.state,o=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const l=this.handler(_t(_t(_t({},o),e),{},{[this.aliasKey]:e.values}));l!==void 0&&(e.memo=l)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function d_([n,e],o){const r=Math.abs(n),l=Math.abs(e);if(r>l&&r>o)return"x";if(l>r&&l>o)return"y"}class Dl extends Nb{constructor(...e){super(...e),Qt(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=yt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=yt.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const o=this.state,r=this.config;if(!o.axis&&e){const l=typeof r.axisThreshold=="object"?r.axisThreshold[_b(e)]:r.axisThreshold;o.axis=d_(o._movement,l)}o._blocked=(r.lockDirection||!!r.axis)&&!o.axis||!!r.axis&&r.axis!==o.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const f_=n=>n,Jv=.15,kb={enabled(n=!0){return n},eventOptions(n,e,o){return _t(_t({},o.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Jv,Jv];case!1:return[0,0];default:return yt.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return yt.toVector(n)},transform(n,e,o){const r=n||o.shared.transform;return this.hasCustomTransform=!!r,r||f_},threshold(n){return yt.toVector(n,0)}},h_=0,Wr=_t(_t({},kb),{},{axis(n,e,{axis:o}){if(this.lockDirection=o==="lock",!this.lockDirection)return o},axisThreshold(n=h_){return n},bounds(n={}){if(typeof n=="function")return c=>Wr.bounds(n(c));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:o=1/0,top:r=-1/0,bottom:l=1/0}=n;return[[e,o],[r,l]]}}),Wv={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class p_ extends Dl{constructor(...e){super(...e),Qt(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const o=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),l={left:o.left-r.left+e.offset[0],right:o.right-r.right+e.offset[0],top:o.top-r.top+e.offset[1],bottom:o.bottom-r.bottom+e.offset[1]};e._bounds=Wr.bounds(l)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const o=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(o.pointerButtons)?!o.pointerButtons.includes(e.buttons):o.pointerButtons!==-1&&o.pointerButtons!==e.buttons))return;const l=this.ctrl.setEventIds(e);o.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(l&&l.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=Rh(e),r._pointerActive=!0,this.computeValues(is(e)),this.computeInitial(),o.preventScrollAxis&&_b(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):o.delay>0?(this.setupDelayTrigger(e),o.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const o=this.state;o._active=!0,o._preventScroll=!0,o._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const o=this.state,r=this.config;if(!o._pointerActive)return;const l=Rh(e);if(o._pointerId!==void 0&&l!==o._pointerId)return;const c=is(e);if(document.pointerLockElement===e.target?o._delta=[e.movementX,e.movementY]:(o._delta=yt.sub(c,o._values),this.computeValues(c)),yt.addTo(o._movement,o._delta),this.compute(e),o._delayed&&o.intentional){this.timeoutStore.remove("dragDelay"),o.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!o._preventScroll)if(o.axis)if(o.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){o._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const o=this.state,r=this.config;if(!o._active||!o._pointerActive)return;const l=Rh(e);if(o._pointerId!==void 0&&l!==o._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[c,d]=o._distance;if(o.tap=c<=r.tapsThreshold&&d<=r.tapsThreshold,o.tap&&r.filterTaps)o._force=!0;else{const[p,m]=o._delta,[h,g]=o._movement,[y,v]=r.swipe.velocity,[w,S]=r.swipe.distance,A=r.swipe.duration;if(o.elapsedTime<A){const x=Math.abs(p/o.timeDelta),E=Math.abs(m/o.timeDelta);x>y&&Math.abs(h)>w&&(o.swipe[0]=Math.sign(p)),E>v&&Math.abs(g)>S&&(o.swipe[1]=Math.sign(m))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const o=this.config,r=o.device;o.pointerLock&&e.currentTarget.requestPointerLock(),o.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,m_(e);const o=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",o),this.eventStore.add(this.sharedConfig.window,"touch","cancel",o),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const o=Wv[e.key];if(o){const r=this.state,l=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=o(this.config.keyboardDisplacement,l),r._keyboardActive=!0,yt.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Wv&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const o=this.config.device;e(o,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(o,"change",this.pointerMove.bind(this)),e(o,"end",this.pointerUp.bind(this)),e(o,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function m_(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Ml=typeof window<"u"&&window.document&&window.document.createElement;function Tb(){return Ml&&"ontouchstart"in window}function g_(){return Tb()||Ml&&window.navigator.maxTouchPoints>1}function y_(){return Ml&&"onpointerdown"in window}function v_(){return Ml&&"exitPointerLock"in window.document}function b_(){try{return"constructor"in GestureEvent}catch{return!1}}const Ai={isBrowser:Ml,gesture:b_(),touch:Tb(),touchscreen:g_(),pointer:y_(),pointerLock:v_()},w_=250,x_=180,S_=.5,A_=50,__=250,C_=10,e1={mouse:0,touch:0,pen:8},E_=_t(_t({},Wr),{},{device(n,e,{pointer:{touch:o=!1,lock:r=!1,mouse:l=!1}={}}){return this.pointerLock=r&&Ai.pointerLock,Ai.touch&&o?"touch":this.pointerLock?"mouse":Ai.pointer&&!l?"pointer":Ai.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:o}){if(this.preventScrollDelay=typeof o=="number"?o:o||o===void 0&&n?w_:void 0,!(!Ai.touchscreen||o===!1))return n||(o!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:o=!0,buttons:r=1,keys:l=!0}={}}){return this.pointerButtons=r,this.keys=l,!this.pointerLock&&this.device==="pointer"&&o},threshold(n,e,{filterTaps:o=!1,tapsThreshold:r=3,axis:l=void 0}){const c=yt.toVector(n,o?r:l?1:0);return this.filterTaps=o,this.tapsThreshold=r,c},swipe({velocity:n=S_,distance:e=A_,duration:o=__}={}){return{velocity:this.transform(yt.toVector(n)),distance:this.transform(yt.toVector(e)),duration:o}},delay(n=0){switch(n){case!0:return x_;case!1:return 0;default:return n}},axisThreshold(n){return n?_t(_t({},e1),n):e1},keyboardDisplacement(n=C_){return n}});function Db(n){const[e,o]=n.overflow,[r,l]=n._delta,[c,d]=n._direction;(e<0&&r>0&&c<0||e>0&&r<0&&c>0)&&(n._movement[0]=n._movementBound[0]),(o<0&&l>0&&d<0||o>0&&l<0&&d>0)&&(n._movement[1]=n._movementBound[1])}const N_=30,k_=100;class T_ extends Nb{constructor(...e){super(...e),Qt(this,"ingKey","pinching"),Qt(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:o,lastOffset:r}=this.state;e==="wheel"?this.state.offset=yt.add(o,r):this.state.offset=[(1+o[0])*r[0],o[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:o}=this.state;this.state.movement=[e[0]/o[0],e[1]-o[1]]}axisIntent(){const e=this.state,[o,r]=e._movement;if(!e.axis){const l=Math.abs(o)*N_-Math.abs(r);l<0?e.axis="angle":l>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const o=this.state,r=this.ctrl.touchIds;if(o._active&&o._touchIds.every(c=>r.has(c))||r.size<2)return;this.start(e),o._touchIds=Array.from(r).slice(0,2);const l=Zv(e,o._touchIds);l&&this.pinchStart(e,l)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const o=this.state,r=o._pointerEvents,l=this.ctrl.pointerIds;if(o._active&&Array.from(r.keys()).every(d=>l.has(d))||(r.size<2&&r.set(e.pointerId,e),o._pointerEvents.size<2))return;this.start(e);const c=tp(...Array.from(r.values()));c&&this.pinchStart(e,c)}pinchStart(e,o){const r=this.state;r.origin=o.origin,this.computeValues([o.distance,o.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const o=Zv(e,this.state._touchIds);o&&this.pinchMove(e,o)}pointerMove(e){const o=this.state._pointerEvents;if(o.has(e.pointerId)&&o.set(e.pointerId,e),!this.state._active)return;const r=tp(...Array.from(o.values()));r&&this.pinchMove(e,r)}pinchMove(e,o){const r=this.state,l=r._values[1],c=o.angle-l;let d=0;Math.abs(c)>270&&(d+=Math.sign(c)),this.computeValues([o.distance,o.angle-360*d]),r.origin=o.origin,r.turns=d,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(o=>!this.ctrl.touchIds.has(o))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const o=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}o._pointerEvents.has(e.pointerId)&&o._pointerEvents.delete(e.pointerId),o._active&&o._pointerEvents.size<2&&(o._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const o=this.state;o._active||(this.start(e),this.computeValues([e.scale,e.rotation]),o.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const o=this.state;this.computeValues([e.scale,e.rotation]),o.origin=[e.clientX,e.clientY];const r=o._movement;o._movement=[e.scale-1,e.rotation],o._delta=yt.sub(o._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const o=this.config.modifierKey;o&&(Array.isArray(o)?!o.find(r=>e[r]):!e[o])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const r=this.state;r._delta=[-Eb(e)[1]/k_*r.offset[0],0],yt.addTo(r._movement,r._delta),Db(r),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const o=this.config.device;o&&(e(o,"start",this[o+"Start"].bind(this)),e(o,"change",this[o+"Move"].bind(this)),e(o,"end",this[o+"End"].bind(this)),e(o,"cancel",this[o+"End"].bind(this)),e("lostPointerCapture","",this[o+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const D_=_t(_t({},kb),{},{device(n,e,{shared:o,pointer:{touch:r=!1}={}}){if(o.target&&!Ai.touch&&Ai.gesture)return"gesture";if(Ai.touch&&r)return"touch";if(Ai.touchscreen){if(Ai.pointer)return"pointer";if(Ai.touch)return"touch"}},bounds(n,e,{scaleBounds:o={},angleBounds:r={}}){const l=d=>{const p=Pv(xu(o,d),{min:-1/0,max:1/0});return[p.min,p.max]},c=d=>{const p=Pv(xu(r,d),{min:-1/0,max:1/0});return[p.min,p.max]};return typeof o!="function"&&typeof r!="function"?[l(),c()]:d=>[l(d),c(d)]},threshold(n,e,o){return this.lockDirection=o.axis==="lock",yt.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});class M_ extends Dl{constructor(...e){super(...e),Qt(this,"ingKey","moving")}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(is(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const o=is(e),r=this.state;r._delta=yt.sub(o,r._values),yt.addTo(r._movement,r._delta),this.computeValues(o),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}}const z_=_t(_t({},Wr),{},{mouseOnly:(n=!0)=>n});class O_ extends Dl{constructor(...e){super(...e),Qt(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const o=this.state,r=a_(e);o._delta=yt.sub(r,o._values),yt.addTo(o._movement,o._delta),this.computeValues(r),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}}const R_=Wr;class j_ extends Dl{constructor(...e){super(...e),Qt(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const o=this.state;o._delta=Eb(e),yt.addTo(o._movement,o._delta),Db(o),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const L_=Wr;class U_ extends Dl{constructor(...e){super(...e),Qt(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(is(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const o=this.state;if(!o._active)return;o._active=!1;const r=is(e);o._movement=o._delta=yt.sub(r,o._values),this.computeValues(r),this.compute(e),o.delta=o.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}}const G_=_t(_t({},Wr),{},{mouseOnly:(n=!0)=>n}),Ep=new Map,np=new Map;function B_(n){Ep.set(n.key,n.engine),np.set(n.key,n.resolver)}const H_={key:"drag",engine:p_,resolver:E_},$_={key:"hover",engine:U_,resolver:G_},Y_={key:"move",engine:M_,resolver:z_},q_={key:"pinch",engine:T_,resolver:D_},V_={key:"scroll",engine:O_,resolver:R_},X_={key:"wheel",engine:j_,resolver:L_};function K_(n,e){if(n==null)return{};var o={},r=Object.keys(n),l,c;for(c=0;c<r.length;c++)l=r[c],!(e.indexOf(l)>=0)&&(o[l]=n[l]);return o}function Q_(n,e){if(n==null)return{};var o=K_(n,e),r,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(n);for(l=0;l<c.length;l++)r=c[l],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(o[r]=n[r])}return o}const Z_={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Ai.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},I_=["target","eventOptions","window","enabled","transform"];function lu(n={},e){const o={};for(const[r,l]of Object.entries(e))switch(typeof l){case"function":o[r]=l.call(o,n[r],r,n);break;case"object":o[r]=lu(n[r],l);break;case"boolean":l&&(o[r]=n[r]);break}return o}function F_(n,e,o={}){const r=n,{target:l,eventOptions:c,window:d,enabled:p,transform:m}=r,h=Q_(r,I_);if(o.shared=lu({target:l,eventOptions:c,window:d,enabled:p,transform:m},Z_),e){const g=np.get(e);o[e]=lu(_t({shared:o.shared},h),g)}else for(const g in h){const y=np.get(g);y&&(o[g]=lu(_t({shared:o.shared},h[g]),y))}return o}class Mb{constructor(e,o){Qt(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=o}add(e,o,r,l,c){const d=this._listeners,p=n_(o,r),m=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},h=_t(_t({},m),c);e.addEventListener(p,l,h);const g=()=>{e.removeEventListener(p,l,h),d.delete(g)};return d.add(g),g}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class P_{constructor(){Qt(this,"_timeouts",new Map)}add(e,o,r=140,...l){this.remove(e),this._timeouts.set(e,window.setTimeout(o,r,...l))}remove(e){const o=this._timeouts.get(e);o&&window.clearTimeout(o)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class J_{constructor(e){Qt(this,"gestures",new Set),Qt(this,"_targetEventStore",new Mb(this)),Qt(this,"gestureEventStores",{}),Qt(this,"gestureTimeoutStores",{}),Qt(this,"handlers",{}),Qt(this,"config",{}),Qt(this,"pointerIds",new Set),Qt(this,"touchIds",new Set),Qt(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),W_(this,e)}setEventIds(e){if(Bu(e))return this.touchIds=new Set(r_(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,o){this.handlers=e,this.nativeHandlers=o}applyConfig(e,o){this.config=F_(e,o,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const o=this.config.shared,r={};let l;if(!(o.target&&(l=o.target(),!l))){if(o.enabled){for(const d of this.gestures){const p=this.config[d],m=t1(r,p.eventOptions,!!l);if(p.enabled){const h=Ep.get(d);new h(this,e,d).bind(m)}}const c=t1(r,o.eventOptions,!!l);for(const d in this.nativeHandlers)c(d,"",p=>this.nativeHandlers[d](_t(_t({},this.state.shared),{},{event:p,args:e})),void 0,!0)}for(const c in r)r[c]=c_(...r[c]);if(!l)return r;for(const c in r){const{device:d,capture:p,passive:m}=t_(c);this._targetEventStore.add(l,d,"",r[c],{capture:p,passive:m})}}}}function Ba(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Mb(n,e),n.gestureTimeoutStores[e]=new P_}function W_(n,e){e.drag&&Ba(n,"drag"),e.wheel&&Ba(n,"wheel"),e.scroll&&Ba(n,"scroll"),e.move&&Ba(n,"move"),e.pinch&&Ba(n,"pinch"),e.hover&&Ba(n,"hover")}const t1=(n,e,o)=>(r,l,c,d={},p=!1)=>{var m,h;const g=(m=d.capture)!==null&&m!==void 0?m:e.capture,y=(h=d.passive)!==null&&h!==void 0?h:e.passive;let v=p?r:W3(r,l,g);o&&y&&(v+="Passive"),n[v]=n[v]||[],n[v].push(c)},eC=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function tC(n){const e={},o={},r=new Set;for(let l in n)eC.test(l)?(r.add(RegExp.lastMatch),o[l]=n[l]):e[l]=n[l];return[o,e,r]}function Ha(n,e,o,r,l,c){if(!n.has(o)||!Ep.has(r))return;const d=o+"Start",p=o+"End",m=h=>{let g;return h.first&&d in e&&e[d](h),o in e&&(g=e[o](h)),h.last&&p in e&&e[p](h),g};l[r]=m,c[r]=c[r]||{}}function nC(n,e){const[o,r,l]=tC(n),c={};return Ha(l,o,"onDrag","drag",c,e),Ha(l,o,"onWheel","wheel",c,e),Ha(l,o,"onScroll","scroll",c,e),Ha(l,o,"onPinch","pinch",c,e),Ha(l,o,"onMove","move",c,e),Ha(l,o,"onHover","hover",c,e),{handlers:c,config:e,nativeHandlers:r}}function iC(n,e={},o,r){const l=Ji.useMemo(()=>new J_(n),[]);if(l.applyHandlers(n,r),l.applyConfig(e,o),Ji.useEffect(l.effect.bind(l)),Ji.useEffect(()=>l.clean.bind(l),[]),e.target===void 0)return l.bind.bind(l)}function oC(n){return n.forEach(B_),function(o,r){const{handlers:l,nativeHandlers:c,config:d}=nC(o,r||{});return iC(l,d,void 0,c)}}function zb(n,e){return oC([H_,q_,V_,X_,Y_,$_])(n,e||{})}var rC=q1();function aC(n,e){var o,r=1;n==null&&(n=0),e==null&&(e=0);function l(){var c,d=o.length,p,m=0,h=0;for(c=0;c<d;++c)p=o[c],m+=p.x,h+=p.y;for(m=(m/d-n)*r,h=(h/d-e)*r,c=0;c<d;++c)p=o[c],p.x-=m,p.y-=h}return l.initialize=function(c){o=c},l.x=function(c){return arguments.length?(n=+c,l):n},l.y=function(c){return arguments.length?(e=+c,l):e},l.strength=function(c){return arguments.length?(r=+c,l):r},l}function sC(n){const e=+this._x.call(null,n),o=+this._y.call(null,n);return Ob(this.cover(e,o),e,o,n)}function Ob(n,e,o,r){if(isNaN(e)||isNaN(o))return n;var l,c=n._root,d={data:r},p=n._x0,m=n._y0,h=n._x1,g=n._y1,y,v,w,S,A,x,E,D;if(!c)return n._root=d,n;for(;c.length;)if((A=e>=(y=(p+h)/2))?p=y:h=y,(x=o>=(v=(m+g)/2))?m=v:g=v,l=c,!(c=c[E=x<<1|A]))return l[E]=d,n;if(w=+n._x.call(null,c.data),S=+n._y.call(null,c.data),e===w&&o===S)return d.next=c,l?l[E]=d:n._root=d,n;do l=l?l[E]=new Array(4):n._root=new Array(4),(A=e>=(y=(p+h)/2))?p=y:h=y,(x=o>=(v=(m+g)/2))?m=v:g=v;while((E=x<<1|A)===(D=(S>=v)<<1|w>=y));return l[D]=c,l[E]=d,n}function lC(n){var e,o,r=n.length,l,c,d=new Array(r),p=new Array(r),m=1/0,h=1/0,g=-1/0,y=-1/0;for(o=0;o<r;++o)isNaN(l=+this._x.call(null,e=n[o]))||isNaN(c=+this._y.call(null,e))||(d[o]=l,p[o]=c,l<m&&(m=l),l>g&&(g=l),c<h&&(h=c),c>y&&(y=c));if(m>g||h>y)return this;for(this.cover(m,h).cover(g,y),o=0;o<r;++o)Ob(this,d[o],p[o],n[o]);return this}function cC(n,e){if(isNaN(n=+n)||isNaN(e=+e))return this;var o=this._x0,r=this._y0,l=this._x1,c=this._y1;if(isNaN(o))l=(o=Math.floor(n))+1,c=(r=Math.floor(e))+1;else{for(var d=l-o||1,p=this._root,m,h;o>n||n>=l||r>e||e>=c;)switch(h=(e<r)<<1|n<o,m=new Array(4),m[h]=p,p=m,d*=2,h){case 0:l=o+d,c=r+d;break;case 1:o=l-d,c=r+d;break;case 2:l=o+d,r=c-d;break;case 3:o=l-d,r=c-d;break}this._root&&this._root.length&&(this._root=p)}return this._x0=o,this._y0=r,this._x1=l,this._y1=c,this}function uC(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function dC(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ln(n,e,o,r,l){this.node=n,this.x0=e,this.y0=o,this.x1=r,this.y1=l}function fC(n,e,o){var r,l=this._x0,c=this._y0,d,p,m,h,g=this._x1,y=this._y1,v=[],w=this._root,S,A;for(w&&v.push(new Ln(w,l,c,g,y)),o==null?o=1/0:(l=n-o,c=e-o,g=n+o,y=e+o,o*=o);S=v.pop();)if(!(!(w=S.node)||(d=S.x0)>g||(p=S.y0)>y||(m=S.x1)<l||(h=S.y1)<c))if(w.length){var x=(d+m)/2,E=(p+h)/2;v.push(new Ln(w[3],x,E,m,h),new Ln(w[2],d,E,x,h),new Ln(w[1],x,p,m,E),new Ln(w[0],d,p,x,E)),(A=(e>=E)<<1|n>=x)&&(S=v[v.length-1],v[v.length-1]=v[v.length-1-A],v[v.length-1-A]=S)}else{var D=n-+this._x.call(null,w.data),R=e-+this._y.call(null,w.data),_=D*D+R*R;if(_<o){var N=Math.sqrt(o=_);l=n-N,c=e-N,g=n+N,y=e+N,r=w.data}}return r}function hC(n){if(isNaN(g=+this._x.call(null,n))||isNaN(y=+this._y.call(null,n)))return this;var e,o=this._root,r,l,c,d=this._x0,p=this._y0,m=this._x1,h=this._y1,g,y,v,w,S,A,x,E;if(!o)return this;if(o.length)for(;;){if((S=g>=(v=(d+m)/2))?d=v:m=v,(A=y>=(w=(p+h)/2))?p=w:h=w,e=o,!(o=o[x=A<<1|S]))return this;if(!o.length)break;(e[x+1&3]||e[x+2&3]||e[x+3&3])&&(r=e,E=x)}for(;o.data!==n;)if(l=o,!(o=o.next))return this;return(c=o.next)&&delete o.next,l?(c?l.next=c:delete l.next,this):e?(c?e[x]=c:delete e[x],(o=e[0]||e[1]||e[2]||e[3])&&o===(e[3]||e[2]||e[1]||e[0])&&!o.length&&(r?r[E]=o:this._root=o),this):(this._root=c,this)}function pC(n){for(var e=0,o=n.length;e<o;++e)this.remove(n[e]);return this}function mC(){return this._root}function gC(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function yC(n){var e=[],o,r=this._root,l,c,d,p,m;for(r&&e.push(new Ln(r,this._x0,this._y0,this._x1,this._y1));o=e.pop();)if(!n(r=o.node,c=o.x0,d=o.y0,p=o.x1,m=o.y1)&&r.length){var h=(c+p)/2,g=(d+m)/2;(l=r[3])&&e.push(new Ln(l,h,g,p,m)),(l=r[2])&&e.push(new Ln(l,c,g,h,m)),(l=r[1])&&e.push(new Ln(l,h,d,p,g)),(l=r[0])&&e.push(new Ln(l,c,d,h,g))}return this}function vC(n){var e=[],o=[],r;for(this._root&&e.push(new Ln(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var l=r.node;if(l.length){var c,d=r.x0,p=r.y0,m=r.x1,h=r.y1,g=(d+m)/2,y=(p+h)/2;(c=l[0])&&e.push(new Ln(c,d,p,g,y)),(c=l[1])&&e.push(new Ln(c,g,p,m,y)),(c=l[2])&&e.push(new Ln(c,d,y,g,h)),(c=l[3])&&e.push(new Ln(c,g,y,m,h))}o.push(r)}for(;r=o.pop();)n(r.node,r.x0,r.y0,r.x1,r.y1);return this}function bC(n){return n[0]}function wC(n){return arguments.length?(this._x=n,this):this._x}function xC(n){return n[1]}function SC(n){return arguments.length?(this._y=n,this):this._y}function Np(n,e,o){var r=new kp(e??bC,o??xC,NaN,NaN,NaN,NaN);return n==null?r:r.addAll(n)}function kp(n,e,o,r,l,c){this._x=n,this._y=e,this._x0=o,this._y0=r,this._x1=l,this._y1=c,this._root=void 0}function n1(n){for(var e={data:n.data},o=e;n=n.next;)o=o.next={data:n.data};return e}var Un=Np.prototype=kp.prototype;Un.copy=function(){var n=new kp(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,o,r;if(!e)return n;if(!e.length)return n._root=n1(e),n;for(o=[{source:e,target:n._root=new Array(4)}];e=o.pop();)for(var l=0;l<4;++l)(r=e.source[l])&&(r.length?o.push({source:r,target:e.target[l]=new Array(4)}):e.target[l]=n1(r));return n};Un.add=sC;Un.addAll=lC;Un.cover=cC;Un.data=uC;Un.extent=dC;Un.find=fC;Un.remove=hC;Un.removeAll=pC;Un.root=mC;Un.size=gC;Un.visit=yC;Un.visitAfter=vC;Un.x=wC;Un.y=SC;function Fr(n){return function(){return n}}function br(n){return(n()-.5)*1e-6}function AC(n){return n.x+n.vx}function _C(n){return n.y+n.vy}function CC(n){var e,o,r,l=1,c=1;typeof n!="function"&&(n=Fr(n==null?1:+n));function d(){for(var h,g=e.length,y,v,w,S,A,x,E=0;E<c;++E)for(y=Np(e,AC,_C).visitAfter(p),h=0;h<g;++h)v=e[h],A=o[v.index],x=A*A,w=v.x+v.vx,S=v.y+v.vy,y.visit(D);function D(R,_,N,T,O){var M=R.data,$=R.r,L=A+$;if(M){if(M.index>v.index){var X=w-M.x-M.vx,ae=S-M.y-M.vy,te=X*X+ae*ae;te<L*L&&(X===0&&(X=br(r),te+=X*X),ae===0&&(ae=br(r),te+=ae*ae),te=(L-(te=Math.sqrt(te)))/te*l,v.vx+=(X*=te)*(L=($*=$)/(x+$)),v.vy+=(ae*=te)*L,M.vx-=X*(L=1-L),M.vy-=ae*L)}return}return _>w+L||T<w-L||N>S+L||O<S-L}}function p(h){if(h.data)return h.r=o[h.data.index];for(var g=h.r=0;g<4;++g)h[g]&&h[g].r>h.r&&(h.r=h[g].r)}function m(){if(e){var h,g=e.length,y;for(o=new Array(g),h=0;h<g;++h)y=e[h],o[y.index]=+n(y,h,e)}}return d.initialize=function(h,g){e=h,r=g,m()},d.iterations=function(h){return arguments.length?(c=+h,d):c},d.strength=function(h){return arguments.length?(l=+h,d):l},d.radius=function(h){return arguments.length?(n=typeof h=="function"?h:Fr(+h),m(),d):n},d}function EC(n){return n.index}function i1(n,e){var o=n.get(e);if(!o)throw new Error("node not found: "+e);return o}function NC(n){var e=EC,o=y,r,l=Fr(30),c,d,p,m,h,g=1;n==null&&(n=[]);function y(x){return 1/Math.min(p[x.source.index],p[x.target.index])}function v(x){for(var E=0,D=n.length;E<g;++E)for(var R=0,_,N,T,O,M,$,L;R<D;++R)_=n[R],N=_.source,T=_.target,O=T.x+T.vx-N.x-N.vx||br(h),M=T.y+T.vy-N.y-N.vy||br(h),$=Math.sqrt(O*O+M*M),$=($-c[R])/$*x*r[R],O*=$,M*=$,T.vx-=O*(L=m[R]),T.vy-=M*L,N.vx+=O*(L=1-L),N.vy+=M*L}function w(){if(d){var x,E=d.length,D=n.length,R=new Map(d.map((N,T)=>[e(N,T,d),N])),_;for(x=0,p=new Array(E);x<D;++x)_=n[x],_.index=x,typeof _.source!="object"&&(_.source=i1(R,_.source)),typeof _.target!="object"&&(_.target=i1(R,_.target)),p[_.source.index]=(p[_.source.index]||0)+1,p[_.target.index]=(p[_.target.index]||0)+1;for(x=0,m=new Array(D);x<D;++x)_=n[x],m[x]=p[_.source.index]/(p[_.source.index]+p[_.target.index]);r=new Array(D),S(),c=new Array(D),A()}}function S(){if(d)for(var x=0,E=n.length;x<E;++x)r[x]=+o(n[x],x,n)}function A(){if(d)for(var x=0,E=n.length;x<E;++x)c[x]=+l(n[x],x,n)}return v.initialize=function(x,E){d=x,h=E,w()},v.links=function(x){return arguments.length?(n=x,w(),v):n},v.id=function(x){return arguments.length?(e=x,v):e},v.iterations=function(x){return arguments.length?(g=+x,v):g},v.strength=function(x){return arguments.length?(o=typeof x=="function"?x:Fr(+x),S(),v):o},v.distance=function(x){return arguments.length?(l=typeof x=="function"?x:Fr(+x),A(),v):l},v}var kC={value:()=>{}};function Rb(){for(var n=0,e=arguments.length,o={},r;n<e;++n){if(!(r=arguments[n]+"")||r in o||/[\s.]/.test(r))throw new Error("illegal type: "+r);o[r]=[]}return new cu(o)}function cu(n){this._=n}function TC(n,e){return n.trim().split(/^|\s+/).map(function(o){var r="",l=o.indexOf(".");if(l>=0&&(r=o.slice(l+1),o=o.slice(0,l)),o&&!e.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:r}})}cu.prototype=Rb.prototype={constructor:cu,on:function(n,e){var o=this._,r=TC(n+"",o),l,c=-1,d=r.length;if(arguments.length<2){for(;++c<d;)if((l=(n=r[c]).type)&&(l=DC(o[l],n.name)))return l;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++c<d;)if(l=(n=r[c]).type)o[l]=o1(o[l],n.name,e);else if(e==null)for(l in o)o[l]=o1(o[l],n.name,null);return this},copy:function(){var n={},e=this._;for(var o in e)n[o]=e[o].slice();return new cu(n)},call:function(n,e){if((l=arguments.length-2)>0)for(var o=new Array(l),r=0,l,c;r<l;++r)o[r]=arguments[r+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(c=this._[n],r=0,l=c.length;r<l;++r)c[r].value.apply(e,o)},apply:function(n,e,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],l=0,c=r.length;l<c;++l)r[l].value.apply(e,o)}};function DC(n,e){for(var o=0,r=n.length,l;o<r;++o)if((l=n[o]).name===e)return l.value}function o1(n,e,o){for(var r=0,l=n.length;r<l;++r)if(n[r].name===e){n[r]=kC,n=n.slice(0,r).concat(n.slice(r+1));break}return o!=null&&n.push({name:e,value:o}),n}var os=0,cl=0,sl=0,jb=1e3,Su,ul,Au=0,Pr=0,Hu=0,vl=typeof performance=="object"&&performance.now?performance:Date,Lb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Ub(){return Pr||(Lb(MC),Pr=vl.now()+Hu)}function MC(){Pr=0}function ip(){this._call=this._time=this._next=null}ip.prototype=Gb.prototype={constructor:ip,restart:function(n,e,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?Ub():+o)+(e==null?0:+e),!this._next&&ul!==this&&(ul?ul._next=this:Su=this,ul=this),this._call=n,this._time=o,op()},stop:function(){this._call&&(this._call=null,this._time=1/0,op())}};function Gb(n,e,o){var r=new ip;return r.restart(n,e,o),r}function zC(){Ub(),++os;for(var n=Su,e;n;)(e=Pr-n._time)>=0&&n._call.call(void 0,e),n=n._next;--os}function r1(){Pr=(Au=vl.now())+Hu,os=cl=0;try{zC()}finally{os=0,RC(),Pr=0}}function OC(){var n=vl.now(),e=n-Au;e>jb&&(Hu-=e,Au=n)}function RC(){for(var n,e=Su,o,r=1/0;e;)e._call?(r>e._time&&(r=e._time),n=e,e=e._next):(o=e._next,e._next=null,e=n?n._next=o:Su=o);ul=n,op(r)}function op(n){if(!os){cl&&(cl=clearTimeout(cl));var e=n-Pr;e>24?(n<1/0&&(cl=setTimeout(r1,n-vl.now()-Hu)),sl&&(sl=clearInterval(sl))):(sl||(Au=vl.now(),sl=setInterval(OC,jb)),os=1,Lb(r1))}}const jC=1664525,LC=1013904223,a1=4294967296;function UC(){let n=1;return()=>(n=(jC*n+LC)%a1)/a1}function GC(n){return n.x}function BC(n){return n.y}var HC=10,$C=Math.PI*(3-Math.sqrt(5));function YC(n){var e,o=1,r=.001,l=1-Math.pow(r,1/300),c=0,d=.6,p=new Map,m=Gb(y),h=Rb("tick","end"),g=UC();n==null&&(n=[]);function y(){v(),h.call("tick",e),o<r&&(m.stop(),h.call("end",e))}function v(A){var x,E=n.length,D;A===void 0&&(A=1);for(var R=0;R<A;++R)for(o+=(c-o)*l,p.forEach(function(_){_(o)}),x=0;x<E;++x)D=n[x],D.fx==null?D.x+=D.vx*=d:(D.x=D.fx,D.vx=0),D.fy==null?D.y+=D.vy*=d:(D.y=D.fy,D.vy=0);return e}function w(){for(var A=0,x=n.length,E;A<x;++A){if(E=n[A],E.index=A,E.fx!=null&&(E.x=E.fx),E.fy!=null&&(E.y=E.fy),isNaN(E.x)||isNaN(E.y)){var D=HC*Math.sqrt(.5+A),R=A*$C;E.x=D*Math.cos(R),E.y=D*Math.sin(R)}(isNaN(E.vx)||isNaN(E.vy))&&(E.vx=E.vy=0)}}function S(A){return A.initialize&&A.initialize(n,g),A}return w(),e={tick:v,restart:function(){return m.restart(y),e},stop:function(){return m.stop(),e},nodes:function(A){return arguments.length?(n=A,w(),p.forEach(S),e):n},alpha:function(A){return arguments.length?(o=+A,e):o},alphaMin:function(A){return arguments.length?(r=+A,e):r},alphaDecay:function(A){return arguments.length?(l=+A,e):+l},alphaTarget:function(A){return arguments.length?(c=+A,e):c},velocityDecay:function(A){return arguments.length?(d=1-A,e):1-d},randomSource:function(A){return arguments.length?(g=A,p.forEach(S),e):g},force:function(A,x){return arguments.length>1?(x==null?p.delete(A):p.set(A,S(x)),e):p.get(A)},find:function(A,x,E){var D=0,R=n.length,_,N,T,O,M;for(E==null?E=1/0:E*=E,D=0;D<R;++D)O=n[D],_=A-O.x,N=x-O.y,T=_*_+N*N,T<E&&(M=O,E=T);return M},on:function(A,x){return arguments.length>1?(h.on(A,x),e):h.on(A)}}}function qC(){var n,e,o,r,l=Fr(-30),c,d=1,p=1/0,m=.81;function h(w){var S,A=n.length,x=Np(n,GC,BC).visitAfter(y);for(r=w,S=0;S<A;++S)e=n[S],x.visit(v)}function g(){if(n){var w,S=n.length,A;for(c=new Array(S),w=0;w<S;++w)A=n[w],c[A.index]=+l(A,w,n)}}function y(w){var S=0,A,x,E=0,D,R,_;if(w.length){for(D=R=_=0;_<4;++_)(A=w[_])&&(x=Math.abs(A.value))&&(S+=A.value,E+=x,D+=x*A.x,R+=x*A.y);w.x=D/E,w.y=R/E}else{A=w,A.x=A.data.x,A.y=A.data.y;do S+=c[A.data.index];while(A=A.next)}w.value=S}function v(w,S,A,x){if(!w.value)return!0;var E=w.x-e.x,D=w.y-e.y,R=x-S,_=E*E+D*D;if(R*R/m<_)return _<p&&(E===0&&(E=br(o),_+=E*E),D===0&&(D=br(o),_+=D*D),_<d&&(_=Math.sqrt(d*_)),e.vx+=E*w.value*r/_,e.vy+=D*w.value*r/_),!0;if(w.length||_>=p)return;(w.data!==e||w.next)&&(E===0&&(E=br(o),_+=E*E),D===0&&(D=br(o),_+=D*D),_<d&&(_=Math.sqrt(d*_)));do w.data!==e&&(R=c[w.data.index]*r/_,e.vx+=E*R,e.vy+=D*R);while(w=w.next)}return h.initialize=function(w,S){n=w,o=S,g()},h.strength=function(w){return arguments.length?(l=typeof w=="function"?w:Fr(+w),g(),h):l},h.distanceMin=function(w){return arguments.length?(d=w*w,h):Math.sqrt(d)},h.distanceMax=function(w){return arguments.length?(p=w*w,h):Math.sqrt(p)},h.theta=function(w){return arguments.length?(m=w*w,h):Math.sqrt(m)},h}var $u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},VC={setTimeout:(n,e)=>setTimeout(n,e),clearTimeout:n=>clearTimeout(n),setInterval:(n,e)=>setInterval(n,e),clearInterval:n=>clearInterval(n)},hr,xp,O1,XC=(O1=class{constructor(){Qe(this,hr,VC);Qe(this,xp,!1)}setTimeoutProvider(n){Re(this,hr,n)}setTimeout(n,e){return re(this,hr).setTimeout(n,e)}clearTimeout(n){re(this,hr).clearTimeout(n)}setInterval(n,e){return re(this,hr).setInterval(n,e)}clearInterval(n){re(this,hr).clearInterval(n)}},hr=new WeakMap,xp=new WeakMap,O1),rp=new XC;function KC(n){setTimeout(n,0)}var Yu=typeof window>"u"||"Deno"in globalThis;function ji(){}function QC(n,e){return typeof n=="function"?n(e):n}function ZC(n){return typeof n=="number"&&n>=0&&n!==1/0}function IC(n,e){return Math.max(n+(e||0)-Date.now(),0)}function ap(n,e){return typeof n=="function"?n(e):n}function FC(n,e){return typeof n=="function"?n(e):n}function s1(n,e){const{type:o="all",exact:r,fetchStatus:l,predicate:c,queryKey:d,stale:p}=n;if(d){if(r){if(e.queryHash!==Tp(d,e.options))return!1}else if(!wl(e.queryKey,d))return!1}if(o!=="all"){const m=e.isActive();if(o==="active"&&!m||o==="inactive"&&m)return!1}return!(typeof p=="boolean"&&e.isStale()!==p||l&&l!==e.state.fetchStatus||c&&!c(e))}function l1(n,e){const{exact:o,status:r,predicate:l,mutationKey:c}=n;if(c){if(!e.options.mutationKey)return!1;if(o){if(bl(e.options.mutationKey)!==bl(c))return!1}else if(!wl(e.options.mutationKey,c))return!1}return!(r&&e.state.status!==r||l&&!l(e))}function Tp(n,e){return((e==null?void 0:e.queryKeyHashFn)||bl)(n)}function bl(n){return JSON.stringify(n,(e,o)=>sp(o)?Object.keys(o).sort().reduce((r,l)=>(r[l]=o[l],r),{}):o)}function wl(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(o=>wl(n[o],e[o])):!1}var PC=Object.prototype.hasOwnProperty;function Bb(n,e){if(n===e)return n;const o=c1(n)&&c1(e);if(!o&&!(sp(n)&&sp(e)))return e;const l=(o?n:Object.keys(n)).length,c=o?e:Object.keys(e),d=c.length,p=o?new Array(d):{};let m=0;for(let h=0;h<d;h++){const g=o?h:c[h],y=n[g],v=e[g];if(y===v){p[g]=y,(o?h<l:PC.call(n,g))&&m++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){p[g]=v;continue}const w=Bb(y,v);p[g]=w,w===y&&m++}return l===d&&m===l?n:p}function c1(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function sp(n){if(!u1(n))return!1;const e=n.constructor;if(e===void 0)return!0;const o=e.prototype;return!(!u1(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function u1(n){return Object.prototype.toString.call(n)==="[object Object]"}function JC(n){return new Promise(e=>{rp.setTimeout(e,n)})}function WC(n,e,o){return typeof o.structuralSharing=="function"?o.structuralSharing(n,e):o.structuralSharing!==!1?Bb(n,e):e}function eE(n,e,o=0){const r=[...n,e];return o&&r.length>o?r.slice(1):r}function tE(n,e,o=0){const r=[e,...n];return o&&r.length>o?r.slice(0,-1):r}var Dp=Symbol();function Hb(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===Dp?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}var Vr,pr,Ia,R1,nE=(R1=class extends $u{constructor(){super();Qe(this,Vr);Qe(this,pr);Qe(this,Ia);Re(this,Ia,e=>{if(!Yu&&window.addEventListener){const o=()=>e();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){re(this,pr)||this.setEventListener(re(this,Ia))}onUnsubscribe(){var e;this.hasListeners()||((e=re(this,pr))==null||e.call(this),Re(this,pr,void 0))}setEventListener(e){var o;Re(this,Ia,e),(o=re(this,pr))==null||o.call(this),Re(this,pr,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){re(this,Vr)!==e&&(Re(this,Vr,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(o=>{o(e)})}isFocused(){var e;return typeof re(this,Vr)=="boolean"?re(this,Vr):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Vr=new WeakMap,pr=new WeakMap,Ia=new WeakMap,R1),$b=new nE;function iE(){let n,e;const o=new Promise((l,c)=>{n=l,e=c});o.status="pending",o.catch(()=>{});function r(l){Object.assign(o,l),delete o.resolve,delete o.reject}return o.resolve=l=>{r({status:"fulfilled",value:l}),n(l)},o.reject=l=>{r({status:"rejected",reason:l}),e(l)},o}var oE=KC;function rE(){let n=[],e=0,o=p=>{p()},r=p=>{p()},l=oE;const c=p=>{e?n.push(p):l(()=>{o(p)})},d=()=>{const p=n;n=[],p.length&&l(()=>{r(()=>{p.forEach(m=>{o(m)})})})};return{batch:p=>{let m;e++;try{m=p()}finally{e--,e||d()}return m},batchCalls:p=>(...m)=>{c(()=>{p(...m)})},schedule:c,setNotifyFunction:p=>{o=p},setBatchNotifyFunction:p=>{r=p},setScheduler:p=>{l=p}}}var jn=rE(),Fa,mr,Pa,j1,aE=(j1=class extends $u{constructor(){super();Qe(this,Fa,!0);Qe(this,mr);Qe(this,Pa);Re(this,Pa,e=>{if(!Yu&&window.addEventListener){const o=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",r)}}})}onSubscribe(){re(this,mr)||this.setEventListener(re(this,Pa))}onUnsubscribe(){var e;this.hasListeners()||((e=re(this,mr))==null||e.call(this),Re(this,mr,void 0))}setEventListener(e){var o;Re(this,Pa,e),(o=re(this,mr))==null||o.call(this),Re(this,mr,e(this.setOnline.bind(this)))}setOnline(e){re(this,Fa)!==e&&(Re(this,Fa,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return re(this,Fa)}},Fa=new WeakMap,mr=new WeakMap,Pa=new WeakMap,j1),_u=new aE;function sE(n){return Math.min(1e3*2**n,3e4)}function Yb(n){return(n??"online")==="online"?_u.isOnline():!0}var lp=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function qb(n){let e=!1,o=0,r;const l=iE(),c=()=>l.status!=="pending",d=A=>{var x;if(!c()){const E=new lp(A);v(E),(x=n.onCancel)==null||x.call(n,E)}},p=()=>{e=!0},m=()=>{e=!1},h=()=>$b.isFocused()&&(n.networkMode==="always"||_u.isOnline())&&n.canRun(),g=()=>Yb(n.networkMode)&&n.canRun(),y=A=>{c()||(r==null||r(),l.resolve(A))},v=A=>{c()||(r==null||r(),l.reject(A))},w=()=>new Promise(A=>{var x;r=E=>{(c()||h())&&A(E)},(x=n.onPause)==null||x.call(n)}).then(()=>{var A;r=void 0,c()||(A=n.onContinue)==null||A.call(n)}),S=()=>{if(c())return;let A;const x=o===0?n.initialPromise:void 0;try{A=x??n.fn()}catch(E){A=Promise.reject(E)}Promise.resolve(A).then(y).catch(E=>{var T;if(c())return;const D=n.retry??(Yu?0:3),R=n.retryDelay??sE,_=typeof R=="function"?R(o,E):R,N=D===!0||typeof D=="number"&&o<D||typeof D=="function"&&D(o,E);if(e||!N){v(E);return}o++,(T=n.onFail)==null||T.call(n,o,E),JC(_).then(()=>h()?void 0:w()).then(()=>{e?v(E):S()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(r==null||r(),l),cancelRetry:p,continueRetry:m,canStart:g,start:()=>(g()?S():w().then(S),l)}}var Xr,L1,Vb=(L1=class{constructor(){Qe(this,Xr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ZC(this.gcTime)&&Re(this,Xr,rp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Yu?1/0:300*1e3))}clearGcTimeout(){re(this,Xr)&&(rp.clearTimeout(re(this,Xr)),Re(this,Xr,void 0))}},Xr=new WeakMap,L1),Kr,Ja,Si,Qr,sn,El,Zr,Li,wo,U1,lE=(U1=class extends Vb{constructor(e){super();Qe(this,Li);Qe(this,Kr);Qe(this,Ja);Qe(this,Si);Qe(this,Qr);Qe(this,sn);Qe(this,El);Qe(this,Zr);Re(this,Zr,!1),Re(this,El,e.defaultOptions),this.setOptions(e.options),this.observers=[],Re(this,Qr,e.client),Re(this,Si,re(this,Qr).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Re(this,Kr,f1(this.options)),this.state=e.state??re(this,Kr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=re(this,sn))==null?void 0:e.promise}setOptions(e){if(this.options={...re(this,El),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=f1(this.options);o.data!==void 0&&(this.setState(d1(o.data,o.dataUpdatedAt)),Re(this,Kr,o))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,Si).remove(this)}setData(e,o){const r=WC(this.state.data,e,this.options);return _n(this,Li,wo).call(this,{data:r,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),r}setState(e,o){_n(this,Li,wo).call(this,{type:"setState",state:e,setStateOptions:o})}cancel(e){var r,l;const o=(r=re(this,sn))==null?void 0:r.promise;return(l=re(this,sn))==null||l.cancel(e),o?o.then(ji).catch(ji):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,Kr))}isActive(){return this.observers.some(e=>FC(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ap(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!IC(this.state.dataUpdatedAt,e)}onFocus(){var o;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(o=re(this,sn))==null||o.continue()}onOnline(){var o;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(o=re(this,sn))==null||o.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),re(this,Si).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(o=>o!==e),this.observers.length||(re(this,sn)&&(re(this,Zr)?re(this,sn).cancel({revert:!0}):re(this,sn).cancelRetry()),this.scheduleGc()),re(this,Si).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_n(this,Li,wo).call(this,{type:"invalidate"})}async fetch(e,o){var m,h,g,y,v,w,S,A,x,E,D,R;if(this.state.fetchStatus!=="idle"&&((m=re(this,sn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(re(this,sn))return re(this,sn).continueRetry(),re(this,sn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const _=this.observers.find(N=>N.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,l=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(Re(this,Zr,!0),r.signal)})},c=()=>{const _=Hb(this.options,o),T=(()=>{const O={client:re(this,Qr),queryKey:this.queryKey,meta:this.meta};return l(O),O})();return Re(this,Zr,!1),this.options.persister?this.options.persister(_,T,this):_(T)},p=(()=>{const _={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:re(this,Qr),state:this.state,fetchFn:c};return l(_),_})();(h=this.options.behavior)==null||h.onFetch(p,this),Re(this,Ja,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=p.fetchOptions)==null?void 0:g.meta))&&_n(this,Li,wo).call(this,{type:"fetch",meta:(y=p.fetchOptions)==null?void 0:y.meta}),Re(this,sn,qb({initialPromise:o==null?void 0:o.initialPromise,fn:p.fetchFn,onCancel:_=>{_ instanceof lp&&_.revert&&this.setState({...re(this,Ja),fetchStatus:"idle"}),r.abort()},onFail:(_,N)=>{_n(this,Li,wo).call(this,{type:"failed",failureCount:_,error:N})},onPause:()=>{_n(this,Li,wo).call(this,{type:"pause"})},onContinue:()=>{_n(this,Li,wo).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const _=await re(this,sn).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(w=(v=re(this,Si).config).onSuccess)==null||w.call(v,_,this),(A=(S=re(this,Si).config).onSettled)==null||A.call(S,_,this.state.error,this),_}catch(_){if(_ instanceof lp){if(_.silent)return re(this,sn).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw _n(this,Li,wo).call(this,{type:"error",error:_}),(E=(x=re(this,Si).config).onError)==null||E.call(x,_,this),(R=(D=re(this,Si).config).onSettled)==null||R.call(D,this.state.data,_,this),_}finally{this.scheduleGc()}}},Kr=new WeakMap,Ja=new WeakMap,Si=new WeakMap,Qr=new WeakMap,sn=new WeakMap,El=new WeakMap,Zr=new WeakMap,Li=new WeakSet,wo=function(e){const o=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cE(r.data,this.options),fetchMeta:e.meta??null};case"success":const l={...r,...d1(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Re(this,Ja,e.manual?l:void 0),l;case"error":const c=e.error;return{...r,error:c,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=o(this.state),jn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),re(this,Si).notify({query:this,type:"updated",action:e})})},U1);function cE(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yb(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function d1(n,e){return{data:n,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function f1(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,o=e!==void 0,r=o?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:o?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}function h1(n){return{onFetch:(e,o)=>{var g,y,v,w,S;const r=e.options,l=(v=(y=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:v.direction,c=((w=e.state.data)==null?void 0:w.pages)||[],d=((S=e.state.data)==null?void 0:S.pageParams)||[];let p={pages:[],pageParams:[]},m=0;const h=async()=>{let A=!1;const x=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>(e.signal.aborted?A=!0:e.signal.addEventListener("abort",()=>{A=!0}),e.signal)})},E=Hb(e.options,e.fetchOptions),D=async(R,_,N)=>{if(A)return Promise.reject();if(_==null&&R.pages.length)return Promise.resolve(R);const O=(()=>{const X={client:e.client,queryKey:e.queryKey,pageParam:_,direction:N?"backward":"forward",meta:e.options.meta};return x(X),X})(),M=await E(O),{maxPages:$}=e.options,L=N?tE:eE;return{pages:L(R.pages,M,$),pageParams:L(R.pageParams,_,$)}};if(l&&c.length){const R=l==="backward",_=R?uE:p1,N={pages:c,pageParams:d},T=_(r,N);p=await D(N,T,R)}else{const R=n??c.length;do{const _=m===0?d[0]??r.initialPageParam:p1(r,p);if(m>0&&_==null)break;p=await D(p,_),m++}while(m<R)}return p};e.options.persister?e.fetchFn=()=>{var A,x;return(x=(A=e.options).persister)==null?void 0:x.call(A,h,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},o)}:e.fetchFn=h}}}function p1(n,{pages:e,pageParams:o}){const r=e.length-1;return e.length>0?n.getNextPageParam(e[r],e,o[r],o):void 0}function uE(n,{pages:e,pageParams:o}){var r;return e.length>0?(r=n.getPreviousPageParam)==null?void 0:r.call(n,e[0],e,o[0],o):void 0}var Nl,Ii,Rn,Ir,Fi,lr,G1,dE=(G1=class extends Vb{constructor(e){super();Qe(this,Fi);Qe(this,Nl);Qe(this,Ii);Qe(this,Rn);Qe(this,Ir);Re(this,Nl,e.client),this.mutationId=e.mutationId,Re(this,Rn,e.mutationCache),Re(this,Ii,[]),this.state=e.state||fE(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){re(this,Ii).includes(e)||(re(this,Ii).push(e),this.clearGcTimeout(),re(this,Rn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Re(this,Ii,re(this,Ii).filter(o=>o!==e)),this.scheduleGc(),re(this,Rn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){re(this,Ii).length||(this.state.status==="pending"?this.scheduleGc():re(this,Rn).remove(this))}continue(){var e;return((e=re(this,Ir))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var d,p,m,h,g,y,v,w,S,A,x,E,D,R,_,N,T,O,M,$;const o=()=>{_n(this,Fi,lr).call(this,{type:"continue"})},r={client:re(this,Nl),meta:this.options.meta,mutationKey:this.options.mutationKey};Re(this,Ir,qb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,X)=>{_n(this,Fi,lr).call(this,{type:"failed",failureCount:L,error:X})},onPause:()=>{_n(this,Fi,lr).call(this,{type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>re(this,Rn).canRun(this)}));const l=this.state.status==="pending",c=!re(this,Ir).canStart();try{if(l)o();else{_n(this,Fi,lr).call(this,{type:"pending",variables:e,isPaused:c}),await((p=(d=re(this,Rn).config).onMutate)==null?void 0:p.call(d,e,this,r));const X=await((h=(m=this.options).onMutate)==null?void 0:h.call(m,e,r));X!==this.state.context&&_n(this,Fi,lr).call(this,{type:"pending",context:X,variables:e,isPaused:c})}const L=await re(this,Ir).start();return await((y=(g=re(this,Rn).config).onSuccess)==null?void 0:y.call(g,L,e,this.state.context,this,r)),await((w=(v=this.options).onSuccess)==null?void 0:w.call(v,L,e,this.state.context,r)),await((A=(S=re(this,Rn).config).onSettled)==null?void 0:A.call(S,L,null,this.state.variables,this.state.context,this,r)),await((E=(x=this.options).onSettled)==null?void 0:E.call(x,L,null,e,this.state.context,r)),_n(this,Fi,lr).call(this,{type:"success",data:L}),L}catch(L){try{throw await((R=(D=re(this,Rn).config).onError)==null?void 0:R.call(D,L,e,this.state.context,this,r)),await((N=(_=this.options).onError)==null?void 0:N.call(_,L,e,this.state.context,r)),await((O=(T=re(this,Rn).config).onSettled)==null?void 0:O.call(T,void 0,L,this.state.variables,this.state.context,this,r)),await(($=(M=this.options).onSettled)==null?void 0:$.call(M,void 0,L,e,this.state.context,r)),L}finally{_n(this,Fi,lr).call(this,{type:"error",error:L})}}finally{re(this,Rn).runNext(this)}}},Nl=new WeakMap,Ii=new WeakMap,Rn=new WeakMap,Ir=new WeakMap,Fi=new WeakSet,lr=function(e){const o=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=o(this.state),jn.batch(()=>{re(this,Ii).forEach(r=>{r.onMutationUpdate(e)}),re(this,Rn).notify({mutation:this,type:"updated",action:e})})},G1);function fE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ao,Ui,kl,B1,hE=(B1=class extends $u{constructor(e={}){super();Qe(this,Ao);Qe(this,Ui);Qe(this,kl);this.config=e,Re(this,Ao,new Set),Re(this,Ui,new Map),Re(this,kl,0)}build(e,o,r){const l=new dE({client:e,mutationCache:this,mutationId:++Jc(this,kl)._,options:e.defaultMutationOptions(o),state:r});return this.add(l),l}add(e){re(this,Ao).add(e);const o=nu(e);if(typeof o=="string"){const r=re(this,Ui).get(o);r?r.push(e):re(this,Ui).set(o,[e])}this.notify({type:"added",mutation:e})}remove(e){if(re(this,Ao).delete(e)){const o=nu(e);if(typeof o=="string"){const r=re(this,Ui).get(o);if(r)if(r.length>1){const l=r.indexOf(e);l!==-1&&r.splice(l,1)}else r[0]===e&&re(this,Ui).delete(o)}}this.notify({type:"removed",mutation:e})}canRun(e){const o=nu(e);if(typeof o=="string"){const r=re(this,Ui).get(o),l=r==null?void 0:r.find(c=>c.state.status==="pending");return!l||l===e}else return!0}runNext(e){var r;const o=nu(e);if(typeof o=="string"){const l=(r=re(this,Ui).get(o))==null?void 0:r.find(c=>c!==e&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jn.batch(()=>{re(this,Ao).forEach(e=>{this.notify({type:"removed",mutation:e})}),re(this,Ao).clear(),re(this,Ui).clear()})}getAll(){return Array.from(re(this,Ao))}find(e){const o={exact:!0,...e};return this.getAll().find(r=>l1(o,r))}findAll(e={}){return this.getAll().filter(o=>l1(e,o))}notify(e){jn.batch(()=>{this.listeners.forEach(o=>{o(e)})})}resumePausedMutations(){const e=this.getAll().filter(o=>o.state.isPaused);return jn.batch(()=>Promise.all(e.map(o=>o.continue().catch(ji))))}},Ao=new WeakMap,Ui=new WeakMap,kl=new WeakMap,B1);function nu(n){var e;return(e=n.options.scope)==null?void 0:e.id}var Pi,H1,pE=(H1=class extends $u{constructor(e={}){super();Qe(this,Pi);this.config=e,Re(this,Pi,new Map)}build(e,o,r){const l=o.queryKey,c=o.queryHash??Tp(l,o);let d=this.get(c);return d||(d=new lE({client:e,queryKey:l,queryHash:c,options:e.defaultQueryOptions(o),state:r,defaultOptions:e.getQueryDefaults(l)}),this.add(d)),d}add(e){re(this,Pi).has(e.queryHash)||(re(this,Pi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const o=re(this,Pi).get(e.queryHash);o&&(e.destroy(),o===e&&re(this,Pi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return re(this,Pi).get(e)}getAll(){return[...re(this,Pi).values()]}find(e){const o={exact:!0,...e};return this.getAll().find(r=>s1(o,r))}findAll(e={}){const o=this.getAll();return Object.keys(e).length>0?o.filter(r=>s1(e,r)):o}notify(e){jn.batch(()=>{this.listeners.forEach(o=>{o(e)})})}onFocus(){jn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){jn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pi=new WeakMap,H1),kt,gr,yr,Wa,es,vr,ts,ns,$1,mE=($1=class{constructor(n={}){Qe(this,kt);Qe(this,gr);Qe(this,yr);Qe(this,Wa);Qe(this,es);Qe(this,vr);Qe(this,ts);Qe(this,ns);Re(this,kt,n.queryCache||new pE),Re(this,gr,n.mutationCache||new hE),Re(this,yr,n.defaultOptions||{}),Re(this,Wa,new Map),Re(this,es,new Map),Re(this,vr,0)}mount(){Jc(this,vr)._++,re(this,vr)===1&&(Re(this,ts,$b.subscribe(async n=>{n&&(await this.resumePausedMutations(),re(this,kt).onFocus())})),Re(this,ns,_u.subscribe(async n=>{n&&(await this.resumePausedMutations(),re(this,kt).onOnline())})))}unmount(){var n,e;Jc(this,vr)._--,re(this,vr)===0&&((n=re(this,ts))==null||n.call(this),Re(this,ts,void 0),(e=re(this,ns))==null||e.call(this),Re(this,ns,void 0))}isFetching(n){return re(this,kt).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return re(this,gr).findAll({...n,status:"pending"}).length}getQueryData(n){var o;const e=this.defaultQueryOptions({queryKey:n});return(o=re(this,kt).get(e.queryHash))==null?void 0:o.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),o=re(this,kt).build(this,e),r=o.state.data;return r===void 0?this.fetchQuery(n):(n.revalidateIfStale&&o.isStaleByTime(ap(e.staleTime,o))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(n){return re(this,kt).findAll(n).map(({queryKey:e,state:o})=>{const r=o.data;return[e,r]})}setQueryData(n,e,o){const r=this.defaultQueryOptions({queryKey:n}),l=re(this,kt).get(r.queryHash),c=l==null?void 0:l.state.data,d=QC(e,c);if(d!==void 0)return re(this,kt).build(this,r).setData(d,{...o,manual:!0})}setQueriesData(n,e,o){return jn.batch(()=>re(this,kt).findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,e,o)]))}getQueryState(n){var o;const e=this.defaultQueryOptions({queryKey:n});return(o=re(this,kt).get(e.queryHash))==null?void 0:o.state}removeQueries(n){const e=re(this,kt);jn.batch(()=>{e.findAll(n).forEach(o=>{e.remove(o)})})}resetQueries(n,e){const o=re(this,kt);return jn.batch(()=>(o.findAll(n).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const o={revert:!0,...e},r=jn.batch(()=>re(this,kt).findAll(n).map(l=>l.cancel(o)));return Promise.all(r).then(ji).catch(ji)}invalidateQueries(n,e={}){return jn.batch(()=>(re(this,kt).findAll(n).forEach(o=>{o.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},e)))}refetchQueries(n,e={}){const o={...e,cancelRefetch:e.cancelRefetch??!0},r=jn.batch(()=>re(this,kt).findAll(n).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,o);return o.throwOnError||(c=c.catch(ji)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(r).then(ji)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const o=re(this,kt).build(this,e);return o.isStaleByTime(ap(e.staleTime,o))?o.fetch(e):Promise.resolve(o.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ji).catch(ji)}fetchInfiniteQuery(n){return n.behavior=h1(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ji).catch(ji)}ensureInfiniteQueryData(n){return n.behavior=h1(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return _u.isOnline()?re(this,gr).resumePausedMutations():Promise.resolve()}getQueryCache(){return re(this,kt)}getMutationCache(){return re(this,gr)}getDefaultOptions(){return re(this,yr)}setDefaultOptions(n){Re(this,yr,n)}setQueryDefaults(n,e){re(this,Wa).set(bl(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...re(this,Wa).values()],o={};return e.forEach(r=>{wl(n,r.queryKey)&&Object.assign(o,r.defaultOptions)}),o}setMutationDefaults(n,e){re(this,es).set(bl(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...re(this,es).values()],o={};return e.forEach(r=>{wl(n,r.mutationKey)&&Object.assign(o,r.defaultOptions)}),o}defaultQueryOptions(n){if(n._defaulted)return n;const e={...re(this,yr).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=Tp(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Dp&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...re(this,yr).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){re(this,kt).clear(),re(this,gr).clear()}},kt=new WeakMap,gr=new WeakMap,yr=new WeakMap,Wa=new WeakMap,es=new WeakMap,vr=new WeakMap,ts=new WeakMap,ns=new WeakMap,$1);function m1(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function gE(...n){return e=>{let o=!1;const r=n.map(l=>{const c=m1(l,e);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let l=0;l<r.length;l++){const c=r[l];typeof c=="function"?c():m1(n[l],null)}}}}var yE=Symbol.for("react.lazy"),Cu=MS[" use ".trim().toString()];function vE(n){return typeof n=="object"&&n!==null&&"then"in n}function Xb(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===yE&&"_payload"in n&&vE(n._payload)}function bE(n){const e=xE(n),o=ne.forwardRef((r,l)=>{let{children:c,...d}=r;Xb(c)&&typeof Cu=="function"&&(c=Cu(c._payload));const p=ne.Children.toArray(c),m=p.find(AE);if(m){const h=m.props.children,g=p.map(y=>y===m?ne.Children.count(h)>1?ne.Children.only(null):ne.isValidElement(h)?h.props.children:null:y);return z.jsx(e,{...d,ref:l,children:ne.isValidElement(h)?ne.cloneElement(h,void 0,g):null})}return z.jsx(e,{...d,ref:l,children:c})});return o.displayName=`${n}.Slot`,o}var wE=bE("Slot");function xE(n){const e=ne.forwardRef((o,r)=>{let{children:l,...c}=o;if(Xb(l)&&typeof Cu=="function"&&(l=Cu(l._payload)),ne.isValidElement(l)){const d=CE(l),p=_E(c,l.props);return l.type!==ne.Fragment&&(p.ref=r?gE(r,d):d),ne.cloneElement(l,p)}return ne.Children.count(l)>1?ne.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var SE=Symbol("radix.slottable");function AE(n){return ne.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===SE}function _E(n,e){const o={...e};for(const r in e){const l=n[r],c=e[r];/^on[A-Z]/.test(r)?l&&c?o[r]=(...p)=>{const m=c(...p);return l(...p),m}:l&&(o[r]=l):r==="style"?o[r]={...l,...c}:r==="className"&&(o[r]=[l,c].filter(Boolean).join(" "))}return{...n,...o}}function CE(n){var r,l;let e=(r=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:r.get,o=e&&"isReactWarning"in e&&e.isReactWarning;return o?n.ref:(e=(l=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:l.get,o=e&&"isReactWarning"in e&&e.isReactWarning,o?n.props.ref:n.props.ref||n.ref)}function Kb(n){var e,o,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(e=0;e<l;e++)n[e]&&(o=Kb(n[e]))&&(r&&(r+=" "),r+=o)}else for(o in n)n[o]&&(r&&(r+=" "),r+=o);return r}function Qb(){for(var n,e,o=0,r="",l=arguments.length;o<l;o++)(n=arguments[o])&&(e=Kb(n))&&(r&&(r+=" "),r+=e);return r}const g1=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,y1=Qb,Zb=(n,e)=>o=>{var r;if((e==null?void 0:e.variants)==null)return y1(n,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:l,defaultVariants:c}=e,d=Object.keys(l).map(h=>{const g=o==null?void 0:o[h],y=c==null?void 0:c[h];if(g===null)return null;const v=g1(g)||g1(y);return l[h][v]}),p=o&&Object.entries(o).reduce((h,g)=>{let[y,v]=g;return v===void 0||(h[y]=v),h},{}),m=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,g)=>{let{class:y,className:v,...w}=g;return Object.entries(w).every(S=>{let[A,x]=S;return Array.isArray(x)?x.includes({...c,...p}[A]):{...c,...p}[A]===x})?[...h,y,v]:h},[]);return y1(n,d,m,o==null?void 0:o.class,o==null?void 0:o.className)};var Ib=Object.defineProperty,EE=Object.getOwnPropertyNames,NE=(n,e,o)=>e in n?Ib(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,Mt=(n,e)=>function(){return n&&(e=(0,n[EE(n)[0]])(n=0)),e},Mp=(n,e)=>{for(var o in e)Ib(n,o,{get:e[o],enumerable:!0})},cp=(n,e,o)=>NE(n,typeof e!="symbol"?e+"":e,o),kE=Mt({"src/core/types.ts"(){}}),qu={};Mp(qu,{ZOOM_EXIT_THRESHOLD:()=>Zu,ZOOM_TRANSITION_THRESHOLD:()=>Qu,isZoomTransitioningAtom:()=>Fu,panAtom:()=>nn,resetViewportAtom:()=>zl,screenToWorldAtom:()=>Vu,setZoomAtom:()=>Ku,viewportRectAtom:()=>Zn,worldToScreenAtom:()=>Xu,zoomAtom:()=>Tt,zoomFocusNodeIdAtom:()=>Iu,zoomTransitionProgressAtom:()=>xl});var Tt,nn,Zn,Vu,Xu,Ku,zl,Qu,Zu,Iu,xl,Fu,cn=Mt({"src/core/viewport-store.ts"(){Tt=K(1),nn=K({x:0,y:0}),Zn=K(null),Vu=K(n=>(e,o)=>{const r=n(nn),l=n(Tt),c=n(Zn);if(!c)return{x:e,y:o};const d=e-c.left,p=o-c.top;return{x:(d-r.x)/l,y:(p-r.y)/l}}),Xu=K(n=>(e,o)=>{const r=n(nn),l=n(Tt),c=n(Zn);return c?{x:e*l+r.x+c.left,y:o*l+r.y+c.top}:{x:e,y:o}}),Ku=K(null,(n,e,{zoom:o,centerX:r,centerY:l})=>{const c=n(Tt),d=n(nn),p=n(Zn),m=Math.max(.1,Math.min(5,o));if(r!==void 0&&l!==void 0&&p){const h=r-p.left,g=l-p.top,y=(h-d.x)/c,v=(g-d.y)/c,w=h-y*m,S=g-v*m;e(nn,{x:w,y:S})}e(Tt,m)}),zl=K(null,(n,e)=>{e(Tt,1),e(nn,{x:0,y:0})}),Qu=3.5,Zu=2,Iu=K(null),xl=K(0),Fu=K(n=>{const e=n(xl);return e>0&&e<1})}});function ln(n){return $3(`${Fb}:${n}`)}var Fb,Mo=Mt({"src/utils/debug.ts"(){Fb="canvas",ln("graph:node"),ln("graph:edge"),ln("graph:sync"),ln("ui:selection"),ln("ui:drag"),ln("ui:resize"),ln("sync:status"),ln("sync:mutations"),ln("sync:queue"),ln("viewport")}}),gt,iu,wr,ze,en,xi,Qn,zp,up,dp,Pb,Qa,Gi,pl,fp,ls,Sl,Op,Al,Jb,Rp,jp,Lp,Up,Wb,Gp,Bp,e2,t2,n2,Zt=Mt({"src/core/graph-store.ts"(){cn(),Mo(),gt=ln("graph"),iu={type:"directed",multi:!0,allowSelfLoops:!0},wr=K(null),ze=K(new We(iu)),en=K(0),xi=Mh(n=>K(e=>{e(Qn);const o=e(ze);return o.hasNode(n)?{x:o.getNodeAttribute(n,"x"),y:o.getNodeAttribute(n,"y")}:{x:0,y:0}})),Qn=K(0),zp=K(null,(n,e,{nodeId:o,position:r})=>{const l=n(ze);l.hasNode(o)&&(gt("Updating node %s position to %o",o,r),l.setNodeAttribute(o,"x",r.x),l.setNodeAttribute(o,"y",r.y),e(Qn,c=>c+1))}),up=K(null,(n,e,o)=>{xi.remove(o),gt("Removed position atom for node: %s",o)}),dp=K(null,(n,e)=>{const r=n(ze).nodes();r.forEach(l=>{xi.remove(l)}),gt("Removed %d position atoms",r.length)}),Pb=K(null,(n,e)=>{gt("Clearing graph for switch"),e(dp);const o=new We(iu);e(ze,o),e(en,r=>r+1)}),Qa=K({isCreating:!1,sourceNodeId:null,sourceNodePosition:null,targetPosition:null,hoveredTargetNodeId:null,sourceHandle:null,targetHandle:null,sourcePort:null,targetPort:null,snappedTargetPosition:null}),Gi=K(null),pl=K(null),fp=K(n=>{n(en);const e=n(ze);let o=0;return e.forEachNode((r,l)=>{l.zIndex>o&&(o=l.zIndex)}),o}),ls=K(n=>{n(en);const e=n(ze),o=n(Gi),r=[];return e.forEachNode((l,c)=>{const d=n(xi(l));r.push({...c,id:l,position:d,isDragging:l===o})}),r}),Sl=K(n=>(n(en),n(ze).nodes())),Op=Mh(n=>K(e=>{e(en);const o=e(ze);if(!o.hasNode(n))return null;const r=o.getNodeAttributes(n),l=e(xi(n)),c=e(Gi);return{...r,id:n,position:l,isDragging:n===c}}),(n,e)=>n===e),Al=K(n=>(n(en),n(ze).edges())),Jb=K(n=>{const e=n(Al);return n(Qa).isCreating?[...e,"temp-creating-edge"]:e}),Rp=Mh(n=>K(e=>{if(e(Qn),n==="temp-creating-edge"){const g=e(Qa),y=e(ze);if(g.isCreating&&g.sourceNodeId&&g.targetPosition){const v=y.getNodeAttributes(g.sourceNodeId),w=e(xi(g.sourceNodeId)),S=e(nn),A=e(Tt),x=e(Zn);if(v&&x){const E=g.targetPosition.x-x.left,D=g.targetPosition.y-x.top,R=(E-S.x)/A,_=(D-S.y)/A;return{key:"temp-creating-edge",sourceId:g.sourceNodeId,targetId:"temp-cursor",sourcePosition:w,targetPosition:{x:R,y:_},sourceNodeSize:v.size,sourceNodeWidth:v.width,sourceNodeHeight:v.height,targetNodeSize:0,targetNodeWidth:0,targetNodeHeight:0,type:"dashed",color:"#FF9800",weight:2,label:void 0,dbData:{id:"temp-creating-edge",graph_id:e(wr)||"",source_node_id:g.sourceNodeId,target_node_id:"temp-cursor",edge_type:"temp",filter_condition:null,ui_properties:null,data:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}}}return null}const o=e(ze);if(!o.hasEdge(n))return null;const r=o.source(n),l=o.target(n),c=o.getEdgeAttributes(n),d=o.getNodeAttributes(r),p=o.getNodeAttributes(l),m=e(xi(r)),h=e(xi(l));return d&&p?{...c,key:n,sourceId:r,targetId:l,sourcePosition:m,targetPosition:h,sourceNodeSize:d.size,targetNodeSize:p.size,sourceNodeWidth:d.width??d.size,sourceNodeHeight:d.height??d.size,targetNodeWidth:p.width??p.size,targetNodeHeight:p.height??p.size}:null}),(n,e)=>n===e),jp=K(null,(n,e,{nodeId:o})=>{const r=n(ze);if(!r.hasNode(o))return;const l=r.getNodeAttributes(o);e(pl,JSON.parse(JSON.stringify(l)));const d=n(fp)+1;r.setNodeAttribute(o,"zIndex",d),e(Gi,o)}),Lp=K(null,(n,e,o)=>{const r=n(Gi);r&&gt("Node %s drag ended",r),e(Gi,null),e(pl,null)}),Up=K(null,(n,e,{nodeId:o})=>{const r=n(ze);r.hasNode(o)&&(r.dropNode(o),e(up,o),e(ze,r.copy()),gt("Optimistically deleted node %s",o))}),Wb=K(null,(n,e,{edgeKey:o})=>{const r=n(ze);r.hasEdge(o)&&(r.dropEdge(o),e(ze,r.copy()),gt("Optimistically deleted edge %s",o))}),Gp=K(null,(n,e,o)=>{const r=n(ze);if(r.hasNode(o.id)){gt("Node %s already exists, skipping",o.id);return}const l=o.ui_properties||{},c={x:typeof l.x=="number"?l.x:Math.random()*800,y:typeof l.y=="number"?l.y:Math.random()*600,size:typeof l.size=="number"?l.size:15,width:typeof l.width=="number"?l.width:500,height:typeof l.height=="number"?l.height:500,color:typeof l.color=="string"?l.color:"#ccc",label:o.label||o.node_type||o.id,zIndex:typeof l.zIndex=="number"?l.zIndex:0,dbData:o};gt("Adding node %s to local graph at (%d, %d)",o.id,c.x,c.y),r.addNode(o.id,c),e(ze,r.copy()),e(en,d=>d+1),e(Qn,d=>d+1)}),Bp=K(null,(n,e,o)=>{const r=n(ze);if(r.hasNode(o.source_node_id)&&r.hasNode(o.target_node_id)){const l=o.ui_properties||{},c={type:typeof l.style=="string"?l.style:"solid",color:typeof l.color=="string"?l.color:"#999",label:o.edge_type??void 0,weight:typeof l.weight=="number"?l.weight:1,dbData:o};if(!r.hasEdge(o.id))try{gt("Adding edge %s to local graph",o.id),r.addEdgeWithKey(o.id,o.source_node_id,o.target_node_id,c),e(ze,r.copy()),e(en,d=>d+1)}catch(d){gt("Failed to add edge %s: %o",o.id,d)}}}),e2=K(null,(n,e,o)=>{const r=n(ze);r.hasEdge(o)&&(r.dropEdge(o),e(ze,r.copy()),e(en,l=>l+1))}),t2=K(null,(n,e,{tempEdgeId:o,newEdge:r})=>{const l=n(ze);if(l.hasEdge(o)&&l.dropEdge(o),l.hasNode(r.source_node_id)&&l.hasNode(r.target_node_id)){const c=r.ui_properties||{},d={type:typeof c.style=="string"?c.style:"solid",color:typeof c.color=="string"?c.color:"#999",label:r.edge_type??void 0,weight:typeof c.weight=="number"?c.weight:1,dbData:r};if(!l.hasEdge(r.id))try{gt("Atomically swapping temp edge %s with real edge %s",o,r.id),l.addEdgeWithKey(r.id,r.source_node_id,r.target_node_id,d)}catch(p){gt("Failed to add edge %s: %o",r.id,p)}}e(ze,l.copy()),e(en,c=>c+1)}),n2=K(null,(n,e,o,r)=>{gt("========== START SYNC =========="),gt("Fetched nodes: %d, edges: %d",o.length,r.length);const l=n(wr);if(o.length>0&&o[0].graph_id!==l){gt("Skipping sync - data belongs to different graph");return}const c=n(ze);if(n(Gi)!==null){gt("Skipping sync - drag in progress");return}const p=new Set(c.nodes()),m=new Set(o.map(v=>v.id)),h=Array.from(p).some(v=>m.has(v));let g;h&&p.size>0?(gt("Merging DB data into existing graph"),g=c.copy()):(gt("Creating fresh graph (graph switch detected)"),g=new We(iu));const y=new Set(r.map(v=>v.id));h&&p.size>0&&g.forEachNode(v=>{m.has(v)||(gt("Removing deleted node: %s",v),g.dropNode(v),xi.remove(v))}),o.forEach(v=>{const w=v.ui_properties||{},S=typeof w.x=="number"?w.x:Math.random()*800,A=typeof w.y=="number"?w.y:Math.random()*600;if(g.hasNode(v.id)){const x=g.getNodeAttributes(v.id),E={x:S,y:A,size:typeof w.size=="number"?w.size:x.size,width:typeof w.width=="number"?w.width:x.width??500,height:typeof w.height=="number"?w.height:x.height??500,color:typeof w.color=="string"?w.color:x.color,label:v.label||v.node_type||v.id,zIndex:typeof w.zIndex=="number"?w.zIndex:x.zIndex,dbData:v};g.replaceNodeAttributes(v.id,E)}else{const x={x:S,y:A,size:typeof w.size=="number"?w.size:15,width:typeof w.width=="number"?w.width:500,height:typeof w.height=="number"?w.height:500,color:typeof w.color=="string"?w.color:"#ccc",label:v.label||v.node_type||v.id,zIndex:typeof w.zIndex=="number"?w.zIndex:0,dbData:v};g.addNode(v.id,x)}}),g.forEachEdge(v=>{y.has(v)||(gt("Removing deleted edge: %s",v),g.dropEdge(v))}),r.forEach(v=>{if(g.hasNode(v.source_node_id)&&g.hasNode(v.target_node_id)){const w=v.ui_properties||{},S={type:typeof w.style=="string"?w.style:"solid",color:typeof w.color=="string"?w.color:"#999",label:v.edge_type??void 0,weight:typeof w.weight=="number"?w.weight:1,dbData:v};if(g.hasEdge(v.id))g.replaceEdgeAttributes(v.id,S);else try{g.addEdgeWithKey(v.id,v.source_node_id,v.target_node_id,S)}catch(A){gt("Failed to add edge %s: %o",v.id,A)}}}),e(ze,g),e(en,v=>v+1),gt("========== SYNC COMPLETE =========="),gt("Final graph: %d nodes, %d edges",g.order,g.size)})}}),rr,tt,_o,Hp,Pu,$p,cs,Ol,i2,Ju,Yp,qp,Vp,Tn=Mt({"src/core/selection-store.ts"(){Mo(),rr=ln("selection"),tt=K(new Set),_o=K(null),Hp=K(null,(n,e,{nodeId:o,isShiftPressed:r})=>{const l=n(tt);if(rr("handleNodePointerDownSelection: nodeId=%s, shift=%s, current=%o",o,r,Array.from(l)),e(_o,null),r){const c=new Set(l);c.has(o)?c.delete(o):c.add(o),rr("Shift-click, setting selection to: %o",Array.from(c)),e(tt,c)}else l.has(o)?rr("Node already selected, preserving multi-select"):(rr("Node not in selection, selecting: %s",o),e(tt,new Set([o])))}),Pu=K(null,(n,e,o)=>{if(rr("selectSingleNode: %s",o),e(_o,null),o==null)rr("Clearing selection"),e(tt,new Set);else{const r=n(tt);if(r.has(o)&&r.size===1)return;e(tt,new Set([o]))}}),$p=K(null,(n,e,o)=>{const r=n(tt),l=new Set(r);l.has(o)?l.delete(o):l.add(o),e(tt,l)}),cs=K(null,(n,e)=>{rr("clearSelection"),e(tt,new Set)}),Ol=K(null,(n,e,o)=>{const r=n(tt),l=new Set(r);for(const c of o)l.add(c);e(tt,l)}),i2=K(null,(n,e,o)=>{const r=n(tt),l=new Set(r);for(const c of o)l.delete(c);e(tt,l)}),Ju=K(null,(n,e,o)=>{e(_o,o),o!==null&&e(tt,new Set)}),Yp=K(null,(n,e)=>{e(_o,null)}),qp=K(n=>n(tt).size),Vp=K(n=>n(tt).size>0)}}),zi,ai,Ri,qr,xo,uu,wi,o2,Wu,ed,r2,a2,s2,l2,c2,u2,d2,zo=Mt({"src/core/sync-store.ts"(){Mo(),zi=ln("sync"),ai=K("synced"),Ri=K(0),qr=K(typeof navigator<"u"?navigator.onLine:!0),xo=K(null),uu=K(Date.now()),wi=K([]),o2=K(n=>({status:n(ai),pendingMutations:n(Ri),lastError:n(xo),lastSyncTime:n(uu),isOnline:n(qr),queuedMutations:n(wi).length})),Wu=K(null,(n,e)=>{const o=n(Ri),r=o+1;e(Ri,r),zi("Mutation started. Pending count: %d -> %d",o,r),r>0&&n(ai)!=="syncing"&&(e(ai,"syncing"),zi("Status -> syncing"))}),ed=K(null,(n,e,o=!0)=>{const r=n(Ri),l=Math.max(0,r-1);if(e(Ri,l),zi("Mutation completed (success: %s). Pending count: %d -> %d",o,r,l),o&&(e(uu,Date.now()),l===0&&e(xo,null)),l===0){const c=n(qr);n(xo)!==null?(e(ai,"error"),zi("Status -> error")):c?(e(ai,"synced"),zi("Status -> synced")):(e(ai,"offline"),zi("Status -> offline"))}}),r2=K(null,(n,e,o)=>{e(xo,o),zi("Mutation failed: %s",o)}),a2=K(null,(n,e,o)=>{e(qr,o);const r=n(Ri),l=n(xo)!==null,c=n(wi).length;r===0&&(l||c>0?e(ai,"error"):e(ai,o?"synced":"offline"))}),s2=K(null,(n,e,o)=>{const r=n(wi),l={...o,id:crypto.randomUUID(),timestamp:Date.now(),retryCount:0,maxRetries:o.maxRetries??3},c=[...r,l];return e(wi,c),zi("Queued mutation: %s. Queue size: %d",o.type,c.length),n(Ri)===0&&e(ai,"error"),l.id}),l2=K(null,(n,e,o)=>{const l=n(wi).filter(c=>c.id!==o);e(wi,l),zi("Dequeued mutation: %s. Queue size: %d",o,l.length),l.length===0&&n(Ri)===0&&n(xo)===null&&e(ai,n(qr)?"synced":"offline")}),c2=K(null,(n,e,o)=>{const l=n(wi).map(c=>c.id===o?{...c,retryCount:c.retryCount+1}:c);e(wi,l)}),u2=K(n=>n(wi).find(o=>o.retryCount<o.maxRetries)??null),d2=K(null,(n,e)=>{e(wi,[]),zi("Cleared mutation queue"),n(Ri)===0&&n(xo)===null&&e(ai,n(qr)?"synced":"offline")})}}),cr,dl,du,f2,h2,p2,m2,g2,y2,v2,b2,TE=Mt({"src/core/interaction-store.ts"(){cr=K({type:"normal"}),dl=K(null),du=K(null),f2=K(null,(n,e)=>{e(cr,{type:"normal"}),e(dl,null),e(du,null)}),h2=K(null,(n,e,o)=>{e(cr,{type:"pickNode",...o})}),p2=K(null,(n,e,o)=>{e(cr,{type:"pickNodes",...o})}),m2=K(null,(n,e,o)=>{e(cr,{type:"pickPoint",...o})}),g2=K(null,(n,e,o)=>{e(du,o)}),y2=K(null,(n,e,o)=>{const r=n(dl);e(dl,{...r,...o})}),v2=K(n=>n(cr).type!=="normal"),b2=K(n=>{const e=n(cr);return e.type==="pickNode"||e.type==="pickNodes"})}}),fr,w2,ur,fl,Xp,Kp,x2,S2,A2,_2,Qp=Mt({"src/core/locked-node-store.ts"(){Zt(),fr=K(null),w2=K(n=>{const e=n(fr);return e&&n(ls).find(r=>r.id===e)||null}),ur=K(0),fl=K(1),Xp=K(null,(n,e,o)=>{e(fr,o.nodeId),e(ur,0)}),Kp=K(null,(n,e)=>{e(fr,null)}),x2=K(null,(n,e)=>{const o=n(ur),r=n(fl);e(ur,(o+1)%r)}),S2=K(null,(n,e)=>{const o=n(ur),r=n(fl);e(ur,(o-1+r)%r)}),A2=K(null,(n,e,o)=>{const r=n(fl);o>=0&&o<r&&e(ur,o)}),_2=K(n=>n(fr)!==null)}});function DE(n,e){ea.set(n,e)}function ME(n){for(const[e,o]of Object.entries(n))ea.set(e,o)}function zE(n){if(n)return ea.get(n)}function OE(n){return n?ea.has(n):!1}function RE(){return Array.from(ea.keys())}function jE(){ea.clear()}var ea,C2,E2=Mt({"src/core/node-type-registry.tsx"(){ea=new Map,C2=n=>{const e=Oe.c(11),{nodeData:o}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={padding:"12px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",color:"#666",fontSize:"12px"},e[0]=r):r=e[0];const l=o.dbData.node_type||"none";let c;e[1]!==l?(c=z.jsxs("div",{children:["Unknown type: ",l]}),e[1]=l,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={marginTop:"4px",opacity:.7},e[3]=d):d=e[3];let p;e[4]!==o.id?(p=o.id.substring(0,8),e[4]=o.id,e[5]=p):p=e[5];let m;e[6]!==p?(m=z.jsx("div",{style:d,children:p}),e[6]=p,e[7]=m):m=e[7];let h;return e[8]!==c||e[9]!==m?(h=z.jsxs("div",{style:r,children:[c,m]}),e[8]=c,e[9]=m,e[10]=h):h=e[10],h}}});function hp(n,e){switch(e.type){case"move-node":return n.hasNode(e.nodeId)&&(n.setNodeAttribute(e.nodeId,"x",e.to.x),n.setNodeAttribute(e.nodeId,"y",e.to.y)),!1;case"resize-node":return n.hasNode(e.nodeId)&&(n.setNodeAttribute(e.nodeId,"width",e.to.width),n.setNodeAttribute(e.nodeId,"height",e.to.height)),!1;case"add-node":return n.hasNode(e.nodeId)?!1:(n.addNode(e.nodeId,e.attributes),!0);case"remove-node":return n.hasNode(e.nodeId)?(n.dropNode(e.nodeId),!0):!1;case"add-edge":return n.hasEdge(e.edgeId)||!n.hasNode(e.source)||!n.hasNode(e.target)?!1:(n.addEdgeWithKey(e.edgeId,e.source,e.target,e.attributes),!0);case"remove-edge":return n.hasEdge(e.edgeId)?(n.dropEdge(e.edgeId),!0):!1;case"update-node-attr":return n.hasNode(e.nodeId)&&n.setNodeAttribute(e.nodeId,e.key,e.to),!1;case"batch":{let o=!1;for(const r of e.deltas)hp(n,r)&&(o=!0);return o}case"full-snapshot":{n.clear();for(const o of e.nodes)n.addNode(o.id,o.attributes);for(const o of e.edges)n.hasNode(o.source)&&n.hasNode(o.target)&&n.addEdgeWithKey(o.id,o.source,o.target,o.attributes);return!0}}}function N2(n){switch(n.type){case"move-node":return{...n,from:n.to,to:n.from};case"resize-node":return{...n,from:n.to,to:n.from};case"add-node":return{type:"remove-node",nodeId:n.nodeId,attributes:n.attributes,connectedEdges:[]};case"remove-node":const e=[{type:"add-node",nodeId:n.nodeId,attributes:n.attributes},...n.connectedEdges.map(o=>({type:"add-edge",edgeId:o.id,source:o.source,target:o.target,attributes:o.attributes}))];return e.length===1?e[0]:{type:"batch",deltas:e};case"add-edge":return{type:"remove-edge",edgeId:n.edgeId,source:n.source,target:n.target,attributes:n.attributes};case"remove-edge":return{type:"add-edge",edgeId:n.edgeId,source:n.source,target:n.target,attributes:n.attributes};case"update-node-attr":return{...n,from:n.to,to:n.from};case"batch":return{type:"batch",deltas:n.deltas.map(N2).reverse()};case"full-snapshot":return n}}function jh(n,e){const o=[],r=[];return n.forEachNode((l,c)=>{o.push({id:l,attributes:{...c}})}),n.forEachEdge((l,c,d,p)=>{r.push({id:l,source:d,target:p,attributes:{...c}})}),{timestamp:Date.now(),label:e,nodes:o,edges:r}}var $a,Lh,Kt,td,nd,Zp,Ip,k2,us,Rl,jl,Fp,Pp,ds=Mt({"src/core/history-store.ts"(){Zt(),Mo(),$a=ln("history"),Lh=50,Kt=K({past:[],future:[],isApplying:!1}),td=K(n=>{const e=n(Kt);return e.past.length>0&&!e.isApplying}),nd=K(n=>{const e=n(Kt);return e.future.length>0&&!e.isApplying}),Zp=K(n=>n(Kt).past.length),Ip=K(n=>n(Kt).future.length),k2=K(null,(n,e,o)=>{const r=n(Kt);if(r.isApplying)return;const{label:l,...c}=o,d={forward:c,reverse:N2(c),timestamp:Date.now(),label:l},p=[...r.past,d];p.length>Lh&&p.shift(),e(Kt,{past:p,future:[],isApplying:!1}),$a("Pushed delta: %s (past: %d)",l||o.type,p.length)}),us=K(null,(n,e,o)=>{const r=n(Kt);if(r.isApplying)return;const l=n(ze),c=jh(l,o),d={type:"full-snapshot",nodes:c.nodes,edges:c.edges},p={forward:d,reverse:d,timestamp:Date.now(),label:o},m=[...r.past,p];m.length>Lh&&m.shift(),e(Kt,{past:m,future:[],isApplying:!1}),$a("Pushed snapshot: %s (past: %d)",o||"unnamed",m.length)}),Rl=K(null,(n,e)=>{const o=n(Kt);if(o.past.length===0||o.isApplying)return!1;e(Kt,{...o,isApplying:!0});try{const r=n(ze),l=[...o.past],c=l.pop();let d=c.forward;if(c.reverse.type==="full-snapshot"){const h=jh(r,"current");d={type:"full-snapshot",nodes:h.nodes,edges:h.edges}}hp(r,c.reverse)&&(e(ze,r),e(en,h=>h+1)),e(Qn,h=>h+1);const m={forward:d,reverse:c.reverse,timestamp:c.timestamp,label:c.label};return e(Kt,{past:l,future:[m,...o.future],isApplying:!1}),$a("Undo: %s (past: %d, future: %d)",c.label,l.length,o.future.length+1),!0}catch(r){return console.error("[History] Undo failed:",r),e(Kt,{...o,isApplying:!1}),!1}}),jl=K(null,(n,e)=>{const o=n(Kt);if(o.future.length===0||o.isApplying)return!1;e(Kt,{...o,isApplying:!0});try{const r=n(ze),l=[...o.future],c=l.shift();let d=c.reverse;if(c.forward.type==="full-snapshot"){const h=jh(r,"current");d={type:"full-snapshot",nodes:h.nodes,edges:h.edges}}hp(r,c.forward)&&(e(ze,r),e(en,h=>h+1)),e(Qn,h=>h+1);const m={forward:c.forward,reverse:d,timestamp:c.timestamp,label:c.label};return e(Kt,{past:[...o.past,m],future:l,isApplying:!1}),$a("Redo: %s (past: %d, future: %d)",c.label,o.past.length+1,l.length),!0}catch(r){return console.error("[History] Redo failed:",r),e(Kt,{...o,isApplying:!1}),!1}}),Fp=K(null,(n,e)=>{e(Kt,{past:[],future:[],isApplying:!1}),$a("History cleared")}),Pp=K(n=>{const e=n(Kt);return{past:e.past.map(o=>o.label||"Unnamed"),future:e.future.map(o=>o.label||"Unnamed")}})}});function T2(n,e){return{x:Math.round(n.x/e)*e,y:Math.round(n.y/e)*e}}function LE(n,e,o){return o?T2(n,e):n}function UE(n,e,o=5){const r=Math.round(n.x/e)*e,l=Math.round(n.y/e)*e;return{x:Math.abs(n.x-r)<o?r:null,y:Math.abs(n.y-l)<o?l:null}}var qa,Eu,pp,D2,Jp,M2,GE=Mt({"src/core/snap-store.ts"(){qa=K(!1),Eu=K(20),pp=K(!1),D2=K(n=>n(qa)&&!n(pp)),Jp=K(null,(n,e)=>{e(qa,!n(qa))}),M2=K(null,(n,e,o)=>{e(Eu,Math.max(5,Math.min(200,o)))})}}),fe,xr,Ze,Ne,Va,Ll=Mt({"src/core/settings-types.ts"(){fe=(function(n){return n.NodeClick="node:click",n.NodeDoubleClick="node:double-click",n.NodeTripleClick="node:triple-click",n.NodeRightClick="node:right-click",n.NodeLongPress="node:long-press",n.EdgeClick="edge:click",n.EdgeDoubleClick="edge:double-click",n.EdgeRightClick="edge:right-click",n.BackgroundClick="background:click",n.BackgroundDoubleClick="background:double-click",n.BackgroundRightClick="background:right-click",n.BackgroundLongPress="background:long-press",n})({}),xr={[fe.NodeClick]:{type:fe.NodeClick,label:"Click Node",description:"Triggered when clicking on a node",category:"node"},[fe.NodeDoubleClick]:{type:fe.NodeDoubleClick,label:"Double-click Node",description:"Triggered when double-clicking on a node",category:"node"},[fe.NodeTripleClick]:{type:fe.NodeTripleClick,label:"Triple-click Node",description:"Triggered when triple-clicking on a node",category:"node"},[fe.NodeRightClick]:{type:fe.NodeRightClick,label:"Right-click Node",description:"Triggered when right-clicking on a node",category:"node"},[fe.NodeLongPress]:{type:fe.NodeLongPress,label:"Long-press Node",description:"Triggered when long-pressing on a node (mobile/touch)",category:"node"},[fe.EdgeClick]:{type:fe.EdgeClick,label:"Click Edge",description:"Triggered when clicking on an edge",category:"edge"},[fe.EdgeDoubleClick]:{type:fe.EdgeDoubleClick,label:"Double-click Edge",description:"Triggered when double-clicking on an edge",category:"edge"},[fe.EdgeRightClick]:{type:fe.EdgeRightClick,label:"Right-click Edge",description:"Triggered when right-clicking on an edge",category:"edge"},[fe.BackgroundClick]:{type:fe.BackgroundClick,label:"Click Background",description:"Triggered when clicking on the canvas background",category:"background"},[fe.BackgroundDoubleClick]:{type:fe.BackgroundDoubleClick,label:"Double-click Background",description:"Triggered when double-clicking on the canvas background",category:"background"},[fe.BackgroundRightClick]:{type:fe.BackgroundRightClick,label:"Right-click Background",description:"Triggered when right-clicking on the canvas background",category:"background"},[fe.BackgroundLongPress]:{type:fe.BackgroundLongPress,label:"Long-press Background",description:"Triggered when long-pressing on the canvas background (mobile/touch)",category:"background"}},Ze=(function(n){return n.None="none",n.Selection="selection",n.Viewport="viewport",n.Node="node",n.Layout="layout",n.History="history",n.Custom="custom",n})({}),Ne={None:"none",SelectNode:"select-node",SelectEdge:"select-edge",AddToSelection:"add-to-selection",ClearSelection:"clear-selection",DeleteSelected:"delete-selected",FitToView:"fit-to-view",FitAllToView:"fit-all-to-view",CenterOnNode:"center-on-node",ResetViewport:"reset-viewport",LockNode:"lock-node",UnlockNode:"unlock-node",ToggleLock:"toggle-lock",OpenContextMenu:"open-context-menu",ApplyForceLayout:"apply-force-layout",Undo:"undo",Redo:"redo",CreateNode:"create-node"},Va={[fe.NodeClick]:Ne.None,[fe.NodeDoubleClick]:Ne.FitToView,[fe.NodeTripleClick]:Ne.ToggleLock,[fe.NodeRightClick]:Ne.OpenContextMenu,[fe.NodeLongPress]:Ne.OpenContextMenu,[fe.EdgeClick]:Ne.SelectEdge,[fe.EdgeDoubleClick]:Ne.None,[fe.EdgeRightClick]:Ne.OpenContextMenu,[fe.BackgroundClick]:Ne.ClearSelection,[fe.BackgroundDoubleClick]:Ne.FitAllToView,[fe.BackgroundRightClick]:Ne.None,[fe.BackgroundLongPress]:Ne.CreateNode}}});function Wt(n){ta.set(n.id,n)}function z2(n){return ta.get(n)}function BE(n){return ta.has(n)}function O2(){return Array.from(ta.values())}function R2(n){return O2().filter(e=>e.category===n)}function HE(n){return ta.delete(n)}function $E(){ta.clear()}function YE(){Wt({id:Ne.None,label:"None",description:"Do nothing",category:Ze.None,icon:"ban",isBuiltIn:!0,handler:()=>{}}),Wt({id:Ne.SelectNode,label:"Select Node",description:"Select this node (replacing current selection)",category:Ze.Selection,icon:"pointer",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.selectNode(n.nodeId)}}),Wt({id:Ne.SelectEdge,label:"Select Edge",description:"Select this edge",category:Ze.Selection,icon:"git-commit",isBuiltIn:!0,handler:(n,e)=>{n.edgeId&&e.selectEdge(n.edgeId)}}),Wt({id:Ne.AddToSelection,label:"Add to Selection",description:"Add this node to the current selection",category:Ze.Selection,icon:"plus-square",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.addToSelection(n.nodeId)}}),Wt({id:Ne.ClearSelection,label:"Clear Selection",description:"Deselect all nodes",category:Ze.Selection,icon:"x-square",isBuiltIn:!0,handler:(n,e)=>{e.clearSelection()}}),Wt({id:Ne.DeleteSelected,label:"Delete Selected",description:"Delete all selected nodes",category:Ze.Selection,icon:"trash-2",isBuiltIn:!0,handler:async(n,e)=>{const o=e.getSelectedNodeIds();for(const r of o)await e.deleteNode(r)}}),Wt({id:Ne.FitToView,label:"Fit to View",description:"Zoom and pan to fit this node in view",category:Ze.Viewport,icon:"maximize-2",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.centerOnNode(n.nodeId)}}),Wt({id:Ne.FitAllToView,label:"Fit All to View",description:"Zoom and pan to fit all nodes in view",category:Ze.Viewport,icon:"maximize",isBuiltIn:!0,handler:(n,e)=>{e.fitToBounds("graph")}}),Wt({id:Ne.CenterOnNode,label:"Center on Node",description:"Center the viewport on this node",category:Ze.Viewport,icon:"crosshair",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.centerOnNode(n.nodeId)}}),Wt({id:Ne.ResetViewport,label:"Reset Viewport",description:"Reset zoom to 100% and center on origin",category:Ze.Viewport,icon:"home",isBuiltIn:!0,handler:(n,e)=>{e.resetViewport()}}),Wt({id:Ne.LockNode,label:"Lock Node",description:"Prevent this node from being moved",category:Ze.Node,icon:"lock",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.lockNode(n.nodeId)}}),Wt({id:Ne.UnlockNode,label:"Unlock Node",description:"Allow this node to be moved",category:Ze.Node,icon:"unlock",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.unlockNode(n.nodeId)}}),Wt({id:Ne.ToggleLock,label:"Toggle Lock",description:"Toggle whether this node can be moved",category:Ze.Node,icon:"lock",requiresNode:!0,isBuiltIn:!0,handler:(n,e)=>{n.nodeId&&e.toggleLock(n.nodeId)}}),Wt({id:Ne.OpenContextMenu,label:"Open Context Menu",description:"Show the context menu for this node",category:Ze.Node,icon:"more-vertical",isBuiltIn:!0,handler:(n,e)=>{e.openContextMenu&&e.openContextMenu(n.screenPosition,n.nodeId)}}),Wt({id:Ne.ApplyForceLayout,label:"Apply Force Layout",description:"Automatically arrange nodes using force-directed layout",category:Ze.Layout,icon:"layout-grid",isBuiltIn:!0,handler:async(n,e)=>{await e.applyForceLayout()}}),Wt({id:Ne.Undo,label:"Undo",description:"Undo the last action",category:Ze.History,icon:"undo-2",isBuiltIn:!0,handler:(n,e)=>{e.canUndo()&&e.undo()}}),Wt({id:Ne.Redo,label:"Redo",description:"Redo the last undone action",category:Ze.History,icon:"redo-2",isBuiltIn:!0,handler:(n,e)=>{e.canRedo()&&e.redo()}}),Wt({id:Ne.CreateNode,label:"Create Node",description:"Create a new node at this position",category:Ze.Node,icon:"plus",isBuiltIn:!0,handler:async(n,e)=>{e.createNode&&await e.createNode(n.worldPosition)}})}function j2(){const n={[Ze.None]:"None",[Ze.Selection]:"Selection",[Ze.Viewport]:"Viewport",[Ze.Node]:"Node",[Ze.Layout]:"Layout",[Ze.History]:"History",[Ze.Custom]:"Custom"};return[Ze.None,Ze.Selection,Ze.Viewport,Ze.Node,Ze.Layout,Ze.History,Ze.Custom].map(o=>({category:o,label:n[o],actions:R2(o)})).filter(o=>o.actions.length>0)}var ta,Wp=Mt({"src/core/action-registry.ts"(){Ll(),ta=new Map,YE()}});async function mp(n,e,o){if(n===Ne.None)return{success:!0,actionId:n};const r=z2(n);if(!r)return console.warn(`Action not found: ${n}`),{success:!1,actionId:n,error:new Error(`Action not found: ${n}`)};if(r.requiresNode&&!e.nodeId)return console.warn(`Action ${n} requires a node context`),{success:!1,actionId:n,error:new Error(`Action ${n} requires a node context`)};try{const l=r.handler(e,o);return l instanceof Promise&&await l,{success:!0,actionId:n}}catch(l){return console.error(`Error executing action ${n}:`,l),{success:!1,actionId:n,error:l instanceof Error?l:new Error(String(l))}}}function si(n,e,o,r){return{eventType:n,nodeId:r==null?void 0:r.nodeId,nodeData:r==null?void 0:r.nodeData,edgeId:r==null?void 0:r.edgeId,edgeData:r==null?void 0:r.edgeData,worldPosition:o,screenPosition:{x:e.clientX,y:e.clientY},modifiers:{shift:!1,ctrl:!1,alt:!1,meta:!1}}}function qE(n,e,o,r){return{eventType:n,nodeId:r==null?void 0:r.nodeId,nodeData:r==null?void 0:r.nodeData,edgeId:r==null?void 0:r.edgeId,edgeData:r==null?void 0:r.edgeData,worldPosition:o,screenPosition:{x:e.clientX,y:e.clientY},modifiers:{shift:e.shiftKey,ctrl:e.ctrlKey,alt:e.altKey,meta:e.metaKey}}}function VE(n,e,o,r){return{eventType:n,nodeId:r==null?void 0:r.nodeId,nodeData:r==null?void 0:r.nodeData,edgeId:r==null?void 0:r.edgeId,edgeData:r==null?void 0:r.edgeData,worldPosition:o,screenPosition:{x:e.clientX,y:e.clientY},modifiers:{shift:!1,ctrl:!1,alt:!1,meta:!1}}}var L2=Mt({"src/core/action-executor.ts"(){Wp(),Ll()}});function Nu(n,e){return n[e]||Ne.None}var gp,v1,lt,id,ku,ml,Tu,em,gl,tm,nm,im,om,rm,am,sm,lm,cm,um,dm,Jr=Mt({"src/core/settings-store.ts"(){Ll(),gp=[{id:"default",name:"Default",description:"Standard canvas interactions",isBuiltIn:!0,mappings:Va},{id:"minimal",name:"Minimal",description:"Only essential selection and context menu actions",isBuiltIn:!0,mappings:{[fe.NodeClick]:Ne.None,[fe.NodeDoubleClick]:Ne.None,[fe.NodeTripleClick]:Ne.None,[fe.NodeRightClick]:Ne.OpenContextMenu,[fe.NodeLongPress]:Ne.OpenContextMenu,[fe.EdgeClick]:Ne.SelectEdge,[fe.EdgeDoubleClick]:Ne.None,[fe.EdgeRightClick]:Ne.None,[fe.BackgroundClick]:Ne.ClearSelection,[fe.BackgroundDoubleClick]:Ne.None,[fe.BackgroundRightClick]:Ne.None,[fe.BackgroundLongPress]:Ne.None}},{id:"power-user",name:"Power User",description:"Quick actions for experienced users",isBuiltIn:!0,mappings:{[fe.NodeClick]:Ne.None,[fe.NodeDoubleClick]:Ne.ToggleLock,[fe.NodeTripleClick]:Ne.DeleteSelected,[fe.NodeRightClick]:Ne.OpenContextMenu,[fe.NodeLongPress]:Ne.AddToSelection,[fe.EdgeClick]:Ne.SelectEdge,[fe.EdgeDoubleClick]:Ne.None,[fe.EdgeRightClick]:Ne.OpenContextMenu,[fe.BackgroundClick]:Ne.ClearSelection,[fe.BackgroundDoubleClick]:Ne.CreateNode,[fe.BackgroundRightClick]:Ne.OpenContextMenu,[fe.BackgroundLongPress]:Ne.ApplyForceLayout}}],v1={mappings:Va,activePresetId:"default",customPresets:[],isPanelOpen:!1,virtualizationEnabled:!0},lt=Sb("canvas-settings",v1),id=K(n=>n(lt).mappings),ku=K(n=>n(lt).activePresetId),ml=K(n=>{const e=n(lt);return[...gp,...e.customPresets]}),Tu=K(n=>{const e=n(ku);return e&&n(ml).find(r=>r.id===e)||null}),em=K(n=>n(lt).isPanelOpen),gl=K(n=>n(lt).virtualizationEnabled??!0),tm=K(n=>{const e=n(lt),o=n(Tu);return o?Object.values(fe).some(l=>e.mappings[l]!==o.mappings[l]):!0}),nm=K(null,(n,e,{event:o,actionId:r})=>{const l=n(lt);e(lt,{...l,mappings:{...l.mappings,[o]:r},activePresetId:null})}),im=K(null,(n,e,o)=>{const l=n(ml).find(d=>d.id===o);if(!l){console.warn(`Preset not found: ${o}`);return}const c=n(lt);e(lt,{...c,mappings:{...l.mappings},activePresetId:o})}),om=K(null,(n,e,{name:o,description:r})=>{const l=n(lt),c=`custom-${Date.now()}`,d={id:c,name:o,description:r,mappings:{...l.mappings},isBuiltIn:!1};return e(lt,{...l,customPresets:[...l.customPresets,d],activePresetId:c}),c}),rm=K(null,(n,e,o)=>{const r=n(lt),l=r.customPresets.findIndex(d=>d.id===o);if(l===-1){console.warn(`Cannot update preset: ${o} (not found or built-in)`);return}const c=[...r.customPresets];c[l]={...c[l],mappings:{...r.mappings}},e(lt,{...r,customPresets:c,activePresetId:o})}),am=K(null,(n,e,o)=>{const r=n(lt),l=r.customPresets.filter(p=>p.id!==o);if(l.length===r.customPresets.length){console.warn(`Cannot delete preset: ${o} (not found or built-in)`);return}const c=r.activePresetId===o?"default":r.activePresetId,d=c==="default"?Va:r.mappings;e(lt,{...r,customPresets:l,activePresetId:c,mappings:d})}),sm=K(null,(n,e)=>{const o=n(lt);e(lt,{...o,mappings:Va,activePresetId:"default"})}),lm=K(null,(n,e)=>{const o=n(lt);e(lt,{...o,isPanelOpen:!o.isPanelOpen})}),cm=K(null,(n,e,o)=>{const r=n(lt);e(lt,{...r,isPanelOpen:o})}),um=K(null,(n,e,o)=>{const r=n(lt);e(lt,{...r,virtualizationEnabled:o})}),dm=K(null,(n,e)=>{const o=n(lt);e(lt,{...o,virtualizationEnabled:!(o.virtualizationEnabled??!0)})})}});function XE(n,e,o,r,l){const c=n+o,d=e+r;return!(n>l.maxX||c<l.minX||e>l.maxY||d<l.minY)}var yp,fu,yl,Du,fm,Ul=Mt({"src/core/virtualization-store.ts"(){Zt(),cn(),Jr(),Jr(),yp=200,fu=K(n=>{const e=n(Zn),o=n(nn),r=n(Tt);if(!e||r===0)return null;const l=yp;return{minX:(-l-o.x)/r,minY:(-l-o.y)/r,maxX:(e.width+l-o.x)/r,maxY:(e.height+l-o.y)/r}}),yl=K(n=>{const e=n(gl),o=n(Sl);if(!e)return o;const r=n(fu);if(!r)return o;n(Qn),n(en);const l=n(ze);return o.filter(c=>{if(!l.hasNode(c))return!1;const d=l.getNodeAttributes(c);return XE(d.x,d.y,d.width||200,d.height||100,r)})}),Du=K(n=>{const e=n(gl),o=n(Al),l=n(Qa).isCreating?"temp-creating-edge":null;if(!e)return l?[...o,l]:o;const c=n(yl),d=new Set(c);n(en);const p=n(ze),m=o.filter(h=>{const g=p.source(h),y=p.target(h);return d.has(g)&&d.has(y)});return l?[...m,l]:m}),fm=K(n=>{const e=n(gl),o=n(Sl).length,r=n(Al).length,l=n(yl).length,c=n(Du).length,d=n(fu);return{enabled:e,totalNodes:o,totalEdges:r,visibleNodes:l,visibleEdges:c,culledNodes:o-l,culledEdges:r-c,bounds:d}})}});function KE(n,e,o,r,l){switch(l.side){case"left":return{x:n,y:e+r*l.position};case"right":return{x:n+o,y:e+r*l.position};case"top":return{x:n+o*l.position,y:e};case"bottom":return{x:n+o*l.position,y:e+r}}}function QE(n){return n&&n.length>0?n:[hm]}function ZE(n,e,o){return!(o&&n.type==="input"||!o&&n.type==="output"||n.maxConnections!==void 0&&e>=n.maxConnections)}function IE(n,e){return!(n.type==="input"||e.type==="output")}var hm,U2=Mt({"src/core/port-types.ts"(){hm={id:"default",type:"bidirectional",side:"right",position:.5}}}),Gl={};Mp(Gl,{PASTE_OFFSET:()=>Mu,clearClipboardAtom:()=>gm,clipboardAtom:()=>dr,clipboardNodeCountAtom:()=>pm,copyToClipboardAtom:()=>Za,cutToClipboardAtom:()=>mm,duplicateSelectionAtom:()=>rd,hasClipboardContentAtom:()=>od,pasteFromClipboardAtom:()=>_l});function FE(n){if(n.length===0)return{minX:0,minY:0,maxX:0,maxY:0};let e=1/0,o=1/0,r=-1/0,l=-1/0;for(const c of n)e=Math.min(e,c.attrs.x),o=Math.min(o,c.attrs.y),r=Math.max(r,c.attrs.x+c.attrs.width),l=Math.max(l,c.attrs.y+c.attrs.height);return{minX:e,minY:o,maxX:r,maxY:l}}function b1(n){return`paste-${Date.now()}-${n}-${Math.random().toString(36).slice(2,8)}`}var Oi,Mu,dr,od,pm,Za,mm,_l,rd,gm,fs=Mt({"src/core/clipboard-store.ts"(){Zt(),Tn(),ds(),Mo(),Oi=ln("clipboard"),Mu={x:50,y:50},dr=K(null),od=K(n=>n(dr)!==null),pm=K(n=>{const e=n(dr);return(e==null?void 0:e.nodes.length)??0}),Za=K(null,(n,e,o)=>{const r=o??Array.from(n(tt));if(r.length===0){Oi("Nothing to copy - no nodes selected");return}const l=n(ze),c=new Set(r),d=[],p=[];for(const g of r){if(!l.hasNode(g)){Oi("Node %s not found in graph, skipping",g);continue}const y=l.getNodeAttributes(g);d.push({attrs:{...y},dbData:{...y.dbData}})}l.forEachEdge((g,y,v,w)=>{c.has(v)&&c.has(w)&&p.push({source:v,target:w,attrs:{...y},dbData:{...y.dbData}})});const m=FE(d),h={nodes:d,edges:p,bounds:m,timestamp:Date.now()};e(dr,h),Oi("Copied %d nodes and %d edges to clipboard",d.length,p.length)}),mm=K(null,(n,e,o)=>{e(Za,o),Oi("Cut operation: copied to clipboard. App should delete selected nodes.")}),_l=K(null,(n,e,o)=>{const r=n(dr);if(!r||r.nodes.length===0)return Oi("Nothing to paste - clipboard empty"),[];const l=o??Mu;n(ze),e(us,"Paste nodes");const c=new Map,d=[];for(let p=0;p<r.nodes.length;p++){const m=r.nodes[p],h=b1(p);c.set(m.dbData.id,h),d.push(h);const g={...m.dbData,id:h,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),ui_properties:{...m.dbData.ui_properties||{},x:m.attrs.x+l.x,y:m.attrs.y+l.y}};Oi("Pasting node %s -> %s at (%d, %d)",m.dbData.id,h,m.attrs.x+l.x,m.attrs.y+l.y),e(Gp,g)}for(const p of r.edges){const m=c.get(p.source),h=c.get(p.target);if(!m||!h){Oi("Edge %s: source or target not found in id map, skipping",p.dbData.id);continue}const g=b1(r.edges.indexOf(p)+r.nodes.length),y={...p.dbData,id:g,source_node_id:m,target_node_id:h,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};Oi("Pasting edge %s -> %s (from %s to %s)",p.dbData.id,g,m,h),e(Bp,y)}return e(cs),e(Ol,d),Oi("Pasted %d nodes and %d edges",d.length,r.edges.length),d}),rd=K(null,(n,e)=>(e(Za),e(_l))),gm=K(null,(n,e)=>{e(dr,null),Oi("Clipboard cleared")})}});function G2(n){return{source:PE(n.pointerType),pointerId:n.pointerId,pressure:n.pressure,tiltX:n.tiltX,tiltY:n.tiltY,isPrimary:n.isPrimary,rawPointerType:n.pointerType}}function PE(n){switch(n){case"pen":return"pencil";case"touch":return"finger";case"mouse":return"mouse";default:return"mouse"}}function B2(){if(typeof window>"u")return{hasTouch:!1,hasStylus:!1,hasMouse:!0,hasCoarsePointer:!1};const n="ontouchstart"in window||navigator.maxTouchPoints>0,e=typeof window.matchMedia=="function",o=e?window.matchMedia("(pointer: coarse)").matches:!1,l=(e?window.matchMedia("(pointer: fine)").matches:!0)||!n;return{hasTouch:n,hasStylus:!1,hasMouse:l,hasCoarsePointer:o}}function JE(n){switch(n){case"finger":return{dragThreshold:10,tapThreshold:10,longPressDuration:600,longPressMoveLimit:10};case"pencil":return{dragThreshold:2,tapThreshold:3,longPressDuration:500,longPressMoveLimit:5};case"mouse":return{dragThreshold:3,tapThreshold:5,longPressDuration:0,longPressMoveLimit:0}}}function WE(n){return ym[n]}var ym,vm=Mt({"src/core/input-classifier.ts"(){ym={finger:44,pencil:24,mouse:16}}}),Zi,zu,hl,bm,H2,$2,wm,xm,Sm,Y2,ad=Mt({"src/core/input-store.ts"(){vm(),Zi=K(new Map),zu=K("mouse"),hl=K(B2()),bm=K(n=>{const e=n(Zi);for(const[,o]of e)if(o.source==="pencil")return!0;return!1}),H2=K(n=>{const e=n(Zi);let o=0;for(const[,r]of e)r.source==="finger"&&o++;return o>1}),$2=K(n=>{const e=n(Zi);let o=0;for(const[,r]of e)r.source==="finger"&&o++;return o}),wm=K(n=>n(hl).hasTouch),xm=K(null,(n,e,o)=>{const r=new Map(n(Zi));if(r.set(o.pointerId,o),e(Zi,r),e(zu,o.source),o.source==="pencil"){const l=n(hl);l.hasStylus||e(hl,{...l,hasStylus:!0})}}),Sm=K(null,(n,e,o)=>{const r=new Map(n(Zi));r.delete(o),e(Zi,r)}),Y2=K(null,(n,e)=>{e(Zi,new Map)})}});function q2(n){const{source:e,type:o,target:r,modifierKey:l,isStylusActive:c}=n;if(c&&e==="finger"){if(o==="drag")return"pan";if(o==="tap"||o==="long-press")return"none"}if(l&&o==="drag"&&r==="background")return"rect-select";const d=V2[o];if(!d)return"none";const p=d[r];return p?p[e]??"none":"none"}function eN(n,e){return!!(n==="finger"&&e)}var V2,X2=Mt({"src/core/gesture-resolver.ts"(){V2={tap:{node:{pencil:"select",finger:"select",mouse:"select"},edge:{pencil:"select",finger:"select",mouse:"select"},port:{pencil:"select",finger:"select",mouse:"select"},background:{pencil:"none",finger:"none",mouse:"none"}},"double-tap":{node:{pencil:"edit-node",finger:"edit-node",mouse:"edit-node"},background:{pencil:"none",finger:"none",mouse:"none"}},drag:{node:{pencil:"move-node",finger:"move-node",mouse:"move-node"},port:{pencil:"create-edge",finger:"create-edge",mouse:"create-edge"},"resize-handle":{pencil:"none",finger:"none",mouse:"none"},background:{pencil:"lasso-select",finger:"pan",mouse:"pan"}},"long-press":{node:{pencil:"context-menu",finger:"context-menu",mouse:"none"},background:{pencil:"none",finger:"context-menu",mouse:"none"}},"right-click":{node:{pencil:"none",finger:"none",mouse:"context-menu"},edge:{pencil:"none",finger:"none",mouse:"context-menu"},background:{pencil:"none",finger:"none",mouse:"context-menu"}},pinch:{background:{pencil:"none",finger:"zoom",mouse:"none"},node:{pencil:"none",finger:"zoom",mouse:"none"}},scroll:{background:{pencil:"none",finger:"none",mouse:"zoom"},node:{pencil:"none",finger:"none",mouse:"zoom"}}}}}),Bl={};Mp(Bl,{ActionCategory:()=>Ze,BUILT_IN_PRESETS:()=>gp,BuiltInActionId:()=>Ne,CanvasEventType:()=>fe,DEFAULT_MAPPINGS:()=>Va,DEFAULT_PORT:()=>hm,EVENT_TYPE_INFO:()=>xr,FallbackNodeTypeComponent:()=>C2,HIT_TARGET_SIZES:()=>ym,PASTE_OFFSET:()=>Mu,VIRTUALIZATION_BUFFER:()=>yp,ZOOM_EXIT_THRESHOLD:()=>Zu,ZOOM_TRANSITION_THRESHOLD:()=>Qu,activePointersAtom:()=>Zi,activePresetAtom:()=>Tu,activePresetIdAtom:()=>ku,addEdgeToLocalGraphAtom:()=>Bp,addNodeToLocalGraphAtom:()=>Gp,addNodesToSelectionAtom:()=>Ol,allPresetsAtom:()=>ml,applyPresetAtom:()=>im,arePortsCompatible:()=>IE,calculatePortPosition:()=>KE,canPortAcceptConnection:()=>ZE,canRedoAtom:()=>nd,canUndoAtom:()=>td,canvasSettingsAtom:()=>lt,classifyPointer:()=>G2,cleanupAllNodePositionsAtom:()=>dp,cleanupNodePositionAtom:()=>up,clearActions:()=>$E,clearClipboardAtom:()=>gm,clearEdgeSelectionAtom:()=>Yp,clearGraphOnSwitchAtom:()=>Pb,clearHistoryAtom:()=>Fp,clearMutationQueueAtom:()=>d2,clearNodeTypeRegistry:()=>jE,clearPointersAtom:()=>Y2,clearSelectionAtom:()=>cs,clipboardAtom:()=>dr,clipboardNodeCountAtom:()=>pm,completeMutationAtom:()=>ed,conditionalSnap:()=>LE,copyToClipboardAtom:()=>Za,createActionContext:()=>si,createActionContextFromReactEvent:()=>qE,createActionContextFromTouchEvent:()=>VE,currentGraphIdAtom:()=>wr,cutToClipboardAtom:()=>mm,deletePresetAtom:()=>am,dequeueMutationAtom:()=>l2,detectInputCapabilities:()=>B2,draggingNodeIdAtom:()=>Gi,duplicateSelectionAtom:()=>rd,edgeCreationAtom:()=>Qa,edgeFamilyAtom:()=>Rp,edgeKeysAtom:()=>Al,edgeKeysWithTempEdgeAtom:()=>Jb,endNodeDragAtom:()=>Lp,eventMappingsAtom:()=>id,executeAction:()=>mp,fingerCountAtom:()=>$2,getAction:()=>z2,getActionForEvent:()=>Nu,getActionsByCategories:()=>j2,getActionsByCategory:()=>R2,getAllActions:()=>O2,getGestureThresholds:()=>JE,getHitTargetSize:()=>WE,getNextQueuedMutationAtom:()=>u2,getNodePorts:()=>QE,getNodeTypeComponent:()=>zE,getRegisteredNodeTypes:()=>RE,getSnapGuides:()=>UE,goToLockedPageAtom:()=>A2,graphAtom:()=>ze,graphUpdateVersionAtom:()=>en,handleNodePointerDownSelectionAtom:()=>Hp,hasAction:()=>BE,hasClipboardContentAtom:()=>od,hasLockedNodeAtom:()=>_2,hasNodeTypeComponent:()=>OE,hasSelectionAtom:()=>Vp,hasUnsavedChangesAtom:()=>tm,highestZIndexAtom:()=>fp,historyLabelsAtom:()=>Pp,historyStateAtom:()=>Kt,incrementRetryCountAtom:()=>c2,inputCapabilitiesAtom:()=>hl,inputModeAtom:()=>cr,interactionFeedbackAtom:()=>dl,isBackgroundGesture:()=>eN,isMultiTouchAtom:()=>H2,isOnlineAtom:()=>qr,isPanelOpenAtom:()=>em,isPickNodeModeAtom:()=>b2,isPickingModeAtom:()=>v2,isSnappingActiveAtom:()=>D2,isStylusActiveAtom:()=>bm,isTouchDeviceAtom:()=>wm,isZoomTransitioningAtom:()=>Fu,lastSyncErrorAtom:()=>xo,lastSyncTimeAtom:()=>uu,loadGraphFromDbAtom:()=>n2,lockNodeAtom:()=>Xp,lockedNodeDataAtom:()=>w2,lockedNodeIdAtom:()=>fr,lockedNodePageCountAtom:()=>fl,lockedNodePageIndexAtom:()=>ur,mutationQueueAtom:()=>wi,nextLockedPageAtom:()=>x2,nodeFamilyAtom:()=>Op,nodeKeysAtom:()=>Sl,nodePositionAtomFamily:()=>xi,nodePositionUpdateCounterAtom:()=>Qn,optimisticDeleteEdgeAtom:()=>Wb,optimisticDeleteNodeAtom:()=>Up,panAtom:()=>nn,pasteFromClipboardAtom:()=>_l,pendingInputResolverAtom:()=>du,pendingMutationsCountAtom:()=>Ri,pointerDownAtom:()=>xm,pointerUpAtom:()=>Sm,preDragNodeAttributesAtom:()=>pl,prevLockedPageAtom:()=>S2,primaryInputSourceAtom:()=>zu,provideInputAtom:()=>g2,pushDeltaAtom:()=>k2,pushHistoryAtom:()=>us,queueMutationAtom:()=>s2,redoAtom:()=>jl,redoCountAtom:()=>Ip,registerAction:()=>Wt,registerNodeType:()=>DE,registerNodeTypes:()=>ME,removeEdgeFromLocalGraphAtom:()=>e2,removeNodesFromSelectionAtom:()=>i2,resetInputModeAtom:()=>f2,resetSettingsAtom:()=>sm,resetViewportAtom:()=>zl,resolveGestureIntent:()=>q2,saveAsPresetAtom:()=>om,screenToWorldAtom:()=>Vu,selectEdgeAtom:()=>Ju,selectSingleNodeAtom:()=>Pu,selectedEdgeIdAtom:()=>_o,selectedNodeIdsAtom:()=>tt,selectedNodesCountAtom:()=>qp,setEventMappingAtom:()=>nm,setGridSizeAtom:()=>M2,setOnlineStatusAtom:()=>a2,setPanelOpenAtom:()=>cm,setVirtualizationEnabledAtom:()=>um,setZoomAtom:()=>Ku,snapEnabledAtom:()=>qa,snapGridSizeAtom:()=>Eu,snapTemporaryDisableAtom:()=>pp,snapToGrid:()=>T2,startMutationAtom:()=>Wu,startNodeDragAtom:()=>jp,startPickNodeAtom:()=>h2,startPickNodesAtom:()=>p2,startPickPointAtom:()=>m2,swapEdgeAtomicAtom:()=>t2,syncStateAtom:()=>o2,syncStatusAtom:()=>ai,toggleNodeInSelectionAtom:()=>$p,togglePanelAtom:()=>lm,toggleSnapAtom:()=>Jp,toggleVirtualizationAtom:()=>dm,trackMutationErrorAtom:()=>r2,uiNodesAtom:()=>ls,undoAtom:()=>Rl,undoCountAtom:()=>Zp,unlockNodeAtom:()=>Kp,unregisterAction:()=>HE,updateInteractionFeedbackAtom:()=>y2,updateNodePositionAtom:()=>zp,updatePresetAtom:()=>rm,viewportRectAtom:()=>Zn,virtualizationEnabledAtom:()=>gl,virtualizationMetricsAtom:()=>fm,visibleBoundsAtom:()=>fu,visibleEdgeKeysAtom:()=>Du,visibleNodeKeysAtom:()=>yl,worldToScreenAtom:()=>Xu,zoomAtom:()=>Tt,zoomFocusNodeIdAtom:()=>Iu,zoomTransitionProgressAtom:()=>xl});var na=Mt({"src/core/index.ts"(){kE(),Zt(),cn(),Tn(),zo(),TE(),Qp(),E2(),ds(),GE(),Ll(),Wp(),L2(),Jr(),Ul(),Jr(),U2(),fs(),vm(),ad(),X2()}});na();Tn();function tN(n){const e=Oe.c(13),[o]=Ci(tt),r=ge(Pu),l=ge($p);let c;e[0]!==n||e[1]!==o?(c=o.has(n),e[0]=n,e[1]=o,e[2]=c):c=e[2];let d;e[3]!==n||e[4]!==r?(d=()=>r(n),e[3]=n,e[4]=r,e[5]=d):d=e[5];let p;e[6]!==n||e[7]!==l?(p=()=>l(n),e[6]=n,e[7]=l,e[8]=p):p=e[8];let m;return e[9]!==c||e[10]!==d||e[11]!==p?(m={isSelected:c,selectNode:d,toggleNode:p},e[9]=c,e[10]=d,e[11]=p,e[12]=m):m=e[12],m}Zt();cn();Tn();zo();ds();var nN={eventOptions:{passive:!1,capture:!1},drag:{pointer:{touch:!0,keys:!1},filterTaps:!0,tapsThreshold:5,threshold:3}},iN=nN,w1=new Map;function Uh(n){let e=w1.get(n);return e||(e={inFlight:!1,queuedPosition:null,queuedUiProperties:null,graphId:null},w1.set(n,e)),e}Mo();var oN=ln("drag");function rN(n,e){const o=Oe.c(36);let r;o[0]!==e?(r=e===void 0?{}:e,o[0]=e,o[1]=r):r=o[1];const l=r,{onPersist:c,onPersistError:d,invalidationDebounceMs:p}=l,m=he(ze),h=ge(Wu),g=ge(ed),y=ge(jp),v=ge(Lp),w=he(pl),S=he(Tt),A=he(tt);he(Gi);const x=he(wr),E=he(Qa),D=ge(ze);ge(Qn);const R=ge(us);let _;o[2]===Symbol.for("react.memo_cache_sentinel")?(_=K(null,aN),o[2]=_):_=o[2];const N=ge(_);let T;o[3]!==N?(T=ce=>{N(ce)},o[3]=N,o[4]=T):T=o[4];const O=T,M=ne.useRef(0);ne.useRef(null);let $;o[5]===Symbol.for("react.memo_cache_sentinel")?($=ce=>{const j=ce.event.target;j.closest('[data-no-drag="true"]')||j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT"||(M.current=M.current+1)},o[5]=$):$=o[5];let L;o[6]!==S||o[7]!==E||o[8]!==A||o[9]!==m||o[10]!==n||o[11]!==R||o[12]!==y||o[13]!==h||o[14]!==O?(L=ce=>{const j=ce.event.target;if(j.closest('[data-no-drag="true"]')||j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT"||E.isCreating)return;ce.event.stopPropagation();const{movement:I,first:G,active:Y,down:V,pinching:k,cancel:H,tap:F}=ce,[oe,J]=I;let W=ce.memo;if(F||!Y)return W;const ue=M.current;if(G){const Ce=A.size,Se=Ce>1?`Move ${Ce} nodes`:"Move node";R(Se),y({nodeId:n});const Ee=A;Ee.forEach(()=>h());const Be=new Map;Ee.forEach(et=>{if(m.hasNode(et)){const ft=m.getNodeAttributes(et);Be.set(et,{x:ft.x,y:ft.y})}}),W={initialPositions:Be,gestureInstance:ue}}if(!W||W.gestureInstance!==ue||!W.initialPositions)return H&&!k&&!V&&!F&&!Y&&H(),W;const xe=oe/S,de=J/S,Te=[];return W.initialPositions.forEach((Ce,Se)=>{if(m.hasNode(Se)){const Ee={x:Ce.x+xe,y:Ce.y+de};Te.push({id:Se,pos:Ee})}}),Te.length>0&&O(Te),W},o[6]=S,o[7]=E,o[8]=A,o[9]=m,o[10]=n,o[11]=R,o[12]=y,o[13]=h,o[14]=O,o[15]=L):L=o[15];let X;o[16]!==g||o[17]!==x||o[18]!==S||o[19]!==E||o[20]!==w||o[21]!==m||o[22]!==n||o[23]!==c||o[24]!==d||o[25]!==v||o[26]!==D||o[27]!==h||o[28]!==O?(X=ce=>{const j=ce.event.target;if(j.closest('[data-no-drag="true"]')||j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT")return;if(E.isCreating){v({nodeId:n});return}ce.event.stopPropagation();const I=ce.memo;if(!x){oN("Cannot update node position: currentGraphId is not set"),v({nodeId:n});return}(I!=null&&I.initialPositions?Array.from(I.initialPositions.keys()):[n]).forEach(Y=>{if(!m.hasNode(Y)){g(!1);return}const V=m.getNodeAttributes(Y),k=I==null?void 0:I.initialPositions.get(Y);if(!k){g(!1);return}const[H,F]=ce.movement,oe=H/S,J=F/S,W={x:k.x+oe,y:k.y+J};if(O([{id:Y,pos:W}]),!c){g(!0),v({nodeId:Y});return}const xe={...typeof V.dbData.ui_properties=="object"&&V.dbData.ui_properties!==null&&!Array.isArray(V.dbData.ui_properties)?V.dbData.ui_properties:{},x:W.x,y:W.y,zIndex:V.zIndex},de=Uh(Y);if(de.inFlight){de.queuedPosition=W,de.queuedUiProperties=xe,de.graphId=x;return}de.inFlight=!0,de.graphId=x;const Te=async Ce=>{const Se=Uh(Ce);if(Se&&Se.queuedPosition&&Se.queuedUiProperties&&Se.graphId){const Ee=Se.queuedUiProperties,Be=Se.graphId;Se.queuedPosition=null,Se.queuedUiProperties=null,h();try{await c(Ce,Be,Ee),g(!0)}catch(et){const ft=et;g(!1),d==null||d(Ce,ft)}Se.inFlight=!1,Te(Ce)}else Se&&(Se.inFlight=!1)};c(Y,x,xe).then(()=>{g(!0),Te(Y)}).catch(Ce=>{g(!1);const Se=Uh(Y);Se&&(Se.inFlight=!1);const Ee=w;Ee&&Ee.dbData.id===Y&&m.hasNode(Y)&&(m.replaceNodeAttributes(Y,Ee),D(m)),d==null||d(Y,Ce),Te(Y)}).finally(()=>{v({nodeId:Y})})})},o[16]=g,o[17]=x,o[18]=S,o[19]=E,o[20]=w,o[21]=m,o[22]=n,o[23]=c,o[24]=d,o[25]=v,o[26]=D,o[27]=h,o[28]=O,o[29]=X):X=o[29];let ae;o[30]!==L||o[31]!==X?(ae={onPointerDown:$,onDrag:L,onDragEnd:X},o[30]=L,o[31]=X,o[32]=ae):ae=o[32];const te=zb(ae,iN);let me;return o[33]!==te||o[34]!==O?(me={bind:te,updateNodePositions:O},o[33]=te,o[34]=O,o[35]=me):me=o[35],me}function aN(n,e,o){const r=n(ze);o.forEach(l=>{r.hasNode(l.id)&&(r.setNodeAttribute(l.id,"x",l.pos.x),r.setNodeAttribute(l.id,"y",l.pos.y))}),e(Qn,sN)}function sN(n){return n+1}Zt();cn();zo();Mo();ln("resize");function lN(n){const e=Oe.c(38),{id:o,nodeData:r,updateNodePositions:l,options:c}=n;let d;e[0]!==c?(d=c===void 0?{}:c,e[0]=c,e[1]=d):d=e[1];const p=d,{onPersist:m,onPersistError:h,minWidth:g,minHeight:y}=p,v=g===void 0?200:g,w=y===void 0?150:y,[S,A]=ne.useState(r.width||500),[x,E]=ne.useState(r.height||500),[D,R]=ne.useState(!1),_=ne.useRef(null),N=he(ze),T=he(Tt),O=he(wr),M=ge(Wu),$=ge(ed),L=ge(en),X=ge(Qn);let ae,te;e[2]!==D||e[3]!==r.height||e[4]!==r.width?(ae=()=>{D||(A(r.width||500),E(r.height||500))},te=[r.width,r.height,D],e[2]=D,e[3]=r.height,e[4]=r.width,e[5]=ae,e[6]=te):(ae=e[5],te=e[6]),ne.useEffect(ae,te);let me;e[7]!==N||e[8]!==o||e[9]!==x||e[10]!==S?(me=k=>H=>{H.stopPropagation(),H.preventDefault(),R(!0);const F=N.hasNode(o)?N.getNodeAttributes(o):{x:0,y:0};_.current={width:S,height:x,startX:H.clientX,startY:H.clientY,startNodeX:F.x,startNodeY:F.y,direction:k},H.target.setPointerCapture(H.pointerId)},e[7]=N,e[8]=o,e[9]=x,e[10]=S,e[11]=me):me=e[11];const ce=me;let j;e[12]!==T||e[13]!==N||e[14]!==o||e[15]!==w||e[16]!==v||e[17]!==L||e[18]!==X||e[19]!==l?(j=k=>{if(!_.current)return;k.stopPropagation(),k.preventDefault();const H=(k.clientX-_.current.startX)/T,F=(k.clientY-_.current.startY)/T,{direction:oe,width:J,height:W,startNodeX:ue,startNodeY:xe}=_.current;let de=J,Te=W,Ce=ue,Se=xe;oe.includes("e")&&(de=Math.max(v,J+H)),oe.includes("w")&&(de=Math.max(v,J-H),Ce=ue+(J-de)),oe.includes("s")&&(Te=Math.max(w,W+F)),oe.includes("n")&&(Te=Math.max(w,W-F),Se=xe+(W-Te)),N.hasNode(o)&&(N.setNodeAttribute(o,"width",de),N.setNodeAttribute(o,"height",Te),N.setNodeAttribute(o,"x",Ce),N.setNodeAttribute(o,"y",Se)),rC.flushSync(()=>{A(de),E(Te),L(uN)}),oe.includes("n")||oe.includes("w")?l([{id:o,pos:{x:Ce,y:Se}}]):X(cN)},e[12]=T,e[13]=N,e[14]=o,e[15]=w,e[16]=v,e[17]=L,e[18]=X,e[19]=l,e[20]=j):j=e[20];const I=j;let G;e[21]!==$||e[22]!==O||e[23]!==N||e[24]!==o||e[25]!==x||e[26]!==S||e[27]!==m||e[28]!==h||e[29]!==M?(G=k=>{if(!_.current)return;if(k.stopPropagation(),k.target.releasePointerCapture(k.pointerId),R(!1),!O||!_.current){_.current=null;return}const H=N.hasNode(o)?N.getNodeAttributes(o):null;if(!H){_.current=null;return}const F=H.width||S,oe=H.height||x,J=H.x,W=H.y;if(A(F),E(oe),!m){_.current=null;return}const xe={...typeof H.dbData.ui_properties=="object"&&H.dbData.ui_properties!==null&&!Array.isArray(H.dbData.ui_properties)?H.dbData.ui_properties:{},width:F,height:oe,x:J,y:W};M(),m(o,O,xe).then(()=>{$(!0)}).catch(de=>{$(!1),_.current&&(A(_.current.width),E(_.current.height)),h==null||h(o,de)}).finally(()=>{_.current=null})},e[21]=$,e[22]=O,e[23]=N,e[24]=o,e[25]=x,e[26]=S,e[27]=m,e[28]=h,e[29]=M,e[30]=G):G=e[30];const Y=G;let V;return e[31]!==ce||e[32]!==Y||e[33]!==I||e[34]!==D||e[35]!==x||e[36]!==S?(V={localWidth:S,localHeight:x,isResizing:D,createResizeStart:ce,handleResizeMove:I,handleResizeEnd:Y},e[31]=ce,e[32]=Y,e[33]=I,e[34]=D,e[35]=x,e[36]=S,e[37]=V):V=e[37],V}function cN(n){return n+1}function uN(n){return n+1}ds();function dN(n){const e=Oe.c(25);let o;e[0]!==n?(o=n===void 0?{}:n,e[0]=n,e[1]=o):o=e[1];const r=o,{enableKeyboardShortcuts:l}=r,c=l===void 0?!1:l,d=he(td),p=he(nd),m=he(Zp),h=he(Ip),g=he(Pp),y=ge(Rl),v=ge(jl),w=ge(us),S=ge(Fp);let A;e[2]!==y?(A=()=>y(),e[2]=y,e[3]=A):A=e[3];const x=A;let E;e[4]!==v?(E=()=>v(),e[4]=v,e[5]=E):E=e[5];const D=E;let R;e[6]!==w?(R=L=>{w(L)},e[6]=w,e[7]=R):R=e[7];const _=R;let N;e[8]!==S?(N=()=>{S()},e[8]=S,e[9]=N):N=e[9];const T=N;let O,M;e[10]!==c||e[11]!==D||e[12]!==x?(O=()=>{if(!c)return;const L=X=>{X.target instanceof HTMLInputElement||X.target instanceof HTMLTextAreaElement||X.target instanceof HTMLElement&&X.target.isContentEditable||((X.ctrlKey||X.metaKey)&&X.key==="z"&&!X.shiftKey&&(X.preventDefault(),x()),(X.ctrlKey||X.metaKey)&&X.key==="z"&&X.shiftKey&&(X.preventDefault(),D()),(X.ctrlKey||X.metaKey)&&X.key==="y"&&(X.preventDefault(),D()))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},M=[c,x,D],e[10]=c,e[11]=D,e[12]=x,e[13]=O,e[14]=M):(O=e[13],M=e[14]),ne.useEffect(O,M);let $;return e[15]!==p||e[16]!==d||e[17]!==T||e[18]!==g||e[19]!==_||e[20]!==D||e[21]!==h||e[22]!==x||e[23]!==m?($={undo:x,redo:D,canUndo:d,canRedo:p,undoCount:m,redoCount:h,historyLabels:g,recordSnapshot:_,clear:T},e[15]=p,e[16]=d,e[17]=T,e[18]=g,e[19]=_,e[20]=D,e[21]=h,e[22]=x,e[23]=m,e[24]=$):$=e[24],$}Tn();function fN(){const n=Oe.c(6),e=he(tt),o=he(_o),r=he(qp),l=he(Vp),c=o!==null;let d;return n[0]!==r||n[1]!==l||n[2]!==o||n[3]!==e||n[4]!==c?(d={selectedNodeIds:e,selectedEdgeId:o,count:r,hasSelection:l,hasEdgeSelection:c},n[0]=r,n[1]=l,n[2]=o,n[3]=e,n[4]=c,n[5]=d):d=n[5],d}cn();function hN(){const n=Oe.c(9),e=he(Tt),o=he(nn),r=he(Zn),l=he(Vu),c=he(Xu),d=he(Iu),p=he(xl),m=he(Fu);let h;return n[0]!==m||n[1]!==o||n[2]!==l||n[3]!==r||n[4]!==c||n[5]!==e||n[6]!==d||n[7]!==p?(h={zoom:e,pan:o,viewportRect:r,screenToWorld:l,worldToScreen:c,zoomFocusNodeId:d,zoomTransitionProgress:p,isZoomTransitioning:m,zoomTransitionThreshold:Qu,zoomExitThreshold:Zu},n[0]=m,n[1]=o,n[2]=l,n[3]=r,n[4]=c,n[5]=e,n[6]=d,n[7]=p,n[8]=h):h=n[8],h}Zt();Zt();cn();Tn();var No=(function(n){return n.Graph="graph",n.Selection="selection",n})({}),K2=n=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const e=Math.min(...n.map(c=>c.x)),o=Math.min(...n.map(c=>c.y)),r=Math.max(...n.map(c=>c.x+c.width)),l=Math.max(...n.map(c=>c.y+c.height));return{x:e,y:o,width:r-e,height:l-o}};function x1(n){return{x:n.x+n.width/2,y:n.y+n.height/2}}function pN(n,e){const o=x1(n),r=x1(e),l=Math.abs(o.x-r.x),c=Math.abs(o.y-r.y),d=(n.width+e.width)/2,p=(n.height+e.height)/2;return l<d&&c<p}var mN=()=>{const n=Oe.c(6),e=he(ze);he(Qn);let o,r;n[0]!==e?(o=e.nodes().map(d=>{const p=e.getNodeAttributes(d);return{x:p.x,y:p.y,width:p.width||500,height:p.height||500}}),r=K2(o),n[0]=e,n[1]=o,n[2]=r):(o=n[1],r=n[2]);const l=r;let c;return n[3]!==l||n[4]!==o?(c={bounds:l,nodes:o},n[3]=l,n[4]=o,n[5]=c):c=n[5],c},gN=()=>{const n=Oe.c(5),e=he(tt),o=he(ls);let r;if(n[0]!==o||n[1]!==e){let l;n[3]!==e?(l=d=>e.has(d.id),n[3]=e,n[4]=l):l=n[4];const c=o.filter(l).map(yN);r=K2(c),n[0]=o,n[1]=e,n[2]=r}else r=n[2];return r},Am=()=>{const n=Oe.c(6),{bounds:e}=mN(),o=gN(),r=he(Zn),l=ge(Tt),c=ge(nn);let d;return n[0]!==e||n[1]!==o||n[2]!==c||n[3]!==l||n[4]!==r?(d={fitToBounds:(m,h)=>{const g=h===void 0?20:h,y=typeof m=="string"?m==="graph"?No.Graph:No.Selection:m;if(!r||typeof r.width!="number"||typeof r.height!="number"){console.warn("[fitToBounds] Error: viewportSize is undefined or invalid.","Received:",r);return}if(r.width<=0||r.height<=0){console.warn("[fitToBounds] Error: Viewport dimensions are zero or negative.",r.width,r.height);return}let v=null;if(y===No.Graph?v=e:y===No.Selection&&(v=o),!v||typeof v.width!="number"||typeof v.height!="number"){console.warn("[fitToBounds] Error: bounds object is undefined or invalid.","Received:",v);return}if(v.width<=0||v.height<=0){console.warn("[fitToBounds] Error: Bounds dimensions are zero or negative.",v.width,v.height);return}const w=Math.max(0,r.width/2-1),S=Math.max(0,r.height/2-1);let A=g;g>w&&(console.warn(`[fitToBounds] Horizontal padding (${g}px) too large. Clamping to ${w}px.`),A=w),g>S&&S<A&&(console.warn(`[fitToBounds] Vertical padding (${g}px) too large. Clamping to ${S}px.`),A=S),A=Math.max(0,A);const x=Math.max(1,r.width-2*A),E=Math.max(1,r.height-2*A),D=x/v.width,R=E/v.height,_=Math.min(D,R);if(_<=0||!isFinite(_)){console.warn("[fitToBounds] Error: Calculated scale is zero, negative, or not finite.",{calculatedScale:_,viewportSize:r,bounds:v,effectiveViewportWidth:x,effectiveViewportHeight:E,safePadding:A});return}l(_);const N=v.width*_,T=v.height*_,O=A+(x-N)/2,M=A+(E-T)/2,$=O-v.x*_,L=M-v.y*_;c({x:$,y:L})}},n[0]=e,n[1]=o,n[2]=c,n[3]=l,n[4]=r,n[5]=d):d=n[5],d};function yN(n){return{x:n.position.x,y:n.position.y,width:n.width??500,height:n.height??500}}Zt();var vN=(n={})=>{const{onPositionsChanged:e,maxIterations:o=1e3,chargeStrength:r=-6e3,linkStrength:l=.03}=n,c=he(ls),d=he(ze),p=ge(zp),m=ne.useRef(!1),h=()=>{const y=[];for(let v=0;v<c.length;v++)for(let w=1;w<=3;w++){const S=(v+w)%c.length;y.push({source:c[v].id,target:c[S].id,strength:.05})}return y};return{applyForceLayout:async()=>{if(m.current){console.warn("[ForceLayout] Layout already running, ignoring request.");return}if(c.length===0){console.warn("[ForceLayout] No nodes to layout.");return}m.current=!0;const y=c.map(w=>{var x,E;const S=w.width||80,A=w.height||80;return{id:w.id,x:((x=w.position)==null?void 0:x.x)||0,y:((E=w.position)==null?void 0:E.y)||0,width:S,height:A,radius:Math.max(S,A)+80}}),v=YC(y).force("charge",qC().strength(r).distanceMax(900)).force("collide",CC().radius(w=>w.radius).strength(2).iterations(8)).force("link",NC(h()).id(w=>w.id).strength(l)).force("center",aC(0,0)).stop();return console.log("[ForceLayout] Starting simulation..."),new Promise(w=>{let S=0;function A(){if(S>=o){console.log(`[ForceLayout] Reached max iterations (${o}), finalizing.`),x();return}v.tick(),S++;let E=!1;for(let D=0;D<y.length;D++){for(let R=D+1;R<y.length;R++)if(pN(y[D],y[R])){E=!0;break}if(E)break}if(!E){console.log(`[ForceLayout] No overlaps after ${S} iterations.`),x();return}requestAnimationFrame(A)}function x(){const E=[];y.forEach(D=>{if(d.hasNode(D.id)){const R={x:Math.round(D.x),y:Math.round(D.y)};p({nodeId:D.id,position:R}),E.push({nodeId:D.id,position:R})}}),e&&E.length>0&&(console.log(`[ForceLayout] Saving ${E.length} positions via callback...`),Promise.resolve(e(E)).then(()=>console.log("[ForceLayout] Positions saved successfully.")).catch(D=>console.error("[ForceLayout] Error saving positions:",D))),console.log("[ForceLayout] Layout complete."),m.current=!1,w()}requestAnimationFrame(A)})},isRunning:m.current}};Jr();function _m(){const n=Oe.c(34),e=he(id),o=he(ku),r=he(Tu),l=he(ml),c=he(tm),d=he(em),p=ge(nm),m=ge(im),h=ge(om),g=ge(rm),y=ge(am),v=ge(sm),w=ge(lm),S=ge(cm);let A;n[0]!==p?(A=(G,Y)=>{p({event:G,actionId:Y})},n[0]=p,n[1]=A):A=n[1];const x=A;let E;n[2]!==m?(E=G=>{m(G)},n[2]=m,n[3]=E):E=n[3];const D=E;let R;n[4]!==h?(R=(G,Y)=>h({name:G,description:Y}),n[4]=h,n[5]=R):R=n[5];const _=R;let N;n[6]!==g?(N=G=>{g(G)},n[6]=g,n[7]=N):N=n[7];const T=N;let O;n[8]!==y?(O=G=>{y(G)},n[8]=y,n[9]=O):O=n[9];const M=O;let $;n[10]!==v?($=()=>{v()},n[10]=v,n[11]=$):$=n[11];const L=$;let X;n[12]!==w?(X=()=>{w()},n[12]=w,n[13]=X):X=n[13];const ae=X;let te;n[14]!==S?(te=G=>{S(G)},n[14]=S,n[15]=te):te=n[15];const me=te;let ce;n[16]!==e?(ce=G=>Nu(e,G),n[16]=e,n[17]=ce):ce=n[17];const j=ce;let I;return n[18]!==r||n[19]!==o||n[20]!==l||n[21]!==D||n[22]!==M||n[23]!==j||n[24]!==c||n[25]!==d||n[26]!==e||n[27]!==L||n[28]!==_||n[29]!==x||n[30]!==me||n[31]!==ae||n[32]!==T?(I={mappings:e,activePresetId:o,activePreset:r,allPresets:l,hasUnsavedChanges:c,isPanelOpen:d,setEventMapping:x,applyPreset:D,saveAsPreset:_,updatePreset:T,deletePreset:M,resetSettings:L,togglePanel:ae,setPanelOpen:me,getActionForEvent:j},n[18]=r,n[19]=o,n[20]=l,n[21]=D,n[22]=M,n[23]=j,n[24]=c,n[25]=d,n[26]=e,n[27]=L,n[28]=_,n[29]=x,n[30]=me,n[31]=ae,n[32]=T,n[33]=I):I=n[33],I}Tn();cn();Qp();ds();Zt();L2();Jr();function bN(n){const e=Oe.c(76);let o;e[0]!==n?(o=n===void 0?{}:n,e[0]=n,e[1]=o):o=e[1];const r=o,{onDeleteNode:l,onOpenContextMenu:c,onCreateNode:d,onApplyForceLayout:p}=r,m=Tl(),h=ge(Pu),g=ge(Ol),y=ge(cs),v=ge(Ju),w=ge(Yp);ge(Ku);const S=ge(zl),{fitToBounds:A}=Am(),x=ge(Xp),E=ge(Kp),D=ge(Rl),R=ge(jl),_=he(id);let N;e[2]!==h?(N=Ee=>{h(Ee)},e[2]=h,e[3]=N):N=e[3];let T;e[4]!==g?(T=Ee=>{g([Ee])},e[4]=g,e[5]=T):T=e[5];let O;e[6]!==y?(O=()=>{y()},e[6]=y,e[7]=O):O=e[7];let M;e[8]!==m?(M=()=>Array.from(m.get(tt)),e[8]=m,e[9]=M):M=e[9];let $;e[10]!==A?($=(Ee,Be)=>{const et=Ee==="graph"?No.Graph:No.Selection;A(et,Be)},e[10]=A,e[11]=$):$=e[11];let L;e[12]!==m?(L=Ee=>{const et=m.get(ls).find(ft=>ft.id===Ee);if(et){const{x:ft,y:un,width:St,height:ht}=et,zt=St===void 0?200:St,Gt=ht===void 0?100:ht,on=m.get(Tt),rn=ft+zt/2,Ve=un+Gt/2,Bt=m.get(Zn),wn=Bt?Bt.width/2:400,xn=Bt?Bt.height/2:300;m.set(nn,{x:wn-rn*on,y:xn-Ve*on})}},e[12]=m,e[13]=L):L=e[13];let X;e[14]!==S?(X=()=>{S()},e[14]=S,e[15]=X):X=e[15];let ae;e[16]!==x?(ae=Ee=>{x({nodeId:Ee})},e[16]=x,e[17]=ae):ae=e[17];let te;e[18]!==E?(te=Ee=>{E()},e[18]=E,e[19]=te):te=e[19];let me;e[20]!==x||e[21]!==m||e[22]!==E?(me=Ee=>{m.get(fr)===Ee?E():x({nodeId:Ee})},e[20]=x,e[21]=m,e[22]=E,e[23]=me):me=e[23];let ce;e[24]!==l?(ce=async Ee=>{l?await l(Ee):console.warn("deleteNode called but onDeleteNode callback not provided")},e[24]=l,e[25]=ce):ce=e[25];let j;e[26]!==m?(j=Ee=>m.get(fr)===Ee,e[26]=m,e[27]=j):j=e[27];let I;e[28]!==p?(I=async()=>{p?await p():console.warn("applyForceLayout called but onApplyForceLayout callback not provided")},e[28]=p,e[29]=I):I=e[29];let G;e[30]!==D?(G=()=>{D()},e[30]=D,e[31]=G):G=e[31];let Y;e[32]!==R?(Y=()=>{R()},e[32]=R,e[33]=Y):Y=e[33];let V,k;e[34]!==m?(V=()=>m.get(td),k=()=>m.get(nd),e[34]=m,e[35]=V,e[36]=k):(V=e[35],k=e[36]);let H;e[37]!==v?(H=Ee=>{v(Ee)},e[37]=v,e[38]=H):H=e[38];let F;e[39]!==w?(F=()=>{w()},e[39]=w,e[40]=F):F=e[40];let oe;e[41]!==d||e[42]!==c||e[43]!==te||e[44]!==me||e[45]!==ce||e[46]!==j||e[47]!==I||e[48]!==G||e[49]!==Y||e[50]!==V||e[51]!==k||e[52]!==H||e[53]!==N||e[54]!==F||e[55]!==T||e[56]!==O||e[57]!==M||e[58]!==$||e[59]!==L||e[60]!==X||e[61]!==ae?(oe={selectNode:N,addToSelection:T,clearSelection:O,getSelectedNodeIds:M,fitToBounds:$,centerOnNode:L,resetViewport:X,lockNode:ae,unlockNode:te,toggleLock:me,deleteNode:ce,isNodeLocked:j,applyForceLayout:I,undo:G,redo:Y,canUndo:V,canRedo:k,selectEdge:H,clearEdgeSelection:F,openContextMenu:c,createNode:d},e[41]=d,e[42]=c,e[43]=te,e[44]=me,e[45]=ce,e[46]=j,e[47]=I,e[48]=G,e[49]=Y,e[50]=V,e[51]=k,e[52]=H,e[53]=N,e[54]=F,e[55]=T,e[56]=O,e[57]=M,e[58]=$,e[59]=L,e[60]=X,e[61]=ae,e[62]=oe):oe=e[62];const J=oe;let W;e[63]!==J?(W=async(Ee,Be)=>mp(Ee,Be,J),e[63]=J,e[64]=W):W=e[64];const ue=W;let xe;e[65]!==J||e[66]!==_?(xe=async(Ee,Be)=>{const et=Nu(_,Ee);return mp(et,Be,J)},e[65]=J,e[66]=_,e[67]=xe):xe=e[67];const de=xe;let Te;e[68]!==_?(Te=Ee=>Nu(_,Ee),e[68]=_,e[69]=Te):Te=e[69];const Ce=Te;let Se;return e[70]!==ue||e[71]!==de||e[72]!==Ce||e[73]!==J||e[74]!==_?(Se={executeActionById:ue,executeEventAction:de,getActionForEvent:Ce,mappings:_,helpers:J},e[70]=ue,e[71]=de,e[72]=Ce,e[73]=J,e[74]=_,e[75]=Se):Se=e[75],Se}var wN=class{constructor(){cp(this,"commands",new Map),cp(this,"aliases",new Map)}register(n){if(this.commands.has(n.name))throw new Error(`Command "${n.name}" is already registered`);if(this.commands.set(n.name,n),n.aliases)for(const e of n.aliases){if(this.aliases.has(e))throw new Error(`Alias "${e}" is already registered for command "${this.aliases.get(e)}"`);if(this.commands.has(e))throw new Error(`Alias "${e}" conflicts with existing command name`);this.aliases.set(e,n.name)}}unregister(n){const e=this.commands.get(n);if(e){if(e.aliases)for(const o of e.aliases)this.aliases.delete(o);this.commands.delete(n)}}get(n){const e=this.commands.get(n);if(e)return e;const o=this.aliases.get(n);if(o)return this.commands.get(o)}has(n){return this.commands.has(n)||this.aliases.has(n)}search(n){var l,c,d;if(!n.trim())return this.all();const e=n.toLowerCase().trim(),o=[],r=Array.from(this.commands.values());for(const p of r){let m=0;p.name.toLowerCase()===e?m=100:p.name.toLowerCase().startsWith(e)?m=80:p.name.toLowerCase().includes(e)?m=60:(l=p.aliases)!=null&&l.some(h=>h.toLowerCase()===e)?m=90:(c=p.aliases)!=null&&c.some(h=>h.toLowerCase().startsWith(e))?m=70:(d=p.aliases)!=null&&d.some(h=>h.toLowerCase().includes(e))?m=50:p.description.toLowerCase().includes(e)&&(m=30),m>0&&o.push({command:p,score:m})}return o.sort((p,m)=>m.score-p.score||p.command.name.localeCompare(m.command.name)).map(p=>p.command)}all(){return Array.from(this.commands.values()).sort((n,e)=>n.name.localeCompare(e.name))}byCategory(n){return this.all().filter(e=>e.category===n)}categories(){const n=new Set,e=Array.from(this.commands.values());for(const o of e)n.add(o.category);return Array.from(n).sort()}get size(){return this.commands.size}clear(){this.commands.clear(),this.aliases.clear()}toJSON(){return this.all().map(n=>({name:n.name,aliases:n.aliases||[],description:n.description,category:n.category,inputs:n.inputs.map(e=>({name:e.name,type:e.type,prompt:e.prompt,required:e.required!==!1}))}))}},To=new wN;function En(n){To.register(n)}var Bi=K({type:"normal"}),sd=K(!1),Dt=K({phase:"idle"}),Cl=K(null),vp=Sb("canvas-command-history",[]),ld=K(0),xN=K(null),Q2=K(null,(n,e)=>{e(sd,!0),e(Dt,{phase:"searching",query:"",suggestions:To.all()}),e(ld,0)}),Cm=K(null,(n,e)=>{e(sd,!1),e(Dt,{phase:"idle"}),e(Bi,{type:"normal"}),e(Cl,null),e(xN,null)}),SN=K(null,(n,e,o)=>{const r=To.search(o);e(Dt,{phase:"searching",query:o,suggestions:r}),e(ld,0)}),Z2=K(null,(n,e,o)=>{const r=n(vp),l=[o.name,...r.filter(d=>d!==o.name)].slice(0,50);if(e(vp,l),o.inputs.length===0){e(Dt,{phase:"executing",command:o});return}e(Dt,{phase:"collecting",command:o,inputIndex:0,collected:{}});const c=o.inputs[0];e(Bi,Em(c))}),I2=K(null,(n,e,o)=>{const r=n(Dt);if(r.phase!=="collecting")return;const{command:l,inputIndex:c,collected:d}=r,p=l.inputs[c];if(p.validate){const h=p.validate(o,d);if(h!==!0){e(Dt,{phase:"error",message:typeof h=="string"?h:`Invalid value for ${p.name}`});return}}const m={...d,[p.name]:o};if(c<l.inputs.length-1){const h=c+1,g=l.inputs[h];if(e(Dt,{phase:"collecting",command:l,inputIndex:h,collected:m}),e(Bi,Em(g,m)),l.feedback){const y=l.feedback(m,g);if(y){const v={hoveredNodeId:y.highlightNodeId,ghostNode:y.ghostNode,crosshair:y.crosshair,previewEdge:y.previewEdge&&"to"in y.previewEdge?{from:y.previewEdge.from,to:y.previewEdge.to}:void 0};e(Cl,v)}else e(Cl,null)}}else e(Dt,{phase:"collecting",command:l,inputIndex:c,collected:m}),e(Bi,{type:"normal"})}),AN=K(null,(n,e)=>{const o=n(Dt);if(o.phase!=="collecting")return;const{command:r,inputIndex:l}=o,c=r.inputs[l];if(c.required!==!1)return;const d=c.default;e(I2,d)}),_N=K(null,(n,e)=>{const o=n(Dt);if(o.phase!=="collecting")return;const{command:r,inputIndex:l,collected:c}=o;if(l===0){e(Dt,{phase:"searching",query:r.name,suggestions:[r]}),e(Bi,{type:"normal"});return}const d=l-1,p=r.inputs[d],m={...c};delete m[p.name],e(Dt,{phase:"collecting",command:r,inputIndex:d,collected:m}),e(Bi,Em(p,m))}),CN=K(null,(n,e,o)=>{e(Dt,{phase:"error",message:o}),e(Bi,{type:"normal"})});K(null,(n,e)=>{e(Dt,{phase:"idle"})});K(n=>{const e=n(Dt);return e.phase==="collecting"||e.phase==="executing"});var F2=K(n=>{const e=n(Dt);return e.phase!=="collecting"?null:e.command.inputs[e.inputIndex]}),P2=K(n=>{const e=n(Dt);return e.phase!=="collecting"?null:{current:e.inputIndex+1,total:e.command.inputs.length}});function Em(n,e){switch(n.type){case"point":return{type:"pickPoint",prompt:n.prompt,snapToGrid:n.snapToGrid};case"node":return{type:"pickNode",prompt:n.prompt,filter:n.filter?o=>n.filter(o,e||{}):void 0};case"nodes":return{type:"pickNodes",prompt:n.prompt,filter:n.filter?o=>n.filter(o,e||{}):void 0};case"select":return{type:"select",prompt:n.prompt,options:n.options||[]};case"text":case"number":case"color":case"boolean":default:return{type:"text",prompt:n.prompt}}}Ul();Jr();function EN(){const n=Oe.c(8),e=he(fm),o=ge(um),r=ge(dm);let l,c;n[0]!==o?(l=()=>o(!0),c=()=>o(!1),n[0]=o,n[1]=l,n[2]=c):(l=n[1],c=n[2]);let d;return n[3]!==e||n[4]!==l||n[5]!==c||n[6]!==r?(d={...e,enable:l,disable:c,toggle:r},n[3]=e,n[4]=l,n[5]=c,n[6]=r,n[7]=d):d=n[7],d}Mo();var bp=({x1:n,y1:e,x2:o,y2:r})=>{const l=Math.abs(o-n),c=Math.max(l*.5,50),d=n+c,p=e,m=o-c,g=`M ${n} ${e} C ${d} ${p}, ${m} ${r}, ${o} ${r}`,y=(n+o)/2,v=(e+r)/2;return{path:g,labelX:y,labelY:v}},J2=({x1:n,y1:e,x2:o,y2:r})=>{const l=Math.abs(r-e),c=Math.max(l*.5,50),d=n,p=e+c,m=o,h=r-c,g=`M ${n} ${e} C ${d} ${p}, ${m} ${h}, ${o} ${r}`,y=(n+o)/2,v=(e+r)/2;return{path:g,labelX:y,labelY:v}},NN=n=>{const{x1:e,y1:o,x2:r,y2:l}=n,c=Math.abs(r-e),d=Math.abs(l-o);return c>d?bp(n):J2(n)},kN=({x1:n,y1:e,x2:o,y2:r})=>{const l=`M ${n} ${e} L ${o} ${r}`,c=(n+o)/2,d=(e+r)/2;return{path:l,labelX:c,labelY:d}},Nm=({x1:n,y1:e,x2:o,y2:r})=>{const l=(n+o)/2,c=`M ${n} ${e} L ${l} ${e} L ${l} ${r} L ${o} ${r}`,d=l,p=(e+r)/2;return{path:c,labelX:d,labelY:p}},W2=({x1:n,y1:e,x2:o,y2:r})=>{const l=(e+r)/2,c=`M ${n} ${e} L ${n} ${l} L ${o} ${l} L ${o} ${r}`,d=(n+o)/2;return{path:c,labelX:d,labelY:l}},TN=n=>{const{x1:e,y1:o,x2:r,y2:l}=n,c=Math.abs(r-e),d=Math.abs(l-o);return c>d?Nm(n):W2(n)},DN=({x1:n,y1:e,x2:o,y2:r})=>{const l=(n+o)/2,c=Math.min(20,Math.abs(o-n)/4,Math.abs(r-e)/2);if(c<5||Math.abs(r-e)<c*2)return Nm({x1:n,y1:e,x2:o,y2:r});const d=r>e?1:-1,p=`
    M ${n} ${e}
    L ${l-c} ${e}
    Q ${l} ${e}, ${l} ${e+c*d}
    L ${l} ${r-c*d}
    Q ${l} ${r}, ${l+c} ${r}
    L ${o} ${r}
  `.replace(/\s+/g," ").trim(),m=l,h=(e+r)/2;return{path:p,labelX:m,labelY:h}};function MN(n){switch(n){case"bezier":return bp;case"bezier-vertical":return J2;case"bezier-smart":return NN;case"straight":return kN;case"step":return Nm;case"step-vertical":return W2;case"step-smart":return TN;case"smooth-step":return DN;default:return bp}}K(null);zo();zo();zo();zo();zo();zo();var ew={background:{color:"#f0f0f0",gradient:{from:"#f0f0f0",to:"#e0e0e0",angle:180},pattern:"none"},grid:{visible:!0,minorLineColor:"rgba(0, 0, 0, 0.05)",majorLineColor:"rgba(0, 0, 0, 0.1)",opacity:1},axes:{visible:!0,color:"rgba(0, 0, 0, 0.3)",labelColor:"rgba(0, 0, 0, 0.7)",tickColor:"rgba(0, 0, 0, 0.3)"},nodes:{defaultBackground:"#FAFAFA",defaultBorderColor:"rgba(0, 0, 0, 0.06)",defaultBorderRadius:12,selectedBorderColor:"#FF9800",selectedGlowColor:"rgba(255, 152, 0, 0.5)",shadowColor:"rgba(0, 0, 0, 0.1)",shadowOpacity:1,draggingBackgroundColor:"#FAFAFAd9",draggingBorderColor:"#CCCCCC",resizeHandleColor:"rgba(0, 0, 0, 0.2)",resizeHandleActiveColor:"rgba(59, 130, 246, 0.8)"},edges:{defaultColor:"#cccccc",defaultWeight:1.5,labelColor:"#FFFFFF",labelStrokeColor:"#000000",pathType:"bezier"}},zN={background:{color:"#0f172a",gradient:{from:"#0f172a",to:"#1e293b",angle:180},pattern:"none"},grid:{visible:!0,minorLineColor:"rgba(255, 255, 255, 0.06)",majorLineColor:"rgba(255, 255, 255, 0.12)",opacity:1},axes:{visible:!0,color:"rgba(255, 255, 255, 0.35)",labelColor:"rgba(255, 255, 255, 0.7)",tickColor:"rgba(255, 255, 255, 0.35)"},nodes:{defaultBackground:"#FAFAFA",defaultBorderColor:"rgba(0, 0, 0, 0.06)",defaultBorderRadius:12,selectedBorderColor:"#FF9800",selectedGlowColor:"rgba(255, 152, 0, 0.5)",shadowColor:"rgba(0, 0, 0, 0.1)",shadowOpacity:1,draggingBackgroundColor:"#FAFAFAd9",draggingBorderColor:"#666666",resizeHandleColor:"rgba(255, 255, 255, 0.2)",resizeHandleActiveColor:"rgba(96, 165, 250, 0.8)"},edges:{defaultColor:"#cccccc",defaultWeight:1.5,labelColor:"#FFFFFF",labelStrokeColor:"#000000",pathType:"bezier"}};function ON(n,e){const o=e?zN:ew;return n?{background:{...o.background,...n.background},grid:{...o.grid,...n.grid},axes:{...o.axes,...n.axes},nodes:{...o.nodes,...n.nodes},edges:{...o.edges,...n.edges}}:o}var RN=K(ew),jN=K(!1),LN=K(void 0),tw=ne.createContext(null),UN=["--canvas-bg","--node-bg","--node-border","--node-radius","--node-selected-border","--node-selected-glow","--node-shadow","--node-shadow-opacity","--node-dragging-bg","--node-dragging-border","--node-resize-handle","--node-resize-handle-active","--edge-color","--edge-weight","--edge-label-color","--edge-label-stroke"];function GN(n,e){var c,d;const{nodes:o,edges:r,background:l}=e;n.style.setProperty("--canvas-bg",l.color||""),n.style.setProperty("--node-bg",o.defaultBackground||""),n.style.setProperty("--node-border",o.defaultBorderColor||""),n.style.setProperty("--node-radius",o.defaultBorderRadius?`${o.defaultBorderRadius}px`:"8px"),n.style.setProperty("--node-selected-border",o.selectedBorderColor||""),n.style.setProperty("--node-selected-glow",o.selectedGlowColor||""),n.style.setProperty("--node-shadow",o.shadowColor||""),n.style.setProperty("--node-shadow-opacity",((c=o.shadowOpacity)==null?void 0:c.toString())||"0.2"),n.style.setProperty("--node-dragging-bg",o.draggingBackgroundColor||""),n.style.setProperty("--node-dragging-border",o.draggingBorderColor||""),n.style.setProperty("--node-resize-handle",o.resizeHandleColor||""),n.style.setProperty("--node-resize-handle-active",o.resizeHandleActiveColor||""),n.style.setProperty("--edge-color",r.defaultColor||""),n.style.setProperty("--edge-weight",((d=r.defaultWeight)==null?void 0:d.toString())||"1.5"),n.style.setProperty("--edge-label-color",r.labelColor||""),n.style.setProperty("--edge-label-stroke",r.labelStrokeColor||"")}function BN(n){UN.forEach(e=>{n.style.removeProperty(e)})}function HN(n){const e=Oe.c(24),{children:o,styles:r,isDark:l}=n,c=l===void 0?!1:l,d=ne.useRef(null),[p,m]=Ci(LN),[h,g]=Ci(jN),y=ge(RN),v=p??r,w=h||c;let S;e[0]!==w||e[1]!==v?(S=ON(v,w),e[0]=w,e[1]=v,e[2]=S):S=e[2];const A=S;let x,E;e[3]!==A||e[4]!==y?(x=()=>{y(A)},E=[A,y],e[3]=A,e[4]=y,e[5]=x,e[6]=E):(x=e[5],E=e[6]),ne.useLayoutEffect(x,E);let D;e[7]!==A?(D=te=>{if(d.current=te,!!te)return GN(te,A),()=>BN(te)},e[7]=A,e[8]=D):D=e[8];const R=D;let _;e[9]!==m?(_=te=>{m(te)},e[9]=m,e[10]=_):_=e[10];const N=_;let T;e[11]!==g?(T=te=>{g(te)},e[11]=g,e[12]=T):T=e[12];const O=T;let M;e[13]!==A||e[14]!==O||e[15]!==N?(M={styles:A,containerRef:d,setStyles:N,setDarkMode:O},e[13]=A,e[14]=O,e[15]=N,e[16]=M):M=e[16];const $=M;let L;e[17]===Symbol.for("react.memo_cache_sentinel")?(L={display:"contents"},e[17]=L):L=e[17];let X;e[18]!==o||e[19]!==R?(X=z.jsx("div",{ref:R,className:"canvas-style-scope",style:L,children:o}),e[18]=o,e[19]=R,e[20]=X):X=e[20];let ae;return e[21]!==$||e[22]!==X?(ae=z.jsx(tw,{value:$,children:X}),e[21]=$,e[22]=X,e[23]=ae):ae=e[23],ae}function cd(){const n=ne.useContext(tw);if(!n)throw new Error("useCanvasStyle must be used within a CanvasStyleProvider");return n.styles}Zt();new mE({defaultOptions:{queries:{staleTime:1e3*60,refetchOnWindowFocus:!1}}});cn();Tn();vm();ad();X2();function $N(n){const e=Oe.c(19),{pan:o,zoom:r,viewportWidth:l,viewportHeight:c,gridSize:d,majorGridSize:p}=n,m=d===void 0?50:d,h=p===void 0?250:p,g=cd();if(!g.grid.visible||!l||!c||r<=0)return null;let y,v;if(e[0]!==m||e[1]!==h||e[2]!==o.x||e[3]!==o.y||e[4]!==g.grid.majorLineColor||e[5]!==g.grid.minorLineColor||e[6]!==g.grid.opacity||e[7]!==c||e[8]!==l||e[9]!==r){v=[];const x=g.grid.minorLineColor,E=g.grid.majorLineColor;y=g.grid.opacity;const D=-o.x/r,R=-o.y/r,_=(-o.x+l)/r,N=(-o.y+c)/r,T=Math.ceil(D/m)*m;for(let L=T;L<=_;L=L+m,L)L%h!==0&&v.push(z.jsx("line",{x1:L,y1:R,x2:L,y2:N,stroke:x,strokeWidth:1/r},`v-${L}`));const O=Math.ceil(R/m)*m;for(let L=O;L<=N;L=L+m,L)L%h!==0&&v.push(z.jsx("line",{x1:D,y1:L,x2:_,y2:L,stroke:x,strokeWidth:1/r},`h-${L}`));const M=Math.ceil(D/h)*h;for(let L=M;L<=_;L=L+h,L)v.push(z.jsx("line",{x1:L,y1:R,x2:L,y2:N,stroke:E,strokeWidth:1.5/r},`major-v-${L}`));const $=Math.ceil(R/h)*h;for(let L=$;L<=N;L=L+h,L)v.push(z.jsx("line",{x1:D,y1:L,x2:_,y2:L,stroke:E,strokeWidth:1.5/r},`major-h-${L}`));e[0]=m,e[1]=h,e[2]=o.x,e[3]=o.y,e[4]=g.grid.majorLineColor,e[5]=g.grid.minorLineColor,e[6]=g.grid.opacity,e[7]=c,e[8]=l,e[9]=r,e[10]=y,e[11]=v}else y=e[10],v=e[11];let w;e[12]!==y?(w={position:"absolute",top:0,left:0,overflow:"visible",pointerEvents:"none",opacity:y},e[12]=y,e[13]=w):w=e[13];let S;e[14]!==v?(S=z.jsx("g",{children:v}),e[14]=v,e[15]=S):S=e[15];let A;return e[16]!==w||e[17]!==S?(A=z.jsx("svg",{width:"100%",height:"100%",style:w,children:S}),e[16]=w,e[17]=S,e[18]=A):A=e[18],A}function YN(n){const e=Oe.c(31),{pan:o,zoom:r,viewportWidth:l,viewportHeight:c,tickSize:d,labelSize:p}=n,m=d===void 0?100:d,h=p===void 0?12:p,g=cd();if(!g.axes.visible||!l||!c||r<=0)return null;let y;e[0]!==m||e[1]!==r?(y=()=>{const E=80/r,D=[50,100,250,500,1e3,2500,5e3,1e4];for(const R of D)if(R>=E)return Math.max(R,m);return 1e4},e[0]=m,e[1]=r,e[2]=y):y=e[2];const w=y();let S;if(e[3]!==w||e[4]!==h||e[5]!==o.x||e[6]!==o.y||e[7]!==g.axes.color||e[8]!==g.axes.labelColor||e[9]!==c||e[10]!==l||e[11]!==r){S=[];const E=1.5/r,D=5/r,R=8/r,_=h/r,N=g.axes.color,T=g.axes.labelColor,O=-o.x/r,M=-o.y/r,$=(-o.x+l)/r,L=(-o.y+c)/r;if(M<=0&&L>=0){let X;e[13]!==N||e[14]!==E||e[15]!==O||e[16]!==$?(X=z.jsx("line",{x1:O,y1:0,x2:$,y2:0,stroke:N,strokeWidth:E},"x-axis"),e[13]=N,e[14]=E,e[15]=O,e[16]=$,e[17]=X):X=e[17],S.push(X);const ae=Math.ceil(O/w)*w;for(let te=ae;te<=$;te=te+w,te)te===0&&O<=0&&$>=0||(S.push(z.jsx("line",{x1:te,y1:-D,x2:te,y2:D,stroke:N,strokeWidth:E/1.5},`x-tick-${te}`)),S.push(z.jsx("text",{x:te,y:D+R,fill:T,fontSize:_,textAnchor:"middle",dominantBaseline:"hanging",children:te},`x-label-${te}`)))}if(O<=0&&$>=0){let X;e[18]!==N||e[19]!==E||e[20]!==L||e[21]!==M?(X=z.jsx("line",{x1:0,y1:M,x2:0,y2:L,stroke:N,strokeWidth:E},"y-axis"),e[18]=N,e[19]=E,e[20]=L,e[21]=M,e[22]=X):X=e[22],S.push(X);const ae=Math.ceil(M/w)*w;for(let te=ae;te<=L;te=te+w,te)te===0&&M<=0&&L>=0||(S.push(z.jsx("line",{x1:-D,y1:te,x2:D,y2:te,stroke:N,strokeWidth:E/1.5},`y-tick-${te}`)),S.push(z.jsx("text",{x:D+R,y:te,fill:T,fontSize:_,textAnchor:"start",dominantBaseline:"middle",children:te},`y-label-${te}`)))}if(O<=0&&$>=0&&M<=0&&L>=0){const X=-R,ae=_*1.1;let te;e[23]!==T||e[24]!==R||e[25]!==X||e[26]!==ae?(te=z.jsx("text",{x:R,y:X,fill:T,fontSize:ae,textAnchor:"start",dominantBaseline:"alphabetic",children:"(0,0)"},"origin-label"),e[23]=T,e[24]=R,e[25]=X,e[26]=ae,e[27]=te):te=e[27],S.push(te)}e[3]=w,e[4]=h,e[5]=o.x,e[6]=o.y,e[7]=g.axes.color,e[8]=g.axes.labelColor,e[9]=c,e[10]=l,e[11]=r,e[12]=S}else S=e[12];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A={position:"absolute",top:0,left:0,overflow:"visible",pointerEvents:"none"},e[28]=A):A=e[28];let x;return e[29]!==S?(x=z.jsx("svg",{width:"100%",height:"100%",style:A,children:z.jsx("g",{children:S})}),e[29]=S,e[30]=x):x=e[30],x}var S1=.92,A1=.5,qN=5;function VN(n){const e=Oe.c(107),{children:o,minZoom:r,maxZoom:l,zoomSensitivity:c,className:d,style:p,enablePan:m,enableZoom:h,onBackgroundClick:g,onBackgroundDoubleClick:y,onBackgroundRightClick:v,onBackgroundLongPress:w,onBackgroundPointerDown:S}=n,A=r===void 0?.1:r,x=l===void 0?5:l,E=c===void 0?.0015:c,D=m===void 0?!0:m,R=h===void 0?!0:h,[_,N]=Ci(nn),[T,O]=Ci(Tt),M=ge(Zn),$=he(Zn),L=ge(cs),X=he(tt),ae=ge(xm),te=ge(Sm),me=he(bm),ce=he(zu),j=ne.useRef(null);let I;e[0]===Symbol.for("react.memo_cache_sentinel")?(I={x:0,y:0},e[0]=I):I=e[0];const G=ne.useRef(I),Y=ne.useRef(!1),V=ne.useRef("mouse"),k=ne.useRef(null);let H;e[1]===Symbol.for("react.memo_cache_sentinel")?(H=[],e[1]=H):H=e[1];const F=ne.useRef(H),oe=ne.useRef(null),J=ne.useRef(null),W=ne.useRef(!1);let ue,xe;e[2]!==M?(ue=()=>{const be=j.current;if(be){M(be.getBoundingClientRect());const Xe=new ResizeObserver(ct=>{for(const bt of ct)M(bt.contentRect)});return Xe.observe(be),()=>{be&&Xe.unobserve(be),Xe.disconnect()}}else M(null)},xe=[M],e[2]=M,e[3]=ue,e[4]=xe):(ue=e[3],xe=e[4]),ne.useEffect(ue,xe);let de,Te;e[5]===Symbol.for("react.memo_cache_sentinel")?(de=()=>()=>{k.current&&cancelAnimationFrame(k.current)},Te=[],e[5]=de,e[6]=Te):(de=e[5],Te=e[6]),ne.useEffect(de,Te);let Ce;e[7]!==_.x||e[8]!==_.y||e[9]!==T?(Ce=(be,Xe)=>{if(!j.current)return{x:0,y:0};const ct=j.current.getBoundingClientRect(),bt=(be-ct.left-_.x)/T,Rt=(Xe-ct.top-_.y)/T;return{x:bt,y:Rt}},e[7]=_.x,e[8]=_.y,e[9]=T,e[10]=Ce):Ce=e[10];const Se=Ce;let Ee;e[11]===Symbol.for("react.memo_cache_sentinel")?(Ee=be=>{if(!j.current||!be)return!1;const Xe=j.current.firstChild;return be===j.current||be===Xe},e[11]=Ee):Ee=e[11];const Be=Ee;let et;e[12]!==y||e[13]!==Se?(et=be=>{if(!y||!Be(be.target))return;be.preventDefault(),be.stopPropagation();const Xe=Se(be.clientX,be.clientY);y(Xe)},e[12]=y,e[13]=Se,e[14]=et):et=e[14];const ft=et;let un;e[15]!==v||e[16]!==Se?(un=be=>{if(!v||!Be(be.target))return;be.preventDefault(),be.stopPropagation();const Xe=Se(be.clientX,be.clientY);v(Xe,be)},e[15]=v,e[16]=Se,e[17]=un):un=e[17];const St=un;let ht;e[18]===Symbol.for("react.memo_cache_sentinel")?(ht=()=>{J.current&&(clearTimeout(J.current),J.current=null)},e[18]=ht):ht=e[18];const zt=ht;let Gt;e[19]!==N?(Gt=(be,Xe)=>{k.current&&cancelAnimationFrame(k.current);let ct=be,bt=Xe;const Rt=()=>{if(ct=ct*S1,bt=bt*S1,Math.abs(ct)<A1&&Math.abs(bt)<A1){k.current=null;return}N(At=>({x:At.x+ct,y:At.y+bt})),k.current=requestAnimationFrame(Rt)};k.current=requestAnimationFrame(Rt)},e[19]=N,e[20]=Gt):Gt=e[20];const on=Gt;let rn;e[21]===Symbol.for("react.memo_cache_sentinel")?(rn=()=>{const be=F.current;if(be.length<2)return{vx:0,vy:0};const Xe=be[be.length-1],ct=be[0];if((Xe.t-ct.t)/1e3<=0)return{vx:0,vy:0};let Rt=0,At=0;for(const Ht of be)Rt=Rt+Ht.vx,At=At+Ht.vy;return{vx:Rt/be.length,vy:At/be.length}},e[21]=rn):rn=e[21];const Ve=rn;let Bt;e[22]!==me||e[23]!==w||e[24]!==S||e[25]!==Se||e[26]!==ae?(Bt=be=>{var bt;if(!j.current){Y.current=!1;return}const Xe=G2(be.event);ae(Xe),V.current=Xe.source,k.current&&(cancelAnimationFrame(k.current),k.current=null);const ct=(bt=j.current)==null?void 0:bt.firstChild;if(be.event.target===j.current||be.event.target===ct){Y.current=!0;const Rt=Se(be.event.clientX,be.event.clientY);if(S==null||S(Rt,be.event),w&&(Xe.source==="finger"||Xe.source==="pencil")&&!(Xe.source==="finger"&&me)){W.current=!1,zt();const At=be.event.clientX,Ht=be.event.clientY;J.current=setTimeout(()=>{W.current=!0;const zn=Se(At,Ht);w(zn),J.current=null},600)}}else Y.current=!1},e[22]=me,e[23]=w,e[24]=S,e[25]=Se,e[26]=ae,e[27]=Bt):Bt=e[27];let wn;e[28]!==te?(wn=be=>{te(be.event.pointerId),zt()},e[28]=te,e[29]=wn):wn=e[29];let xn;e[30]!==D||e[31]!==_?(xn=()=>{Y.current&&D&&(G.current={..._},F.current=[],oe.current=null)},e[30]=D,e[31]=_,e[32]=xn):xn=e[32];let dt;e[33]!==L||e[34]!==D||e[35]!==me||e[36]!==g||e[37]!==Se||e[38]!==N?(dt=be=>{const{movement:Xe,tap:ct,active:bt,pinching:Rt,event:At,velocity:Ht,direction:zn}=be,[Bn,$t]=Xe,[nt,wt]=Ht,[An,hn]=zn;if(ct&&Y.current){zt(),W.current||(g?g(Se(At.clientX,At.clientY)):L()),W.current=!1;return}if(!ct&&bt&&D&&!Rt&&Y.current&&(zt(),q2({source:V.current,type:"drag",target:"background",isStylusActive:me})==="pan")){const Pe={x:G.current.x+Bn,y:G.current.y+$t};N(Pe);const Ct=performance.now();F.current.push({vx:nt*An,vy:wt*hn,t:Ct}),F.current.length>qN&&F.current.shift()}},e[33]=L,e[34]=D,e[35]=me,e[36]=g,e[37]=Se,e[38]=N,e[39]=dt):dt=e[39];let In;e[40]!==on?(In=()=>{if(zt(),W.current=!1,Y.current&&V.current==="finger"){const be=Ve();Math.sqrt(be.vx**2+be.vy**2)>2&&on(be.vx,be.vy)}Y.current=!1,F.current=[]},e[40]=on,e[41]=In):In=e[41];let Ei;e[42]!==R||e[43]!==x||e[44]!==A||e[45]!==_.x||e[46]!==_.y||e[47]!==X||e[48]!==N||e[49]!==O||e[50]!==E||e[51]!==T?(Ei=be=>{const{event:Xe,pinching:ct,delta:bt,memo:Rt}=be,[,At]=bt;if(Rt===!0||ct||!R||!j.current)return;const Ht=Xe.target,zn=Ht.closest('[data-no-drag="true"]');if(zn){const Ft=Ht.closest('[data-draggable-node="true"]');if(Ft){const Ro=Ft.getAttribute("data-node-id");if(Ro&&X.has(Ro)){let pn=Ht;for(;pn&&zn.contains(pn);){if(pn.scrollHeight>pn.clientHeight){const jo=At>0,Wi=At<0,jt=pn.scrollTop+pn.clientHeight>=pn.scrollHeight-1,hs=pn.scrollTop<=1;if(!jt&&jo||!hs&&Wi||jt&&Wi||hs&&jo)return}pn=pn.parentElement}}}}Xe.preventDefault();const Bn=j.current.getBoundingClientRect(),$t=Xe.clientX-Bn.left,nt=Xe.clientY-Bn.top,wt=($t-_.x)/T,An=(nt-_.y)/T,hn=-At*E*T;let Hn=T+hn;Hn=Math.max(A,Math.min(x,Hn));const Pe=$t-wt*Hn,Ct=nt-An*Hn;O(Hn),N({x:Pe,y:Ct})},e[42]=R,e[43]=x,e[44]=A,e[45]=_.x,e[46]=_.y,e[47]=X,e[48]=N,e[49]=O,e[50]=E,e[51]=T,e[52]=Ei):Ei=e[52];let Fn;e[53]!==R?(Fn=()=>!R||!j.current?!0:(k.current&&(cancelAnimationFrame(k.current),k.current=null),!1),e[53]=R,e[54]=Fn):Fn=e[54];let Hi;e[55]!==R||e[56]!==x||e[57]!==A||e[58]!==_.x||e[59]!==_.y||e[60]!==N||e[61]!==O||e[62]!==T?(Hi=be=>{const{offset:Xe,origin:ct,event:bt,memo:Rt}=be,[At]=Xe,[Ht,zn]=ct;if(Rt===!0||!R||!j.current)return;bt.preventDefault();const Bn=j.current.getBoundingClientRect(),$t=Ht-Bn.left,nt=zn-Bn.top,wt=($t-_.x)/T,An=(nt-_.y)/T;let hn=At;hn=Math.max(A,Math.min(x,hn));const Hn=$t-wt*hn,Pe=nt-An*hn;O(hn),N({x:Hn,y:Pe})},e[55]=R,e[56]=x,e[57]=A,e[58]=_.x,e[59]=_.y,e[60]=N,e[61]=O,e[62]=T,e[63]=Hi):Hi=e[63];let Dn;e[64]!==Bt||e[65]!==wn||e[66]!==xn||e[67]!==dt||e[68]!==In||e[69]!==Ei||e[70]!==Fn||e[71]!==Hi?(Dn={onPointerDown:Bt,onPointerUp:wn,onDragStart:xn,onDrag:dt,onDragEnd:In,onWheel:Ei,onPinchStart:Fn,onPinch:Hi},e[64]=Bt,e[65]=wn,e[66]=xn,e[67]=dt,e[68]=In,e[69]=Ei,e[70]=Fn,e[71]=Hi,e[72]=Dn):Dn=e[72];let Ot;e[73]===Symbol.for("react.memo_cache_sentinel")?(Ot={passive:!1,capture:!0},e[73]=Ot):Ot=e[73];const dn=ce==="finger"?10:5;let vt;e[74]===Symbol.for("react.memo_cache_sentinel")?(vt={touch:!0,keys:!1},e[74]=vt):vt=e[74];let Pn;e[75]!==dn?(Pn={filterTaps:!0,tapsThreshold:dn,pointer:vt},e[75]=dn,e[76]=Pn):Pn=e[76];let Oo;e[77]===Symbol.for("react.memo_cache_sentinel")?(Oo={},e[77]=Oo):Oo=e[77];let Jn;e[78]!==x||e[79]!==A?(Jn=()=>({min:A,max:x}),e[78]=x,e[79]=A,e[80]=Jn):Jn=e[80];let Mn;e[81]!==T?(Mn=()=>[T,0],e[81]=T,e[82]=Mn):Mn=e[82];let Sn;e[83]!==Jn||e[84]!==Mn?(Sn={scaleBounds:Jn,from:Mn},e[83]=Jn,e[84]=Mn,e[85]=Sn):Sn=e[85];let Ni;e[86]!==Pn||e[87]!==Sn?(Ni={target:j,eventOptions:Ot,drag:Pn,wheel:Oo,pinch:Sn},e[86]=Pn,e[87]=Sn,e[88]=Ni):Ni=e[88],zb(Dn,Ni);let It;e[89]!==p?(It={width:"100%",height:"100%",overflow:"hidden",position:"relative",touchAction:"none",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",background:"var(--canvas-bg, #23272a)",...p},e[89]=p,e[90]=It):It=e[90];const $i=`translate(${_.x}px, ${_.y}px) scale(${T})`;let fn;e[91]!==$i?(fn={transform:$i,transformOrigin:"0 0",width:"100%",height:"100%"},e[91]=$i,e[92]=fn):fn=e[92];let Yi;e[93]!==_||e[94]!==$||e[95]!==T?(Yi=$&&$.width>0&&$.height>0&&z.jsxs(z.Fragment,{children:[z.jsx($N,{pan:_,zoom:T,viewportWidth:$.width,viewportHeight:$.height}),z.jsx(YN,{pan:_,zoom:T,viewportWidth:$.width,viewportHeight:$.height})]}),e[93]=_,e[94]=$,e[95]=T,e[96]=Yi):Yi=e[96];let Gn;e[97]!==o||e[98]!==fn||e[99]!==Yi?(Gn=z.jsxs("div",{style:fn,children:[Yi,o]}),e[97]=o,e[98]=fn,e[99]=Yi,e[100]=Gn):Gn=e[100];let qi;return e[101]!==d||e[102]!==St||e[103]!==ft||e[104]!==It||e[105]!==Gn?(qi=z.jsx("div",{ref:j,id:"viewport-canvas",className:d,"data-viewport":"true",onDoubleClick:ft,onContextMenu:St,style:It,children:Gn}),e[101]=d,e[102]=St,e[103]=ft,e[104]=It,e[105]=Gn,e[106]=qi):qi=e[106],qi}Zt();Ul();Zt();Tn();var _1=44,Ya=12,ou="8px";function XN(n){const e={position:"absolute",width:`${_1}px`,height:`${_1}px`,zIndex:10,touchAction:"none",WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"};switch(n){case"nw":return{...e,top:-22,left:-22,cursor:"nwse-resize"};case"ne":return{...e,top:-22,right:-22,cursor:"nesw-resize"};case"sw":return{...e,bottom:-22,left:-22,cursor:"nesw-resize"};case"se":return{...e,bottom:-22,right:-22,cursor:"nwse-resize"};case"n":return{...e,top:-22,left:"50%",transform:"translateX(-50%)",cursor:"ns-resize"};case"s":return{...e,bottom:-22,left:"50%",transform:"translateX(-50%)",cursor:"ns-resize"};case"e":return{...e,right:-22,top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"};case"w":return{...e,left:-22,top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}}}function KN(n,e){const d=`${e?"4px":"3px"} solid ${e?"var(--node-resize-handle-active, rgba(59, 130, 246, 0.8))":"var(--node-resize-handle, rgba(0, 0, 0, 0.2))"}`,p={position:"absolute",pointerEvents:"none",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:`${Ya}px`,height:`${Ya}px`};switch(n){case"nw":return{...p,borderTop:d,borderLeft:d,borderTopLeftRadius:ou};case"ne":return{...p,borderTop:d,borderRight:d,borderTopRightRadius:ou};case"sw":return{...p,borderBottom:d,borderLeft:d,borderBottomLeftRadius:ou};case"se":return{...p,borderBottom:d,borderRight:d,borderBottomRightRadius:ou};case"n":return{...p,borderTop:d,width:`${Ya*2}px`};case"s":return{...p,borderBottom:d,width:`${Ya*2}px`};case"e":return{...p,borderRight:d,height:`${Ya*2}px`};case"w":return{...p,borderLeft:d,height:`${Ya*2}px`}}}function $r(n){const e=Oe.c(26),{direction:o,createResizeStart:r,handleResizeMove:l,handleResizeEnd:c,isResizing:d,alwaysVisible:p}=n,m=p===void 0?!1:p;let h;e[0]!==r||e[1]!==o?(h=r(o),e[0]=r,e[1]=o,e[2]=h):h=e[2];let g;e[3]!==o?(g=XN(o),e[3]=o,e[4]=g):g=e[4];const y=m||d?1:0;let v;e[5]!==g||e[6]!==y?(v={...g,opacity:y,transition:"opacity 200ms"},e[5]=g,e[6]=y,e[7]=v):v=e[7];let w;e[8]!==m?(w=D=>{m||(D.currentTarget.style.opacity="1")},e[8]=m,e[9]=w):w=e[9];let S;e[10]!==m||e[11]!==d?(S=D=>{!m&&!d&&(D.currentTarget.style.opacity="0")},e[10]=m,e[11]=d,e[12]=S):S=e[12];let A;e[13]!==o||e[14]!==d?(A=KN(o,d),e[13]=o,e[14]=d,e[15]=A):A=e[15];let x;e[16]!==A?(x=z.jsx("div",{style:A}),e[16]=A,e[17]=x):x=e[17];let E;return e[18]!==c||e[19]!==l||e[20]!==h||e[21]!==v||e[22]!==w||e[23]!==S||e[24]!==x?(E=z.jsx("div",{"data-no-drag":"true",onPointerDown:h,onPointerMove:l,onPointerUp:c,onPointerCancel:c,style:v,onPointerEnter:w,onPointerLeave:S,children:x}),e[18]=c,e[19]=l,e[20]=h,e[21]=v,e[22]=w,e[23]=S,e[24]=x,e[25]=E):E=e[25],E}function QN(n){const e=Oe.c(137),{nodeData:o,renderContent:r,onClick:l,onDoubleClick:c,onTripleClick:d,onRightClick:p,onLongPress:m,onHover:h,onLeave:g,onPersist:y,onPersistError:v,wrapper:w}=n,{id:S,zIndex:A}=o,x=he(ze),E=ge(Hp),{isSelected:D}=tN(S),R=he(tt),_=he(Gi);let N;e[0]!==S?(N=xi(S),e[0]=S,e[1]=N):N=e[1],he(N),he(wr);const T=cd(),O=ne.useRef(null),M=ne.useRef(null),$=ne.useRef(!1);let L;e[2]!==y||e[3]!==v?(L={onPersist:y,onPersistError:v},e[2]=y,e[3]=v,e[4]=L):L=e[4];const{bind:X,updateNodePositions:ae}=rN(S,L);let te;e[5]!==y||e[6]!==v?(te={onPersist:y,onPersistError:v},e[5]=y,e[6]=v,e[7]=te):te=e[7];const me=te;let ce;e[8]!==S||e[9]!==o||e[10]!==me||e[11]!==ae?(ce={id:S,nodeData:o,updateNodePositions:ae,options:me},e[8]=S,e[9]=o,e[10]=me,e[11]=ae,e[12]=ce):ce=e[12];const{localWidth:j,localHeight:I,isResizing:G,createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k}=lN(ce),H=j,F=I,oe=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0);let J,W,ue,xe,de,Te,Ce,Se,Ee,Be,et,ft,un,St;if(e[13]!==_||e[14]!==X||e[15]!==T.nodes.defaultBackground||e[16]!==T.nodes.defaultBorderColor||e[17]!==T.nodes.defaultBorderRadius||e[18]!==T.nodes.draggingBackgroundColor||e[19]!==T.nodes.draggingBorderColor||e[20]!==T.nodes.selectedBorderColor||e[21]!==T.nodes.selectedGlowColor||e[22]!==T.nodes.shadowColor||e[23]!==x||e[24]!==S||e[25]!==G||e[26]!==D||e[27]!==o||e[28]!==F||e[29]!==H||e[30]!==l||e[31]!==c||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==p||e[36]!==d||e[37]!==r||e[38]!==R||e[39]!==E||e[40]!==A){const dt=_!==null&&R.has(S);let In;e[55]!==S||e[56]!==o||e[57]!==m?(In=Pe=>{if(!oe)return;const Ct=Pe.target;if(Ct.closest('[data-no-drag="true"]')||Ct.closest("button")||Ct.closest("input"))return;const Ft=Pe.touches[0];M.current={x:Ft.clientX,y:Ft.clientY},$.current=!1,O.current=setTimeout(()=>{$.current=!0,m==null||m(S,o,{x:Ft.clientX,y:Ft.clientY}),O.current=null},600)},e[55]=S,e[56]=o,e[57]=m,e[58]=In):In=e[58];const Ei=In;let Fn;e[59]===Symbol.for("react.memo_cache_sentinel")?(Fn=Pe=>{if(!O.current||!M.current)return;const Ct=Pe.touches[0],Ft=Math.abs(Ct.clientX-M.current.x),Ro=Math.abs(Ct.clientY-M.current.y);(Ft>10||Ro>10)&&(clearTimeout(O.current),O.current=null)},e[59]=Fn):Fn=e[59];const Hi=Fn;let Dn;e[60]===Symbol.for("react.memo_cache_sentinel")?(Dn=Pe=>{$.current&&(Pe.preventDefault(),Pe.stopPropagation(),$.current=!1),O.current&&(clearTimeout(O.current),O.current=null),M.current=null},e[60]=Dn):Dn=e[60];const Ot=Dn;let dn;e[61]!==X?(dn=X(),e[61]=X,e[62]=dn):dn=e[62];const vt=dn;let Pn;e[63]!==vt||e[64]!==S||e[65]!==E?(Pn=Pe=>{const Ct=Pe.target;Ct.closest('[data-no-drag="true"]')||Ct.tagName==="INPUT"||Ct.tagName==="TEXTAREA"||Ct.tagName==="SELECT"||(vt.onPointerDown&&vt.onPointerDown(Pe),Pe.stopPropagation(),E({nodeId:S,isShiftPressed:Pe.shiftKey}))},e[63]=vt,e[64]=S,e[65]=E,e[66]=Pn):Pn=e[66];const Oo=Pn;let Jn;e[67]!==x||e[68]!==S||e[69]!==A?(Jn=x.hasNode(S)?x.getNodeAttribute(S,"zIndex"):A,e[67]=x,e[68]=S,e[69]=A,e[70]=Jn):Jn=e[70];const Mn=Jn;let Sn;e[71]!==S||e[72]!==o||e[73]!==l||e[74]!==c||e[75]!==d?(Sn=Pe=>{const Ct=Pe.target;if(Ct.closest('[data-no-drag="true"]')||Ct.tagName==="INPUT"||Ct.tagName==="TEXTAREA")return;const Ft=Pe.detail;Ft===1?l==null||l(S,o):Ft===2?(Pe.preventDefault(),Pe.stopPropagation(),c==null||c(S,o)):Ft>=3&&(Pe.preventDefault(),Pe.stopPropagation(),d==null||d(S,o))},e[71]=S,e[72]=o,e[73]=l,e[74]=c,e[75]=d,e[76]=Sn):Sn=e[76];const Ni=Sn;let It;e[77]!==S||e[78]!==o||e[79]!==p?(It=Pe=>{p&&(Pe.preventDefault(),Pe.stopPropagation(),p(S,o,Pe))},e[77]=S,e[78]=o,e[79]=p,e[80]=It):It=e[80];const $i=It;let fn;e[81]!==S||e[82]!==o||e[83]!==h?(fn=()=>{h==null||h(S,o)},e[81]=S,e[82]=o,e[83]=h,e[84]=fn):fn=e[84];const Yi=fn;let Gn;e[85]!==S||e[86]!==g?(Gn=()=>{g==null||g(S)},e[85]=S,e[86]=g,e[87]=Gn):Gn=e[87];const qi=Gn,be=D?T.nodes.selectedBorderColor:dt?T.nodes.draggingBorderColor:T.nodes.defaultBorderColor,Xe=D||dt?"1.5px":"1px",ct=`${T.nodes.defaultBorderRadius}px`,bt=`0px 8px 24px ${T.nodes.shadowColor}`,Rt=`0px 12px 32px ${T.nodes.shadowColor}`,At=`0 0 10px 2px ${T.nodes.selectedGlowColor}, ${bt}`,Ht=D?At:dt?Rt:bt;Be="true",et=S,ft=vt,un=Oo,St=Ei,J=Hi,W=Ot,ue=Ot,xe=Ni,de=$i,Te=Yi,Ce=qi;const zn=`${H}px`,Bn=`${F}px`,$t=dt?T.nodes.draggingBackgroundColor:T.nodes.defaultBackground,nt=`${Xe} solid ${be}`,wt=dt?"grabbing":"grab",An=dt?.9:1,hn=dt?"opacity 0.1s, transform 0.05s, background-color 0.1s, box-shadow 0.1s, border-color 0.1s":"opacity 0.4s, border-color 0.4s, box-shadow 0.4s, background-color 0.4s, transform 0.4s ease-in-out",Hn=dt?"scale(1.005)":"scale(1)";e[88]!==ct||e[89]!==Ht||e[90]!==Mn||e[91]!==zn||e[92]!==Bn||e[93]!==$t||e[94]!==nt||e[95]!==wt||e[96]!==An||e[97]!==hn||e[98]!==Hn?(Se={width:zn,height:Bn,backgroundColor:$t,border:nt,borderRadius:ct,boxShadow:Ht,cursor:wt,opacity:An,transition:hn,transform:Hn,zIndex:Mn,touchAction:"manipulation",userSelect:"auto",position:"relative",overflow:"hidden"},e[88]=ct,e[89]=Ht,e[90]=Mn,e[91]=zn,e[92]=Bn,e[93]=$t,e[94]=nt,e[95]=wt,e[96]=An,e[97]=hn,e[98]=Hn,e[99]=Se):Se=e[99],Ee=r({node:o,isSelected:D,isResizing:G,isDragging:dt}),e[13]=_,e[14]=X,e[15]=T.nodes.defaultBackground,e[16]=T.nodes.defaultBorderColor,e[17]=T.nodes.defaultBorderRadius,e[18]=T.nodes.draggingBackgroundColor,e[19]=T.nodes.draggingBorderColor,e[20]=T.nodes.selectedBorderColor,e[21]=T.nodes.selectedGlowColor,e[22]=T.nodes.shadowColor,e[23]=x,e[24]=S,e[25]=G,e[26]=D,e[27]=o,e[28]=F,e[29]=H,e[30]=l,e[31]=c,e[32]=h,e[33]=g,e[34]=m,e[35]=p,e[36]=d,e[37]=r,e[38]=R,e[39]=E,e[40]=A,e[41]=J,e[42]=W,e[43]=ue,e[44]=xe,e[45]=de,e[46]=Te,e[47]=Ce,e[48]=Se,e[49]=Ee,e[50]=Be,e[51]=et,e[52]=ft,e[53]=un,e[54]=St}else J=e[41],W=e[42],ue=e[43],xe=e[44],de=e[45],Te=e[46],Ce=e[47],Se=e[48],Ee=e[49],Be=e[50],et=e[51],ft=e[52],un=e[53],St=e[54];let ht,zt,Gt,on,rn,Ve,Bt;e[100]!==Y||e[101]!==k||e[102]!==V||e[103]!==G?(ht=z.jsx($r,{direction:"nw",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G}),zt=z.jsx($r,{direction:"ne",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G}),Gt=z.jsx($r,{direction:"sw",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G}),on=z.jsx($r,{direction:"se",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G,alwaysVisible:!0}),rn=z.jsx($r,{direction:"n",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G}),Ve=z.jsx($r,{direction:"s",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G}),Bt=z.jsx($r,{direction:"w",createResizeStart:Y,handleResizeMove:V,handleResizeEnd:k,isResizing:G}),e[100]=Y,e[101]=k,e[102]=V,e[103]=G,e[104]=ht,e[105]=zt,e[106]=Gt,e[107]=on,e[108]=rn,e[109]=Ve,e[110]=Bt):(ht=e[104],zt=e[105],Gt=e[106],on=e[107],rn=e[108],Ve=e[109],Bt=e[110]);let wn;e[111]!==J||e[112]!==W||e[113]!==ue||e[114]!==xe||e[115]!==de||e[116]!==Te||e[117]!==Ce||e[118]!==Se||e[119]!==Ee||e[120]!==ht||e[121]!==zt||e[122]!==Gt||e[123]!==on||e[124]!==rn||e[125]!==Ve||e[126]!==Bt||e[127]!==Be||e[128]!==et||e[129]!==ft||e[130]!==un||e[131]!==St?(wn=z.jsxs("div",{"data-draggable-node":Be,"data-node-id":et,...ft,onPointerDown:un,onTouchStart:St,onTouchMove:J,onTouchEnd:W,onTouchCancel:ue,onClick:xe,onContextMenu:de,onPointerEnter:Te,onPointerLeave:Ce,style:Se,children:[Ee,ht,zt,Gt,on,rn,Ve,Bt]}),e[111]=J,e[112]=W,e[113]=ue,e[114]=xe,e[115]=de,e[116]=Te,e[117]=Ce,e[118]=Se,e[119]=Ee,e[120]=ht,e[121]=zt,e[122]=Gt,e[123]=on,e[124]=rn,e[125]=Ve,e[126]=Bt,e[127]=Be,e[128]=et,e[129]=ft,e[130]=un,e[131]=St,e[132]=wn):wn=e[132];const xn=wn;if(w){let dt;return e[133]!==w||e[134]!==xn||e[135]!==o?(dt=z.jsx(w,{nodeData:o,children:xn}),e[133]=w,e[134]=xn,e[135]=o,e[136]=dt):dt=e[136],dt}return xn}function ZN(n){const e=Oe.c(11),{error:o,reset:r}=n;let l,c,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={padding:"16px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",borderRadius:"8px",color:"#ef4444",fontSize:"12px",minWidth:"150px"},c=z.jsx("div",{style:{fontWeight:600,marginBottom:"8px"},children:"⚠️ Node Error"}),d={color:"#888",marginBottom:"8px",wordBreak:"break-word"},e[0]=l,e[1]=c,e[2]=d):(l=e[0],c=e[1],d=e[2]);const p=o.message||"Unknown error";let m;e[3]!==p?(m=z.jsx("div",{style:d,children:p}),e[3]=p,e[4]=m):m=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={padding:"4px 8px",fontSize:"11px",backgroundColor:"rgba(239, 68, 68, 0.2)",border:"1px solid rgba(239, 68, 68, 0.3)",borderRadius:"4px",color:"#ef4444",cursor:"pointer"},e[5]=h):h=e[5];let g;e[6]!==r?(g=z.jsx("button",{onClick:r,style:h,children:"Retry"}),e[6]=r,e[7]=g):g=e[7];let y;return e[8]!==m||e[9]!==g?(y=z.jsxs("div",{style:l,children:[c,m,g]}),e[8]=m,e[9]=g,e[10]=y):y=e[10],y}var IN=class extends ne.Component{constructor(n){super(n),cp(this,"reset",()=>{this.setState({hasError:!1,error:null})}),this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,e){const{nodeId:o,onError:r}=this.props;console.error(`[NodeErrorBoundary] Error in node ${o}:`,n,e),r==null||r(o,n,e)}render(){const{hasError:n,error:e}=this.state,{nodeId:o,children:r,renderFallback:l}=this.props;return n&&e?l?l({nodeId:o,error:e,reset:this.reset}):z.jsx(ZN,{nodeId:o,error:e,reset:this.reset}):r}};function FN(n){const e=Oe.c(31),{renderNode:o,onNodeClick:r,onNodeDoubleClick:l,onNodeTripleClick:c,onNodeRightClick:d,onNodeLongPress:p,onNodeHover:m,onNodeLeave:h,onNodePersist:g,onNodePersistError:y,onNodeRenderError:v,renderErrorFallback:w,nodeWrapper:S}=n,A=he(yl);let x;if(e[0]!==A||e[1]!==S||e[2]!==r||e[3]!==l||e[4]!==m||e[5]!==h||e[6]!==p||e[7]!==g||e[8]!==y||e[9]!==v||e[10]!==d||e[11]!==c||e[12]!==w||e[13]!==o){let D;e[15]!==S||e[16]!==r||e[17]!==l||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==y||e[23]!==v||e[24]!==d||e[25]!==c||e[26]!==w||e[27]!==o?(D=R=>z.jsx(PN,{nodeKey:R,renderNode:o,onNodeClick:r,onNodeDoubleClick:l,onNodeTripleClick:c,onNodeRightClick:d,onNodeLongPress:p,onNodeHover:m,onNodeLeave:h,onNodePersist:g,onNodePersistError:y,onNodeRenderError:v,renderErrorFallback:w,nodeWrapper:S},R),e[15]=S,e[16]=r,e[17]=l,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=y,e[23]=v,e[24]=d,e[25]=c,e[26]=w,e[27]=o,e[28]=D):D=e[28],x=A.map(D),e[0]=A,e[1]=S,e[2]=r,e[3]=l,e[4]=m,e[5]=h,e[6]=p,e[7]=g,e[8]=y,e[9]=v,e[10]=d,e[11]=c,e[12]=w,e[13]=o,e[14]=x}else x=e[14];let E;return e[29]!==x?(E=z.jsx(z.Fragment,{children:x}),e[29]=x,e[30]=E):E=e[30],E}function PN(n){const e=Oe.c(28),{nodeKey:o,renderNode:r,onNodeClick:l,onNodeDoubleClick:c,onNodeTripleClick:d,onNodeRightClick:p,onNodeLongPress:m,onNodeHover:h,onNodeLeave:g,onNodePersist:y,onNodePersistError:v,onNodeRenderError:w,renderErrorFallback:S,nodeWrapper:A}=n;let x;e[0]!==o?(x=Op(o),e[0]=o,e[1]=x):x=e[1];const E=he(x);let D;e[2]!==o?(D=xi(o),e[2]=o,e[3]=D):D=e[3];const R=he(D);if(!E)return null;let _;e[4]!==R.x||e[5]!==R.y?(_={position:"absolute",left:R.x,top:R.y,transform:"translate(0, 0)"},e[4]=R.x,e[5]=R.y,e[6]=_):_=e[6];let N;e[7]!==E||e[8]!==A||e[9]!==l||e[10]!==c||e[11]!==h||e[12]!==g||e[13]!==m||e[14]!==y||e[15]!==v||e[16]!==p||e[17]!==d||e[18]!==r?(N=z.jsx(QN,{nodeData:E,renderContent:r,onClick:l,onDoubleClick:c,onTripleClick:d,onRightClick:p,onLongPress:m,onHover:h,onLeave:g,onPersist:y,onPersistError:v,wrapper:A}),e[7]=E,e[8]=A,e[9]=l,e[10]=c,e[11]=h,e[12]=g,e[13]=m,e[14]=y,e[15]=v,e[16]=p,e[17]=d,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==o||e[21]!==w||e[22]!==S||e[23]!==N?(T=z.jsx(IN,{nodeId:o,onError:w,renderFallback:S,children:N}),e[20]=o,e[21]=w,e[22]=S,e[23]=N,e[24]=T):T=e[24];let O;return e[25]!==_||e[26]!==T?(O=z.jsx("div",{style:_,children:T}),e[25]=_,e[26]=T,e[27]=O):O=e[27],O}Zt();Ul();Tn();cn();var JN="#3b82f6";function WN(n){const e=Oe.c(16),{onEdgeClick:o,onEdgeDoubleClick:r,onEdgeRightClick:l,onEdgeHover:c,onEdgeLeave:d}=n,p=he(Du);let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:0,overflow:"visible"},e[0]=m):m=e[0];let h;if(e[1]!==p||e[2]!==o||e[3]!==r||e[4]!==c||e[5]!==d||e[6]!==l){let y;e[8]!==o||e[9]!==r||e[10]!==c||e[11]!==d||e[12]!==l?(y=v=>z.jsx(e5,{edgeKey:v,onEdgeClick:o,onEdgeDoubleClick:r,onEdgeRightClick:l,onEdgeHover:c,onEdgeLeave:d},v),e[8]=o,e[9]=r,e[10]=c,e[11]=d,e[12]=l,e[13]=y):y=e[13],h=p.map(y),e[1]=p,e[2]=o,e[3]=r,e[4]=c,e[5]=d,e[6]=l,e[7]=h}else h=e[7];let g;return e[14]!==h?(g=z.jsx("svg",{style:m,children:h}),e[14]=h,e[15]=g):g=e[15],g}function e5(n){const e=Oe.c(71),{edgeKey:o,onEdgeClick:r,onEdgeDoubleClick:l,onEdgeRightClick:c,onEdgeHover:d,onEdgeLeave:p}=n;let m;e[0]!==o?(m=Rp(o),e[0]=o,e[1]=m):m=e[1];const h=he(m),g=cd(),y=he(_o),v=ge(Ju),w=he(Tt),S=y===o;let A,x,E,D,R,_,N,T,O,M,$;if(e[2]!==h||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==d||e[7]!==p||e[8]!==c||e[9]!==v||e[10]!==g.edges.pathType||e[11]!==w){O=Symbol.for("react.early_return_sentinel");e:{const W=MN(g.edges.pathType||"bezier");let ue;e[23]!==h||e[24]!==o||e[25]!==r||e[26]!==v?(ue=Ve=>{Ve.stopPropagation(),r&&h?r(o,h,Ve):v(o)},e[23]=h,e[24]=o,e[25]=r,e[26]=v,e[27]=ue):ue=e[27],x=ue;let xe;e[28]!==h||e[29]!==o||e[30]!==l?(xe=Ve=>{l&&h&&(Ve.stopPropagation(),Ve.preventDefault(),l(o,h,Ve))},e[28]=h,e[29]=o,e[30]=l,e[31]=xe):xe=e[31],D=xe;let de;e[32]!==h||e[33]!==o||e[34]!==c?(de=Ve=>{c&&h&&(Ve.preventDefault(),Ve.stopPropagation(),c(o,h,Ve))},e[32]=h,e[33]=o,e[34]=c,e[35]=de):de=e[35],E=de;let Te;e[36]!==h||e[37]!==o||e[38]!==d?(Te=()=>{d&&h&&d(o,h)},e[36]=h,e[37]=o,e[38]=d,e[39]=Te):Te=e[39],R=Te;let Ce;if(e[40]!==o||e[41]!==p?(Ce=()=>{p&&p(o)},e[40]=o,e[41]=p,e[42]=Ce):Ce=e[42],_=Ce,!h){O=null;break e}const{sourcePosition:Se,targetPosition:Ee,color:Be,weight:et,type:ft,label:un,sourceEndpoint:St,targetEndpoint:ht}=h;A=Be,$=et,M=ft,N=un;const zt=(St==null?void 0:St.x)??Se.x+h.sourceNodeWidth/2,Gt=(St==null?void 0:St.y)??Se.y+h.sourceNodeHeight/2,on=(ht==null?void 0:ht.x)??Ee.x+h.targetNodeWidth/2,rn=(ht==null?void 0:ht.y)??Ee.y+h.targetNodeHeight/2;if(isNaN(zt)||isNaN(Gt)||isNaN(on)||isNaN(rn)||w===0){O=null;break e}T=W({x1:zt,y1:Gt,x2:on,y2:rn,sourceWidth:h.sourceNodeWidth,sourceHeight:h.sourceNodeHeight,targetWidth:h.targetNodeWidth,targetHeight:h.targetNodeHeight})}e[2]=h,e[3]=o,e[4]=r,e[5]=l,e[6]=d,e[7]=p,e[8]=c,e[9]=v,e[10]=g.edges.pathType,e[11]=w,e[12]=A,e[13]=x,e[14]=E,e[15]=D,e[16]=R,e[17]=_,e[18]=N,e[19]=T,e[20]=O,e[21]=M,e[22]=$}else A=e[12],x=e[13],E=e[14],D=e[15],R=e[16],_=e[17],N=e[18],T=e[19],O=e[20],M=e[21],$=e[22];if(O!==Symbol.for("react.early_return_sentinel"))return O;const{path:L,labelX:X,labelY:ae}=T,te=S?JN:A||g.edges.defaultColor,me=$||g.edges.defaultWeight,ce=(S?me*1.5:me)/w,j=10/w,I=Math.max(10,me*3)/w;let G;e[43]===Symbol.for("react.memo_cache_sentinel")?(G={cursor:"pointer"},e[43]=G):G=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y={pointerEvents:"stroke"},e[44]=Y):Y=e[44];let V;e[45]!==x||e[46]!==E||e[47]!==D||e[48]!==R||e[49]!==_||e[50]!==I||e[51]!==L?(V=z.jsx("path",{d:L,stroke:"transparent",strokeWidth:I,fill:"none",style:Y,onClick:x,onDoubleClick:D,onContextMenu:E,onPointerEnter:R,onPointerLeave:_}),e[45]=x,e[46]=E,e[47]=D,e[48]=R,e[49]=_,e[50]=I,e[51]=L,e[52]=V):V=e[52];const k=M==="dashed"?`calc(5px / ${w}) calc(5px / ${w})`:void 0;let H;e[53]===Symbol.for("react.memo_cache_sentinel")?(H={pointerEvents:"none"},e[53]=H):H=e[53];let F;e[54]!==te||e[55]!==ce||e[56]!==L||e[57]!==k?(F=z.jsx("path",{d:L,stroke:te,strokeWidth:ce,fill:"none",strokeDasharray:k,style:H}),e[54]=te,e[55]=ce,e[56]=L,e[57]=k,e[58]=F):F=e[58];let oe;e[59]!==j||e[60]!==N||e[61]!==X||e[62]!==ae||e[63]!==g.edges.labelColor||e[64]!==g.edges.labelStrokeColor||e[65]!==w?(oe=N&&z.jsx("text",{x:X,y:ae,fontSize:`${j}px`,fill:g.edges.labelColor,stroke:g.edges.labelStrokeColor,strokeWidth:`${.2/w}px`,textAnchor:"middle",dy:`${-5/w}px`,style:{pointerEvents:"none"},children:N}),e[59]=j,e[60]=N,e[61]=X,e[62]=ae,e[63]=g.edges.labelColor,e[64]=g.edges.labelStrokeColor,e[65]=w,e[66]=oe):oe=e[66];let J;return e[67]!==oe||e[68]!==V||e[69]!==F?(J=z.jsxs("g",{style:G,children:[V,F,oe]}),e[67]=oe,e[68]=V,e[69]=F,e[70]=J):J=e[70],J}Tn();function t5(n){const e=Oe.c(5),o=he(tt),r=he(_o),l=ne.useRef(!0);let c,d;e[0]!==n||e[1]!==r||e[2]!==o?(c=()=>{if(l.current){l.current=!1;return}n==null||n(o,r)},d=[o,r,n],e[0]=n,e[1]=r,e[2]=o,e[3]=c,e[4]=d):(c=e[3],d=e[4]),ne.useEffect(c,d)}cn();function n5(n){const e=Oe.c(5),o=he(Tt),r=he(nn),l=ne.useRef(null),c=ne.useRef(!0);let d,p;e[0]!==n||e[1]!==r||e[2]!==o?(d=()=>{if(c.current){c.current=!1;return}if(n)return l.current!==null&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{n({zoom:o,pan:r}),l.current=null}),()=>{l.current!==null&&cancelAnimationFrame(l.current)}},p=[o,r,n],e[0]=n,e[1]=r,e[2]=o,e[3]=d,e[4]=p):(d=e[3],p=e[4]),ne.useEffect(d,p)}Zt();Tn();function i5(n,e){const o=Oe.c(7),r=he(Gi),l=Tl(),c=ne.useRef(null);let d;o[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],o[0]=d):d=o[0];const p=ne.useRef(d);let m,h;o[1]!==r||o[2]!==e||o[3]!==n||o[4]!==l?(m=()=>{const g=c.current;if(c.current=r,g===null&&r!==null){const y=Array.from(l.get(tt));p.current=y,n==null||n(y)}else if(g!==null&&r===null){const y=p.current;if(e&&y.length>0){const v=l.get(ze),w=new Map;for(const S of y)if(v.hasNode(S)){const A=v.getNodeAttributes(S);w.set(S,{x:A.x,y:A.y})}e(y,w)}p.current=[]}},h=[r,l,n,e],o[1]=r,o[2]=e,o[3]=n,o[4]=l,o[5]=m,o[6]=h):(m=o[5],h=o[6]),ne.useEffect(m,h)}function o5(n){const e=Oe.c(50);let o,r,l,c,d,p,m,h,g,y,v,w,S,A,x,E,D,R,_,N,T,O,M,$;e[0]!==n?({renderNode:M,onNodeClick:y,onNodeDoubleClick:v,onNodeTripleClick:_,onNodeRightClick:R,onNodeLongPress:A,onNodeHover:w,onNodeLeave:S,onEdgeClick:d,onEdgeDoubleClick:p,onEdgeRightClick:g,onEdgeHover:m,onEdgeLeave:h,onSelectionChange:N,onViewportChange:T,onDragStart:c,onDragEnd:l,onNodePersist:x,onNodePersistError:E,onNodeRenderError:D,renderErrorFallback:O,nodeWrapper:r,children:o,...$}=n,e[0]=n,e[1]=o,e[2]=r,e[3]=l,e[4]=c,e[5]=d,e[6]=p,e[7]=m,e[8]=h,e[9]=g,e[10]=y,e[11]=v,e[12]=w,e[13]=S,e[14]=A,e[15]=x,e[16]=E,e[17]=D,e[18]=R,e[19]=_,e[20]=N,e[21]=T,e[22]=O,e[23]=M,e[24]=$):(o=e[1],r=e[2],l=e[3],c=e[4],d=e[5],p=e[6],m=e[7],h=e[8],g=e[9],y=e[10],v=e[11],w=e[12],S=e[13],A=e[14],x=e[15],E=e[16],D=e[17],R=e[18],_=e[19],N=e[20],T=e[21],O=e[22],M=e[23],$=e[24]),t5(N),n5(T),i5(c,l);let L;e[25]!==d||e[26]!==p||e[27]!==m||e[28]!==h||e[29]!==g?(L=z.jsx(WN,{onEdgeClick:d,onEdgeDoubleClick:p,onEdgeRightClick:g,onEdgeHover:m,onEdgeLeave:h}),e[25]=d,e[26]=p,e[27]=m,e[28]=h,e[29]=g,e[30]=L):L=e[30];let X;e[31]!==r||e[32]!==y||e[33]!==v||e[34]!==w||e[35]!==S||e[36]!==A||e[37]!==x||e[38]!==E||e[39]!==D||e[40]!==R||e[41]!==_||e[42]!==O||e[43]!==M?(X=z.jsx(FN,{renderNode:M,onNodeClick:y,onNodeDoubleClick:v,onNodeTripleClick:_,onNodeRightClick:R,onNodeLongPress:A,onNodeHover:w,onNodeLeave:S,onNodePersist:x,onNodePersistError:E,onNodeRenderError:D,renderErrorFallback:O,nodeWrapper:r}),e[31]=r,e[32]=y,e[33]=v,e[34]=w,e[35]=S,e[36]=A,e[37]=x,e[38]=E,e[39]=D,e[40]=R,e[41]=_,e[42]=O,e[43]=M,e[44]=X):X=e[44];let ae;return e[45]!==o||e[46]!==L||e[47]!==X||e[48]!==$?(ae=z.jsxs(VN,{...$,children:[L,X,o]}),e[45]=o,e[46]=L,e[47]=X,e[48]=$,e[49]=ae):ae=e[49],ae}Mo();ln("connected-node");Zt();Ul();Zt();Tn();ad();Qp();Zt();Tn();U2();E2();na();Ll();Wp();function Gh(n){const e=Oe.c(28),{event:o,currentActionId:r,onActionChange:l,rowClassName:c,labelClassName:d,selectClassName:p}=n;let m,h,g,y,v,w;if(e[0]!==r||e[1]!==o.label||e[2]!==o.type||e[3]!==d||e[4]!==l||e[5]!==c||e[6]!==p){const x=j2();v=c,e[13]!==o.label||e[14]!==d?(w=z.jsx("span",{className:d,children:o.label}),e[13]=o.label,e[14]=d,e[15]=w):w=e[15],m=p,h=r,e[16]!==o.type||e[17]!==l?(g=E=>l(o.type,E.target.value),e[16]=o.type,e[17]=l,e[18]=g):g=e[18],y=x.map(r5),e[0]=r,e[1]=o.label,e[2]=o.type,e[3]=d,e[4]=l,e[5]=c,e[6]=p,e[7]=m,e[8]=h,e[9]=g,e[10]=y,e[11]=v,e[12]=w}else m=e[7],h=e[8],g=e[9],y=e[10],v=e[11],w=e[12];let S;e[19]!==m||e[20]!==h||e[21]!==g||e[22]!==y?(S=z.jsx("select",{className:m,value:h,onChange:g,children:y}),e[19]=m,e[20]=h,e[21]=g,e[22]=y,e[23]=S):S=e[23];let A;return e[24]!==v||e[25]!==w||e[26]!==S?(A=z.jsxs("div",{className:v,children:[w,S]}),e[24]=v,e[25]=w,e[26]=S,e[27]=A):A=e[27],A}function r5(n){return z.jsx("optgroup",{label:n.label,children:n.actions.map(a5)},n.category)}function a5(n){return z.jsx("option",{value:n.id,children:n.label},n.id)}function s5(n){const e=Oe.c(17),{className:o,checkboxClassName:r,virtualizationClassName:l,virtualizationStatsClassName:c}=n,{enabled:d,toggle:p,visibleNodes:m,totalNodes:h,culledNodes:g}=EN();let y;e[0]!==r||e[1]!==d||e[2]!==p?(y=z.jsx("input",{type:"checkbox",className:r,checked:d,onChange:p}),e[0]=r,e[1]=d,e[2]=p,e[3]=y):y=e[3];let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=z.jsx("span",{children:"Virtualization"}),e[4]=v):v=e[4];let w;e[5]!==y?(w=z.jsxs("label",{children:[y,v]}),e[5]=y,e[6]=w):w=e[6];const S=d?`${m}/${h} (${g} culled)`:"Off";let A;e[7]!==S||e[8]!==c?(A=z.jsx("span",{className:c,children:S}),e[7]=S,e[8]=c,e[9]=A):A=e[9];let x;e[10]!==w||e[11]!==A||e[12]!==l?(x=z.jsxs("div",{className:l,children:[w,A]}),e[10]=w,e[11]=A,e[12]=l,e[13]=x):x=e[13];let E;return e[14]!==o||e[15]!==x?(E=z.jsx("div",{className:o,children:x}),e[14]=o,e[15]=x,e[16]=E):E=e[16],E}function l5(n){var ce;const e=Oe.c(36),{className:o,selectClassName:r,buttonClassName:l,buttonsClassName:c,inputClassName:d}=n,{allPresets:p,activePresetId:m,hasUnsavedChanges:h,applyPreset:g,saveAsPreset:y,deletePreset:v,resetSettings:w}=_m(),[S,A]=ne.useState(!1),[x,E]=ne.useState("");let D;e[0]!==x||e[1]!==y?(D=()=>{x.trim()&&(y(x.trim()),E(""),A(!1))},e[0]=x,e[1]=y,e[2]=D):D=e[2];const R=D;let _;e[3]!==m||e[4]!==p||e[5]!==v?(_=()=>{var j;m&&!((j=p.find(I=>I.id===m))!=null&&j.isBuiltIn)&&v(m)},e[3]=m,e[4]=p,e[5]=v,e[6]=_):_=e[6];const N=_,T=m||"";let O;e[7]!==g?(O=j=>j.target.value&&g(j.target.value),e[7]=g,e[8]=O):O=e[8];const M=h?"Custom (modified)":"Select preset...";let $;e[9]!==M?($=z.jsx("option",{value:"",disabled:!0,children:M}),e[9]=M,e[10]=$):$=e[10];let L;e[11]!==p?(L=p.map(c5),e[11]=p,e[12]=L):L=e[12];let X;e[13]!==r||e[14]!==T||e[15]!==O||e[16]!==$||e[17]!==L?(X=z.jsxs("select",{className:r,value:T,onChange:O,children:[$,L]}),e[13]=r,e[14]=T,e[15]=O,e[16]=$,e[17]=L,e[18]=X):X=e[18];let ae;e[19]!==m||e[20]!==p||e[21]!==l||e[22]!==N||e[23]!==R||e[24]!==d||e[25]!==x||e[26]!==w||e[27]!==S?(ae=S?z.jsxs(z.Fragment,{children:[z.jsx("input",{type:"text",className:d,placeholder:"Preset name",value:x,onChange:j=>E(j.target.value),onKeyDown:j=>j.key==="Enter"&&R(),autoFocus:!0}),z.jsx("button",{className:l,onClick:R,children:"Save"}),z.jsx("button",{className:l,onClick:()=>A(!1),children:"Cancel"})]}):z.jsxs(z.Fragment,{children:[z.jsx("button",{className:l,onClick:()=>A(!0),children:"Save as..."}),m&&!((ce=p.find(j=>j.id===m))!=null&&ce.isBuiltIn)&&z.jsx("button",{className:l,onClick:N,children:"Delete"}),z.jsx("button",{className:l,onClick:w,children:"Reset"})]}),e[19]=m,e[20]=p,e[21]=l,e[22]=N,e[23]=R,e[24]=d,e[25]=x,e[26]=w,e[27]=S,e[28]=ae):ae=e[28];let te;e[29]!==c||e[30]!==ae?(te=z.jsx("div",{className:c,children:ae}),e[29]=c,e[30]=ae,e[31]=te):te=e[31];let me;return e[32]!==o||e[33]!==te||e[34]!==X?(me=z.jsxs("div",{className:o,children:[X,te]}),e[32]=o,e[33]=te,e[34]=X,e[35]=me):me=e[35],me}function c5(n){return z.jsxs("option",{value:n.id,children:[n.name,n.isBuiltIn?"":" (custom)"]},n.id)}function u5(n){const e=Oe.c(71),{className:o,headerClassName:r,contentClassName:l,footerClassName:c,rowClassName:d,labelClassName:p,selectClassName:m,buttonClassName:h,presetClassName:g,presetSelectClassName:y,presetButtonsClassName:v,checkboxClassName:w,groupClassName:S,groupHeadingClassName:A,quickActionsClassName:x,virtualizationClassName:E,virtualizationStatsClassName:D,inputClassName:R,renderHeader:_,renderFooter:N,onClose:T}=n,{mappings:O,setEventMapping:M}=_m();let $;e[0]===Symbol.for("react.memo_cache_sentinel")?($=Object.values(fe).filter(h5),e[0]=$):$=e[0];const L=$;let X;e[1]===Symbol.for("react.memo_cache_sentinel")?(X=Object.values(fe).filter(f5),e[1]=X):X=e[1];const ae=X;let te;e[2]===Symbol.for("react.memo_cache_sentinel")?(te=Object.values(fe).filter(d5),e[2]=te):te=e[2];const me=te;let ce;e[3]!==h||e[4]!==r||e[5]!==T||e[6]!==_?(ce=_?_():z.jsxs("div",{className:r,children:[z.jsx("h2",{children:"Canvas Settings"}),T&&z.jsx("button",{className:h,onClick:T,children:"×"})]}),e[3]=h,e[4]=r,e[5]=T,e[6]=_,e[7]=ce):ce=e[7];const j=y||m;let I;e[8]!==h||e[9]!==R||e[10]!==v||e[11]!==g||e[12]!==j?(I=z.jsx(l5,{className:g,selectClassName:j,buttonClassName:h,buttonsClassName:v,inputClassName:R}),e[8]=h,e[9]=R,e[10]=v,e[11]=g,e[12]=j,e[13]=I):I=e[13];let G;e[14]!==h||e[15]!==w||e[16]!==x||e[17]!==E||e[18]!==D?(G=z.jsx(s5,{className:x,buttonClassName:h,checkboxClassName:w,virtualizationClassName:E,virtualizationStatsClassName:D}),e[14]=h,e[15]=w,e[16]=x,e[17]=E,e[18]=D,e[19]=G):G=e[19];let Y;e[20]!==A?(Y=z.jsx("h3",{className:A,children:"Node Events"}),e[20]=A,e[21]=Y):Y=e[21];let V;e[22]!==p||e[23]!==O||e[24]!==d||e[25]!==m||e[26]!==M?(V=L.map(Ce=>z.jsx(Gh,{event:xr[Ce],currentActionId:O[Ce],onActionChange:M,rowClassName:d,labelClassName:p,selectClassName:m},Ce)),e[22]=p,e[23]=O,e[24]=d,e[25]=m,e[26]=M,e[27]=V):V=e[27];let k;e[28]!==S||e[29]!==Y||e[30]!==V?(k=z.jsxs("div",{className:S,children:[Y,V]}),e[28]=S,e[29]=Y,e[30]=V,e[31]=k):k=e[31];let H;e[32]!==A?(H=z.jsx("h3",{className:A,children:"Edge Events"}),e[32]=A,e[33]=H):H=e[33];let F;e[34]!==p||e[35]!==O||e[36]!==d||e[37]!==m||e[38]!==M?(F=ae.map(Ce=>z.jsx(Gh,{event:xr[Ce],currentActionId:O[Ce],onActionChange:M,rowClassName:d,labelClassName:p,selectClassName:m},Ce)),e[34]=p,e[35]=O,e[36]=d,e[37]=m,e[38]=M,e[39]=F):F=e[39];let oe;e[40]!==S||e[41]!==H||e[42]!==F?(oe=z.jsxs("div",{className:S,children:[H,F]}),e[40]=S,e[41]=H,e[42]=F,e[43]=oe):oe=e[43];let J;e[44]!==A?(J=z.jsx("h3",{className:A,children:"Background Events"}),e[44]=A,e[45]=J):J=e[45];let W;e[46]!==p||e[47]!==O||e[48]!==d||e[49]!==m||e[50]!==M?(W=me.map(Ce=>z.jsx(Gh,{event:xr[Ce],currentActionId:O[Ce],onActionChange:M,rowClassName:d,labelClassName:p,selectClassName:m},Ce)),e[46]=p,e[47]=O,e[48]=d,e[49]=m,e[50]=M,e[51]=W):W=e[51];let ue;e[52]!==S||e[53]!==J||e[54]!==W?(ue=z.jsxs("div",{className:S,children:[J,W]}),e[52]=S,e[53]=J,e[54]=W,e[55]=ue):ue=e[55];let xe;e[56]!==l||e[57]!==k||e[58]!==oe||e[59]!==ue?(xe=z.jsxs("div",{className:l,children:[k,oe,ue]}),e[56]=l,e[57]=k,e[58]=oe,e[59]=ue,e[60]=xe):xe=e[60];let de;e[61]!==c||e[62]!==N?(de=N?N():z.jsx("div",{className:c,children:"Changes auto-saved to localStorage."}),e[61]=c,e[62]=N,e[63]=de):de=e[63];let Te;return e[64]!==o||e[65]!==xe||e[66]!==de||e[67]!==ce||e[68]!==I||e[69]!==G?(Te=z.jsxs("div",{className:o,children:[ce,I,G,xe,de]}),e[64]=o,e[65]=xe,e[66]=de,e[67]=ce,e[68]=I,e[69]=G,e[70]=Te):Te=e[70],Te}function d5(n){return xr[n].category==="background"}function f5(n){return xr[n].category==="edge"}function h5(n){return xr[n].category==="node"}function p5(){const n=Oe.c(24),[e]=Ci(Dt),o=ge(SN),r=ge(Z2);he(vp);const[l,c]=Ci(ld),d=ne.useRef(null),[p,m]=ne.useState("");let h,g;n[0]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{var N;(N=d.current)==null||N.focus()},g=[],n[0]=h,n[1]=g):(h=n[0],g=n[1]),ne.useEffect(h,g);let y;n[2]!==e.phase||n[3]!==e.suggestions?(y=e.phase==="searching"?e.suggestions:To.all(),n[2]=e.phase,n[3]=e.suggestions,n[4]=y):y=n[4];const v=y;let w;n[5]!==o?(w=N=>{const T=N.target.value;m(T),o(T)},n[5]=o,n[6]=w):w=n[6];const S=w;let A;n[7]!==r||n[8]!==l||n[9]!==c||n[10]!==v||n[11]!==o?(A=N=>{e:switch(N.key){case"ArrowDown":{N.preventDefault(),c(T=>Math.min(T+1,v.length-1));break e}case"ArrowUp":{N.preventDefault(),c(m5);break e}case"Enter":{N.preventDefault(),v[l]&&r(v[l]);break e}case"Tab":N.preventDefault(),v[l]&&(m(v[l].name),o(v[l].name))}},n[7]=r,n[8]=l,n[9]=c,n[10]=v,n[11]=o,n[12]=A):A=n[12];const x=A;let E;n[13]===Symbol.for("react.memo_cache_sentinel")?(E={color:"var(--cmd-input-text)"},n[13]=E):E=n[13];let D;n[14]!==S||n[15]!==x||n[16]!==p?(D=z.jsx("input",{ref:d,type:"text",value:p,onChange:S,onKeyDown:x,placeholder:"Type command name...",className:"flex-1 bg-transparent outline-none",style:E,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),n[14]=S,n[15]=x,n[16]=p,n[17]=D):D=n[17];let R;n[18]!==p||n[19]!==v?(R=p&&z.jsxs("span",{className:"ml-2 text-xs",style:{color:"var(--hud-text-secondary)",opacity:.6},children:[v.length," matches"]}),n[18]=p,n[19]=v,n[20]=R):R=n[20];let _;return n[21]!==D||n[22]!==R?(_=z.jsxs("div",{className:"flex flex-1 items-center",children:[D,R]}),n[21]=D,n[22]=R,n[23]=_):_=n[23],_}function m5(n){return Math.max(n-1,0)}cn();function g5(){const n=Oe.c(73),[e]=Ci(Dt),o=he(F2),r=he(P2),l=he(Bi),c=ge(I2),d=ge(AN),p=ge(_N),m=ne.useRef(null),[h,g]=ne.useState(""),y=he(Tt),v=he(nn),w=he(Zn);let S,A;n[0]!==o?(S=()=>{var J;o&&(o.type==="text"||o.type==="number"||o.type==="point")&&((J=m.current)==null||J.focus())},A=[o],n[0]=o,n[1]=S,n[2]=A):(S=n[1],A=n[2]),ne.useEffect(S,A);let x;n[3]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{g("")},n[3]=x):x=n[3];const E=o==null?void 0:o.name;let D;n[4]!==E?(D=[E],n[4]=E,n[5]=D):D=n[5],ne.useEffect(x,D);let R;n[6]!==v.x||n[7]!==v.y||n[8]!==w||n[9]!==y?(R=()=>{const J=w?w.width/2:window.innerWidth/2,W=w?w.height/2:window.innerHeight/2,ue=(J-v.x)/y,xe=(W-v.y)/y;return{x:Math.round(ue),y:Math.round(xe)}},n[6]=v.x,n[7]=v.y,n[8]=w,n[9]=y,n[10]=R):R=n[10];const _=R;let N,T;n[11]!==o||n[12]!==_||n[13]!==c?(N=()=>{if(!o)return;const J=W=>{const ue=W.target,xe=ue.tagName==="INPUT"||ue.tagName==="TEXTAREA"||ue.isContentEditable;if(W.key==="Enter"&&!xe){if(o.type==="point"){W.preventDefault(),c(_());return}if(o.default!==void 0){W.preventDefault(),c(o.default);return}}if(o.type==="select"&&o.options){const de=o.options.find(Te=>Te.shortcut.toLowerCase()===W.key.toLowerCase());if(de){W.preventDefault(),c(de.value);return}}if(o.type==="boolean"){if(W.key.toLowerCase()==="y"){W.preventDefault(),c(!0);return}if(W.key.toLowerCase()==="n"){W.preventDefault(),c(!1);return}}};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},T=[o,c,_],n[11]=o,n[12]=_,n[13]=c,n[14]=N,n[15]=T):(N=n[14],T=n[15]),ne.useEffect(N,T);let O;n[16]!==o||n[17]!==c||n[18]!==h?(O=J=>{if(J.preventDefault(),!!o){if(h===""&&o.default!==void 0){c(o.default),g("");return}if(o.type==="number"){const W=parseFloat(h);isNaN(W)||c(W)}else c(h);g("")}},n[16]=o,n[17]=c,n[18]=h,n[19]=O):O=n[19];const M=O;let $;n[20]!==o||n[21]!==p||n[22]!==r||n[23]!==c||n[24]!==d||n[25]!==h?($=J=>{if(J.key==="Escape"){J.preventDefault(),(o==null?void 0:o.required)===!1?d():r&&r.current>1&&p();return}if(J.key==="Backspace"&&h===""&&r&&r.current>1){J.preventDefault(),p();return}if((o==null?void 0:o.type)==="select"&&o.options){const W=o.options.find(ue=>ue.shortcut.toLowerCase()===J.key.toLowerCase());W&&(J.preventDefault(),c(W.value))}},n[20]=o,n[21]=p,n[22]=r,n[23]=c,n[24]=d,n[25]=h,n[26]=$):$=n[26];const L=$;if(e.phase!=="collecting"||!o)return null;const X=l.type==="pickPoint"||l.type==="pickNode"||l.type==="pickNodes",ae=o.type==="select";let te;n[27]!==r||n[28]!==e.command?(te=r&&z.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:"var(--hud-text-secondary)"},children:[z.jsx("span",{className:"font-medium",style:{color:"var(--hud-text)"},children:e.command.name}),z.jsx("span",{children:"•"}),z.jsxs("span",{children:["Step ",r.current,"/",r.total]})]}),n[27]=r,n[28]=e.command,n[29]=te):te=n[29];let me;n[30]===Symbol.for("react.memo_cache_sentinel")?(me={color:"var(--hud-text-secondary)"},n[30]=me):me=n[30];let ce;n[31]!==o.prompt?(ce=z.jsxs("span",{style:me,children:[o.prompt,":"]}),n[31]=o.prompt,n[32]=ce):ce=n[32];let j;n[33]!==l.type||n[34]!==X?(j=X&&z.jsxs("span",{className:"animate-pulse text-sm",style:{color:"var(--badge-info-text)"},children:[l.type==="pickPoint"&&"Click on canvas or enter x,y",l.type==="pickNode"&&"Click on a node",l.type==="pickNodes"&&"Click nodes (Enter when done)"]}),n[33]=l.type,n[34]=X,n[35]=j):j=n[35];let I;n[36]!==o.options||n[37]!==ae||n[38]!==c?(I=ae&&o.options&&z.jsx("div",{className:"flex items-center gap-2",children:o.options.map(J=>z.jsxs("button",{onClick:()=>c(J.value),className:"flex items-center gap-1 rounded px-2 py-0.5 text-sm transition-colors",style:{backgroundColor:"var(--list-item-bg-hover)",color:"var(--hud-text)"},onMouseEnter:E5,onMouseLeave:C5,title:J.description,children:[z.jsx("kbd",{className:"rounded px-1 py-0.5 font-mono text-xs",style:{backgroundColor:"var(--cmd-bg)",color:"var(--badge-info-text)"},children:J.shortcut.toUpperCase()}),z.jsx("span",{children:J.label})]},J.value))}),n[36]=o.options,n[37]=ae,n[38]=c,n[39]=I):I=n[39];let G;n[40]!==o.default||n[41]!==o.type||n[42]!==L||n[43]!==M||n[44]!==h?(G=(o.type==="text"||o.type==="number")&&z.jsx("form",{onSubmit:M,className:"flex flex-1 items-center",children:z.jsx("input",{ref:m,type:o.type==="number"?"number":"text",value:h,onChange:J=>g(J.target.value),onKeyDown:L,placeholder:o.default!==void 0?`Default: ${o.default}`:void 0,className:"flex-1 bg-transparent outline-none",style:{color:"var(--cmd-input-text)"},autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})}),n[40]=o.default,n[41]=o.type,n[42]=L,n[43]=M,n[44]=h,n[45]=G):G=n[45];let Y;n[46]!==o.type||n[47]!==_||n[48]!==L||n[49]!==c||n[50]!==h?(Y=o.type==="point"&&z.jsx("form",{onSubmit:J=>{if(J.preventDefault(),h.trim()===""){c(_()),g("");return}const W=h.match(/^\s*(-?\d+(?:\.\d+)?)\s*,\s*(-?\d+(?:\.\d+)?)\s*$/);W&&(c({x:parseFloat(W[1]),y:parseFloat(W[2])}),g(""))},className:"flex flex-1 items-center",children:z.jsx("input",{ref:m,type:"text",value:h,onChange:J=>g(J.target.value),onKeyDown:L,placeholder:"x, y or click on canvas (Enter for center)",className:"flex-1 bg-transparent outline-none",style:{color:"var(--cmd-input-text)"},autoComplete:"off"})}),n[46]=o.type,n[47]=_,n[48]=L,n[49]=c,n[50]=h,n[51]=Y):Y=n[51];let V;n[52]!==o.type||n[53]!==c?(V=o.type==="boolean"&&z.jsxs("div",{className:"flex items-center gap-2",children:[z.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-1 rounded px-2 py-0.5 text-sm transition-colors",style:{backgroundColor:"var(--list-item-bg-hover)",color:"var(--hud-text)"},onMouseEnter:_5,onMouseLeave:A5,children:[z.jsx("kbd",{className:"rounded px-1 py-0.5 font-mono text-xs",style:{backgroundColor:"var(--cmd-bg)",color:"var(--badge-info-text)"},children:"Y"}),z.jsx("span",{children:"Yes"})]}),z.jsxs("button",{onClick:()=>c(!1),className:"flex items-center gap-1 rounded px-2 py-0.5 text-sm transition-colors",style:{backgroundColor:"var(--list-item-bg-hover)",color:"var(--hud-text)"},onMouseEnter:S5,onMouseLeave:x5,children:[z.jsx("kbd",{className:"rounded px-1 py-0.5 font-mono text-xs",style:{backgroundColor:"var(--cmd-bg)",color:"var(--badge-info-text)"},children:"N"}),z.jsx("span",{children:"No"})]})]}),n[52]=o.type,n[53]=c,n[54]=V):V=n[54];let k;n[55]!==o.required||n[56]!==d?(k=o.required===!1&&z.jsx("button",{onClick:()=>d(),className:"rounded px-2 py-0.5 text-xs transition-colors",style:{color:"var(--hud-text-secondary)",opacity:.8},onMouseEnter:w5,onMouseLeave:b5,children:"Skip (Esc)"}),n[55]=o.required,n[56]=d,n[57]=k):k=n[57];let H;n[58]!==p||n[59]!==r?(H=r&&r.current>1&&z.jsx("button",{onClick:()=>p(),className:"rounded px-2 py-0.5 text-xs transition-colors",style:{color:"var(--hud-text-secondary)",opacity:.8},onMouseEnter:v5,onMouseLeave:y5,children:"Back"}),n[58]=p,n[59]=r,n[60]=H):H=n[60];let F;n[61]!==ce||n[62]!==j||n[63]!==I||n[64]!==G||n[65]!==Y||n[66]!==V||n[67]!==k||n[68]!==H?(F=z.jsxs("div",{className:"flex items-center gap-2",children:[ce,j,I,G,Y,V,k,H]}),n[61]=ce,n[62]=j,n[63]=I,n[64]=G,n[65]=Y,n[66]=V,n[67]=k,n[68]=H,n[69]=F):F=n[69];let oe;return n[70]!==te||n[71]!==F?(oe=z.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[te,F]}),n[70]=te,n[71]=F,n[72]=oe):oe=n[72],oe}function y5(n){n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.color="var(--hud-text-secondary)"}function v5(n){n.currentTarget.style.backgroundColor="var(--list-item-bg-hover)",n.currentTarget.style.color="var(--hud-text)"}function b5(n){n.currentTarget.style.backgroundColor="transparent",n.currentTarget.style.color="var(--hud-text-secondary)"}function w5(n){n.currentTarget.style.backgroundColor="var(--list-item-bg-hover)",n.currentTarget.style.color="var(--hud-text)"}function x5(n){return n.currentTarget.style.backgroundColor="var(--list-item-bg-hover)"}function S5(n){return n.currentTarget.style.backgroundColor="var(--list-item-border)"}function A5(n){return n.currentTarget.style.backgroundColor="var(--list-item-bg-hover)"}function _5(n){return n.currentTarget.style.backgroundColor="var(--list-item-border)"}function C5(n){return n.currentTarget.style.backgroundColor="var(--list-item-bg-hover)"}function E5(n){return n.currentTarget.style.backgroundColor="var(--list-item-border)"}var N5=60,k5=400,C1=200;function T5(n){const e=Oe.c(58),{isModalOpen:o}=n,r=he(sd),[l,c]=Ci(Dt);ge(Cm);const d=he(P2),p=he(ld),m=ge(Bi),h=ne.useRef(null),[g,y]=ne.useState(C1),[v,w]=ne.useState(!1),S=ne.useRef(0),A=ne.useRef(C1);let x,E;e[0]!==o||e[1]!==m||e[2]!==c||e[3]!==l.phase||e[4]!==r?(x=()=>{if(!r)return;const W=ue=>{if(ue.key==="Escape"){if(o!=null&&o())return;ue.preventDefault(),ue.stopPropagation(),(l.phase==="collecting"||l.phase==="executing"||l.phase==="error")&&(c({phase:"searching",query:"",suggestions:To.all()}),m({type:"normal"}))}};return window.addEventListener("keydown",W,{capture:!0}),()=>window.removeEventListener("keydown",W,{capture:!0})},E=[r,l.phase,c,m,o],e[0]=o,e[1]=m,e[2]=c,e[3]=l.phase,e[4]=r,e[5]=x,e[6]=E):(x=e[5],E=e[6]),ne.useEffect(x,E);let D;e[7]!==g?(D=W=>{W.preventDefault(),w(!0),S.current=W.clientY,A.current=g},e[7]=g,e[8]=D):D=e[8];const R=D;let _,N;if(e[9]!==v?(_=()=>{if(!v)return;const W=xe=>{const de=S.current-xe.clientY,Te=Math.min(k5,Math.max(N5,A.current+de));y(Te)},ue=()=>{w(!1)};return window.addEventListener("mousemove",W),window.addEventListener("mouseup",ue),()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",ue)}},N=[v],e[9]=v,e[10]=_,e[11]=N):(_=e[10],N=e[11]),ne.useEffect(_,N),!r)return null;const T=`${g}px`;let O;e[12]!==T?(O={height:T,maxHeight:"50vh",backgroundColor:"var(--cmd-bg)"},e[12]=T,e[13]=O):O=e[13];const M=v?"var(--cmd-resize-hover)":"var(--cmd-resize-bg)";let $;e[14]!==M?($={borderColor:"var(--cmd-border)",backgroundColor:M},e[14]=M,e[15]=$):$=e[15];let L,X;e[16]!==v?(L=W=>!v&&(W.currentTarget.style.backgroundColor="var(--cmd-resize-hover)"),X=W=>!v&&(W.currentTarget.style.backgroundColor="var(--cmd-resize-bg)"),e[16]=v,e[17]=L,e[18]=X):(L=e[17],X=e[18]);let ae;e[19]===Symbol.for("react.memo_cache_sentinel")?(ae=z.jsx("div",{className:"h-1 w-12 rounded-full opacity-50",style:{backgroundColor:"var(--hud-icon)"}}),e[19]=ae):ae=e[19];let te;e[20]!==R||e[21]!==L||e[22]!==X||e[23]!==$?(te=z.jsx("div",{onMouseDown:R,className:"flex h-3 w-full shrink-0 cursor-ns-resize items-center justify-center border-t transition-colors",style:$,onMouseEnter:L,onMouseLeave:X,children:ae}),e[20]=R,e[21]=L,e[22]=X,e[23]=$,e[24]=te):te=e[24];let me;e[25]===Symbol.for("react.memo_cache_sentinel")?(me=z.jsx("span",{className:"mr-2 text-lg font-bold select-none",style:{color:"var(--badge-info-text)"},children:">"}),e[25]=me):me=e[25];let ce;e[26]!==l.phase?(ce=(l.phase==="idle"||l.phase==="searching")&&z.jsx(p5,{}),e[26]=l.phase,e[27]=ce):ce=e[27];let j;e[28]!==l.phase?(j=l.phase==="collecting"&&z.jsx(g5,{}),e[28]=l.phase,e[29]=j):j=e[29];let I;e[30]!==l.command||e[31]!==l.phase?(I=l.phase==="executing"&&z.jsxs("div",{className:"flex items-center gap-2",style:{color:"var(--badge-warning-text)"},children:[z.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",children:[z.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),z.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),z.jsxs("span",{className:"text-base",children:["Executing ",l.command.name,"..."]})]}),e[30]=l.command,e[31]=l.phase,e[32]=I):I=e[32];let G;e[33]!==c||e[34]!==l.message||e[35]!==l.phase?(G=l.phase==="error"&&z.jsxs("div",{className:"flex items-center gap-2",style:{color:"var(--badge-error-text)"},children:[z.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[z.jsx("circle",{cx:"12",cy:"12",r:"10"}),z.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),z.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),z.jsx("span",{className:"text-base",children:l.message}),z.jsx("button",{onClick:()=>c({phase:"idle"}),className:"ml-2 rounded px-2 py-1 text-sm transition-colors",style:{backgroundColor:"var(--list-item-bg-hover)",color:"var(--hud-text-secondary)"},onMouseEnter:M5,onMouseLeave:D5,children:"Try again"})]}),e[33]=c,e[34]=l.message,e[35]=l.phase,e[36]=G):G=e[36];let Y;e[37]===Symbol.for("react.memo_cache_sentinel")?(Y=z.jsx("div",{className:"flex-1"}),e[37]=Y):Y=e[37];let V;e[38]!==d?(V=d&&z.jsxs("span",{className:"mr-4 rounded px-2 py-1 text-sm",style:{backgroundColor:"var(--list-item-bg-hover)",color:"var(--hud-text-secondary)"},children:["Step ",d.current,"/",d.total]}),e[38]=d,e[39]=V):V=e[39];let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=z.jsx("span",{className:"text-sm select-none",style:{color:"var(--hud-text-secondary)",opacity:.6},children:"/ to close • ESC to cancel"}),e[40]=k):k=e[40];let H;e[41]!==ce||e[42]!==j||e[43]!==I||e[44]!==G||e[45]!==V?(H=z.jsxs("div",{className:"flex items-center px-4 py-3 font-mono text-sm",children:[me,ce,j,I,G,Y,V,k]}),e[41]=ce,e[42]=j,e[43]=I,e[44]=G,e[45]=V,e[46]=H):H=e[46];let F;e[47]!==p||e[48]!==l.phase||e[49]!==l.suggestions?(F=l.phase==="searching"&&l.suggestions.length>0&&z.jsx("div",{className:"min-h-0 shrink overflow-y-auto border-t",style:{maxHeight:"40vh",borderColor:"var(--cmd-border)"},children:l.suggestions.map((W,ue)=>z.jsx(z5,{command:W,isHighlighted:ue===p},W.name))}),e[47]=p,e[48]=l.phase,e[49]=l.suggestions,e[50]=F):F=e[50];let oe;e[51]!==H||e[52]!==F?(oe=z.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[H,F]}),e[51]=H,e[52]=F,e[53]=oe):oe=e[53];let J;return e[54]!==te||e[55]!==oe||e[56]!==O?(J=z.jsxs("div",{ref:h,className:"fixed right-0 bottom-0 left-0 z-50 flex flex-col shadow-2xl",style:O,children:[te,oe]}),e[54]=te,e[55]=oe,e[56]=O,e[57]=J):J=e[57],J}function D5(n){return n.currentTarget.style.color="var(--hud-text-secondary)"}function M5(n){return n.currentTarget.style.color="var(--hud-text)"}function z5(n){const e=Oe.c(24),{command:o,isHighlighted:r}=n,l=ge(Z2);let c;e[0]!==o||e[1]!==l?(c=()=>l(o),e[0]=o,e[1]=l,e[2]=c):c=e[2];const d=r?"var(--list-item-bg-hover)":"transparent";let p;e[3]!==d?(p={backgroundColor:d},e[3]=d,e[4]=p):p=e[4];let m,h;e[5]!==r?(m=x=>!r&&(x.currentTarget.style.backgroundColor="var(--list-item-bg-hover)"),h=x=>!r&&(x.currentTarget.style.backgroundColor="transparent"),e[5]=r,e[6]=m,e[7]=h):(m=e[6],h=e[7]);let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g={color:"var(--hud-text)"},e[8]=g):g=e[8];let y;e[9]!==o.name?(y=z.jsx("span",{className:"font-mono",style:g,children:o.name}),e[9]=o.name,e[10]=y):y=e[10];let v;e[11]!==o.aliases?(v=o.aliases&&o.aliases.length>0&&z.jsxs("span",{className:"text-xs",style:{color:"var(--hud-text-secondary)",opacity:.5},children:["(",o.aliases.join(", "),")"]}),e[11]=o.aliases,e[12]=v):v=e[12];let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w={color:"var(--hud-text-secondary)"},e[13]=w):w=e[13];let S;e[14]!==o.description?(S=z.jsx("span",{className:"text-sm",style:w,children:o.description}),e[14]=o.description,e[15]=S):S=e[15];let A;return e[16]!==c||e[17]!==S||e[18]!==p||e[19]!==m||e[20]!==h||e[21]!==y||e[22]!==v?(A=z.jsxs("button",{onClick:c,className:"flex w-full items-center gap-3 px-4 py-2 text-left transition-colors",style:p,onMouseEnter:m,onMouseLeave:h,children:[y,v,S]}),e[16]=c,e[17]=S,e[18]=p,e[19]=m,e[20]=h,e[21]=y,e[22]=v,e[23]=A):A=e[23],A}cn();function O5(){const n=Oe.c(27),e=he(Bi),o=he(Cl),r=he(F2),l=he(Tt),c=he(nn);if(e.type==="normal")return null;let d;n[0]===Symbol.for("react.memo_cache_sentinel")?(d={},n[0]=d):d=n[0];let p;n[1]!==o||n[2]!==e.type||n[3]!==c||n[4]!==l?(p=(e.type==="pickPoint"||(o==null?void 0:o.crosshair))&&(o==null?void 0:o.cursorWorldPos)&&z.jsx(R5,{position:o.cursorWorldPos,zoom:l,pan:c}),n[1]=o,n[2]=e.type,n[3]=c,n[4]=l,n[5]=p):p=n[5];let m;n[6]!==o||n[7]!==c||n[8]!==l?(m=(o==null?void 0:o.hoveredNodeId)&&z.jsx(j5,{nodeId:o.hoveredNodeId,zoom:l,pan:c}),n[6]=o,n[7]=c,n[8]=l,n[9]=m):m=n[9];let h;n[10]!==o||n[11]!==c||n[12]!==l?(h=(o==null?void 0:o.previewEdge)&&z.jsx(L5,{edge:o.previewEdge,zoom:l,pan:c}),n[10]=o,n[11]=c,n[12]=l,n[13]=h):h=n[13];let g;n[14]!==o||n[15]!==c||n[16]!==l?(g=(o==null?void 0:o.ghostNode)&&z.jsx(U5,{ghost:o.ghostNode,zoom:l,pan:c}),n[14]=o,n[15]=c,n[16]=l,n[17]=g):g=n[17];const y=r==null?void 0:r.prompt;let v;n[18]!==e||n[19]!==y?(v=z.jsx(G5,{inputMode:e,prompt:y}),n[18]=e,n[19]=y,n[20]=v):v=n[20];let w;return n[21]!==p||n[22]!==m||n[23]!==h||n[24]!==g||n[25]!==v?(w=z.jsxs("div",{className:"pointer-events-none fixed inset-0 z-50",style:d,children:[p,m,h,g,v]}),n[21]=p,n[22]=m,n[23]=h,n[24]=g,n[25]=v,n[26]=w):w=n[26],w}function R5(n){const e=Oe.c(10),{position:o,zoom:r,pan:l}=n,c=o.x*r+l.x,d=o.y*r+l.y,p=c-20,m=d-20;let h;e[0]!==p||e[1]!==m?(h={left:p,top:m,width:40,height:40},e[0]=p,e[1]=m,e[2]=h):h=e[2];let g,y,v,w,S;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=z.jsx("line",{x1:"0",y1:"20",x2:"15",y2:"20",stroke:"var(--list-item-border-active)",strokeWidth:"2"}),y=z.jsx("line",{x1:"25",y1:"20",x2:"40",y2:"20",stroke:"var(--list-item-border-active)",strokeWidth:"2"}),v=z.jsx("line",{x1:"20",y1:"0",x2:"20",y2:"15",stroke:"var(--list-item-border-active)",strokeWidth:"2"}),w=z.jsx("line",{x1:"20",y1:"25",x2:"20",y2:"40",stroke:"var(--list-item-border-active)",strokeWidth:"2"}),S=z.jsx("circle",{cx:"20",cy:"20",r:"3",fill:"var(--list-item-border-active)"}),e[3]=g,e[4]=y,e[5]=v,e[6]=w,e[7]=S):(g=e[3],y=e[4],v=e[5],w=e[6],S=e[7]);let A;return e[8]!==h?(A=z.jsxs("svg",{className:"pointer-events-none absolute",style:h,children:[g,y,v,w,S]}),e[8]=h,e[9]=A):A=e[9],A}function j5({nodeId:n,zoom:e,pan:o}){return null}function L5(n){const e=Oe.c(15),{edge:o,zoom:r,pan:l}=n,c=o.from.x*r+l.x,d=o.from.y*r+l.y;let p;e[0]!==c||e[1]!==d?(p={x:c,y:d},e[0]=c,e[1]=d,e[2]=p):p=e[2];const m=p,h=o.to.x*r+l.x,g=o.to.y*r+l.y;let y;e[3]!==h||e[4]!==g?(y={x:h,y:g},e[3]=h,e[4]=g,e[5]=y):y=e[5];const v=y;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w={width:"100%",height:"100%"},e[6]=w):w=e[6];let S;e[7]!==m.x||e[8]!==m.y||e[9]!==v.x||e[10]!==v.y?(S=z.jsx("line",{x1:m.x,y1:m.y,x2:v.x,y2:v.y,stroke:"var(--list-item-border-active)",strokeWidth:"2",strokeDasharray:"5,5",markerEnd:"url(#arrowhead)"}),e[7]=m.x,e[8]=m.y,e[9]=v.x,e[10]=v.y,e[11]=S):S=e[11];let A;e[12]===Symbol.for("react.memo_cache_sentinel")?(A=z.jsx("defs",{children:z.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:z.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"var(--list-item-border-active)"})})}),e[12]=A):A=e[12];let x;return e[13]!==S?(x=z.jsxs("svg",{className:"pointer-events-none absolute inset-0",style:w,children:[S,A]}),e[13]=S,e[14]=x):x=e[14],x}function U5(n){const e=Oe.c(7),{ghost:o,zoom:r,pan:l}=n,c=o.position.x*r+l.x,d=o.position.y*r+l.y;let p;e[0]!==c||e[1]!==d?(p={x:c,y:d},e[0]=c,e[1]=d,e[2]=p):p=e[2];const m=p,h=m.x-50,g=m.y-50;let y;return e[3]!==o.opacity||e[4]!==h||e[5]!==g?(y=z.jsx("div",{className:"absolute rounded-lg border-2 border-dashed",style:{left:h,top:g,width:100,height:100,opacity:o.opacity,borderColor:"var(--badge-info-border)",backgroundColor:"var(--badge-info-bg)"}}),e[3]=o.opacity,e[4]=h,e[5]=g,e[6]=y):y=e[6],y}function G5(n){const e=Oe.c(7),{inputMode:o,prompt:r}=n,l=r||o.prompt||"Waiting for input...";let c;e:switch(o.type){case"pickPoint":{c="Click to pick point";break e}case"pickNode":{c="Click a node to select";break e}case"pickNodes":{c="Click nodes to select (Shift+click for multiple)";break e}case"select":{c="Choose an option";break e}case"text":{c="Type your input";break e}default:c=o.type}let d,p;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"var(--modal-bg)",borderColor:"var(--modal-border)",color:"var(--modal-text-primary)",opacity:.9},p={color:"var(--badge-info-text)"},e[0]=d,e[1]=p):(d=e[0],p=e[1]);let m;e[2]!==c?(m=z.jsxs("span",{style:p,children:[c,":"]}),e[2]=c,e[3]=m):m=e[3];let h;return e[4]!==l||e[5]!==m?(h=z.jsxs("div",{className:"fixed bottom-16 left-1/2 -translate-x-1/2 rounded-lg border px-4 py-2 font-mono text-sm shadow-lg",style:d,children:[m," ",l]}),e[4]=l,e[5]=m,e[6]=h):h=e[6],h}cn();ad();function B5(n){const e=Oe.c(39),{minZoom:o,maxZoom:r,zoomStep:l,position:c,alwaysVisible:d,className:p,style:m}=n,h=o===void 0?.1:o,g=r===void 0?5:r,y=l===void 0?.25:l,v=c===void 0?"bottom-right":c,w=d===void 0?!1:d,[S,A]=Ci(Tt);Ci(nn);const x=he(wm),E=ge(zl);let D;e[0]!==g||e[1]!==A||e[2]!==S||e[3]!==y?(D=()=>{A(Math.min(g,S+y))},e[0]=g,e[1]=A,e[2]=S,e[3]=y,e[4]=D):D=e[4];const R=D;let _;e[5]!==h||e[6]!==A||e[7]!==S||e[8]!==y?(_=()=>{A(Math.max(h,S-y))},e[5]=h,e[6]=A,e[7]=S,e[8]=y,e[9]=_):_=e[9];const N=_;let T;e[10]!==E?(T=()=>{E()},e[10]=E,e[11]=T):T=e[11];const O=T;if(!w&&!x)return null;let M;e[12]!==v?(M=Y5(v),e[12]=v,e[13]=M):M=e[13];const $=M;let L;e[14]!==S?(L=Math.round(S*100),e[14]=S,e[15]=L):L=e[15];const X=L;let ae;e[16]!==$||e[17]!==m?(ae={position:"absolute",...$,display:"flex",flexDirection:"column",gap:"4px",zIndex:100,pointerEvents:"auto",...m},e[16]=$,e[17]=m,e[18]=ae):ae=e[18];const te=S>=g;let me;e[19]===Symbol.for("react.memo_cache_sentinel")?(me=z.jsx(H5,{}),e[19]=me):me=e[19];let ce;e[20]!==R||e[21]!==te?(ce=z.jsx(Bh,{onClick:R,disabled:te,"aria-label":"Zoom in",children:me}),e[20]=R,e[21]=te,e[22]=ce):ce=e[22];const j=`Reset zoom (${X}%)`,I=`${X}%`;let G;e[23]===Symbol.for("react.memo_cache_sentinel")?(G={fontSize:"10px",fontWeight:600},e[23]=G):G=e[23];let Y;e[24]!==O||e[25]!==j||e[26]!==I||e[27]!==X?(Y=z.jsxs(Bh,{onClick:O,"aria-label":j,title:I,style:G,children:[X,"%"]}),e[24]=O,e[25]=j,e[26]=I,e[27]=X,e[28]=Y):Y=e[28];const V=S<=h;let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=z.jsx($5,{}),e[29]=k):k=e[29];let H;e[30]!==N||e[31]!==V?(H=z.jsx(Bh,{onClick:N,disabled:V,"aria-label":"Zoom out",children:k}),e[30]=N,e[31]=V,e[32]=H):H=e[32];let F;return e[33]!==p||e[34]!==ae||e[35]!==ce||e[36]!==Y||e[37]!==H?(F=z.jsxs("div",{className:p,style:ae,children:[ce,Y,H]}),e[33]=p,e[34]=ae,e[35]=ce,e[36]=Y,e[37]=H,e[38]=F):F=e[38],F}function Bh(n){const e=Oe.c(12);let o,r,l;if(e[0]!==n){const{children:h,style:g,disabled:y,...v}=n;l=g,o=y,r=v,e[0]=n,e[1]=o,e[2]=r,e[3]=l}else o=e[1],r=e[2],l=e[3];const c=o?"default":"pointer",d=o?.4:1;let p;e[4]!==l||e[5]!==c||e[6]!==d?(p={width:"44px",height:"44px",borderRadius:"12px",border:"1px solid var(--canvas-control-border, rgba(255,255,255,0.1))",backgroundColor:"var(--canvas-control-bg, rgba(30,30,30,0.85))",color:"var(--canvas-control-fg, rgba(255,255,255,0.9))",display:"flex",alignItems:"center",justifyContent:"center",cursor:c,opacity:d,touchAction:"manipulation",WebkitTapHighlightColor:"transparent",userSelect:"none",transition:"background-color 150ms, opacity 150ms",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",padding:0,...l},e[4]=l,e[5]=c,e[6]=d,e[7]=p):p=e[7];let m;return e[8]!==o||e[9]!==r||e[10]!==p?(m=z.jsx("button",{...r,disabled:o,style:p,"data-no-drag":"true"}),e[8]=o,e[9]=r,e[10]=p,e[11]=m):m=e[11],m}function H5(){const n=Oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=z.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[z.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"14"}),z.jsx("line",{x1:"4",y1:"9",x2:"14",y2:"9"})]}),n[0]=e):e=n[0],e}function $5(){const n=Oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=z.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:z.jsx("line",{x1:"4",y1:"9",x2:"14",y2:"9"})}),n[0]=e):e=n[0],e}function Y5(n){switch(n){case"bottom-right":return{bottom:"16px",right:"16px"};case"bottom-left":return{bottom:"16px",left:"16px"};case"top-right":return{top:"16px",right:"16px"};case"top-left":return{top:"16px",left:"16px"};default:return{bottom:"16px",right:"16px"}}}Tn();na();fs();function q5(n){const e=Oe.c(18),o=he(sd),r=ge(Q2),l=ge(Cm),c=he(tt),d=ge(cs),p=ge(Ol),m=he(Sl),h=he(od),g=ge(Za),y=ge(_l),v=ge(rd),w=ge(us),S=ge(Up);let A;e[0]!==p||e[1]!==d||e[2]!==l||e[3]!==o||e[4]!==g||e[5]!==S||e[6]!==v||e[7]!==h||e[8]!==m||e[9]!==r||e[10]!==n||e[11]!==y||e[12]!==w||e[13]!==c?(A=R=>{const _=R.target,N=_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_.isContentEditable,T=R.metaKey||R.ctrlKey;if(R.key==="Escape"){!o&&c.size>0&&(R.preventDefault(),d());return}if(!N){if(R.key==="/"){R.preventDefault(),o?l():r();return}if(T&&R.key==="c"&&!R.shiftKey){c.size>0&&(R.preventDefault(),g(Array.from(c)));return}if(T&&R.key==="x"&&!R.shiftKey){c.size>0&&(R.preventDefault(),g(Array.from(c)));return}if(T&&R.key==="v"&&!R.shiftKey){h&&(R.preventDefault(),y());return}if(T&&R.key==="d"&&!R.shiftKey){c.size>0&&(R.preventDefault(),v());return}if(T&&R.key==="a"&&!R.shiftKey){R.preventDefault(),d(),p(m);return}if((R.key==="Delete"||R.key==="Backspace")&&!T){if(c.size>0){R.preventDefault();{w("Delete nodes");for(const O of c)S({nodeId:O})}}return}}},e[0]=p,e[1]=d,e[2]=l,e[3]=o,e[4]=g,e[5]=S,e[6]=v,e[7]=h,e[8]=m,e[9]=r,e[10]=n,e[11]=y,e[12]=w,e[13]=c,e[14]=A):A=e[14];const x=A;let E,D;e[15]!==x?(E=()=>(window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)),D=[x],e[15]=x,e[16]=E,e[17]=D):(E=e[16],D=e[17]),ne.useEffect(E,D)}Zt();Tn();cn();ds();var V5=ne.createContext(null);function X5(n){const e=Oe.c(43),{children:o,onCreateNode:r,onUpdateNode:l,onDeleteNode:c,onCreateEdge:d,onDeleteEdge:p,onForceLayoutPersist:m}=n,h=Tl(),g=he(wr),y=he(tt),v=he(Tt),w=he(nn),S=ge(Rl),A=ge(jl),{fitToBounds:x}=Am();let E;e[0]!==m?(E=m?async Y=>{await m(Y.map(Q5))}:void 0,e[0]=m,e[1]=E):E=e[1];let D;e[2]!==E?(D={onPositionsChanged:E},e[2]=E,e[3]=D):D=e[3];const{applyForceLayout:R}=vN(D),_=ge(Cm),N=ge(CN);let T;e[4]!==R||e[5]!==g||e[6]!==x||e[7]!==d||e[8]!==r||e[9]!==p||e[10]!==c||e[11]!==l||e[12]!==w||e[13]!==A||e[14]!==y||e[15]!==h.get||e[16]!==h.set||e[17]!==S||e[18]!==v?(T=()=>({get:h.get,set:h.set,currentGraphId:g,selectedNodeIds:y,viewport:{zoom:v,pan:w},mutations:{createNode:async Y=>{if(!r)throw new Error("onCreateNode callback not provided to CommandProvider");return r(Y)},updateNode:async(Y,V)=>{if(!l)throw new Error("onUpdateNode callback not provided to CommandProvider");return l(Y,V)},deleteNode:async Y=>{if(!c)throw new Error("onDeleteNode callback not provided to CommandProvider");return c(Y)},createEdge:async Y=>{if(!d)throw new Error("onCreateEdge callback not provided to CommandProvider");return d(Y)},deleteEdge:async Y=>{if(!p)throw new Error("onDeleteEdge callback not provided to CommandProvider");return p(Y)}},layout:{fitToBounds:(Y,V)=>{const k=Y==="graph"?No.Graph:No.Selection;x(k,V)},applyForceLayout:R},history:{undo:S,redo:A}}),e[4]=R,e[5]=g,e[6]=x,e[7]=d,e[8]=r,e[9]=p,e[10]=c,e[11]=l,e[12]=w,e[13]=A,e[14]=y,e[15]=h.get,e[16]=h.set,e[17]=S,e[18]=v,e[19]=T):T=e[19];const O=T;let M;e[20]!==_||e[21]!==O||e[22]!==N?(M=async(Y,V)=>{const k=To.get(Y);if(!k)throw new Error(`Unknown command: ${Y}`);for(const F of k.inputs)if(F.required!==!1&&V[F.name]===void 0)throw new Error(`Missing required input: ${F.name}`);const H=O();try{await k.execute(V,H),_()}catch(F){const oe=F,J=oe instanceof Error?oe.message:"Command execution failed";throw N(J),oe}},e[20]=_,e[21]=O,e[22]=N,e[23]=M):M=e[23];const $=M,L=K5,[X,ae]=Ci(Dt),te=ne.useRef(!1);let me;e[24]!==X||e[25]!==O||e[26]!==N||e[27]!==ae||e[28]!==h?(me=()=>{if(X.phase==="executing"&&!te.current){const{command:oe}=X;if(oe.inputs.length===0){te.current=!0;const J=O();oe.execute({},J).then(()=>{ae({phase:"searching",query:"",suggestions:To.all()})}).catch(W=>{const ue=W instanceof Error?W.message:"Command execution failed";N(ue)}).finally(()=>{te.current=!1})}return}if(X.phase!=="collecting"){te.current=!1;return}const{command:Y,inputIndex:V,collected:k}=X,H=Y.inputs.length-1,F=Y.inputs[H];if(V===H&&k[F.name]!==void 0&&!te.current){te.current=!0,ae({phase:"executing",command:Y});const oe=O();Y.execute(k,oe).then(()=>{ae({phase:"searching",query:"",suggestions:To.all()}),h.set(Bi,{type:"normal"}),h.set(Cl,null)}).catch(J=>{const W=J instanceof Error?J.message:"Command execution failed";N(W)}).finally(()=>{te.current=!1})}},e[24]=X,e[25]=O,e[26]=N,e[27]=ae,e[28]=h,e[29]=me):me=e[29];let ce;e[30]!==_||e[31]!==X||e[32]!==O||e[33]!==N||e[34]!==ae||e[35]!==h?(ce=[X,O,_,N,ae,h],e[30]=_,e[31]=X,e[32]=O,e[33]=N,e[34]=ae,e[35]=h,e[36]=ce):ce=e[36],ne.useEffect(me,ce);let j;e[37]!==$||e[38]!==O?(j={executeCommand:$,getContext:O,hasCommand:L},e[37]=$,e[38]=O,e[39]=j):j=e[39];const I=j;let G;return e[40]!==o||e[41]!==I?(G=z.jsx(V5,{value:I,children:o}),e[40]=o,e[41]=I,e[42]=G):G=e[42],G}function K5(n){return To.has(n)}function Q5(n){return{nodeId:n.nodeId,x:n.position.x,y:n.position.y}}var Z5={name:"fitToView",description:"Fit all nodes in the viewport",aliases:["fit","fitAll"],category:"viewport",inputs:[],execute:async(n,e)=>{e.layout.fitToBounds("graph")}},I5={name:"fitSelection",description:"Fit selected nodes in the viewport",aliases:["fitSel"],category:"viewport",inputs:[],execute:async(n,e)=>{if(e.selectedNodeIds.size===0)throw new Error("No nodes selected");e.layout.fitToBounds("selection")}},F5={name:"resetViewport",description:"Reset zoom and pan to default",aliases:["reset","home"],category:"viewport",inputs:[],execute:async(n,e)=>{const{resetViewportAtom:o}=await Promise.resolve().then(()=>(cn(),qu));e.set(o)}},P5={name:"zoomIn",description:"Zoom in on the canvas",aliases:["+","in"],category:"viewport",inputs:[],execute:async(n,e)=>{const{zoomAtom:o,setZoomAtom:r}=await Promise.resolve().then(()=>(cn(),qu)),l=e.get(o);e.set(r,{zoom:Math.min(5,l*1.25)})}},J5={name:"zoomOut",description:"Zoom out on the canvas",aliases:["-","out"],category:"viewport",inputs:[],execute:async(n,e)=>{const{zoomAtom:o,setZoomAtom:r}=await Promise.resolve().then(()=>(cn(),qu)),l=e.get(o);e.set(r,{zoom:Math.max(.1,l/1.25)})}};function W5(){En(Z5),En(I5),En(F5),En(P5),En(J5)}var e4={name:"selectAll",description:"Select all nodes in the graph",aliases:["all"],category:"selection",inputs:[],execute:async(n,e)=>{const{nodeKeysAtom:o,selectedNodeIdsAtom:r}=await Promise.resolve().then(()=>(na(),Bl)),l=e.get(o);e.set(r,new Set(l))}},t4={name:"clearSelection",description:"Clear all selection",aliases:["deselect","clear"],category:"selection",inputs:[],execute:async(n,e)=>{const{clearSelectionAtom:o}=await Promise.resolve().then(()=>(na(),Bl));e.set(o)}},n4={name:"invertSelection",description:"Invert the current selection",aliases:["invert"],category:"selection",inputs:[],execute:async(n,e)=>{const{nodeKeysAtom:o,selectedNodeIdsAtom:r}=await Promise.resolve().then(()=>(na(),Bl)),l=e.get(o),c=e.selectedNodeIds,d=l.filter(p=>!c.has(p));e.set(r,new Set(d))}};function i4(){En(e4),En(t4),En(n4)}var o4={name:"undo",description:"Undo the last action",aliases:["z"],category:"history",inputs:[],execute:async(n,e)=>{e.history.undo()}},r4={name:"redo",description:"Redo the last undone action",aliases:["y"],category:"history",inputs:[],execute:async(n,e)=>{e.history.redo()}};function a4(){En(o4),En(r4)}var s4={name:"forceLayout",description:"Apply force-directed layout to all nodes",aliases:["force","autoLayout"],category:"layout",inputs:[],execute:async(n,e)=>{await e.layout.applyForceLayout()}};function l4(){En(s4)}var c4={name:"copy",description:"Copy selected nodes to clipboard",aliases:["cp"],category:"selection",inputs:[],execute:async(n,e)=>{const{copyToClipboardAtom:o,hasClipboardContentAtom:r}=await Promise.resolve().then(()=>(fs(),Gl));if(e.selectedNodeIds.size===0)throw new Error("No nodes selected to copy");if(e.set(o,Array.from(e.selectedNodeIds)),!e.get(r))throw new Error("Failed to copy nodes")}},u4={name:"cut",description:"Cut selected nodes (copy to clipboard)",aliases:["x"],category:"selection",inputs:[],execute:async(n,e)=>{const{copyToClipboardAtom:o,hasClipboardContentAtom:r}=await Promise.resolve().then(()=>(fs(),Gl));if(e.selectedNodeIds.size===0)throw new Error("No nodes selected to cut");if(e.set(o,Array.from(e.selectedNodeIds)),!e.get(r))throw new Error("Failed to cut nodes");for(const c of e.selectedNodeIds)await e.mutations.deleteNode(c)}},d4={name:"paste",description:"Paste nodes from clipboard",aliases:["v"],category:"selection",inputs:[{name:"position",type:"point",prompt:"Click to paste at position (or Enter for default offset)",required:!1}],execute:async(n,e)=>{const{pasteFromClipboardAtom:o,clipboardAtom:r,PASTE_OFFSET:l}=await Promise.resolve().then(()=>(fs(),Gl)),c=e.get(r);if(!c||c.nodes.length===0)throw new Error("Clipboard is empty");let d=l;if(n.position){const m=n.position;d={x:m.x-c.bounds.minX,y:m.y-c.bounds.minY}}const p=e.set(o,d);if(!p||p.length===0)throw new Error("Failed to paste nodes")},feedback:(n,e)=>e.name==="position"?{crosshair:!0}:null},f4={name:"duplicate",description:"Duplicate selected nodes",aliases:["d","dup"],category:"selection",inputs:[],execute:async(n,e)=>{const{duplicateSelectionAtom:o}=await Promise.resolve().then(()=>(fs(),Gl));if(e.selectedNodeIds.size===0)throw new Error("No nodes selected to duplicate");const r=e.set(o);if(!r||r.length===0)throw new Error("Failed to duplicate nodes")}},h4={name:"deleteSelected",description:"Delete selected nodes",aliases:["del","delete","remove"],category:"selection",inputs:[],execute:async(n,e)=>{if(e.selectedNodeIds.size===0)throw new Error("No nodes selected to delete");const{pushHistoryAtom:o}=await Promise.resolve().then(()=>(na(),Bl));e.set(o,"Delete nodes");for(const r of e.selectedNodeIds)await e.mutations.deleteNode(r)}};function p4(){En(c4),En(u4),En(d4),En(f4),En(h4)}function m4(){W5(),i4(),a4(),l4(),p4()}var g4="0.6.0",y4={version:g4};const v4=(n,e)=>{const o=new Array(n.length+e.length);for(let r=0;r<n.length;r++)o[r]=n[r];for(let r=0;r<e.length;r++)o[n.length+r]=e[r];return o},b4=(n,e)=>({classGroupId:n,validator:e}),nw=(n=new Map,e=null,o)=>({nextPart:n,validators:e,classGroupId:o}),Ou="-",E1=[],w4="arbitrary..",x4=n=>{const e=A4(n),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return S4(d);const p=d.split(Ou),m=p[0]===""&&p.length>1?1:0;return iw(p,m,e)},getConflictingClassGroupIds:(d,p)=>{if(p){const m=r[d],h=o[d];return m?h?v4(h,m):m:h||E1}return o[d]||E1}}},iw=(n,e,o)=>{if(n.length-e===0)return o.classGroupId;const l=n[e],c=o.nextPart.get(l);if(c){const h=iw(n,e+1,c);if(h)return h}const d=o.validators;if(d===null)return;const p=e===0?n.join(Ou):n.slice(e).join(Ou),m=d.length;for(let h=0;h<m;h++){const g=d[h];if(g.validator(p))return g.classGroupId}},S4=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),o=e.indexOf(":"),r=e.slice(0,o);return r?w4+r:void 0})(),A4=n=>{const{theme:e,classGroups:o}=n;return _4(o,e)},_4=(n,e)=>{const o=nw();for(const r in n){const l=n[r];km(l,o,r,e)}return o},km=(n,e,o,r)=>{const l=n.length;for(let c=0;c<l;c++){const d=n[c];C4(d,e,o,r)}},C4=(n,e,o,r)=>{if(typeof n=="string"){E4(n,e,o);return}if(typeof n=="function"){N4(n,e,o,r);return}k4(n,e,o,r)},E4=(n,e,o)=>{const r=n===""?e:ow(e,n);r.classGroupId=o},N4=(n,e,o,r)=>{if(T4(n)){km(n(r),e,o,r);return}e.validators===null&&(e.validators=[]),e.validators.push(b4(o,n))},k4=(n,e,o,r)=>{const l=Object.entries(n),c=l.length;for(let d=0;d<c;d++){const[p,m]=l[d];km(m,ow(e,p),o,r)}},ow=(n,e)=>{let o=n;const r=e.split(Ou),l=r.length;for(let c=0;c<l;c++){const d=r[c];let p=o.nextPart.get(d);p||(p=nw(),o.nextPart.set(d,p)),o=p}return o},T4=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,D4=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,o=Object.create(null),r=Object.create(null);const l=(c,d)=>{o[c]=d,e++,e>n&&(e=0,r=o,o=Object.create(null))};return{get(c){let d=o[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return l(c,d),d},set(c,d){c in o?o[c]=d:l(c,d)}}},wp="!",N1=":",M4=[],k1=(n,e,o,r,l)=>({modifiers:n,hasImportantModifier:e,baseClassName:o,maybePostfixModifierPosition:r,isExternal:l}),z4=n=>{const{prefix:e,experimentalParseClassName:o}=n;let r=l=>{const c=[];let d=0,p=0,m=0,h;const g=l.length;for(let A=0;A<g;A++){const x=l[A];if(d===0&&p===0){if(x===N1){c.push(l.slice(m,A)),m=A+1;continue}if(x==="/"){h=A;continue}}x==="["?d++:x==="]"?d--:x==="("?p++:x===")"&&p--}const y=c.length===0?l:l.slice(m);let v=y,w=!1;y.endsWith(wp)?(v=y.slice(0,-1),w=!0):y.startsWith(wp)&&(v=y.slice(1),w=!0);const S=h&&h>m?h-m:void 0;return k1(c,w,v,S)};if(e){const l=e+N1,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):k1(M4,!1,d,void 0,!0)}if(o){const l=r;r=c=>o({className:c,parseClassName:l})}return r},O4=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((o,r)=>{e.set(o,1e6+r)}),o=>{const r=[];let l=[];for(let c=0;c<o.length;c++){const d=o[c],p=d[0]==="[",m=e.has(d);p||m?(l.length>0&&(l.sort(),r.push(...l),l=[]),r.push(d)):l.push(d)}return l.length>0&&(l.sort(),r.push(...l)),r}},R4=n=>({cache:D4(n.cacheSize),parseClassName:z4(n),sortModifiers:O4(n),...x4(n)}),j4=/\s+/,L4=(n,e)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=e,d=[],p=n.trim().split(j4);let m="";for(let h=p.length-1;h>=0;h-=1){const g=p[h],{isExternal:y,modifiers:v,hasImportantModifier:w,baseClassName:S,maybePostfixModifierPosition:A}=o(g);if(y){m=g+(m.length>0?" "+m:m);continue}let x=!!A,E=r(x?S.substring(0,A):S);if(!E){if(!x){m=g+(m.length>0?" "+m:m);continue}if(E=r(S),!E){m=g+(m.length>0?" "+m:m);continue}x=!1}const D=v.length===0?"":v.length===1?v[0]:c(v).join(":"),R=w?D+wp:D,_=R+E;if(d.indexOf(_)>-1)continue;d.push(_);const N=l(E,x);for(let T=0;T<N.length;++T){const O=N[T];d.push(R+O)}m=g+(m.length>0?" "+m:m)}return m},U4=(...n)=>{let e=0,o,r,l="";for(;e<n.length;)(o=n[e++])&&(r=rw(o))&&(l&&(l+=" "),l+=r);return l},rw=n=>{if(typeof n=="string")return n;let e,o="";for(let r=0;r<n.length;r++)n[r]&&(e=rw(n[r]))&&(o&&(o+=" "),o+=e);return o},G4=(n,...e)=>{let o,r,l,c;const d=m=>{const h=e.reduce((g,y)=>y(g),n());return o=R4(h),r=o.cache.get,l=o.cache.set,c=p,p(m)},p=m=>{const h=r(m);if(h)return h;const g=L4(m,o);return l(m,g),g};return c=d,(...m)=>c(U4(...m))},B4=[],Jt=n=>{const e=o=>o[n]||B4;return e.isThemeGetter=!0,e},aw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,H4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y4=/\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$/,q4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,V4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ar=n=>H4.test(n),Ge=n=>!!n&&!Number.isNaN(Number(n)),sr=n=>!!n&&Number.isInteger(Number(n)),Hh=n=>n.endsWith("%")&&Ge(n.slice(0,-1)),bo=n=>$4.test(n),lw=()=>!0,K4=n=>Y4.test(n)&&!q4.test(n),Tm=()=>!1,Q4=n=>V4.test(n),Z4=n=>X4.test(n),I4=n=>!we(n)&&!Ae(n),F4=n=>Sr(n,dw,Tm),we=n=>aw.test(n),Yr=n=>Sr(n,fw,K4),T1=n=>Sr(n,o6,Ge),P4=n=>Sr(n,pw,lw),J4=n=>Sr(n,hw,Tm),D1=n=>Sr(n,cw,Tm),W4=n=>Sr(n,uw,Z4),ru=n=>Sr(n,mw,Q4),Ae=n=>sw.test(n),ll=n=>ia(n,fw),e6=n=>ia(n,hw),M1=n=>ia(n,cw),t6=n=>ia(n,dw),n6=n=>ia(n,uw),au=n=>ia(n,mw,!0),i6=n=>ia(n,pw,!0),Sr=(n,e,o)=>{const r=aw.exec(n);return r?r[1]?e(r[1]):o(r[2]):!1},ia=(n,e,o=!1)=>{const r=sw.exec(n);return r?r[1]?e(r[1]):o:!1},cw=n=>n==="position"||n==="percentage",uw=n=>n==="image"||n==="url",dw=n=>n==="length"||n==="size"||n==="bg-size",fw=n=>n==="length",o6=n=>n==="number",hw=n=>n==="family-name",pw=n=>n==="number"||n==="weight",mw=n=>n==="shadow",r6=()=>{const n=Jt("color"),e=Jt("font"),o=Jt("text"),r=Jt("font-weight"),l=Jt("tracking"),c=Jt("leading"),d=Jt("breakpoint"),p=Jt("container"),m=Jt("spacing"),h=Jt("radius"),g=Jt("shadow"),y=Jt("inset-shadow"),v=Jt("text-shadow"),w=Jt("drop-shadow"),S=Jt("blur"),A=Jt("perspective"),x=Jt("aspect"),E=Jt("ease"),D=Jt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[..._(),Ae,we],T=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[Ae,we,m],$=()=>[ar,"full","auto",...M()],L=()=>[sr,"none","subgrid",Ae,we],X=()=>["auto",{span:["full",sr,Ae,we]},sr,Ae,we],ae=()=>[sr,"auto",Ae,we],te=()=>["auto","min","max","fr",Ae,we],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...M()],I=()=>[ar,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],G=()=>[ar,"screen","full","dvw","lvw","svw","min","max","fit",...M()],Y=()=>[ar,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],V=()=>[n,Ae,we],k=()=>[..._(),M1,D1,{position:[Ae,we]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",t6,F4,{size:[Ae,we]}],oe=()=>[Hh,ll,Yr],J=()=>["","none","full",h,Ae,we],W=()=>["",Ge,ll,Yr],ue=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Ge,Hh,M1,D1],Te=()=>["","none",S,Ae,we],Ce=()=>["none",Ge,Ae,we],Se=()=>["none",Ge,Ae,we],Ee=()=>[Ge,Ae,we],Be=()=>[ar,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bo],breakpoint:[bo],color:[lw],container:[bo],"drop-shadow":[bo],ease:["in","out","in-out"],font:[I4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bo],shadow:[bo],spacing:["px",Ge],text:[bo],"text-shadow":[bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ar,we,Ae,x]}],container:["container"],columns:[{columns:[Ge,we,Ae,p]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:N()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[sr,"auto",Ae,we]}],basis:[{basis:[ar,"full","auto",p,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,ar,"auto","initial","none",we]}],grow:[{grow:["",Ge,Ae,we]}],shrink:[{shrink:["",Ge,Ae,we]}],order:[{order:[sr,"first","last","none",Ae,we]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[p,"screen",...I()]}],"min-w":[{"min-w":[p,"screen","none",...I()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[d]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",o,ll,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,i6,P4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Hh,we]}],"font-family":[{font:[e6,J4,e]}],"font-features":[{"font-features":[we]}],"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:[l,Ae,we]}],"line-clamp":[{"line-clamp":[Ge,"none",Ae,T1]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",Ae,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",Ae,Yr]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Ge,"auto",Ae,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},sr,Ae,we],radial:["",Ae,we],conic:[sr,Ae,we]},n6,W4]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-bs":[{"border-bs":W()}],"border-w-be":[{"border-be":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,Ae,we]}],"outline-w":[{outline:["",Ge,ll,Yr]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",g,au,ru]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",y,au,ru]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Ge,Yr]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",v,au,ru]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Ge,Ae,we]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Ae,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,we]}],filter:[{filter:["","none",Ae,we]}],blur:[{blur:Te()}],brightness:[{brightness:[Ge,Ae,we]}],contrast:[{contrast:[Ge,Ae,we]}],"drop-shadow":[{"drop-shadow":["","none",w,au,ru]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Ge,Ae,we]}],"hue-rotate":[{"hue-rotate":[Ge,Ae,we]}],invert:[{invert:["",Ge,Ae,we]}],saturate:[{saturate:[Ge,Ae,we]}],sepia:[{sepia:["",Ge,Ae,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,we]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,Ae,we]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,Ae,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,Ae,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,Ae,we]}],"backdrop-invert":[{"backdrop-invert":["",Ge,Ae,we]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,Ae,we]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,Ae,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,Ae,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",Ae,we]}],ease:[{ease:["linear","initial",E,Ae,we]}],delay:[{delay:[Ge,Ae,we]}],animate:[{animate:["none",D,Ae,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,Ae,we]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[Ae,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"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",Ae,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",Ae,we]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Ge,ll,Yr,T1]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},a6=G4(r6);function Dm(...n){return a6(Qb(n))}const s6=Zb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),So=ne.forwardRef(({className:n,variant:e,size:o,asChild:r=!1,...l},c)=>{const d=r?wE:"button";return z.jsx(d,{className:Dm(s6({variant:e,size:o,className:n})),ref:c,...l})});So.displayName="Button";const l6=Zb("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function $h({className:n,variant:e,...o}){return z.jsx("div",{className:Dm(l6({variant:e}),n),...o})}const gw=ne.forwardRef(({className:n,orientation:e="horizontal",decorative:o=!0,...r},l)=>z.jsx("div",{ref:l,role:o?"none":"separator","aria-orientation":o?void 0:e,className:Dm("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",n),...r}));gw.displayName="Separator";/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yw=(...n)=>n.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const c6=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const u6=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase());/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z1=n=>{const e=u6(n);return e.charAt(0).toUpperCase()+e.slice(1)};/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var d6={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.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f6=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const h6=ne.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...p},m)=>ne.createElement("svg",{ref:m,...d6,width:e,height:e,stroke:n,strokeWidth:r?Number(o)*24/Number(e):o,className:yw("lucide",l),...!c&&!f6(p)&&{"aria-hidden":"true"},...p},[...d.map(([h,g])=>ne.createElement(h,g)),...Array.isArray(c)?c:[c]]));/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const li=(n,e)=>{const o=ne.forwardRef(({className:r,...l},c)=>ne.createElement(h6,{ref:c,iconNode:e,className:yw(`lucide-${c6(z1(n))}`,`lucide-${n}`,r),...l}));return o.displayName=z1(n),o};/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const p6=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],m6=li("command",p6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const g6=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],y6=li("copy",g6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v6=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],b6=li("keyboard",v6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w6=[["path",{d:"m12 15 4 4",key:"lnac28"}],["path",{d:"M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z",key:"nlhkjb"}],["path",{d:"m5 8 4 4",key:"j6kj7e"}]],x6=li("magnet",w6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S6=[["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"}]],A6=li("maximize",S6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _6=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],C6=li("mouse-pointer-click",_6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const E6=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]],N6=li("move",E6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k6=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],T6=li("pencil",k6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D6=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],M6=li("redo-2",D6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z6=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],O6=li("settings",z6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R6=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],j6=li("trash-2",R6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L6=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],U6=li("undo-2",L6);/**
 * @license lucide-react v0.576.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],B6=li("x",G6);m4();const Xa=["#6366f1","#f97316","#22c55e","#3b82f6","#ec4899","#eab308","#14b8a6","#f43f5e","#a855f7","#ef4444"],Ru=160,ju=80;function H6(){const[n,e]=ne.useState(0),o=ne.useRef(0),r=ne.useRef(performance.now());return ne.useEffect(()=>{let l;const c=()=>{o.current++;const d=performance.now();d-r.current>=1e3&&(e(Math.round(o.current*1e3/(d-r.current))),o.current=0,r.current=d),l=requestAnimationFrame(c)};return l=requestAnimationFrame(c),()=>cancelAnimationFrame(l)},[]),n}const $6=Ji.memo(function({node:e,isSelected:o}){return z.jsxs("div",{className:`
            w-full h-full flex flex-col items-center justify-center gap-1
            rounded-lg border px-3 py-2 cursor-grab
            transition-all duration-150
            ${o?"bg-indigo-500/20 border-indigo-400 shadow-[0_0_20px_rgba(99,102,241,0.3)]":"bg-secondary/50 border-border/50 shadow-sm hover:border-border"}
        `,children:[z.jsx("span",{className:"text-sm font-semibold text-foreground truncate max-w-full",children:e.label||`Node ${e.id}`}),z.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:[Math.round(e.x),", ",Math.round(e.y)]})]})});function Y6(n){const e=new We({multi:!0,allowSelfLoops:!0,type:"directed"}),o=new Date().toISOString(),r=Math.max(Math.ceil(Math.sqrt(n*1.5)),5);for(let l=0;l<n;l++){const c=l%r,d=Math.floor(l/r),p=c*220+(Math.random()-.5)*40,m=d*140+(Math.random()-.5)*30,h=Xa[l%Xa.length],g=`n${l}`;e.addNode(g,{x:p,y:m,size:10,width:Ru,height:ju,color:h,label:`Node ${l}`,zIndex:0,dbData:{id:g,graph_id:"demo",label:`Node ${l}`,node_type:"default",configuration:null,ui_properties:{x:p,y:m,width:Ru,height:ju,color:h},created_at:o,updated_at:o}})}for(let l=0;l<n;l++)for(let c=0;c<1+Math.floor(Math.random()*2);c++){const d=Math.min(l+1+Math.floor(Math.random()*r),n-1);if(d!==l){const p=`e${l}-${d}-${c}`;e.hasEdge(p)||e.addEdgeWithKey(p,`n${l}`,`n${d}`,{color:Xa[l%Xa.length],dbData:{id:p,graph_id:"demo",source_node_id:`n${l}`,target_node_id:`n${d}`,label:null,edge_type:"default",configuration:null,filter_condition:null,ui_properties:null,created_at:o,updated_at:o}})}}return e}function q6({nodeCount:n,onSetNodes:e}){const o=H6(),r=fN(),l=hN(),{undo:c,redo:d,canUndo:p,canRedo:m}=dN({enableKeyboardShortcuts:!0}),{fitToBounds:h}=Am(),g=Ka(Q2),y=Ih(qa),v=Ka(Jp),w=Ih(Eu),{isPanelOpen:S,togglePanel:A}=_m(),x=o>=50?"text-green-400":o>=30?"text-yellow-400":"text-red-400";return z.jsxs("aside",{className:"fixed top-0 left-0 bottom-0 w-64 bg-background/95 backdrop-blur-xl border-r border-border z-[200] flex flex-col overflow-y-auto",children:[z.jsxs("div",{className:"p-4 pb-3 border-b border-border",children:[z.jsxs("p",{className:"text-[11px] font-mono text-muted-foreground",children:["@blinksgg/canvas v",y4.version]}),z.jsx("h1",{className:"text-base font-bold mt-1",children:"Feature Demo"})]}),z.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[z.jsx("span",{className:`text-3xl font-bold ${x}`,children:o}),z.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:"FPS"})]}),z.jsx(su,{title:"Graph",children:z.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[z.jsxs($h,{variant:"secondary",children:["📦 ",n," nodes"]}),z.jsxs($h,{variant:"secondary",children:["✅ ",r.count," selected"]}),z.jsxs($h,{variant:"secondary",children:["🔍 ",(l.zoom*100).toFixed(0),"%"]})]})}),z.jsx(su,{title:"Node Count",children:z.jsx("div",{className:"flex flex-wrap gap-1",children:[10,50,100,200,500,1e3].map(E=>z.jsx(So,{size:"sm",variant:n===E?"default":"secondary",className:"h-7 px-2.5 text-xs font-mono",onClick:()=>e(E),children:E},E))})}),z.jsx(su,{title:"Actions",children:z.jsxs("div",{className:"flex flex-col gap-1",children:[z.jsxs(So,{variant:"ghost",size:"sm",className:"justify-between",onClick:()=>g(),children:[z.jsxs("span",{className:"flex items-center gap-2",children:[z.jsx(m6,{className:"w-3.5 h-3.5"})," Command Palette"]}),z.jsx("kbd",{className:"text-[10px] text-muted-foreground bg-secondary px-1.5 py-0.5 rounded",children:"/"})]}),z.jsxs(So,{variant:"ghost",size:"sm",className:"justify-start gap-2",onClick:()=>h(No.Graph),children:[z.jsx(A6,{className:"w-3.5 h-3.5"})," Fit to View"]}),z.jsxs("div",{className:"flex gap-1",children:[z.jsxs(So,{variant:"ghost",size:"sm",className:"flex-1 gap-1",disabled:!p,onClick:c,children:[z.jsx(U6,{className:"w-3.5 h-3.5"})," Undo"]}),z.jsxs(So,{variant:"ghost",size:"sm",className:"flex-1 gap-1",disabled:!m,onClick:d,children:[z.jsx(M6,{className:"w-3.5 h-3.5"})," Redo"]})]}),z.jsxs(So,{variant:"ghost",size:"sm",className:"justify-start gap-2",onClick:v,children:[z.jsx(x6,{className:"w-3.5 h-3.5"}),"Snap: ",y?"ON":"OFF"," (",w,"px)"]}),z.jsxs(So,{variant:S?"secondary":"ghost",size:"sm",className:"justify-start gap-2",onClick:A,children:[z.jsx(O6,{className:"w-3.5 h-3.5"})," Settings Panel"]})]})}),S&&z.jsx(su,{title:"Event → Action Mappings",children:z.jsx(u5,{className:"flex flex-col gap-2 text-xs",headerClassName:"hidden",contentClassName:"flex flex-col gap-3",footerClassName:"text-[10px] text-muted-foreground pt-2 border-t border-border",groupClassName:"flex flex-col gap-1",groupHeadingClassName:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1",rowClassName:"flex items-center justify-between gap-2 py-0.5",labelClassName:"text-xs text-foreground shrink-0",selectClassName:"bg-secondary text-foreground border border-border rounded-md px-1.5 py-1 text-[11px] min-w-0 flex-1 truncate",buttonClassName:"bg-secondary text-foreground border border-border rounded-md px-2 py-1 text-[11px] cursor-pointer hover:bg-accent transition-colors",presetClassName:"flex flex-col gap-1.5",presetSelectClassName:"bg-secondary text-foreground border border-border rounded-md px-2 py-1 text-xs w-full",presetButtonsClassName:"flex gap-1 flex-wrap",inputClassName:"bg-secondary text-foreground border border-border rounded-md px-2 py-1 text-xs flex-1 min-w-0",checkboxClassName:"accent-indigo-500",quickActionsClassName:"flex flex-col gap-1",virtualizationClassName:"flex items-center gap-2 [&_label]:flex [&_label]:items-center [&_label]:gap-1.5 [&_label]:cursor-pointer [&_label]:text-xs",virtualizationStatsClassName:"text-[10px] text-muted-foreground",onClose:A,renderHeader:()=>z.jsxs("div",{className:"flex items-center justify-between w-full mb-1",children:[z.jsx("span",{className:"font-semibold text-sm",children:"Settings"}),z.jsx(So,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:A,children:z.jsx(B6,{className:"w-3.5 h-3.5"})})]})})}),z.jsx(gw,{}),z.jsxs("div",{className:"px-4 py-3 mt-auto text-[11px] text-muted-foreground leading-relaxed",children:[z.jsx("p",{className:"font-semibold text-xs text-foreground mb-1.5",children:"Controls"}),z.jsxs("div",{className:"space-y-0.5",children:[z.jsxs("p",{children:[z.jsx(N6,{className:"w-3 h-3 inline mr-1"})," Drag bg → Pan"]}),z.jsxs("p",{children:[z.jsx(C6,{className:"w-3 h-3 inline mr-1"})," Dbl-click → mapped action"]}),z.jsxs("p",{children:[z.jsx(T6,{className:"w-3 h-3 inline mr-1"})," Pencil → Lasso"]}),z.jsxs("p",{children:[z.jsx(b6,{className:"w-3 h-3 inline mr-1"})," / → Palette · ⌘Z → Undo"]}),z.jsxs("p",{children:[z.jsx(y6,{className:"w-3 h-3 inline mr-1"})," ⌘C/V/D → Copy/Paste/Dupe"]}),z.jsxs("p",{children:[z.jsx(j6,{className:"w-3 h-3 inline mr-1"})," Del → Remove selected"]})]})]})]})}function su({title:n,children:e}){return z.jsxs("div",{className:"px-4 py-3 border-b border-border",children:[z.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-2",children:n}),e]})}function V6(){return q5(),null}let Yh=0;function X6(){const[n]=rA(ze),e=Ka(ze),o=Ka(en),r=Ka(Qn),[l,c]=ne.useState(20),d=ne.useCallback(()=>{o(G=>G+1),r(G=>G+1)},[o,r]),p=ne.useCallback(G=>{Yh=G,e(Y6(G)),d()},[e,d]);ne.useEffect(()=>{p(l)},[]);const m=ne.useCallback(G=>{c(G),p(G)},[p]),h=ne.useCallback((G,Y,V)=>{const k=`n${Yh++}`,H=Xa[Math.floor(Math.random()*Xa.length)],F=V??`Node ${Yh-1}`;n.addNode(k,{x:G-80,y:Y-40,size:10,width:Ru,height:ju,color:H,label:F,zIndex:0,dbData:{id:k,graph_id:"demo",label:F,node_type:"default",configuration:null,ui_properties:{x:G-80,y:Y-40,width:Ru,height:ju,color:H},created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}),d(),c(n.order)},[n,d]),g=ne.useCallback(G=>{n.hasNode(G)&&(n.dropNode(G),d(),c(n.order))},[n,d]),{executeEventAction:y}=bN({onCreateNode:async G=>h(G.x,G.y),onDeleteNode:async G=>g(G),onOpenContextMenu:(G,Y)=>console.log("[ctx]",Y??"bg",G)}),v=ne.useCallback((G,Y)=>{y(fe.NodeClick,si(fe.NodeClick,{clientX:Y.x,clientY:Y.y},{x:Y.x,y:Y.y},{nodeId:G}))},[y]),w=ne.useCallback((G,Y)=>{y(fe.NodeDoubleClick,si(fe.NodeDoubleClick,{clientX:Y.x,clientY:Y.y},{x:Y.x,y:Y.y},{nodeId:G}))},[y]),S=ne.useCallback((G,Y)=>{y(fe.NodeTripleClick,si(fe.NodeTripleClick,{clientX:Y.x,clientY:Y.y},{x:Y.x,y:Y.y},{nodeId:G}))},[y]),A=ne.useCallback(G=>{y(fe.BackgroundDoubleClick,si(fe.BackgroundDoubleClick,{clientX:G.x,clientY:G.y},G))},[y]),x=ne.useCallback((G,Y)=>{y(fe.BackgroundRightClick,si(fe.BackgroundRightClick,{clientX:Y.clientX,clientY:Y.clientY},G))},[y]),E=ne.useCallback(G=>{y(fe.BackgroundLongPress,si(fe.BackgroundLongPress,{clientX:G.x,clientY:G.y},G))},[y]),D=ne.useCallback(G=>{y(fe.BackgroundClick,si(fe.BackgroundClick,{clientX:G.x,clientY:G.y},G))},[y]),R=ne.useCallback((G,Y,V)=>{y(fe.NodeRightClick,si(fe.NodeRightClick,{clientX:V.clientX,clientY:V.clientY},{x:Y.x,y:Y.y},{nodeId:G}))},[y]),_=ne.useCallback((G,Y,V)=>{y(fe.NodeLongPress,si(fe.NodeLongPress,{clientX:V.x,clientY:V.y},{x:Y.x,y:Y.y},{nodeId:G}))},[y]),N=ne.useCallback((G,Y,V)=>{y(fe.EdgeClick,si(fe.EdgeClick,{clientX:V.clientX,clientY:V.clientY},{x:V.clientX,y:V.clientY},{edgeId:G,edgeData:Y}))},[y]),T=ne.useCallback((G,Y,V)=>{y(fe.EdgeDoubleClick,si(fe.EdgeDoubleClick,{clientX:V.clientX,clientY:V.clientY},{x:V.clientX,y:V.clientY},{edgeId:G,edgeData:Y}))},[y]),O=ne.useCallback((G,Y,V)=>{y(fe.EdgeRightClick,si(fe.EdgeRightClick,{clientX:V.clientX,clientY:V.clientY},{x:V.clientX,y:V.clientY},{edgeId:G,edgeData:Y}))},[y]),M=ne.useCallback((G,Y)=>{console.log("[edge:hover]",G)},[]),$=ne.useCallback(G=>{console.log("[edge:leave]",G)},[]),L=ne.useCallback((G,Y)=>{console.log("[selection]",{nodes:[...G],edge:Y})},[]),X=ne.useCallback(G=>{console.log("[viewport]",{zoom:G.zoom.toFixed(2),pan:G.pan})},[]),ae=ne.useCallback(G=>{console.log("[drag:start]",G)},[]),te=ne.useCallback((G,Y)=>{console.log("[drag:end]",G,Object.fromEntries(Y))},[]),me=ne.useCallback((G,Y)=>{console.log("[hover]",G)},[]),ce=ne.useCallback(G=>{console.log("[leave]",G)},[]),j=ne.useCallback(async G=>{const Y=G.ui_properties;h((Y==null?void 0:Y.x)??0,(Y==null?void 0:Y.y)??0,G.label)},[h]),I=ne.useCallback(async G=>g(G),[g]);return z.jsxs(X5,{onCreateNode:j,onDeleteNode:I,children:[z.jsx(V6,{}),z.jsx("div",{className:"w-screen h-screen pl-64 box-border",children:z.jsxs(o5,{renderNode:G=>z.jsx($6,{...G}),style:{background:"linear-gradient(145deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%)"},onNodeClick:v,onNodeDoubleClick:w,onNodeTripleClick:S,onNodeRightClick:R,onNodeLongPress:_,onNodeHover:me,onNodeLeave:ce,onEdgeClick:N,onEdgeDoubleClick:T,onEdgeRightClick:O,onEdgeHover:M,onEdgeLeave:$,onSelectionChange:L,onViewportChange:X,onDragStart:ae,onDragEnd:te,onBackgroundClick:D,onBackgroundDoubleClick:A,onBackgroundRightClick:x,onBackgroundLongPress:E,children:[z.jsx(B5,{}),z.jsx(O5,{})]})}),z.jsx(T5,{}),z.jsx(q6,{nodeCount:l,onSetNodes:m})]})}function K6(){return z.jsx(iA,{children:z.jsx(HN,{isDark:!0,children:z.jsx(X6,{})})})}US.createRoot(document.getElementById("root")).render(z.jsx(Ji.StrictMode,{children:z.jsx(K6,{})}));
