@dudousxd/nestjs-durable-dashboard 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,62 @@
1
+ var Dd=e=>{throw TypeError(e)};var lu=(e,t,n)=>t.has(e)||Dd("Cannot "+n);var C=(e,t,n)=>(lu(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?Dd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Q=(e,t,n,r)=>(lu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),te=(e,t,n)=>(lu(e,t,"access private method"),n);var Xs=(e,t,n,r)=>({set _(i){Q(e,t,i,n)},get _(){return C(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function yp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vp={exports:{}},El={},xp={exports:{}},re={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var $s=Symbol.for("react.element"),Fv=Symbol.for("react.portal"),Hv=Symbol.for("react.fragment"),Bv=Symbol.for("react.strict_mode"),Vv=Symbol.for("react.profiler"),Uv=Symbol.for("react.provider"),Qv=Symbol.for("react.context"),Wv=Symbol.for("react.forward_ref"),Xv=Symbol.for("react.suspense"),Yv=Symbol.for("react.memo"),qv=Symbol.for("react.lazy"),Ad=Symbol.iterator;function Kv(e){return e===null||typeof e!="object"?null:(e=Ad&&e[Ad]||e["@@iterator"],typeof e=="function"?e:null)}var wp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sp=Object.assign,kp={};function wi(e,t,n){this.props=e,this.context=t,this.refs=kp,this.updater=n||wp}wi.prototype.isReactComponent={};wi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};wi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ep(){}Ep.prototype=wi.prototype;function gc(e,t,n){this.props=e,this.context=t,this.refs=kp,this.updater=n||wp}var yc=gc.prototype=new Ep;yc.constructor=gc;Sp(yc,wi.prototype);yc.isPureReactComponent=!0;var Ld=Array.isArray,_p=Object.prototype.hasOwnProperty,vc={current:null},Np={key:!0,ref:!0,__self:!0,__source:!0};function Cp(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)_p.call(t,r)&&!Np.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),a=0;a<l;a++)u[a]=arguments[a+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:$s,type:e,key:s,ref:o,props:i,_owner:vc.current}}function Gv(e,t){return{$$typeof:$s,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xc(e){return typeof e=="object"&&e!==null&&e.$$typeof===$s}function Zv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Od=/\/+/g;function uu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zv(""+e.key):t.toString(36)}function ko(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case $s:case Fv:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+uu(o,0):r,Ld(i)?(n="",e!=null&&(n=e.replace(Od,"$&/")+"/"),ko(i,t,n,"",function(a){return a})):i!=null&&(xc(i)&&(i=Gv(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Od,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Ld(e))for(var l=0;l<e.length;l++){s=e[l];var u=r+uu(s,l);o+=ko(s,t,n,u,i)}else if(u=Kv(e),typeof u=="function")for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=r+uu(s,l++),o+=ko(s,t,n,u,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ys(e,t,n){if(e==null)return e;var r=[],i=0;return ko(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Jv(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ue={current:null},Eo={transition:null},ex={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Eo,ReactCurrentOwner:vc};function Mp(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Ys,forEach:function(e,t,n){Ys(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ys(e,function(){t++}),t},toArray:function(e){return Ys(e,function(t){return t})||[]},only:function(e){if(!xc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=wi;re.Fragment=Hv;re.Profiler=Vv;re.PureComponent=gc;re.StrictMode=Bv;re.Suspense=Xv;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ex;re.act=Mp;re.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Sp({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=vc.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)_p.call(t,u)&&!Np.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var a=0;a<u;a++)l[a]=arguments[a+2];r.children=l}return{$$typeof:$s,type:e.type,key:i,ref:s,props:r,_owner:o}};re.createContext=function(e){return e={$$typeof:Qv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Uv,_context:e},e.Consumer=e};re.createElement=Cp;re.createFactory=function(e){var t=Cp.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:Wv,render:e}};re.isValidElement=xc;re.lazy=function(e){return{$$typeof:qv,_payload:{_status:-1,_result:e},_init:Jv}};re.memo=function(e,t){return{$$typeof:Yv,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Eo.transition;Eo.transition={};try{e()}finally{Eo.transition=t}};re.unstable_act=Mp;re.useCallback=function(e,t){return Ue.current.useCallback(e,t)};re.useContext=function(e){return Ue.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};re.useEffect=function(e,t){return Ue.current.useEffect(e,t)};re.useId=function(){return Ue.current.useId()};re.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Ue.current.useMemo(e,t)};re.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};re.useRef=function(e){return Ue.current.useRef(e)};re.useState=function(e){return Ue.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return Ue.current.useTransition()};re.version="18.3.1";xp.exports=re;var R=xp.exports;const tx=yp(R);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var nx=R,rx=Symbol.for("react.element"),ix=Symbol.for("react.fragment"),sx=Object.prototype.hasOwnProperty,ox=nx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lx={key:!0,ref:!0,__self:!0,__source:!0};function Pp(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)sx.call(t,r)&&!lx.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:rx,type:e,key:s,ref:o,props:i,_owner:ox.current}}El.Fragment=ix;El.jsx=Pp;El.jsxs=Pp;vp.exports=El;var g=vp.exports,Si=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},dr=typeof window>"u"||"Deno"in globalThis;function ct(){}function ux(e,t){return typeof e=="function"?e(t):e}function Qu(e){return typeof e=="number"&&e>=0&&e!==1/0}function jp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Lr(e,t){return typeof e=="function"?e(t):e}function kt(e,t){return typeof e=="function"?e(t):e}function Fd(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==wc(o,t.options))return!1}else if(!rs(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||s&&!s(t))}function Hd(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(fr(t.options.mutationKey)!==fr(s))return!1}else if(!rs(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function wc(e,t){return((t==null?void 0:t.queryKeyHashFn)||fr)(e)}function fr(e){return JSON.stringify(e,(t,n)=>Wu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function rs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!rs(e[n],t[n])):!1}function bp(e,t){if(e===t)return e;const n=Bd(e)&&Bd(t);if(n||Wu(e)&&Wu(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,l=n?[]:{};let u=0;for(let a=0;a<o;a++){const f=n?a:s[a];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=bp(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return i===o&&u===i?e:l}return t}function Fo(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Bd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wu(e){if(!Vd(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Vd(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Vd(e){return Object.prototype.toString.call(e)==="[object Object]"}function ax(e){return new Promise(t=>{setTimeout(t,e)})}function Xu(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bp(e,t):t}function cx(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dx(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Sc=Symbol();function zp(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sc?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var er,kn,Xr,lp,fx=(lp=class extends Si{constructor(){super();J(this,er);J(this,kn);J(this,Xr);Q(this,Xr,t=>{if(!dr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,kn)||this.setEventListener(C(this,Xr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,kn))==null||t.call(this),Q(this,kn,void 0))}setEventListener(t){var n;Q(this,Xr,t),(n=C(this,kn))==null||n.call(this),Q(this,kn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,er)!==t&&(Q(this,er,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,er)=="boolean"?C(this,er):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},er=new WeakMap,kn=new WeakMap,Xr=new WeakMap,lp),kc=new fx,Yr,En,qr,up,hx=(up=class extends Si{constructor(){super();J(this,Yr,!0);J(this,En);J(this,qr);Q(this,qr,t=>{if(!dr&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,En)||this.setEventListener(C(this,qr))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,En))==null||t.call(this),Q(this,En,void 0))}setEventListener(t){var n;Q(this,qr,t),(n=C(this,En))==null||n.call(this),Q(this,En,t(this.setOnline.bind(this)))}setOnline(t){C(this,Yr)!==t&&(Q(this,Yr,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,Yr)}},Yr=new WeakMap,En=new WeakMap,qr=new WeakMap,up),Ho=new hx;function Yu(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function px(e){return Math.min(1e3*2**e,3e4)}function Tp(e){return(e??"online")==="online"?Ho.isOnline():!0}var Ip=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function au(e){return e instanceof Ip}function Rp(e){let t=!1,n=0,r=!1,i;const s=Yu(),o=x=>{var S;r||(d(new Ip(x)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},u=()=>{t=!1},a=()=>kc.isFocused()&&(e.networkMode==="always"||Ho.isOnline())&&e.canRun(),f=()=>Tp(e.networkMode)&&e.canRun(),c=x=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,x),i==null||i(),s.resolve(x))},d=x=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,x),i==null||i(),s.reject(x))},h=()=>new Promise(x=>{var S;i=p=>{(r||a())&&x(p)},(S=e.onPause)==null||S.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),v=()=>{if(r)return;let x;const S=n===0?e.initialPromise:void 0;try{x=S??e.fn()}catch(p){x=Promise.reject(p)}Promise.resolve(x).then(c).catch(p=>{var P;if(r)return;const y=e.retry??(dr?0:3),m=e.retryDelay??px,w=typeof m=="function"?m(n,p):m,E=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,p);if(t||!E){d(p);return}n++,(P=e.onFail)==null||P.call(e,n,p),ax(w).then(()=>a()?void 0:h()).then(()=>{t?d(p):v()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:l,continueRetry:u,canStart:f,start:()=>(f()?v():h().then(v),s)}}function mx(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const s=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||o()}return u},batchCalls:l=>(...u)=>{s(()=>{l(...u)})},schedule:s,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Me=mx(),tr,ap,$p=(ap=class{constructor(){J(this,tr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qu(this.gcTime)&&Q(this,tr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dr?1/0:5*60*1e3))}clearGcTimeout(){C(this,tr)&&(clearTimeout(C(this,tr)),Q(this,tr,void 0))}},tr=new WeakMap,ap),Kr,Gr,at,Ae,zs,nr,xt,Vt,cp,gx=(cp=class extends $p{constructor(t){super();J(this,xt);J(this,Kr);J(this,Gr);J(this,at);J(this,Ae);J(this,zs);J(this,nr);Q(this,nr,!1),Q(this,zs,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,at,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,Kr,yx(this.options)),this.state=t.state??C(this,Kr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,Ae))==null?void 0:t.promise}setOptions(t){this.options={...C(this,zs),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,at).remove(this)}setData(t,n){const r=Xu(this.state.data,t,this.options);return te(this,xt,Vt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){te(this,xt,Vt).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=C(this,Ae))==null?void 0:r.promise;return(i=C(this,Ae))==null||i.cancel(t),n?n.then(ct).catch(ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,Kr))}isActive(){return this.observers.some(t=>kt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!jp(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ae))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,Ae))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,at).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,Ae)&&(C(this,nr)?C(this,Ae).cancel({revert:!0}):C(this,Ae).cancelRetry()),this.scheduleGc()),C(this,at).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||te(this,xt,Vt).call(this,{type:"invalidate"})}fetch(t,n){var u,a,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ae))return C(this,Ae).continueRetry(),C(this,Ae).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(Q(this,nr,!0),r.signal)})},s=()=>{const c=zp(this.options,n),d={queryKey:this.queryKey,meta:this.meta};return i(d),Q(this,nr,!1),this.options.persister?this.options.persister(c,d,this):c(d)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(u=this.options.behavior)==null||u.onFetch(o,this),Q(this,Gr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=o.fetchOptions)==null?void 0:a.meta))&&te(this,xt,Vt).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=c=>{var d,h,v,x;au(c)&&c.silent||te(this,xt,Vt).call(this,{type:"error",error:c}),au(c)||((h=(d=C(this,at).config).onError)==null||h.call(d,c,this),(x=(v=C(this,at).config).onSettled)==null||x.call(v,this.state.data,c,this)),this.scheduleGc()};return Q(this,Ae,Rp({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var d,h,v,x;if(c===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(S){l(S);return}(h=(d=C(this,at).config).onSuccess)==null||h.call(d,c,this),(x=(v=C(this,at).config).onSettled)==null||x.call(v,c,this.state.error,this),this.scheduleGc()},onError:l,onFail:(c,d)=>{te(this,xt,Vt).call(this,{type:"failed",failureCount:c,error:d})},onPause:()=>{te(this,xt,Vt).call(this,{type:"pause"})},onContinue:()=>{te(this,xt,Vt).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),C(this,Ae).start()}},Kr=new WeakMap,Gr=new WeakMap,at=new WeakMap,Ae=new WeakMap,zs=new WeakMap,nr=new WeakMap,xt=new WeakSet,Vt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Dp(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return au(i)&&i.revert&&C(this,Gr)?{...C(this,Gr),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Me.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,at).notify({query:this,type:"updated",action:t})})},cp);function Dp(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tp(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var It,dp,vx=(dp=class extends Si{constructor(t={}){super();J(this,It);this.config=t,Q(this,It,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??wc(i,n);let o=this.get(s);return o||(o=new gx({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){C(this,It).has(t.queryHash)||(C(this,It).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,It).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,It).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,It).get(t)}getAll(){return[...C(this,It).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fd(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fd(t,r)):n}notify(t){Me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Me.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Me.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},It=new WeakMap,dp),Rt,Fe,rr,$t,pn,fp,xx=(fp=class extends $p{constructor(t){super();J(this,$t);J(this,Rt);J(this,Fe);J(this,rr);this.mutationId=t.mutationId,Q(this,Fe,t.mutationCache),Q(this,Rt,[]),this.state=t.state||Ap(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Rt).includes(t)||(C(this,Rt).push(t),this.clearGcTimeout(),C(this,Fe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Rt,C(this,Rt).filter(n=>n!==t)),this.scheduleGc(),C(this,Fe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Rt).length||(this.state.status==="pending"?this.scheduleGc():C(this,Fe).remove(this))}continue(){var t;return((t=C(this,rr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,l,u,a,f,c,d,h,v,x,S,p,y,m,w,E,P,_;Q(this,rr,Rp({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,z)=>{te(this,$t,pn).call(this,{type:"failed",failureCount:M,error:z})},onPause:()=>{te(this,$t,pn).call(this,{type:"pause"})},onContinue:()=>{te(this,$t,pn).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Fe).canRun(this)}));const n=this.state.status==="pending",r=!C(this,rr).canStart();try{if(!n){te(this,$t,pn).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=C(this,Fe).config).onMutate)==null?void 0:s.call(i,t,this));const z=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));z!==this.state.context&&te(this,$t,pn).call(this,{type:"pending",context:z,variables:t,isPaused:r})}const M=await C(this,rr).start();return await((a=(u=C(this,Fe).config).onSuccess)==null?void 0:a.call(u,M,t,this.state.context,this)),await((c=(f=this.options).onSuccess)==null?void 0:c.call(f,M,t,this.state.context)),await((h=(d=C(this,Fe).config).onSettled)==null?void 0:h.call(d,M,null,this.state.variables,this.state.context,this)),await((x=(v=this.options).onSettled)==null?void 0:x.call(v,M,null,t,this.state.context)),te(this,$t,pn).call(this,{type:"success",data:M}),M}catch(M){try{throw await((p=(S=C(this,Fe).config).onError)==null?void 0:p.call(S,M,t,this.state.context,this)),await((m=(y=this.options).onError)==null?void 0:m.call(y,M,t,this.state.context)),await((E=(w=C(this,Fe).config).onSettled)==null?void 0:E.call(w,void 0,M,this.state.variables,this.state.context,this)),await((_=(P=this.options).onSettled)==null?void 0:_.call(P,void 0,M,t,this.state.context)),M}finally{te(this,$t,pn).call(this,{type:"error",error:M})}}finally{C(this,Fe).runNext(this)}}},Rt=new WeakMap,Fe=new WeakMap,rr=new WeakMap,$t=new WeakSet,pn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Me.batch(()=>{C(this,Rt).forEach(r=>{r.onMutationUpdate(t)}),C(this,Fe).notify({mutation:this,type:"updated",action:t})})},fp);function Ap(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var et,Ts,hp,wx=(hp=class extends Si{constructor(t={}){super();J(this,et);J(this,Ts);this.config=t,Q(this,et,new Map),Q(this,Ts,Date.now())}build(t,n,r){const i=new xx({mutationCache:this,mutationId:++Xs(this,Ts)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=qs(t),r=C(this,et).get(n)??[];r.push(t),C(this,et).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=qs(t);if(C(this,et).has(n)){const i=(r=C(this,et).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?C(this,et).delete(n):C(this,et).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=C(this,et).get(qs(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=C(this,et).get(qs(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Me.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...C(this,et).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hd(n,r))}findAll(t={}){return this.getAll().filter(n=>Hd(t,n))}notify(t){Me.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Me.batch(()=>Promise.all(t.map(n=>n.continue().catch(ct))))}},et=new WeakMap,Ts=new WeakMap,hp);function qs(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Ud(e){return{onFetch:(t,n)=>{var f,c,d,h,v;const r=t.options,i=(d=(c=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:c.fetchMore)==null?void 0:d.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const a=async()=>{let x=!1;const S=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},p=zp(t.options,t.fetchOptions),y=async(m,w,E)=>{if(x)return Promise.reject();if(w==null&&m.pages.length)return Promise.resolve(m);const P={queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};S(P);const _=await p(P),{maxPages:M}=t.options,z=E?dx:cx;return{pages:z(m.pages,_,M),pageParams:z(m.pageParams,w,M)}};if(i&&s.length){const m=i==="backward",w=m?Sx:Qd,E={pages:s,pageParams:o},P=w(r,E);l=await y(E,P,m)}else{const m=e??s.length;do{const w=u===0?o[0]??r.initialPageParam:Qd(r,l);if(u>0&&w==null)break;l=await y(l,w),u++}while(u<m)}return l};t.options.persister?t.fetchFn=()=>{var x,S;return(S=(x=t.options).persister)==null?void 0:S.call(x,a,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=a}}}function Qd(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Sx(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var we,_n,Nn,Zr,Jr,Cn,ei,ti,pp,kx=(pp=class{constructor(e={}){J(this,we);J(this,_n);J(this,Nn);J(this,Zr);J(this,Jr);J(this,Cn);J(this,ei);J(this,ti);Q(this,we,e.queryCache||new vx),Q(this,_n,e.mutationCache||new wx),Q(this,Nn,e.defaultOptions||{}),Q(this,Zr,new Map),Q(this,Jr,new Map),Q(this,Cn,0)}mount(){Xs(this,Cn)._++,C(this,Cn)===1&&(Q(this,ei,kc.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,we).onFocus())})),Q(this,ti,Ho.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,we).onOnline())})))}unmount(){var e,t;Xs(this,Cn)._--,C(this,Cn)===0&&((e=C(this,ei))==null||e.call(this),Q(this,ei,void 0),(t=C(this,ti))==null||t.call(this),Q(this,ti,void 0))}isFetching(e){return C(this,we).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,_n).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,we).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,we).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Lr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,we).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=C(this,we).get(r.queryHash),s=i==null?void 0:i.state.data,o=ux(t,s);if(o!==void 0)return C(this,we).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Me.batch(()=>C(this,we).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,we).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,we);Me.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,we),r={type:"active",...e};return Me.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Me.batch(()=>C(this,we).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ct).catch(ct)}invalidateQueries(e,t={}){return Me.batch(()=>{if(C(this,we).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Me.batch(()=>C(this,we).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(ct)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ct)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,we).build(this,t);return n.isStaleByTime(Lr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ct).catch(ct)}fetchInfiniteQuery(e){return e.behavior=Ud(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ct).catch(ct)}ensureInfiniteQueryData(e){return e.behavior=Ud(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ho.isOnline()?C(this,_n).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,we)}getMutationCache(){return C(this,_n)}getDefaultOptions(){return C(this,Nn)}setDefaultOptions(e){Q(this,Nn,e)}setQueryDefaults(e,t){C(this,Zr).set(fr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Zr).values()],n={};return t.forEach(r=>{rs(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,Jr).set(fr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Jr).values()];let n={};return t.forEach(r=>{rs(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,Nn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=wc(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Sc&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,Nn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,we).clear(),C(this,_n).clear()}},we=new WeakMap,_n=new WeakMap,Nn=new WeakMap,Zr=new WeakMap,Jr=new WeakMap,Cn=new WeakMap,ei=new WeakMap,ti=new WeakMap,pp),We,ie,Is,He,ir,ni,Mn,Dt,Rs,ri,ii,sr,or,Pn,si,ae,Oi,qu,Ku,Gu,Zu,Ju,ea,ta,Lp,mp,Ex=(mp=class extends Si{constructor(t,n){super();J(this,ae);J(this,We);J(this,ie);J(this,Is);J(this,He);J(this,ir);J(this,ni);J(this,Mn);J(this,Dt);J(this,Rs);J(this,ri);J(this,ii);J(this,sr);J(this,or);J(this,Pn);J(this,si,new Set);this.options=n,Q(this,We,t),Q(this,Dt,null),Q(this,Mn,Yu()),this.options.experimental_prefetchInRender||C(this,Mn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ie).addObserver(this),Wd(C(this,ie),this.options)?te(this,ae,Oi).call(this):this.updateResult(),te(this,ae,Zu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return na(C(this,ie),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return na(C(this,ie),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,te(this,ae,Ju).call(this),te(this,ae,ea).call(this),C(this,ie).removeObserver(this)}setOptions(t,n){const r=this.options,i=C(this,ie);if(this.options=C(this,We).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kt(this.options.enabled,C(this,ie))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");te(this,ae,ta).call(this),C(this,ie).setOptions(this.options),r._defaulted&&!Fo(this.options,r)&&C(this,We).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ie),observer:this});const s=this.hasListeners();s&&Xd(C(this,ie),i,this.options,r)&&te(this,ae,Oi).call(this),this.updateResult(n),s&&(C(this,ie)!==i||kt(this.options.enabled,C(this,ie))!==kt(r.enabled,C(this,ie))||Lr(this.options.staleTime,C(this,ie))!==Lr(r.staleTime,C(this,ie)))&&te(this,ae,qu).call(this);const o=te(this,ae,Ku).call(this);s&&(C(this,ie)!==i||kt(this.options.enabled,C(this,ie))!==kt(r.enabled,C(this,ie))||o!==C(this,Pn))&&te(this,ae,Gu).call(this,o)}getOptimisticResult(t){const n=C(this,We).getQueryCache().build(C(this,We),t),r=this.createResult(n,t);return Nx(this,r)&&(Q(this,He,r),Q(this,ni,this.options),Q(this,ir,C(this,ie).state)),r}getCurrentResult(){return C(this,He)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){C(this,si).add(t)}getCurrentQuery(){return C(this,ie)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,We).defaultQueryOptions(t),r=C(this,We).getQueryCache().build(C(this,We),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return te(this,ae,Oi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,He)))}createResult(t,n){var M;const r=C(this,ie),i=this.options,s=C(this,He),o=C(this,ir),l=C(this,ni),a=t!==r?t.state:C(this,Is),{state:f}=t;let c={...f},d=!1,h;if(n._optimisticResults){const z=this.hasListeners(),T=!z&&Wd(t,n),A=z&&Xd(t,r,n,i);(T||A)&&(c={...c,...Dp(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:v,errorUpdatedAt:x,status:S}=c;if(n.select&&c.data!==void 0)if(s&&c.data===(o==null?void 0:o.data)&&n.select===C(this,Rs))h=C(this,ri);else try{Q(this,Rs,n.select),h=n.select(c.data),h=Xu(s==null?void 0:s.data,h,n),Q(this,ri,h),Q(this,Dt,null)}catch(z){Q(this,Dt,z)}else h=c.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let z;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))z=s.data;else if(z=typeof n.placeholderData=="function"?n.placeholderData((M=C(this,ii))==null?void 0:M.state.data,C(this,ii)):n.placeholderData,n.select&&z!==void 0)try{z=n.select(z),Q(this,Dt,null)}catch(T){Q(this,Dt,T)}z!==void 0&&(S="success",h=Xu(s==null?void 0:s.data,z,n),d=!0)}C(this,Dt)&&(v=C(this,Dt),h=C(this,ri),x=Date.now(),S="error");const p=c.fetchStatus==="fetching",y=S==="pending",m=S==="error",w=y&&p,E=h!==void 0,_={status:S,fetchStatus:c.fetchStatus,isPending:y,isSuccess:S==="success",isError:m,isInitialLoading:w,isLoading:w,data:h,dataUpdatedAt:c.dataUpdatedAt,error:v,errorUpdatedAt:x,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>a.dataUpdateCount||c.errorUpdateCount>a.errorUpdateCount,isFetching:p,isRefetching:p&&!y,isLoadingError:m&&!E,isPaused:c.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:m&&E,isStale:Ec(t,n),refetch:this.refetch,promise:C(this,Mn)};if(this.options.experimental_prefetchInRender){const z=F=>{_.status==="error"?F.reject(_.error):_.data!==void 0&&F.resolve(_.data)},T=()=>{const F=Q(this,Mn,_.promise=Yu());z(F)},A=C(this,Mn);switch(A.status){case"pending":t.queryHash===r.queryHash&&z(A);break;case"fulfilled":(_.status==="error"||_.data!==A.value)&&T();break;case"rejected":(_.status!=="error"||_.error!==A.reason)&&T();break}}return _}updateResult(t){const n=C(this,He),r=this.createResult(C(this,ie),this.options);if(Q(this,ir,C(this,ie).state),Q(this,ni,this.options),C(this,ir).data!==void 0&&Q(this,ii,C(this,ie)),Fo(r,n))return;Q(this,He,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!C(this,si).size)return!0;const u=new Set(l??C(this,si));return this.options.throwOnError&&u.add("error"),Object.keys(C(this,He)).some(a=>{const f=a;return C(this,He)[f]!==n[f]&&u.has(f)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),te(this,ae,Lp).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&te(this,ae,Zu).call(this)}},We=new WeakMap,ie=new WeakMap,Is=new WeakMap,He=new WeakMap,ir=new WeakMap,ni=new WeakMap,Mn=new WeakMap,Dt=new WeakMap,Rs=new WeakMap,ri=new WeakMap,ii=new WeakMap,sr=new WeakMap,or=new WeakMap,Pn=new WeakMap,si=new WeakMap,ae=new WeakSet,Oi=function(t){te(this,ae,ta).call(this);let n=C(this,ie).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ct)),n},qu=function(){te(this,ae,Ju).call(this);const t=Lr(this.options.staleTime,C(this,ie));if(dr||C(this,He).isStale||!Qu(t))return;const r=jp(C(this,He).dataUpdatedAt,t)+1;Q(this,sr,setTimeout(()=>{C(this,He).isStale||this.updateResult()},r))},Ku=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ie)):this.options.refetchInterval)??!1},Gu=function(t){te(this,ae,ea).call(this),Q(this,Pn,t),!(dr||kt(this.options.enabled,C(this,ie))===!1||!Qu(C(this,Pn))||C(this,Pn)===0)&&Q(this,or,setInterval(()=>{(this.options.refetchIntervalInBackground||kc.isFocused())&&te(this,ae,Oi).call(this)},C(this,Pn)))},Zu=function(){te(this,ae,qu).call(this),te(this,ae,Gu).call(this,te(this,ae,Ku).call(this))},Ju=function(){C(this,sr)&&(clearTimeout(C(this,sr)),Q(this,sr,void 0))},ea=function(){C(this,or)&&(clearInterval(C(this,or)),Q(this,or,void 0))},ta=function(){const t=C(this,We).getQueryCache().build(C(this,We),this.options);if(t===C(this,ie))return;const n=C(this,ie);Q(this,ie,t),Q(this,Is,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lp=function(t){Me.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,He))}),C(this,We).getQueryCache().notify({query:C(this,ie),type:"observerResultsUpdated"})})},mp);function _x(e,t){return kt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wd(e,t){return _x(e,t)||e.state.data!==void 0&&na(e,t,t.refetchOnMount)}function na(e,t,n){if(kt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ec(e,t)}return!1}function Xd(e,t,n,r){return(e!==t||kt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ec(e,n)}function Ec(e,t){return kt(t.enabled,e)!==!1&&e.isStaleByTime(Lr(t.staleTime,e))}function Nx(e,t){return!Fo(e.getCurrentResult(),t)}var jn,bn,Xe,Wt,Jt,_o,ra,gp,Cx=(gp=class extends Si{constructor(n,r){super();J(this,Jt);J(this,jn);J(this,bn);J(this,Xe);J(this,Wt);Q(this,jn,n),this.setOptions(r),this.bindMethods(),te(this,Jt,_o).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=C(this,jn).defaultMutationOptions(n),Fo(this.options,r)||C(this,jn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,Xe),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&fr(r.mutationKey)!==fr(this.options.mutationKey)?this.reset():((i=C(this,Xe))==null?void 0:i.state.status)==="pending"&&C(this,Xe).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,Xe))==null||n.removeObserver(this)}onMutationUpdate(n){te(this,Jt,_o).call(this),te(this,Jt,ra).call(this,n)}getCurrentResult(){return C(this,bn)}reset(){var n;(n=C(this,Xe))==null||n.removeObserver(this),Q(this,Xe,void 0),te(this,Jt,_o).call(this),te(this,Jt,ra).call(this)}mutate(n,r){var i;return Q(this,Wt,r),(i=C(this,Xe))==null||i.removeObserver(this),Q(this,Xe,C(this,jn).getMutationCache().build(C(this,jn),this.options)),C(this,Xe).addObserver(this),C(this,Xe).execute(n)}},jn=new WeakMap,bn=new WeakMap,Xe=new WeakMap,Wt=new WeakMap,Jt=new WeakSet,_o=function(){var r;const n=((r=C(this,Xe))==null?void 0:r.state)??Ap();Q(this,bn,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ra=function(n){Me.batch(()=>{var r,i,s,o,l,u,a,f;if(C(this,Wt)&&this.hasListeners()){const c=C(this,bn).variables,d=C(this,bn).context;(n==null?void 0:n.type)==="success"?((i=(r=C(this,Wt)).onSuccess)==null||i.call(r,n.data,c,d),(o=(s=C(this,Wt)).onSettled)==null||o.call(s,n.data,null,c,d)):(n==null?void 0:n.type)==="error"&&((u=(l=C(this,Wt)).onError)==null||u.call(l,n.error,c,d),(f=(a=C(this,Wt)).onSettled)==null||f.call(a,void 0,n.error,c,d))}this.listeners.forEach(c=>{c(C(this,bn))})})},gp),Op=R.createContext(void 0),_l=e=>{const t=R.useContext(Op);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Mx=({client:e,children:t})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(Op.Provider,{value:e,children:t})),Fp=R.createContext(!1),Px=()=>R.useContext(Fp);Fp.Provider;function jx(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bx=R.createContext(jx()),zx=()=>R.useContext(bx);function Hp(e,t){return typeof e=="function"?e(...t):!!e}function ia(){}var Tx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Ix=e=>{R.useEffect(()=>{e.clearReset()},[e])},Rx=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Hp(n,[e.error,r]),$x=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Dx=(e,t)=>e.isLoading&&e.isFetching&&!t,Ax=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yd=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Lx(e,t,n){var f,c,d,h,v;const r=_l(),i=Px(),s=zx(),o=r.defaultQueryOptions(e);(c=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||c.call(f,o),o._optimisticResults=i?"isRestoring":"optimistic",$x(o),Tx(o,s),Ix(s);const l=!r.getQueryCache().get(o.queryHash),[u]=R.useState(()=>new t(r,o)),a=u.getOptimisticResult(o);if(R.useSyncExternalStore(R.useCallback(x=>{const S=i?ia:u.subscribe(Me.batchCalls(x));return u.updateResult(),S},[u,i]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),R.useEffect(()=>{u.setOptions(o,{listeners:!1})},[o,u]),Ax(o,a))throw Yd(o,u,s);if(Rx({result:a,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw a.error;if((h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||h.call(d,o,a),o.experimental_prefetchInRender&&!dr&&Dx(a,i)){const x=l?Yd(o,u,s):(v=r.getQueryCache().get(o.queryHash))==null?void 0:v.promise;x==null||x.catch(ia).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?a:u.trackResult(a)}function sa(e,t){return Lx(e,Ex)}function No(e,t){const n=_l(),[r]=R.useState(()=>new Cx(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);const i=R.useSyncExternalStore(R.useCallback(o=>r.subscribe(Me.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=R.useCallback((o,l)=>{r.mutate(o,l).catch(ia)},[r]);if(i.error&&Hp(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Bp={exports:{}},lt={},Vp={exports:{}},Up={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(N,j){var I=N.length;N.push(j);e:for(;0<I;){var L=I-1>>>1,H=N[L];if(0<i(H,j))N[L]=j,N[I]=H,I=L;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var j=N[0],I=N.pop();if(I!==j){N[0]=I;e:for(var L=0,H=N.length,q=H>>>1;L<q;){var U=2*(L+1)-1,Y=N[U],X=U+1,G=N[X];if(0>i(Y,I))X<H&&0>i(G,Y)?(N[L]=G,N[X]=I,L=X):(N[L]=Y,N[U]=I,L=U);else if(X<H&&0>i(G,I))N[L]=G,N[X]=I,L=X;else break e}}return j}function i(N,j){var I=N.sortIndex-j.sortIndex;return I!==0?I:N.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],a=[],f=1,c=null,d=3,h=!1,v=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(N){for(var j=n(a);j!==null;){if(j.callback===null)r(a);else if(j.startTime<=N)r(a),j.sortIndex=j.expirationTime,t(u,j);else break;j=n(a)}}function w(N){if(x=!1,m(N),!v)if(n(u)!==null)v=!0,b(E);else{var j=n(a);j!==null&&D(w,j.startTime-N)}}function E(N,j){v=!1,x&&(x=!1,p(M),M=-1),h=!0;var I=d;try{for(m(j),c=n(u);c!==null&&(!(c.expirationTime>j)||N&&!A());){var L=c.callback;if(typeof L=="function"){c.callback=null,d=c.priorityLevel;var H=L(c.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?c.callback=H:c===n(u)&&r(u),m(j)}else r(u);c=n(u)}if(c!==null)var q=!0;else{var U=n(a);U!==null&&D(w,U.startTime-j),q=!1}return q}finally{c=null,d=I,h=!1}}var P=!1,_=null,M=-1,z=5,T=-1;function A(){return!(e.unstable_now()-T<z)}function F(){if(_!==null){var N=e.unstable_now();T=N;var j=!0;try{j=_(!0,N)}finally{j?O():(P=!1,_=null)}}else P=!1}var O;if(typeof y=="function")O=function(){y(F)};else if(typeof MessageChannel<"u"){var k=new MessageChannel,$=k.port2;k.port1.onmessage=F,O=function(){$.postMessage(null)}}else O=function(){S(F,0)};function b(N){_=N,P||(P=!0,O())}function D(N,j){M=S(function(){N(e.unstable_now())},j)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){v||h||(v=!0,b(E))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(N){switch(d){case 1:case 2:case 3:var j=3;break;default:j=d}var I=d;d=j;try{return N()}finally{d=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,j){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var I=d;d=N;try{return j()}finally{d=I}},e.unstable_scheduleCallback=function(N,j,I){var L=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?L+I:L):I=L,N){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=I+H,N={id:f++,callback:j,priorityLevel:N,startTime:I,expirationTime:H,sortIndex:-1},I>L?(N.sortIndex=I,t(a,N),n(u)===null&&N===n(a)&&(x?(p(M),M=-1):x=!0,D(w,I-L))):(N.sortIndex=H,t(u,N),v||h||(v=!0,b(E))),N},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(N){var j=d;return function(){var I=d;d=j;try{return N.apply(this,arguments)}finally{d=I}}}})(Up);Vp.exports=Up;var Ox=Vp.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Fx=R,st=Ox;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Qp=new Set,is={};function wr(e,t){oi(e,t),oi(e+"Capture",t)}function oi(e,t){for(is[e]=t,e=0;e<t.length;e++)Qp.add(t[e])}var en=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oa=Object.prototype.hasOwnProperty,Hx=/^[: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]*$/,qd={},Kd={};function Bx(e){return oa.call(Kd,e)?!0:oa.call(qd,e)?!1:Hx.test(e)?Kd[e]=!0:(qd[e]=!0,!1)}function Vx(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ux(e,t,n,r){if(t===null||typeof t>"u"||Vx(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qe(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ie[e]=new Qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ie[t]=new Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ie[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ie[e]=new Qe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ie[e]=new Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ie[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ie[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ie[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ie[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var _c=/[\-:]([a-z])/g;function Nc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_c,Nc);Ie[t]=new Qe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_c,Nc);Ie[t]=new Qe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_c,Nc);Ie[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ie[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ie[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Cc(e,t,n,r){var i=Ie.hasOwnProperty(t)?Ie[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ux(t,n,i,r)&&(n=null),r||i===null?Bx(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var on=Fx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ks=Symbol.for("react.element"),_r=Symbol.for("react.portal"),Nr=Symbol.for("react.fragment"),Mc=Symbol.for("react.strict_mode"),la=Symbol.for("react.profiler"),Wp=Symbol.for("react.provider"),Xp=Symbol.for("react.context"),Pc=Symbol.for("react.forward_ref"),ua=Symbol.for("react.suspense"),aa=Symbol.for("react.suspense_list"),jc=Symbol.for("react.memo"),mn=Symbol.for("react.lazy"),Yp=Symbol.for("react.offscreen"),Gd=Symbol.iterator;function ji(e){return e===null||typeof e!="object"?null:(e=Gd&&e[Gd]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,cu;function Fi(e){if(cu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);cu=t&&t[1]||""}return`
34
+ `+cu+e}var du=!1;function fu(e,t){if(!e||du)return"";du=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(a){var r=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){r=a}e.call(t.prototype)}else{try{throw Error()}catch(a){r=a}e()}}catch(a){if(a&&r&&typeof a.stack=="string"){for(var i=a.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var u=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{du=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fi(e):""}function Qx(e){switch(e.tag){case 5:return Fi(e.type);case 16:return Fi("Lazy");case 13:return Fi("Suspense");case 19:return Fi("SuspenseList");case 0:case 2:case 15:return e=fu(e.type,!1),e;case 11:return e=fu(e.type.render,!1),e;case 1:return e=fu(e.type,!0),e;default:return""}}function ca(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Nr:return"Fragment";case _r:return"Portal";case la:return"Profiler";case Mc:return"StrictMode";case ua:return"Suspense";case aa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xp:return(e.displayName||"Context")+".Consumer";case Wp:return(e._context.displayName||"Context")+".Provider";case Pc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jc:return t=e.displayName||null,t!==null?t:ca(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return ca(e(t))}catch{}}return null}function Wx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ca(t);case 8:return t===Mc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Hn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xx(e){var t=qp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gs(e){e._valueTracker||(e._valueTracker=Xx(e))}function Kp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function da(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Hn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Gp(e,t){t=t.checked,t!=null&&Cc(e,"checked",t,!1)}function fa(e,t){Gp(e,t);var n=Hn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ha(e,t.type,n):t.hasOwnProperty("defaultValue")&&ha(e,t.type,Hn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ha(e,t,n){(t!=="number"||Bo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Hi=Array.isArray;function Or(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Hn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function pa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ef(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(Hi(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Hn(n)}}function Zp(e,t){var n=Hn(t.value),r=Hn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function tf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ma(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zs,e0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Zs=Zs||document.createElement("div"),Zs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ss(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yx=["Webkit","ms","Moz","O"];Object.keys(Wi).forEach(function(e){Yx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wi[t]=Wi[e]})});function t0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Wi.hasOwnProperty(e)&&Wi[e]?(""+t).trim():t+"px"}function n0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=t0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var qx=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ga(e,t){if(t){if(qx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function ya(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var va=null;function bc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xa=null,Fr=null,Hr=null;function nf(e){if(e=Ls(e)){if(typeof xa!="function")throw Error(B(280));var t=e.stateNode;t&&(t=jl(t),xa(e.stateNode,e.type,t))}}function r0(e){Fr?Hr?Hr.push(e):Hr=[e]:Fr=e}function i0(){if(Fr){var e=Fr,t=Hr;if(Hr=Fr=null,nf(e),t)for(e=0;e<t.length;e++)nf(t[e])}}function s0(e,t){return e(t)}function o0(){}var hu=!1;function l0(e,t,n){if(hu)return e(t,n);hu=!0;try{return s0(e,t,n)}finally{hu=!1,(Fr!==null||Hr!==null)&&(o0(),i0())}}function os(e,t){var n=e.stateNode;if(n===null)return null;var r=jl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var wa=!1;if(en)try{var bi={};Object.defineProperty(bi,"passive",{get:function(){wa=!0}}),window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{wa=!1}function Kx(e,t,n,r,i,s,o,l,u){var a=Array.prototype.slice.call(arguments,3);try{t.apply(n,a)}catch(f){this.onError(f)}}var Xi=!1,Vo=null,Uo=!1,Sa=null,Gx={onError:function(e){Xi=!0,Vo=e}};function Zx(e,t,n,r,i,s,o,l,u){Xi=!1,Vo=null,Kx.apply(Gx,arguments)}function Jx(e,t,n,r,i,s,o,l,u){if(Zx.apply(this,arguments),Xi){if(Xi){var a=Vo;Xi=!1,Vo=null}else throw Error(B(198));Uo||(Uo=!0,Sa=a)}}function Sr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function rf(e){if(Sr(e)!==e)throw Error(B(188))}function e1(e){var t=e.alternate;if(!t){if(t=Sr(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return rf(i),e;if(s===r)return rf(i),t;s=s.sibling}throw Error(B(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function a0(e){return e=e1(e),e!==null?c0(e):null}function c0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=c0(e);if(t!==null)return t;e=e.sibling}return null}var d0=st.unstable_scheduleCallback,sf=st.unstable_cancelCallback,t1=st.unstable_shouldYield,n1=st.unstable_requestPaint,Ee=st.unstable_now,r1=st.unstable_getCurrentPriorityLevel,zc=st.unstable_ImmediatePriority,f0=st.unstable_UserBlockingPriority,Qo=st.unstable_NormalPriority,i1=st.unstable_LowPriority,h0=st.unstable_IdlePriority,Nl=null,Lt=null;function s1(e){if(Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Nl,e,void 0,(e.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:u1,o1=Math.log,l1=Math.LN2;function u1(e){return e>>>=0,e===0?32:31-(o1(e)/l1|0)|0}var Js=64,eo=4194304;function Bi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=Bi(l):(s&=o,s!==0&&(r=Bi(s)))}else o=n&~i,o!==0?r=Bi(o):s!==0&&(r=Bi(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ct(t),i=1<<n,r|=e[n],t&=~i;return r}function a1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function c1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Ct(s),l=1<<o,u=i[o];u===-1?(!(l&n)||l&r)&&(i[o]=a1(l,t)):u<=t&&(e.expiredLanes|=l),s&=~l}}function ka(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function p0(){var e=Js;return Js<<=1,!(Js&4194240)&&(Js=64),e}function pu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ds(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ct(t),e[t]=n}function d1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ct(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Tc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ct(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ce=0;function m0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var g0,Ic,y0,v0,x0,Ea=!1,to=[],In=null,Rn=null,$n=null,ls=new Map,us=new Map,xn=[],f1="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 submit".split(" ");function of(e,t){switch(e){case"focusin":case"focusout":In=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":ls.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":us.delete(t.pointerId)}}function zi(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ls(t),t!==null&&Ic(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function h1(e,t,n,r,i){switch(t){case"focusin":return In=zi(In,e,t,n,r,i),!0;case"dragenter":return Rn=zi(Rn,e,t,n,r,i),!0;case"mouseover":return $n=zi($n,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ls.set(s,zi(ls.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,us.set(s,zi(us.get(s)||null,e,t,n,r,i)),!0}return!1}function w0(e){var t=Kn(e.target);if(t!==null){var n=Sr(t);if(n!==null){if(t=n.tag,t===13){if(t=u0(n),t!==null){e.blockedOn=t,x0(e.priority,function(){y0(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_a(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);va=r,n.target.dispatchEvent(r),va=null}else return t=Ls(n),t!==null&&Ic(t),e.blockedOn=n,!1;t.shift()}return!0}function lf(e,t,n){Co(e)&&n.delete(t)}function p1(){Ea=!1,In!==null&&Co(In)&&(In=null),Rn!==null&&Co(Rn)&&(Rn=null),$n!==null&&Co($n)&&($n=null),ls.forEach(lf),us.forEach(lf)}function Ti(e,t){e.blockedOn===t&&(e.blockedOn=null,Ea||(Ea=!0,st.unstable_scheduleCallback(st.unstable_NormalPriority,p1)))}function as(e){function t(i){return Ti(i,e)}if(0<to.length){Ti(to[0],e);for(var n=1;n<to.length;n++){var r=to[n];r.blockedOn===e&&(r.blockedOn=null)}}for(In!==null&&Ti(In,e),Rn!==null&&Ti(Rn,e),$n!==null&&Ti($n,e),ls.forEach(t),us.forEach(t),n=0;n<xn.length;n++)r=xn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<xn.length&&(n=xn[0],n.blockedOn===null);)w0(n),n.blockedOn===null&&xn.shift()}var Br=on.ReactCurrentBatchConfig,Xo=!0;function m1(e,t,n,r){var i=ce,s=Br.transition;Br.transition=null;try{ce=1,Rc(e,t,n,r)}finally{ce=i,Br.transition=s}}function g1(e,t,n,r){var i=ce,s=Br.transition;Br.transition=null;try{ce=4,Rc(e,t,n,r)}finally{ce=i,Br.transition=s}}function Rc(e,t,n,r){if(Xo){var i=_a(e,t,n,r);if(i===null)_u(e,t,r,Yo,n),of(e,r);else if(h1(i,e,t,n,r))r.stopPropagation();else if(of(e,r),t&4&&-1<f1.indexOf(e)){for(;i!==null;){var s=Ls(i);if(s!==null&&g0(s),s=_a(e,t,n,r),s===null&&_u(e,t,r,Yo,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else _u(e,t,r,null,n)}}var Yo=null;function _a(e,t,n,r){if(Yo=null,e=bc(r),e=Kn(e),e!==null)if(t=Sr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=u0(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yo=e,null}function S0(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(r1()){case zc:return 1;case f0:return 4;case Qo:case i1:return 16;case h0:return 536870912;default:return 16}default:return 16}}var zn=null,$c=null,Mo=null;function k0(){if(Mo)return Mo;var e,t=$c,n=t.length,r,i="value"in zn?zn.value:zn.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Mo=i.slice(e,1<r?1-r:void 0)}function Po(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function no(){return!0}function uf(){return!1}function ut(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?no:uf,this.isPropagationStopped=uf,this}return xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=no)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=no)},persist:function(){},isPersistent:no}),t}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dc=ut(ki),As=xe({},ki,{view:0,detail:0}),y1=ut(As),mu,gu,Ii,Cl=xe({},As,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ac,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ii&&(Ii&&e.type==="mousemove"?(mu=e.screenX-Ii.screenX,gu=e.screenY-Ii.screenY):gu=mu=0,Ii=e),mu)},movementY:function(e){return"movementY"in e?e.movementY:gu}}),af=ut(Cl),v1=xe({},Cl,{dataTransfer:0}),x1=ut(v1),w1=xe({},As,{relatedTarget:0}),yu=ut(w1),S1=xe({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),k1=ut(S1),E1=xe({},ki,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_1=ut(E1),N1=xe({},ki,{data:0}),cf=ut(N1),C1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M1={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"},P1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function j1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=P1[e])?!!t[e]:!1}function Ac(){return j1}var b1=xe({},As,{key:function(e){if(e.key){var t=C1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Po(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?M1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ac,charCode:function(e){return e.type==="keypress"?Po(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Po(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z1=ut(b1),T1=xe({},Cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),df=ut(T1),I1=xe({},As,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ac}),R1=ut(I1),$1=xe({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),D1=ut($1),A1=xe({},Cl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),L1=ut(A1),O1=[9,13,27,32],Lc=en&&"CompositionEvent"in window,Yi=null;en&&"documentMode"in document&&(Yi=document.documentMode);var F1=en&&"TextEvent"in window&&!Yi,E0=en&&(!Lc||Yi&&8<Yi&&11>=Yi),ff=" ",hf=!1;function _0(e,t){switch(e){case"keyup":return O1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cr=!1;function H1(e,t){switch(e){case"compositionend":return N0(t);case"keypress":return t.which!==32?null:(hf=!0,ff);case"textInput":return e=t.data,e===ff&&hf?null:e;default:return null}}function B1(e,t){if(Cr)return e==="compositionend"||!Lc&&_0(e,t)?(e=k0(),Mo=$c=zn=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return E0&&t.locale!=="ko"?null:t.data;default:return null}}var V1={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 pf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!V1[e.type]:t==="textarea"}function C0(e,t,n,r){r0(r),t=qo(t,"onChange"),0<t.length&&(n=new Dc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qi=null,cs=null;function U1(e){A0(e,0)}function Ml(e){var t=jr(e);if(Kp(t))return e}function Q1(e,t){if(e==="change")return t}var M0=!1;if(en){var vu;if(en){var xu="oninput"in document;if(!xu){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),xu=typeof mf.oninput=="function"}vu=xu}else vu=!1;M0=vu&&(!document.documentMode||9<document.documentMode)}function gf(){qi&&(qi.detachEvent("onpropertychange",P0),cs=qi=null)}function P0(e){if(e.propertyName==="value"&&Ml(cs)){var t=[];C0(t,cs,e,bc(e)),l0(U1,t)}}function W1(e,t,n){e==="focusin"?(gf(),qi=t,cs=n,qi.attachEvent("onpropertychange",P0)):e==="focusout"&&gf()}function X1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ml(cs)}function Y1(e,t){if(e==="click")return Ml(t)}function q1(e,t){if(e==="input"||e==="change")return Ml(t)}function K1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:K1;function ds(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!oa.call(t,i)||!Pt(e[i],t[i]))return!1}return!0}function yf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vf(e,t){var n=yf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yf(n)}}function j0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?j0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b0(){for(var e=window,t=Bo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bo(e.document)}return t}function Oc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function G1(e){var t=b0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&j0(n.ownerDocument.documentElement,n)){if(r!==null&&Oc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=vf(n,s);var o=vf(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Z1=en&&"documentMode"in document&&11>=document.documentMode,Mr=null,Na=null,Ki=null,Ca=!1;function xf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ca||Mr==null||Mr!==Bo(r)||(r=Mr,"selectionStart"in r&&Oc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ki&&ds(Ki,r)||(Ki=r,r=qo(Na,"onSelect"),0<r.length&&(t=new Dc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function ro(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pr={animationend:ro("Animation","AnimationEnd"),animationiteration:ro("Animation","AnimationIteration"),animationstart:ro("Animation","AnimationStart"),transitionend:ro("Transition","TransitionEnd")},wu={},z0={};en&&(z0=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function Pl(e){if(wu[e])return wu[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in z0)return wu[e]=t[n];return e}var T0=Pl("animationend"),I0=Pl("animationiteration"),R0=Pl("animationstart"),$0=Pl("transitionend"),D0=new Map,wf="abort auxClick 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(" ");function Un(e,t){D0.set(e,t),wr(t,[e])}for(var Su=0;Su<wf.length;Su++){var ku=wf[Su],J1=ku.toLowerCase(),ew=ku[0].toUpperCase()+ku.slice(1);Un(J1,"on"+ew)}Un(T0,"onAnimationEnd");Un(I0,"onAnimationIteration");Un(R0,"onAnimationStart");Un("dblclick","onDoubleClick");Un("focusin","onFocus");Un("focusout","onBlur");Un($0,"onTransitionEnd");oi("onMouseEnter",["mouseout","mouseover"]);oi("onMouseLeave",["mouseout","mouseover"]);oi("onPointerEnter",["pointerout","pointerover"]);oi("onPointerLeave",["pointerout","pointerover"]);wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wr("onBeforeInput",["compositionend","keypress","textInput","paste"]);wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vi="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(" "),tw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vi));function Sf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Jx(r,t,void 0,e),e.currentTarget=null}function A0(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],u=l.instance,a=l.currentTarget;if(l=l.listener,u!==s&&i.isPropagationStopped())break e;Sf(i,l,a),s=u}else for(o=0;o<r.length;o++){if(l=r[o],u=l.instance,a=l.currentTarget,l=l.listener,u!==s&&i.isPropagationStopped())break e;Sf(i,l,a),s=u}}}if(Uo)throw e=Sa,Uo=!1,Sa=null,e}function he(e,t){var n=t[za];n===void 0&&(n=t[za]=new Set);var r=e+"__bubble";n.has(r)||(L0(t,e,2,!1),n.add(r))}function Eu(e,t,n){var r=0;t&&(r|=4),L0(n,e,r,t)}var io="_reactListening"+Math.random().toString(36).slice(2);function fs(e){if(!e[io]){e[io]=!0,Qp.forEach(function(n){n!=="selectionchange"&&(tw.has(n)||Eu(n,!1,e),Eu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[io]||(t[io]=!0,Eu("selectionchange",!1,t))}}function L0(e,t,n,r){switch(S0(t)){case 1:var i=m1;break;case 4:i=g1;break;default:i=Rc}n=i.bind(null,t,n,e),i=void 0,!wa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function _u(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=Kn(l),o===null)return;if(u=o.tag,u===5||u===6){r=s=o;continue e}l=l.parentNode}}r=r.return}l0(function(){var a=s,f=bc(n),c=[];e:{var d=D0.get(e);if(d!==void 0){var h=Dc,v=e;switch(e){case"keypress":if(Po(n)===0)break e;case"keydown":case"keyup":h=z1;break;case"focusin":v="focus",h=yu;break;case"focusout":v="blur",h=yu;break;case"beforeblur":case"afterblur":h=yu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=af;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=x1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=R1;break;case T0:case I0:case R0:h=k1;break;case $0:h=D1;break;case"scroll":h=y1;break;case"wheel":h=L1;break;case"copy":case"cut":case"paste":h=_1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=df}var x=(t&4)!==0,S=!x&&e==="scroll",p=x?d!==null?d+"Capture":null:d;x=[];for(var y=a,m;y!==null;){m=y;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,p!==null&&(w=os(y,p),w!=null&&x.push(hs(y,w,m)))),S)break;y=y.return}0<x.length&&(d=new h(d,v,null,n,f),c.push({event:d,listeners:x}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==va&&(v=n.relatedTarget||n.fromElement)&&(Kn(v)||v[tn]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(v=n.relatedTarget||n.toElement,h=a,v=v?Kn(v):null,v!==null&&(S=Sr(v),v!==S||v.tag!==5&&v.tag!==6)&&(v=null)):(h=null,v=a),h!==v)){if(x=af,w="onMouseLeave",p="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=df,w="onPointerLeave",p="onPointerEnter",y="pointer"),S=h==null?d:jr(h),m=v==null?d:jr(v),d=new x(w,y+"leave",h,n,f),d.target=S,d.relatedTarget=m,w=null,Kn(f)===a&&(x=new x(p,y+"enter",v,n,f),x.target=m,x.relatedTarget=S,w=x),S=w,h&&v)t:{for(x=h,p=v,y=0,m=x;m;m=kr(m))y++;for(m=0,w=p;w;w=kr(w))m++;for(;0<y-m;)x=kr(x),y--;for(;0<m-y;)p=kr(p),m--;for(;y--;){if(x===p||p!==null&&x===p.alternate)break t;x=kr(x),p=kr(p)}x=null}else x=null;h!==null&&kf(c,d,h,x,!1),v!==null&&S!==null&&kf(c,S,v,x,!0)}}e:{if(d=a?jr(a):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var E=Q1;else if(pf(d))if(M0)E=q1;else{E=X1;var P=W1}else(h=d.nodeName)&&h.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(E=Y1);if(E&&(E=E(e,a))){C0(c,E,n,f);break e}P&&P(e,d,a),e==="focusout"&&(P=d._wrapperState)&&P.controlled&&d.type==="number"&&ha(d,"number",d.value)}switch(P=a?jr(a):window,e){case"focusin":(pf(P)||P.contentEditable==="true")&&(Mr=P,Na=a,Ki=null);break;case"focusout":Ki=Na=Mr=null;break;case"mousedown":Ca=!0;break;case"contextmenu":case"mouseup":case"dragend":Ca=!1,xf(c,n,f);break;case"selectionchange":if(Z1)break;case"keydown":case"keyup":xf(c,n,f)}var _;if(Lc)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Cr?_0(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(E0&&n.locale!=="ko"&&(Cr||M!=="onCompositionStart"?M==="onCompositionEnd"&&Cr&&(_=k0()):(zn=f,$c="value"in zn?zn.value:zn.textContent,Cr=!0)),P=qo(a,M),0<P.length&&(M=new cf(M,e,null,n,f),c.push({event:M,listeners:P}),_?M.data=_:(_=N0(n),_!==null&&(M.data=_)))),(_=F1?H1(e,n):B1(e,n))&&(a=qo(a,"onBeforeInput"),0<a.length&&(f=new cf("onBeforeInput","beforeinput",null,n,f),c.push({event:f,listeners:a}),f.data=_))}A0(c,t)})}function hs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qo(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=os(e,n),s!=null&&r.unshift(hs(e,s,i)),s=os(e,t),s!=null&&r.push(hs(e,s,i))),e=e.return}return r}function kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function kf(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var l=n,u=l.alternate,a=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&a!==null&&(l=a,i?(u=os(n,s),u!=null&&o.unshift(hs(n,u,l))):i||(u=os(n,s),u!=null&&o.push(hs(n,u,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var nw=/\r\n?/g,rw=/\u0000|\uFFFD/g;function Ef(e){return(typeof e=="string"?e:""+e).replace(nw,`
38
+ `).replace(rw,"")}function so(e,t,n){if(t=Ef(t),Ef(e)!==t&&n)throw Error(B(425))}function Ko(){}var Ma=null,Pa=null;function ja(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ba=typeof setTimeout=="function"?setTimeout:void 0,iw=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,sw=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(e){return _f.resolve(null).then(e).catch(ow)}:ba;function ow(e){setTimeout(function(){throw e})}function Nu(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),as(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);as(t)}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Nf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ei=Math.random().toString(36).slice(2),At="__reactFiber$"+Ei,ps="__reactProps$"+Ei,tn="__reactContainer$"+Ei,za="__reactEvents$"+Ei,lw="__reactListeners$"+Ei,uw="__reactHandles$"+Ei;function Kn(e){var t=e[At];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tn]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nf(e);e!==null;){if(n=e[At])return n;e=Nf(e)}return t}e=n,n=e.parentNode}return null}function Ls(e){return e=e[At]||e[tn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function jr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function jl(e){return e[ps]||null}var Ta=[],br=-1;function Qn(e){return{current:e}}function pe(e){0>br||(e.current=Ta[br],Ta[br]=null,br--)}function de(e,t){br++,Ta[br]=e.current,e.current=t}var Bn={},Oe=Qn(Bn),Ge=Qn(!1),hr=Bn;function li(e,t){var n=e.type.contextTypes;if(!n)return Bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ze(e){return e=e.childContextTypes,e!=null}function Go(){pe(Ge),pe(Oe)}function Cf(e,t,n){if(Oe.current!==Bn)throw Error(B(168));de(Oe,t),de(Ge,n)}function O0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(B(108,Wx(e)||"Unknown",i));return xe({},n,r)}function Zo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bn,hr=Oe.current,de(Oe,e),de(Ge,Ge.current),!0}function Mf(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=O0(e,t,hr),r.__reactInternalMemoizedMergedChildContext=e,pe(Ge),pe(Oe),de(Oe,e)):pe(Ge),de(Ge,n)}var Qt=null,bl=!1,Cu=!1;function F0(e){Qt===null?Qt=[e]:Qt.push(e)}function aw(e){bl=!0,F0(e)}function Wn(){if(!Cu&&Qt!==null){Cu=!0;var e=0,t=ce;try{var n=Qt;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Qt=null,bl=!1}catch(i){throw Qt!==null&&(Qt=Qt.slice(e+1)),d0(zc,Wn),i}finally{ce=t,Cu=!1}}return null}var zr=[],Tr=0,Jo=null,el=0,dt=[],ft=0,pr=null,Xt=1,Yt="";function Xn(e,t){zr[Tr++]=el,zr[Tr++]=Jo,Jo=e,el=t}function H0(e,t,n){dt[ft++]=Xt,dt[ft++]=Yt,dt[ft++]=pr,pr=e;var r=Xt;e=Yt;var i=32-Ct(r)-1;r&=~(1<<i),n+=1;var s=32-Ct(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xt=1<<32-Ct(t)+i|n<<i|r,Yt=s+e}else Xt=1<<s|n<<i|r,Yt=e}function Fc(e){e.return!==null&&(Xn(e,1),H0(e,1,0))}function Hc(e){for(;e===Jo;)Jo=zr[--Tr],zr[Tr]=null,el=zr[--Tr],zr[Tr]=null;for(;e===pr;)pr=dt[--ft],dt[ft]=null,Yt=dt[--ft],dt[ft]=null,Xt=dt[--ft],dt[ft]=null}var it=null,rt=null,me=!1,Et=null;function B0(e,t){var n=ht(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Pf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,it=e,rt=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,it=e,rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=pr!==null?{id:Xt,overflow:Yt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ht(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,it=e,rt=null,!0):!1;default:return!1}}function Ia(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ra(e){if(me){var t=rt;if(t){var n=t;if(!Pf(e,t)){if(Ia(e))throw Error(B(418));t=Dn(n.nextSibling);var r=it;t&&Pf(e,t)?B0(r,n):(e.flags=e.flags&-4097|2,me=!1,it=e)}}else{if(Ia(e))throw Error(B(418));e.flags=e.flags&-4097|2,me=!1,it=e}}}function jf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;it=e}function oo(e){if(e!==it)return!1;if(!me)return jf(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ja(e.type,e.memoizedProps)),t&&(t=rt)){if(Ia(e))throw V0(),Error(B(418));for(;t;)B0(e,t),t=Dn(t.nextSibling)}if(jf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rt=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rt=null}}else rt=it?Dn(e.stateNode.nextSibling):null;return!0}function V0(){for(var e=rt;e;)e=Dn(e.nextSibling)}function ui(){rt=it=null,me=!1}function Bc(e){Et===null?Et=[e]:Et.push(e)}var cw=on.ReactCurrentBatchConfig;function Ri(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function lo(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bf(e){var t=e._init;return t(e._payload)}function U0(e){function t(p,y){if(e){var m=p.deletions;m===null?(p.deletions=[y],p.flags|=16):m.push(y)}}function n(p,y){if(!e)return null;for(;y!==null;)t(p,y),y=y.sibling;return null}function r(p,y){for(p=new Map;y!==null;)y.key!==null?p.set(y.key,y):p.set(y.index,y),y=y.sibling;return p}function i(p,y){return p=Fn(p,y),p.index=0,p.sibling=null,p}function s(p,y,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<y?(p.flags|=2,y):m):(p.flags|=2,y)):(p.flags|=1048576,y)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,y,m,w){return y===null||y.tag!==6?(y=Iu(m,p.mode,w),y.return=p,y):(y=i(y,m),y.return=p,y)}function u(p,y,m,w){var E=m.type;return E===Nr?f(p,y,m.props.children,w,m.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===mn&&bf(E)===y.type)?(w=i(y,m.props),w.ref=Ri(p,y,m),w.return=p,w):(w=$o(m.type,m.key,m.props,null,p.mode,w),w.ref=Ri(p,y,m),w.return=p,w)}function a(p,y,m,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==m.containerInfo||y.stateNode.implementation!==m.implementation?(y=Ru(m,p.mode,w),y.return=p,y):(y=i(y,m.children||[]),y.return=p,y)}function f(p,y,m,w,E){return y===null||y.tag!==7?(y=ur(m,p.mode,w,E),y.return=p,y):(y=i(y,m),y.return=p,y)}function c(p,y,m){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Iu(""+y,p.mode,m),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ks:return m=$o(y.type,y.key,y.props,null,p.mode,m),m.ref=Ri(p,null,y),m.return=p,m;case _r:return y=Ru(y,p.mode,m),y.return=p,y;case mn:var w=y._init;return c(p,w(y._payload),m)}if(Hi(y)||ji(y))return y=ur(y,p.mode,m,null),y.return=p,y;lo(p,y)}return null}function d(p,y,m,w){var E=y!==null?y.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return E!==null?null:l(p,y,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ks:return m.key===E?u(p,y,m,w):null;case _r:return m.key===E?a(p,y,m,w):null;case mn:return E=m._init,d(p,y,E(m._payload),w)}if(Hi(m)||ji(m))return E!==null?null:f(p,y,m,w,null);lo(p,m)}return null}function h(p,y,m,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(m)||null,l(y,p,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ks:return p=p.get(w.key===null?m:w.key)||null,u(y,p,w,E);case _r:return p=p.get(w.key===null?m:w.key)||null,a(y,p,w,E);case mn:var P=w._init;return h(p,y,m,P(w._payload),E)}if(Hi(w)||ji(w))return p=p.get(m)||null,f(y,p,w,E,null);lo(y,w)}return null}function v(p,y,m,w){for(var E=null,P=null,_=y,M=y=0,z=null;_!==null&&M<m.length;M++){_.index>M?(z=_,_=null):z=_.sibling;var T=d(p,_,m[M],w);if(T===null){_===null&&(_=z);break}e&&_&&T.alternate===null&&t(p,_),y=s(T,y,M),P===null?E=T:P.sibling=T,P=T,_=z}if(M===m.length)return n(p,_),me&&Xn(p,M),E;if(_===null){for(;M<m.length;M++)_=c(p,m[M],w),_!==null&&(y=s(_,y,M),P===null?E=_:P.sibling=_,P=_);return me&&Xn(p,M),E}for(_=r(p,_);M<m.length;M++)z=h(_,p,M,m[M],w),z!==null&&(e&&z.alternate!==null&&_.delete(z.key===null?M:z.key),y=s(z,y,M),P===null?E=z:P.sibling=z,P=z);return e&&_.forEach(function(A){return t(p,A)}),me&&Xn(p,M),E}function x(p,y,m,w){var E=ji(m);if(typeof E!="function")throw Error(B(150));if(m=E.call(m),m==null)throw Error(B(151));for(var P=E=null,_=y,M=y=0,z=null,T=m.next();_!==null&&!T.done;M++,T=m.next()){_.index>M?(z=_,_=null):z=_.sibling;var A=d(p,_,T.value,w);if(A===null){_===null&&(_=z);break}e&&_&&A.alternate===null&&t(p,_),y=s(A,y,M),P===null?E=A:P.sibling=A,P=A,_=z}if(T.done)return n(p,_),me&&Xn(p,M),E;if(_===null){for(;!T.done;M++,T=m.next())T=c(p,T.value,w),T!==null&&(y=s(T,y,M),P===null?E=T:P.sibling=T,P=T);return me&&Xn(p,M),E}for(_=r(p,_);!T.done;M++,T=m.next())T=h(_,p,M,T.value,w),T!==null&&(e&&T.alternate!==null&&_.delete(T.key===null?M:T.key),y=s(T,y,M),P===null?E=T:P.sibling=T,P=T);return e&&_.forEach(function(F){return t(p,F)}),me&&Xn(p,M),E}function S(p,y,m,w){if(typeof m=="object"&&m!==null&&m.type===Nr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ks:e:{for(var E=m.key,P=y;P!==null;){if(P.key===E){if(E=m.type,E===Nr){if(P.tag===7){n(p,P.sibling),y=i(P,m.props.children),y.return=p,p=y;break e}}else if(P.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===mn&&bf(E)===P.type){n(p,P.sibling),y=i(P,m.props),y.ref=Ri(p,P,m),y.return=p,p=y;break e}n(p,P);break}else t(p,P);P=P.sibling}m.type===Nr?(y=ur(m.props.children,p.mode,w,m.key),y.return=p,p=y):(w=$o(m.type,m.key,m.props,null,p.mode,w),w.ref=Ri(p,y,m),w.return=p,p=w)}return o(p);case _r:e:{for(P=m.key;y!==null;){if(y.key===P)if(y.tag===4&&y.stateNode.containerInfo===m.containerInfo&&y.stateNode.implementation===m.implementation){n(p,y.sibling),y=i(y,m.children||[]),y.return=p,p=y;break e}else{n(p,y);break}else t(p,y);y=y.sibling}y=Ru(m,p.mode,w),y.return=p,p=y}return o(p);case mn:return P=m._init,S(p,y,P(m._payload),w)}if(Hi(m))return v(p,y,m,w);if(ji(m))return x(p,y,m,w);lo(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,y!==null&&y.tag===6?(n(p,y.sibling),y=i(y,m),y.return=p,p=y):(n(p,y),y=Iu(m,p.mode,w),y.return=p,p=y),o(p)):n(p,y)}return S}var ai=U0(!0),Q0=U0(!1),tl=Qn(null),nl=null,Ir=null,Vc=null;function Uc(){Vc=Ir=nl=null}function Qc(e){var t=tl.current;pe(tl),e._currentValue=t}function $a(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vr(e,t){nl=e,Vc=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qe=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Vc!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(nl===null)throw Error(B(308));Ir=e,nl.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var Gn=null;function Wc(e){Gn===null?Gn=[e]:Gn.push(e)}function W0(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Wc(t)):(n.next=i.next,i.next=n),t.interleaved=n,nn(e,r)}function nn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var gn=!1;function Xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function X0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,oe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,nn(e,n)}return i=r.interleaved,i===null?(t.next=t,Wc(r)):(t.next=i.next,i.next=t),r.interleaved=t,nn(e,n)}function jo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tc(e,n)}}function zf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function rl(e,t,n,r){var i=e.updateQueue;gn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,a=u.next;u.next=null,o===null?s=a:o.next=a,o=u;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=a:l.next=a,f.lastBaseUpdate=u))}if(s!==null){var c=i.baseState;o=0,f=a=u=null,l=s;do{var d=l.lane,h=l.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,x=l;switch(d=t,h=n,x.tag){case 1:if(v=x.payload,typeof v=="function"){c=v.call(h,c,d);break e}c=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,d=typeof v=="function"?v.call(h,c,d):v,d==null)break e;c=xe({},c,d);break e;case 2:gn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[l]:d.push(l))}else h={eventTime:h,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(a=f=h,u=c):f=f.next=h,o|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;d=l,l=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(f===null&&(u=c),i.baseState=u,i.firstBaseUpdate=a,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);gr|=o,e.lanes=o,e.memoizedState=c}}function Tf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(B(191,i));i.call(r)}}}var Os={},Ot=Qn(Os),ms=Qn(Os),gs=Qn(Os);function Zn(e){if(e===Os)throw Error(B(174));return e}function Yc(e,t){switch(de(gs,t),de(ms,e),de(Ot,Os),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ma(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ma(t,e)}pe(Ot),de(Ot,t)}function ci(){pe(Ot),pe(ms),pe(gs)}function Y0(e){Zn(gs.current);var t=Zn(Ot.current),n=ma(t,e.type);t!==n&&(de(ms,e),de(Ot,n))}function qc(e){ms.current===e&&(pe(Ot),pe(ms))}var ye=Qn(0);function il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mu=[];function Kc(){for(var e=0;e<Mu.length;e++)Mu[e]._workInProgressVersionPrimary=null;Mu.length=0}var bo=on.ReactCurrentDispatcher,Pu=on.ReactCurrentBatchConfig,mr=0,ve=null,Ce=null,je=null,sl=!1,Gi=!1,ys=0,dw=0;function $e(){throw Error(B(321))}function Gc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pt(e[n],t[n]))return!1;return!0}function Zc(e,t,n,r,i,s){if(mr=s,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bo.current=e===null||e.memoizedState===null?mw:gw,e=n(r,i),Gi){s=0;do{if(Gi=!1,ys=0,25<=s)throw Error(B(301));s+=1,je=Ce=null,t.updateQueue=null,bo.current=yw,e=n(r,i)}while(Gi)}if(bo.current=ol,t=Ce!==null&&Ce.next!==null,mr=0,je=Ce=ve=null,sl=!1,t)throw Error(B(300));return e}function Jc(){var e=ys!==0;return ys=0,e}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?ve.memoizedState=je=e:je=je.next=e,je}function gt(){if(Ce===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=je===null?ve.memoizedState:je.next;if(t!==null)je=t,Ce=e;else{if(e===null)throw Error(B(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},je===null?ve.memoizedState=je=e:je=je.next=e}return je}function vs(e,t){return typeof t=="function"?t(e):t}function ju(e){var t=gt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Ce,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,u=null,a=s;do{var f=a.lane;if((mr&f)===f)u!==null&&(u=u.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),r=a.hasEagerState?a.eagerState:e(r,a.action);else{var c={lane:f,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};u===null?(l=u=c,o=r):u=u.next=c,ve.lanes|=f,gr|=f}a=a.next}while(a!==null&&a!==s);u===null?o=r:u.next=l,Pt(r,t.memoizedState)||(qe=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,ve.lanes|=s,gr|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function bu(e){var t=gt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Pt(s,t.memoizedState)||(qe=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function q0(){}function K0(e,t){var n=ve,r=gt(),i=t(),s=!Pt(r.memoizedState,i);if(s&&(r.memoizedState=i,qe=!0),r=r.queue,ed(J0.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||je!==null&&je.memoizedState.tag&1){if(n.flags|=2048,xs(9,Z0.bind(null,n,r,i,t),void 0,null),be===null)throw Error(B(349));mr&30||G0(n,t,i)}return i}function G0(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Z0(e,t,n,r){t.value=n,t.getSnapshot=r,em(t)&&tm(e)}function J0(e,t,n){return n(function(){em(t)&&tm(e)})}function em(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pt(e,n)}catch{return!0}}function tm(e){var t=nn(e,1);t!==null&&Mt(t,e,1,-1)}function If(e){var t=Tt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:e},t.queue=e,e=e.dispatch=pw.bind(null,ve,e),[t.memoizedState,e]}function xs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function nm(){return gt().memoizedState}function zo(e,t,n,r){var i=Tt();ve.flags|=e,i.memoizedState=xs(1|t,n,void 0,r===void 0?null:r)}function zl(e,t,n,r){var i=gt();r=r===void 0?null:r;var s=void 0;if(Ce!==null){var o=Ce.memoizedState;if(s=o.destroy,r!==null&&Gc(r,o.deps)){i.memoizedState=xs(t,n,s,r);return}}ve.flags|=e,i.memoizedState=xs(1|t,n,s,r)}function Rf(e,t){return zo(8390656,8,e,t)}function ed(e,t){return zl(2048,8,e,t)}function rm(e,t){return zl(4,2,e,t)}function im(e,t){return zl(4,4,e,t)}function sm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function om(e,t,n){return n=n!=null?n.concat([e]):null,zl(4,4,sm.bind(null,t,e),n)}function td(){}function lm(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function um(e,t){var n=gt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function am(e,t,n){return mr&21?(Pt(n,t)||(n=p0(),ve.lanes|=n,gr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qe=!0),e.memoizedState=n)}function fw(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=Pu.transition;Pu.transition={};try{e(!1),t()}finally{ce=n,Pu.transition=r}}function cm(){return gt().memoizedState}function hw(e,t,n){var r=On(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dm(e))fm(t,n);else if(n=W0(e,t,n,r),n!==null){var i=Ve();Mt(n,e,r,i),hm(n,t,r)}}function pw(e,t,n){var r=On(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dm(e))fm(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,Pt(l,o)){var u=t.interleaved;u===null?(i.next=i,Wc(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=W0(e,t,i,r),n!==null&&(i=Ve(),Mt(n,e,r,i),hm(n,t,r))}}function dm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function fm(e,t){Gi=sl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tc(e,n)}}var ol={readContext:mt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},mw={readContext:mt,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Rf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zo(4194308,4,sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return zo(4,2,e,t)},useMemo:function(e,t){var n=Tt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Tt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=hw.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:If,useDebugValue:td,useDeferredValue:function(e){return Tt().memoizedState=e},useTransition:function(){var e=If(!1),t=e[0];return e=fw.bind(null,e[1]),Tt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,i=Tt();if(me){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),be===null)throw Error(B(349));mr&30||G0(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Rf(J0.bind(null,r,s,e),[e]),r.flags|=2048,xs(9,Z0.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Tt(),t=be.identifierPrefix;if(me){var n=Yt,r=Xt;n=(r&~(1<<32-Ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ys++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=dw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},gw={readContext:mt,useCallback:lm,useContext:mt,useEffect:ed,useImperativeHandle:om,useInsertionEffect:rm,useLayoutEffect:im,useMemo:um,useReducer:ju,useRef:nm,useState:function(){return ju(vs)},useDebugValue:td,useDeferredValue:function(e){var t=gt();return am(t,Ce.memoizedState,e)},useTransition:function(){var e=ju(vs)[0],t=gt().memoizedState;return[e,t]},useMutableSource:q0,useSyncExternalStore:K0,useId:cm,unstable_isNewReconciler:!1},yw={readContext:mt,useCallback:lm,useContext:mt,useEffect:ed,useImperativeHandle:om,useInsertionEffect:rm,useLayoutEffect:im,useMemo:um,useReducer:bu,useRef:nm,useState:function(){return bu(vs)},useDebugValue:td,useDeferredValue:function(e){var t=gt();return Ce===null?t.memoizedState=e:am(t,Ce.memoizedState,e)},useTransition:function(){var e=bu(vs)[0],t=gt().memoizedState;return[e,t]},useMutableSource:q0,useSyncExternalStore:K0,useId:cm,unstable_isNewReconciler:!1};function vt(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Da(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tl={isMounted:function(e){return(e=e._reactInternals)?Sr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ve(),i=On(e),s=Kt(r,i);s.payload=t,n!=null&&(s.callback=n),t=An(e,s,i),t!==null&&(Mt(t,e,i,r),jo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ve(),i=On(e),s=Kt(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=An(e,s,i),t!==null&&(Mt(t,e,i,r),jo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ve(),r=On(e),i=Kt(n,r);i.tag=2,t!=null&&(i.callback=t),t=An(e,i,r),t!==null&&(Mt(t,e,r,n),jo(t,e,r))}};function $f(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ds(n,r)||!ds(i,s):!0}function pm(e,t,n){var r=!1,i=Bn,s=t.contextType;return typeof s=="object"&&s!==null?s=mt(s):(i=Ze(t)?hr:Oe.current,r=t.contextTypes,s=(r=r!=null)?li(e,i):Bn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Tl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Df(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Tl.enqueueReplaceState(t,t.state,null)}function Aa(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Xc(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=mt(s):(s=Ze(t)?hr:Oe.current,i.context=li(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Da(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Tl.enqueueReplaceState(i,i.state,null),rl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function di(e,t){try{var n="",r=t;do n+=Qx(r),r=r.return;while(r);var i=n}catch(s){i=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function zu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function La(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var vw=typeof WeakMap=="function"?WeakMap:Map;function mm(e,t,n){n=Kt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ul||(ul=!0,Ya=r),La(e,t)},n}function gm(e,t,n){n=Kt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){La(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){La(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Af(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new vw;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Tw.bind(null,e,t,n),t.then(e,e))}function Lf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Of(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Kt(-1,1),t.tag=2,An(n,t,1))),n.lanes|=1),e)}var xw=on.ReactCurrentOwner,qe=!1;function Be(e,t,n,r){t.child=e===null?Q0(t,null,n,r):ai(t,e.child,n,r)}function Ff(e,t,n,r,i){n=n.render;var s=t.ref;return Vr(t,i),r=Zc(e,t,n,r,s,i),n=Jc(),e!==null&&!qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rn(e,t,i)):(me&&n&&Fc(t),t.flags|=1,Be(e,t,r,i),t.child)}function Hf(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!ad(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,ym(e,t,s,r,i)):(e=$o(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ds,n(o,r)&&e.ref===t.ref)return rn(e,t,i)}return t.flags|=1,e=Fn(s,r),e.ref=t.ref,e.return=t,t.child=e}function ym(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ds(s,r)&&e.ref===t.ref)if(qe=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(qe=!0);else return t.lanes=e.lanes,rn(e,t,i)}return Oa(e,t,n,r,i)}function vm(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},de($r,tt),tt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,de($r,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,de($r,tt),tt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,de($r,tt),tt|=r;return Be(e,t,i,n),t.child}function xm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Oa(e,t,n,r,i){var s=Ze(n)?hr:Oe.current;return s=li(t,s),Vr(t,i),n=Zc(e,t,n,r,s,i),r=Jc(),e!==null&&!qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rn(e,t,i)):(me&&r&&Fc(t),t.flags|=1,Be(e,t,n,i),t.child)}function Bf(e,t,n,r,i){if(Ze(n)){var s=!0;Zo(t)}else s=!1;if(Vr(t,i),t.stateNode===null)To(e,t),pm(t,n,r),Aa(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,a=n.contextType;typeof a=="object"&&a!==null?a=mt(a):(a=Ze(n)?hr:Oe.current,a=li(t,a));var f=n.getDerivedStateFromProps,c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||u!==a)&&Df(t,o,r,a),gn=!1;var d=t.memoizedState;o.state=d,rl(t,r,o,i),u=t.memoizedState,l!==r||d!==u||Ge.current||gn?(typeof f=="function"&&(Da(t,n,f,r),u=t.memoizedState),(l=gn||$f(t,n,l,r,d,u,a))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=a,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,X0(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:vt(t.type,l),o.props=a,c=t.pendingProps,d=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=mt(u):(u=Ze(n)?hr:Oe.current,u=li(t,u));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==c||d!==u)&&Df(t,o,r,u),gn=!1,d=t.memoizedState,o.state=d,rl(t,r,o,i);var v=t.memoizedState;l!==c||d!==v||Ge.current||gn?(typeof h=="function"&&(Da(t,n,h,r),v=t.memoizedState),(a=gn||$f(t,n,a,r,d,v,u)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=u,r=a):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Fa(e,t,n,r,s,i)}function Fa(e,t,n,r,i,s){xm(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Mf(t,n,!1),rn(e,t,s);r=t.stateNode,xw.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ai(t,e.child,null,s),t.child=ai(t,null,l,s)):Be(e,t,l,s),t.memoizedState=r.state,i&&Mf(t,n,!0),t.child}function wm(e){var t=e.stateNode;t.pendingContext?Cf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Cf(e,t.context,!1),Yc(e,t.containerInfo)}function Vf(e,t,n,r,i){return ui(),Bc(i),t.flags|=256,Be(e,t,n,r),t.child}var Ha={dehydrated:null,treeContext:null,retryLane:0};function Ba(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sm(e,t,n){var r=t.pendingProps,i=ye.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),de(ye,i&1),e===null)return Ra(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=$l(o,r,0,null),e=ur(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ba(n),t.memoizedState=Ha,e):nd(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return ww(e,t,o,r,l,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Fn(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Fn(l,s):(s=ur(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Ba(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Ha,r}return s=e.child,e=s.sibling,r=Fn(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function nd(e,t){return t=$l({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function uo(e,t,n,r){return r!==null&&Bc(r),ai(t,e.child,null,n),e=nd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ww(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=zu(Error(B(422))),uo(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=$l({mode:"visible",children:r.children},i,0,null),s=ur(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ai(t,e.child,null,o),t.child.memoizedState=Ba(o),t.memoizedState=Ha,s);if(!(t.mode&1))return uo(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(B(419)),r=zu(s,r,void 0),uo(e,t,o,r)}if(l=(o&e.childLanes)!==0,qe||l){if(r=be,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,nn(e,i),Mt(r,e,i,-1))}return ud(),r=zu(Error(B(421))),uo(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Iw.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,rt=Dn(i.nextSibling),it=t,me=!0,Et=null,e!==null&&(dt[ft++]=Xt,dt[ft++]=Yt,dt[ft++]=pr,Xt=e.id,Yt=e.overflow,pr=t),t=nd(t,r.children),t.flags|=4096,t)}function Uf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),$a(e.return,t,n)}function Tu(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function km(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Be(e,t,r.children,n),r=ye.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uf(e,n,t);else if(e.tag===19)Uf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(de(ye,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&il(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tu(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&il(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tu(t,!0,n,null,s);break;case"together":Tu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function To(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Fn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sw(e,t,n){switch(t.tag){case 3:wm(t),ui();break;case 5:Y0(t);break;case 1:Ze(t.type)&&Zo(t);break;case 4:Yc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;de(tl,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(de(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?Sm(e,t,n):(de(ye,ye.current&1),e=rn(e,t,n),e!==null?e.sibling:null);de(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return km(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,vm(e,t,n)}return rn(e,t,n)}var Em,Va,_m,Nm;Em=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Va=function(){};_m=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Zn(Ot.current);var s=null;switch(n){case"input":i=da(e,i),r=da(e,r),s=[];break;case"select":i=xe({},i,{value:void 0}),r=xe({},r,{value:void 0}),s=[];break;case"textarea":i=pa(e,i),r=pa(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ko)}ga(n,r);var o;n=null;for(a in i)if(!r.hasOwnProperty(a)&&i.hasOwnProperty(a)&&i[a]!=null)if(a==="style"){var l=i[a];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(is.hasOwnProperty(a)?s||(s=[]):(s=s||[]).push(a,null));for(a in r){var u=r[a];if(l=i!=null?i[a]:void 0,r.hasOwnProperty(a)&&u!==l&&(u!=null||l!=null))if(a==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(s||(s=[]),s.push(a,n)),n=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(s=s||[]).push(a,u)):a==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(is.hasOwnProperty(a)?(u!=null&&a==="onScroll"&&he("scroll",e),s||l===u||(s=[])):(s=s||[]).push(a,u))}n&&(s=s||[]).push("style",n);var a=s;(t.updateQueue=a)&&(t.flags|=4)}};Nm=function(e,t,n,r){n!==r&&(t.flags|=4)};function $i(e,t){if(!me)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kw(e,t,n){var r=t.pendingProps;switch(Hc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return Ze(t.type)&&Go(),De(t),null;case 3:return r=t.stateNode,ci(),pe(Ge),pe(Oe),Kc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(oo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Et!==null&&(Ga(Et),Et=null))),Va(e,t),De(t),null;case 5:qc(t);var i=Zn(gs.current);if(n=t.type,e!==null&&t.stateNode!=null)_m(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return De(t),null}if(e=Zn(Ot.current),oo(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[At]=t,r[ps]=s,e=(t.mode&1)!==0,n){case"dialog":he("cancel",r),he("close",r);break;case"iframe":case"object":case"embed":he("load",r);break;case"video":case"audio":for(i=0;i<Vi.length;i++)he(Vi[i],r);break;case"source":he("error",r);break;case"img":case"image":case"link":he("error",r),he("load",r);break;case"details":he("toggle",r);break;case"input":Zd(r,s),he("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},he("invalid",r);break;case"textarea":ef(r,s),he("invalid",r)}ga(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&so(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&so(r.textContent,l,e),i=["children",""+l]):is.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&he("scroll",r)}switch(n){case"input":Gs(r),Jd(r,s,!0);break;case"textarea":Gs(r),tf(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Ko)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[At]=t,e[ps]=r,Em(e,t,!1,!1),t.stateNode=e;e:{switch(o=ya(n,r),n){case"dialog":he("cancel",e),he("close",e),i=r;break;case"iframe":case"object":case"embed":he("load",e),i=r;break;case"video":case"audio":for(i=0;i<Vi.length;i++)he(Vi[i],e);i=r;break;case"source":he("error",e),i=r;break;case"img":case"image":case"link":he("error",e),he("load",e),i=r;break;case"details":he("toggle",e),i=r;break;case"input":Zd(e,r),i=da(e,r),he("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=xe({},r,{value:void 0}),he("invalid",e);break;case"textarea":ef(e,r),i=pa(e,r),he("invalid",e);break;default:i=r}ga(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var u=l[s];s==="style"?n0(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&e0(e,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ss(e,u):typeof u=="number"&&ss(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(is.hasOwnProperty(s)?u!=null&&s==="onScroll"&&he("scroll",e):u!=null&&Cc(e,s,u,o))}switch(n){case"input":Gs(e),Jd(e,r,!1);break;case"textarea":Gs(e),tf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Hn(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Or(e,!!r.multiple,s,!1):r.defaultValue!=null&&Or(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Ko)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return De(t),null;case 6:if(e&&t.stateNode!=null)Nm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Zn(gs.current),Zn(Ot.current),oo(t)){if(r=t.stateNode,n=t.memoizedProps,r[At]=t,(s=r.nodeValue!==n)&&(e=it,e!==null))switch(e.tag){case 3:so(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&so(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[At]=t,t.stateNode=r}return De(t),null;case 13:if(pe(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&rt!==null&&t.mode&1&&!(t.flags&128))V0(),ui(),t.flags|=98560,s=!1;else if(s=oo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(B(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(B(317));s[At]=t}else ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),s=!1}else Et!==null&&(Ga(Et),Et=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ye.current&1?Pe===0&&(Pe=3):ud())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return ci(),Va(e,t),e===null&&fs(t.stateNode.containerInfo),De(t),null;case 10:return Qc(t.type._context),De(t),null;case 17:return Ze(t.type)&&Go(),De(t),null;case 19:if(pe(ye),s=t.memoizedState,s===null)return De(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)$i(s,!1);else{if(Pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=il(e),o!==null){for(t.flags|=128,$i(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return de(ye,ye.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ee()>fi&&(t.flags|=128,r=!0,$i(s,!1),t.lanes=4194304)}else{if(!r)if(e=il(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$i(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!me)return De(t),null}else 2*Ee()-s.renderingStartTime>fi&&n!==1073741824&&(t.flags|=128,r=!0,$i(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ee(),t.sibling=null,n=ye.current,de(ye,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return ld(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Ew(e,t){switch(Hc(t),t.tag){case 1:return Ze(t.type)&&Go(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ci(),pe(Ge),pe(Oe),Kc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qc(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return ci(),null;case 10:return Qc(t.type._context),null;case 22:case 23:return ld(),null;case 24:return null;default:return null}}var ao=!1,Le=!1,_w=typeof WeakSet=="function"?WeakSet:Set,W=null;function Rr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Ua(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Qf=!1;function Nw(e,t){if(Ma=Xo,e=b0(),Oc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,u=-1,a=0,f=0,c=e,d=null;t:for(;;){for(var h;c!==n||i!==0&&c.nodeType!==3||(l=o+i),c!==s||r!==0&&c.nodeType!==3||(u=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(h=c.firstChild)!==null;)d=c,c=h;for(;;){if(c===e)break t;if(d===n&&++a===i&&(l=o),d===s&&++f===r&&(u=o),(h=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=h}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pa={focusedElem:e,selectionRange:n},Xo=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,S=v.memoizedState,p=t.stateNode,y=p.getSnapshotBeforeUpdate(t.elementType===t.type?x:vt(t.type,x),S);p.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(w){Se(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return v=Qf,Qf=!1,v}function Zi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Ua(t,n,s)}i=i.next}while(i!==r)}}function Il(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Cm(e){var t=e.alternate;t!==null&&(e.alternate=null,Cm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[ps],delete t[za],delete t[lw],delete t[uw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mm(e){return e.tag===5||e.tag===3||e.tag===4}function Wf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ko));else if(r!==4&&(e=e.child,e!==null))for(Wa(e,t,n),e=e.sibling;e!==null;)Wa(e,t,n),e=e.sibling}function Xa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Xa(e,t,n),e=e.sibling;e!==null;)Xa(e,t,n),e=e.sibling}var ze=null,wt=!1;function cn(e,t,n){for(n=n.child;n!==null;)Pm(e,t,n),n=n.sibling}function Pm(e,t,n){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Nl,n)}catch{}switch(n.tag){case 5:Le||Rr(n,t);case 6:var r=ze,i=wt;ze=null,cn(e,t,n),ze=r,wt=i,ze!==null&&(wt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(wt?(e=ze,n=n.stateNode,e.nodeType===8?Nu(e.parentNode,n):e.nodeType===1&&Nu(e,n),as(e)):Nu(ze,n.stateNode));break;case 4:r=ze,i=wt,ze=n.stateNode.containerInfo,wt=!0,cn(e,t,n),ze=r,wt=i;break;case 0:case 11:case 14:case 15:if(!Le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Ua(n,t,o),i=i.next}while(i!==r)}cn(e,t,n);break;case 1:if(!Le&&(Rr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Se(n,t,l)}cn(e,t,n);break;case 21:cn(e,t,n);break;case 22:n.mode&1?(Le=(r=Le)||n.memoizedState!==null,cn(e,t,n),Le=r):cn(e,t,n);break;default:cn(e,t,n)}}function Xf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _w),t.forEach(function(r){var i=Rw.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function yt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:ze=l.stateNode,wt=!1;break e;case 3:ze=l.stateNode.containerInfo,wt=!0;break e;case 4:ze=l.stateNode.containerInfo,wt=!0;break e}l=l.return}if(ze===null)throw Error(B(160));Pm(s,o,i),ze=null,wt=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(a){Se(i,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jm(t,e),t=t.sibling}function jm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yt(t,e),zt(e),r&4){try{Zi(3,e,e.return),Il(3,e)}catch(x){Se(e,e.return,x)}try{Zi(5,e,e.return)}catch(x){Se(e,e.return,x)}}break;case 1:yt(t,e),zt(e),r&512&&n!==null&&Rr(n,n.return);break;case 5:if(yt(t,e),zt(e),r&512&&n!==null&&Rr(n,n.return),e.flags&32){var i=e.stateNode;try{ss(i,"")}catch(x){Se(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&Gp(i,s),ya(l,o);var a=ya(l,s);for(o=0;o<u.length;o+=2){var f=u[o],c=u[o+1];f==="style"?n0(i,c):f==="dangerouslySetInnerHTML"?e0(i,c):f==="children"?ss(i,c):Cc(i,f,c,a)}switch(l){case"input":fa(i,s);break;case"textarea":Zp(i,s);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Or(i,!!s.multiple,h,!1):d!==!!s.multiple&&(s.defaultValue!=null?Or(i,!!s.multiple,s.defaultValue,!0):Or(i,!!s.multiple,s.multiple?[]:"",!1))}i[ps]=s}catch(x){Se(e,e.return,x)}}break;case 6:if(yt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(B(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){Se(e,e.return,x)}}break;case 3:if(yt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{as(t.containerInfo)}catch(x){Se(e,e.return,x)}break;case 4:yt(t,e),zt(e);break;case 13:yt(t,e),zt(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(sd=Ee())),r&4&&Xf(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(Le=(a=Le)||f,yt(t,e),Le=a):yt(t,e),zt(e),r&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!f&&e.mode&1)for(W=e,f=e.child;f!==null;){for(c=W=f;W!==null;){switch(d=W,h=d.child,d.tag){case 0:case 11:case 14:case 15:Zi(4,d,d.return);break;case 1:Rr(d,d.return);var v=d.stateNode;if(typeof v.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(x){Se(r,n,x)}}break;case 5:Rr(d,d.return);break;case 22:if(d.memoizedState!==null){qf(c);continue}}h!==null?(h.return=d,W=h):qf(c)}f=f.sibling}e:for(f=null,c=e;;){if(c.tag===5){if(f===null){f=c;try{i=c.stateNode,a?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=c.stateNode,u=c.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=t0("display",o))}catch(x){Se(e,e.return,x)}}}else if(c.tag===6){if(f===null)try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(x){Se(e,e.return,x)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:yt(t,e),zt(e),r&4&&Xf(e);break;case 21:break;default:yt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Mm(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ss(i,""),r.flags&=-33);var s=Wf(e);Xa(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Wf(e);Wa(e,l,o);break;default:throw Error(B(161))}}catch(u){Se(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cw(e,t,n){W=e,bm(e)}function bm(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var i=W,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ao;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||Le;l=ao;var a=Le;if(ao=o,(Le=u)&&!a)for(W=i;W!==null;)o=W,u=o.child,o.tag===22&&o.memoizedState!==null?Kf(i):u!==null?(u.return=o,W=u):Kf(i);for(;s!==null;)W=s,bm(s),s=s.sibling;W=i,ao=l,Le=a}Yf(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,W=s):Yf(e)}}function Yf(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Le||Il(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Le)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:vt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Tf(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Tf(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var f=a.memoizedState;if(f!==null){var c=f.dehydrated;c!==null&&as(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Le||t.flags&512&&Qa(t)}catch(d){Se(t,t.return,d)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function qf(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function Kf(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Il(4,t)}catch(u){Se(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(u){Se(t,i,u)}}var s=t.return;try{Qa(t)}catch(u){Se(t,s,u)}break;case 5:var o=t.return;try{Qa(t)}catch(u){Se(t,o,u)}}}catch(u){Se(t,t.return,u)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var Mw=Math.ceil,ll=on.ReactCurrentDispatcher,rd=on.ReactCurrentOwner,pt=on.ReactCurrentBatchConfig,oe=0,be=null,_e=null,Te=0,tt=0,$r=Qn(0),Pe=0,ws=null,gr=0,Rl=0,id=0,Ji=null,Ye=null,sd=0,fi=1/0,Ut=null,ul=!1,Ya=null,Ln=null,co=!1,Tn=null,al=0,es=0,qa=null,Io=-1,Ro=0;function Ve(){return oe&6?Ee():Io!==-1?Io:Io=Ee()}function On(e){return e.mode&1?oe&2&&Te!==0?Te&-Te:cw.transition!==null?(Ro===0&&(Ro=p0()),Ro):(e=ce,e!==0||(e=window.event,e=e===void 0?16:S0(e.type)),e):1}function Mt(e,t,n,r){if(50<es)throw es=0,qa=null,Error(B(185));Ds(e,n,r),(!(oe&2)||e!==be)&&(e===be&&(!(oe&2)&&(Rl|=n),Pe===4&&wn(e,Te)),Je(e,r),n===1&&oe===0&&!(t.mode&1)&&(fi=Ee()+500,bl&&Wn()))}function Je(e,t){var n=e.callbackNode;c1(e,t);var r=Wo(e,e===be?Te:0);if(r===0)n!==null&&sf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sf(n),t===1)e.tag===0?aw(Gf.bind(null,e)):F0(Gf.bind(null,e)),sw(function(){!(oe&6)&&Wn()}),n=null;else{switch(m0(r)){case 1:n=zc;break;case 4:n=f0;break;case 16:n=Qo;break;case 536870912:n=h0;break;default:n=Qo}n=Lm(n,zm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function zm(e,t){if(Io=-1,Ro=0,oe&6)throw Error(B(327));var n=e.callbackNode;if(Ur()&&e.callbackNode!==n)return null;var r=Wo(e,e===be?Te:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=cl(e,r);else{t=r;var i=oe;oe|=2;var s=Im();(be!==e||Te!==t)&&(Ut=null,fi=Ee()+500,lr(e,t));do try{bw();break}catch(l){Tm(e,l)}while(!0);Uc(),ll.current=s,oe=i,_e!==null?t=0:(be=null,Te=0,t=Pe)}if(t!==0){if(t===2&&(i=ka(e),i!==0&&(r=i,t=Ka(e,i))),t===1)throw n=ws,lr(e,0),wn(e,r),Je(e,Ee()),n;if(t===6)wn(e,r);else{if(i=e.current.alternate,!(r&30)&&!Pw(i)&&(t=cl(e,r),t===2&&(s=ka(e),s!==0&&(r=s,t=Ka(e,s))),t===1))throw n=ws,lr(e,0),wn(e,r),Je(e,Ee()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Yn(e,Ye,Ut);break;case 3:if(wn(e,r),(r&130023424)===r&&(t=sd+500-Ee(),10<t)){if(Wo(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Ve(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ba(Yn.bind(null,e,Ye,Ut),t);break}Yn(e,Ye,Ut);break;case 4:if(wn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Ct(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Mw(r/1960))-r,10<r){e.timeoutHandle=ba(Yn.bind(null,e,Ye,Ut),r);break}Yn(e,Ye,Ut);break;case 5:Yn(e,Ye,Ut);break;default:throw Error(B(329))}}}return Je(e,Ee()),e.callbackNode===n?zm.bind(null,e):null}function Ka(e,t){var n=Ji;return e.current.memoizedState.isDehydrated&&(lr(e,t).flags|=256),e=cl(e,t),e!==2&&(t=Ye,Ye=n,t!==null&&Ga(t)),e}function Ga(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function Pw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Pt(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wn(e,t){for(t&=~id,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ct(t),r=1<<n;e[n]=-1,t&=~r}}function Gf(e){if(oe&6)throw Error(B(327));Ur();var t=Wo(e,0);if(!(t&1))return Je(e,Ee()),null;var n=cl(e,t);if(e.tag!==0&&n===2){var r=ka(e);r!==0&&(t=r,n=Ka(e,r))}if(n===1)throw n=ws,lr(e,0),wn(e,t),Je(e,Ee()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Yn(e,Ye,Ut),Je(e,Ee()),null}function od(e,t){var n=oe;oe|=1;try{return e(t)}finally{oe=n,oe===0&&(fi=Ee()+500,bl&&Wn())}}function yr(e){Tn!==null&&Tn.tag===0&&!(oe&6)&&Ur();var t=oe;oe|=1;var n=pt.transition,r=ce;try{if(pt.transition=null,ce=1,e)return e()}finally{ce=r,pt.transition=n,oe=t,!(oe&6)&&Wn()}}function ld(){tt=$r.current,pe($r)}function lr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,iw(n)),_e!==null)for(n=_e.return;n!==null;){var r=n;switch(Hc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Go();break;case 3:ci(),pe(Ge),pe(Oe),Kc();break;case 5:qc(r);break;case 4:ci();break;case 13:pe(ye);break;case 19:pe(ye);break;case 10:Qc(r.type._context);break;case 22:case 23:ld()}n=n.return}if(be=e,_e=e=Fn(e.current,null),Te=tt=t,Pe=0,ws=null,id=Rl=gr=0,Ye=Ji=null,Gn!==null){for(t=0;t<Gn.length;t++)if(n=Gn[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Gn=null}return e}function Tm(e,t){do{var n=_e;try{if(Uc(),bo.current=ol,sl){for(var r=ve.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}sl=!1}if(mr=0,je=Ce=ve=null,Gi=!1,ys=0,rd.current=null,n===null||n.return===null){Pe=1,ws=t,_e=null;break}e:{var s=e,o=n.return,l=n,u=t;if(t=Te,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var a=u,f=l,c=f.tag;if(!(f.mode&1)&&(c===0||c===11||c===15)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=Lf(o);if(h!==null){h.flags&=-257,Of(h,o,l,s,t),h.mode&1&&Af(s,a,t),t=h,u=a;var v=t.updateQueue;if(v===null){var x=new Set;x.add(u),t.updateQueue=x}else v.add(u);break e}else{if(!(t&1)){Af(s,a,t),ud();break e}u=Error(B(426))}}else if(me&&l.mode&1){var S=Lf(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Of(S,o,l,s,t),Bc(di(u,l));break e}}s=u=di(u,l),Pe!==4&&(Pe=2),Ji===null?Ji=[s]:Ji.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=mm(s,u,t);zf(s,p);break e;case 1:l=u;var y=s.type,m=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ln===null||!Ln.has(m)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=gm(s,l,t);zf(s,w);break e}}s=s.return}while(s!==null)}$m(n)}catch(E){t=E,_e===n&&n!==null&&(_e=n=n.return);continue}break}while(!0)}function Im(){var e=ll.current;return ll.current=ol,e===null?ol:e}function ud(){(Pe===0||Pe===3||Pe===2)&&(Pe=4),be===null||!(gr&268435455)&&!(Rl&268435455)||wn(be,Te)}function cl(e,t){var n=oe;oe|=2;var r=Im();(be!==e||Te!==t)&&(Ut=null,lr(e,t));do try{jw();break}catch(i){Tm(e,i)}while(!0);if(Uc(),oe=n,ll.current=r,_e!==null)throw Error(B(261));return be=null,Te=0,Pe}function jw(){for(;_e!==null;)Rm(_e)}function bw(){for(;_e!==null&&!t1();)Rm(_e)}function Rm(e){var t=Am(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?$m(e):_e=t,rd.current=null}function $m(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Ew(n,t),n!==null){n.flags&=32767,_e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Pe=6,_e=null;return}}else if(n=kw(n,t,tt),n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);Pe===0&&(Pe=5)}function Yn(e,t,n){var r=ce,i=pt.transition;try{pt.transition=null,ce=1,zw(e,t,n,r)}finally{pt.transition=i,ce=r}return null}function zw(e,t,n,r){do Ur();while(Tn!==null);if(oe&6)throw Error(B(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(d1(e,s),e===be&&(_e=be=null,Te=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||co||(co=!0,Lm(Qo,function(){return Ur(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=pt.transition,pt.transition=null;var o=ce;ce=1;var l=oe;oe|=4,rd.current=null,Nw(e,n),jm(n,e),G1(Pa),Xo=!!Ma,Pa=Ma=null,e.current=n,Cw(n),n1(),oe=l,ce=o,pt.transition=s}else e.current=n;if(co&&(co=!1,Tn=e,al=i),s=e.pendingLanes,s===0&&(Ln=null),s1(n.stateNode),Je(e,Ee()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(ul)throw ul=!1,e=Ya,Ya=null,e;return al&1&&e.tag!==0&&Ur(),s=e.pendingLanes,s&1?e===qa?es++:(es=0,qa=e):es=0,Wn(),null}function Ur(){if(Tn!==null){var e=m0(al),t=pt.transition,n=ce;try{if(pt.transition=null,ce=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,al=0,oe&6)throw Error(B(331));var i=oe;for(oe|=4,W=e.current;W!==null;){var s=W,o=s.child;if(W.flags&16){var l=s.deletions;if(l!==null){for(var u=0;u<l.length;u++){var a=l[u];for(W=a;W!==null;){var f=W;switch(f.tag){case 0:case 11:case 15:Zi(8,f,s)}var c=f.child;if(c!==null)c.return=f,W=c;else for(;W!==null;){f=W;var d=f.sibling,h=f.return;if(Cm(f),f===a){W=null;break}if(d!==null){d.return=h,W=d;break}W=h}}}var v=s.alternate;if(v!==null){var x=v.child;if(x!==null){v.child=null;do{var S=x.sibling;x.sibling=null,x=S}while(x!==null)}}W=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,W=o;else e:for(;W!==null;){if(s=W,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Zi(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,W=p;break e}W=s.return}}var y=e.current;for(W=y;W!==null;){o=W;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,W=m;else e:for(o=y;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Il(9,l)}}catch(E){Se(l,l.return,E)}if(l===o){W=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,W=w;break e}W=l.return}}if(oe=i,Wn(),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Nl,e)}catch{}r=!0}return r}finally{ce=n,pt.transition=t}}return!1}function Zf(e,t,n){t=di(n,t),t=mm(e,t,1),e=An(e,t,1),t=Ve(),e!==null&&(Ds(e,1,t),Je(e,t))}function Se(e,t,n){if(e.tag===3)Zf(e,e,n);else for(;t!==null;){if(t.tag===3){Zf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=di(n,e),e=gm(t,e,1),t=An(t,e,1),e=Ve(),t!==null&&(Ds(t,1,e),Je(t,e));break}}t=t.return}}function Tw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ve(),e.pingedLanes|=e.suspendedLanes&n,be===e&&(Te&n)===n&&(Pe===4||Pe===3&&(Te&130023424)===Te&&500>Ee()-sd?lr(e,0):id|=n),Je(e,t)}function Dm(e,t){t===0&&(e.mode&1?(t=eo,eo<<=1,!(eo&130023424)&&(eo=4194304)):t=1);var n=Ve();e=nn(e,t),e!==null&&(Ds(e,t,n),Je(e,n))}function Iw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dm(e,n)}function Rw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),Dm(e,n)}var Am;Am=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qe=!1,Sw(e,t,n);qe=!!(e.flags&131072)}else qe=!1,me&&t.flags&1048576&&H0(t,el,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;To(e,t),e=t.pendingProps;var i=li(t,Oe.current);Vr(t,n),i=Zc(null,t,r,e,i,n);var s=Jc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ze(r)?(s=!0,Zo(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Xc(t),i.updater=Tl,t.stateNode=i,i._reactInternals=t,Aa(t,r,e,n),t=Fa(null,t,r,!0,s,n)):(t.tag=0,me&&s&&Fc(t),Be(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(To(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Dw(r),e=vt(r,e),i){case 0:t=Oa(null,t,r,e,n);break e;case 1:t=Bf(null,t,r,e,n);break e;case 11:t=Ff(null,t,r,e,n);break e;case 14:t=Hf(null,t,r,vt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Oa(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Bf(e,t,r,i,n);case 3:e:{if(wm(t),e===null)throw Error(B(387));r=t.pendingProps,s=t.memoizedState,i=s.element,X0(e,t),rl(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=di(Error(B(423)),t),t=Vf(e,t,r,n,i);break e}else if(r!==i){i=di(Error(B(424)),t),t=Vf(e,t,r,n,i);break e}else for(rt=Dn(t.stateNode.containerInfo.firstChild),it=t,me=!0,Et=null,n=Q0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ui(),r===i){t=rn(e,t,n);break e}Be(e,t,r,n)}t=t.child}return t;case 5:return Y0(t),e===null&&Ra(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,ja(r,i)?o=null:s!==null&&ja(r,s)&&(t.flags|=32),xm(e,t),Be(e,t,o,n),t.child;case 6:return e===null&&Ra(t),null;case 13:return Sm(e,t,n);case 4:return Yc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ai(t,null,r,n):Be(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),Ff(e,t,r,i,n);case 7:return Be(e,t,t.pendingProps,n),t.child;case 8:return Be(e,t,t.pendingProps.children,n),t.child;case 12:return Be(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,de(tl,r._currentValue),r._currentValue=o,s!==null)if(Pt(s.value,o)){if(s.children===i.children&&!Ge.current){t=rn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Kt(-1,n&-n),u.tag=2;var a=s.updateQueue;if(a!==null){a=a.shared;var f=a.pending;f===null?u.next=u:(u.next=f.next,f.next=u),a.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),$a(s.return,n,t),l.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(B(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),$a(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Be(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Vr(t,n),i=mt(i),r=r(i),t.flags|=1,Be(e,t,r,n),t.child;case 14:return r=t.type,i=vt(r,t.pendingProps),i=vt(r.type,i),Hf(e,t,r,i,n);case 15:return ym(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:vt(r,i),To(e,t),t.tag=1,Ze(r)?(e=!0,Zo(t)):e=!1,Vr(t,n),pm(t,r,i),Aa(t,r,i,n),Fa(null,t,r,!0,e,n);case 19:return km(e,t,n);case 22:return vm(e,t,n)}throw Error(B(156,t.tag))};function Lm(e,t){return d0(e,t)}function $w(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ht(e,t,n,r){return new $w(e,t,n,r)}function ad(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dw(e){if(typeof e=="function")return ad(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pc)return 11;if(e===jc)return 14}return 2}function Fn(e,t){var n=e.alternate;return n===null?(n=ht(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $o(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")ad(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Nr:return ur(n.children,i,s,t);case Mc:o=8,i|=8;break;case la:return e=ht(12,n,t,i|2),e.elementType=la,e.lanes=s,e;case ua:return e=ht(13,n,t,i),e.elementType=ua,e.lanes=s,e;case aa:return e=ht(19,n,t,i),e.elementType=aa,e.lanes=s,e;case Yp:return $l(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wp:o=10;break e;case Xp:o=9;break e;case Pc:o=11;break e;case jc:o=14;break e;case mn:o=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=ht(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function ur(e,t,n,r){return e=ht(7,e,r,t),e.lanes=n,e}function $l(e,t,n,r){return e=ht(22,e,r,t),e.elementType=Yp,e.lanes=n,e.stateNode={isHidden:!1},e}function Iu(e,t,n){return e=ht(6,e,null,t),e.lanes=n,e}function Ru(e,t,n){return t=ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Aw(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pu(0),this.expirationTimes=pu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pu(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function cd(e,t,n,r,i,s,o,l,u){return e=new Aw(e,t,n,l,u),t===1?(t=1,s===!0&&(t|=8)):t=0,s=ht(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xc(s),e}function Lw(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_r,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Om(e){if(!e)return Bn;e=e._reactInternals;e:{if(Sr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(Ze(n))return O0(e,n,t)}return t}function Fm(e,t,n,r,i,s,o,l,u){return e=cd(n,r,!0,e,i,s,o,l,u),e.context=Om(null),n=e.current,r=Ve(),i=On(n),s=Kt(r,i),s.callback=t??null,An(n,s,i),e.current.lanes=i,Ds(e,i,r),Je(e,r),e}function Dl(e,t,n,r){var i=t.current,s=Ve(),o=On(i);return n=Om(n),t.context===null?t.context=n:t.pendingContext=n,t=Kt(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=An(i,t,o),e!==null&&(Mt(e,i,o,s),jo(e,i,o)),o}function dl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Jf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function dd(e,t){Jf(e,t),(e=e.alternate)&&Jf(e,t)}function Ow(){return null}var Hm=typeof reportError=="function"?reportError:function(e){console.error(e)};function fd(e){this._internalRoot=e}Al.prototype.render=fd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Dl(e,t,null,null)};Al.prototype.unmount=fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yr(function(){Dl(null,e,null,null)}),t[tn]=null}};function Al(e){this._internalRoot=e}Al.prototype.unstable_scheduleHydration=function(e){if(e){var t=v0();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xn.length&&t!==0&&t<xn[n].priority;n++);xn.splice(n,0,e),n===0&&w0(e)}};function hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ll(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function eh(){}function Fw(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var a=dl(o);s.call(a)}}var o=Fm(t,r,e,0,null,!1,!1,"",eh);return e._reactRootContainer=o,e[tn]=o.current,fs(e.nodeType===8?e.parentNode:e),yr(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var a=dl(u);l.call(a)}}var u=cd(e,0,!1,null,null,!1,!1,"",eh);return e._reactRootContainer=u,e[tn]=u.current,fs(e.nodeType===8?e.parentNode:e),yr(function(){Dl(t,u,n,r)}),u}function Ol(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var u=dl(o);l.call(u)}}Dl(t,o,e,i)}else o=Fw(n,t,e,i,r);return dl(o)}g0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Bi(t.pendingLanes);n!==0&&(Tc(t,n|1),Je(t,Ee()),!(oe&6)&&(fi=Ee()+500,Wn()))}break;case 13:yr(function(){var r=nn(e,1);if(r!==null){var i=Ve();Mt(r,e,1,i)}}),dd(e,1)}};Ic=function(e){if(e.tag===13){var t=nn(e,134217728);if(t!==null){var n=Ve();Mt(t,e,134217728,n)}dd(e,134217728)}};y0=function(e){if(e.tag===13){var t=On(e),n=nn(e,t);if(n!==null){var r=Ve();Mt(n,e,t,r)}dd(e,t)}};v0=function(){return ce};x0=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};xa=function(e,t,n){switch(t){case"input":if(fa(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=jl(r);if(!i)throw Error(B(90));Kp(r),fa(r,i)}}}break;case"textarea":Zp(e,n);break;case"select":t=n.value,t!=null&&Or(e,!!n.multiple,t,!1)}};s0=od;o0=yr;var Hw={usingClientEntryPoint:!1,Events:[Ls,jr,jl,r0,i0,od]},Di={findFiberByHostInstance:Kn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Bw={bundleType:Di.bundleType,version:Di.version,rendererPackageName:Di.rendererPackageName,rendererConfig:Di.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:on.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=a0(e),e===null?null:e.stateNode},findFiberByHostInstance:Di.findFiberByHostInstance||Ow,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fo.isDisabled&&fo.supportsFiber)try{Nl=fo.inject(Bw),Lt=fo}catch{}}lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hw;lt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hd(t))throw Error(B(200));return Lw(e,t,null,n)};lt.createRoot=function(e,t){if(!hd(e))throw Error(B(299));var n=!1,r="",i=Hm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=cd(e,1,!1,null,null,n,!1,r,i),e[tn]=t.current,fs(e.nodeType===8?e.parentNode:e),new fd(t)};lt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=a0(t),e=e===null?null:e.stateNode,e};lt.flushSync=function(e){return yr(e)};lt.hydrate=function(e,t,n){if(!Ll(t))throw Error(B(200));return Ol(null,e,t,!0,n)};lt.hydrateRoot=function(e,t,n){if(!hd(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Hm;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Fm(t,null,e,1,n??null,i,!1,s,o),e[tn]=t.current,fs(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Al(t)};lt.render=function(e,t,n){if(!Ll(t))throw Error(B(200));return Ol(null,e,t,!1,n)};lt.unmountComponentAtNode=function(e){if(!Ll(e))throw Error(B(40));return e._reactRootContainer?(yr(function(){Ol(null,null,e,!1,function(){e._reactRootContainer=null,e[tn]=null})}),!0):!1};lt.unstable_batchedUpdates=od;lt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ll(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Ol(e,t,n,!1,r)};lt.version="18.3.1-next-f1338f8080-20240426";function Bm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bm)}catch(e){console.error(e)}}Bm(),Bp.exports=lt;var Vw=Bp.exports,Vm,th=Vw;Vm=th.createRoot,th.hydrateRoot;function Um(){return typeof window<"u"&&window.__DURABLE_API__?window.__DURABLE_API__:`${typeof window<"u"&&window.__DURABLE_BASE__||"/durable"}/api`}async function Er(e,t){const n=await fetch(Um()+e,t);if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const yn={runs(e,t){const n=new URLSearchParams;e&&n.set("status",e),t&&n.set("tag",t);const r=n.toString();return Er(r?`/runs?${r}`:"/runs")},run(e){return Er(`/runs/${encodeURIComponent(e)}`)},retry(e){return Er(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})},bulk(e,t){const n=new URLSearchParams;t.status&&n.set("status",t.status),t.tag&&n.set("tag",t.tag);const r=n.toString();return Er(`/bulk/${e}${r?`?${r}`:""}`,{method:"POST"})},cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return Er(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})},continue(e){return Er(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})},streamRun(e,t){const n=new EventSource(`${Um()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}},jt={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function Qm(e){return g.jsxs("svg",{...jt,...e,"aria-hidden":!0,children:[g.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),g.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function Uw(e){return g.jsxs("svg",{...jt,...e,"aria-hidden":!0,children:[g.jsx("circle",{cx:"12",cy:"12",r:"9"}),g.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function Qw(e){return g.jsxs("svg",{...jt,...e,"aria-hidden":!0,children:[g.jsx("circle",{cx:"12",cy:"13",r:"8"}),g.jsx("path",{d:"M12 13V9M9 2h6"})]})}function Ww(e){return g.jsxs("svg",{...jt,...e,"aria-hidden":!0,children:[g.jsx("circle",{cx:"12",cy:"12",r:"2"}),g.jsx("path",{d:"M7.8 7.8a6 6 0 0 0 0 8.4M16.2 16.2a6 6 0 0 0 0-8.4M5 5a10 10 0 0 0 0 14M19 19a10 10 0 0 0 0-14"})]})}function Wm(e){return g.jsx("svg",{...jt,...e,"aria-hidden":!0,children:g.jsx("path",{d:"m4 12 5 5L20 6"})})}function Fs(e){return g.jsx("svg",{...jt,...e,"aria-hidden":!0,children:g.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function Xw(e){return g.jsxs("svg",{...jt,...e,"aria-hidden":!0,children:[g.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),g.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function nh(e){return g.jsx("svg",{...jt,...e,"aria-hidden":!0,children:g.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function Xm(e){return g.jsx("svg",{...jt,...e,"aria-hidden":!0,children:g.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function Yw(e){return g.jsx("svg",{...jt,...e,"aria-hidden":!0,children:g.jsx("path",{d:"M6 4l14 8-14 8z"})})}function pd(e){return g.jsxs("svg",{...jt,...e,"aria-hidden":!0,children:[g.jsx("circle",{cx:"6",cy:"5",r:"2"}),g.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),g.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const qw={local:Qm,remote:Uw,sleep:Qw,signal:Ww,child:pd};function md(e){return qw[e]??Qm}const Za={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"};function Ym(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function rh(e,t){return Ym(new Date(t).getTime()-new Date(e).getTime())}function ih(e){return qm(new Date(e).getTime())}function qm(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const sh={ok:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",failed:"border-red-500/25 bg-red-500/10 text-red-300",skipped:"border-amber-500/25 bg-amber-500/10 text-amber-300"},Kw={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},Gw=["ok","failed","skipped"];function Zw({events:e}){const t=e.filter(i=>i.status),n=e.filter(i=>!i.status),r=Gw.map(i=>[i,t.filter(s=>s.status===i).length]).filter(([,i])=>i>0);return g.jsxs(g.Fragment,{children:[t.length>0&&g.jsxs("section",{className:"rise",children:[g.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[g.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),g.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([i,s])=>g.jsxs("span",{className:sh[i].split(" ").pop(),children:[s," ",i]},i))})]}),g.jsx("ul",{className:"flex flex-col gap-1",children:t.map(i=>g.jsxs("li",{className:`flex items-center justify-between gap-2 rounded-md border px-2.5 py-1.5 text-[11.5px] ${sh[i.status]}`,children:[g.jsx("span",{className:"mono truncate text-zinc-200",children:i.name}),g.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider",children:i.status})]},`${i.at}-${i.name}`))})]}),n.length>0&&g.jsxs("section",{className:"rise",children:[g.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),g.jsx("ul",{className:"mono max-h-64 overflow-auto rounded-lg border border-[var(--line)] bg-black/40 p-2.5 text-[11px] leading-relaxed",children:n.map(i=>g.jsxs("li",{className:"flex gap-2 py-0.5",children:[g.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:qm(i.at)}),g.jsx("span",{className:`shrink-0 uppercase ${Kw[i.level]}`,children:i.level}),g.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:i.message})]},`${i.at}-${i.message}`))})]})]})}function Jw({value:e}){const[t,n]=R.useState(!1);return g.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200",onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1200)}catch{}},children:[t?g.jsx(Wm,{width:11,height:11}):g.jsx(Xw,{width:11,height:11}),t?"copied":"copy"]})}function fl({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return g.jsxs("section",{className:"rise",children:[g.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[g.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),g.jsx(Jw,{value:n})]}),g.jsx("pre",{className:"mono max-h-64 overflow-auto rounded-lg border border-[var(--line)] bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300",children:n})]})}function dn({k:e,v:t,mono:n=!0}){return g.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[g.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),g.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function eS({step:e,run:t,onClose:n}){const r=e.status==="failed",i=e.status==="pending",s=md(e.kind),o=rh(t.createdAt,e.startedAt),l=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return g.jsxs("aside",{className:"absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-[var(--line)] bg-[var(--panel)]/95 shadow-2xl backdrop-blur-md rise",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${r?"bg-red-500/15 text-red-300":i?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:g.jsx(s,{width:13,height:13})}),g.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),g.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",Za[e.kind]??e.kind]})]}),g.jsx("button",{type:"button",onClick:n,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-[var(--line)] text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:g.jsx(Fs,{})})]}),g.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[g.jsxs("div",{className:"rounded-lg border border-[var(--line)] bg-black/20 px-3.5 py-1",children:[g.jsx(dn,{k:"seq",v:`#${e.seq}`}),l>=1&&g.jsx(dn,{k:"queued",v:g.jsx("span",{className:"text-sky-300",children:Ym(l)})}),g.jsx(dn,{k:"duration",v:i?g.jsx("span",{className:"text-amber-300",children:"running…"}):rh(e.startedAt,e.finishedAt)}),g.jsx(dn,{k:"attempts",v:g.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&g.jsx(Xm,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&g.jsx(dn,{k:"worker",v:`@${e.workerGroup}`}),g.jsx(dn,{k:"started",v:ih(e.startedAt)}),g.jsx(dn,{k:"finished",v:ih(e.finishedAt)}),g.jsx(dn,{k:"offset",v:`+${o}`})]}),r&&e.error&&g.jsxs("section",{className:"rise",children:[g.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),g.jsx("div",{className:"mono rounded-lg border border-red-500/25 bg-red-500/10 p-3 text-[11.5px] leading-relaxed text-red-200",children:e.error.message})]}),e.events&&e.events.length>0&&g.jsx(Zw,{events:e.events}),e.input!==void 0&&g.jsx(fl,{label:"input",value:e.input}),e.output!==void 0&&g.jsx(fl,{label:"output",value:e.output})]})]})}function tS({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return g.jsxs("aside",{className:"absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-[var(--line)] bg-[var(--panel)]/95 shadow-2xl backdrop-blur-md rise",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-[var(--line)] px-5 py-4",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),g.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),g.jsx("button",{type:"button",onClick:t,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-[var(--line)] text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:g.jsx(Fs,{})})]}),g.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&g.jsxs("section",{className:"rise",children:[g.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),g.jsx("div",{className:"mono rounded-lg border border-red-500/25 bg-red-500/10 p-3 text-[11.5px] leading-relaxed text-red-200",children:e.error.message})]}),e.input!==void 0&&g.jsx(fl,{label:"input",value:e.input}),e.output!==void 0&&g.jsx(fl,{label:"output",value:e.output}),n&&g.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function Km(e){const t="spawn:",n="signal:child:";if(e.name.startsWith(t))return e.name.slice(t.length);if(e.name.startsWith(n))return e.name.slice(n.length)}function oh(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const nS={ok:"bg-emerald-500/40 ring-1 ring-emerald-500/50",failed:"bg-red-500/40 ring-1 ring-red-500/50",skipped:"bg-amber-500/35 ring-1 ring-amber-500/45"},rS={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function iS({run:e,timeline:t,selected:n,onSelect:r,onOpenRun:i}){const{span:s,rows:o}=R.useMemo(()=>{const l=t.map(x=>new Date(x.startedAt).getTime()),u=t.map(x=>new Date(x.finishedAt).getTime()),a=Math.min(new Date(e.createdAt).getTime(),...l),f=e.status==="running"||e.status==="suspended",c=Math.max(...u,f?Date.now():a+1),d=Math.max(c-a,1);let h=a;const v=t.map(x=>{const S=new Date(x.finishedAt).getTime(),p=h;h=S;const y=new Date(x.startedAt).getTime();let m=y;const w=(x.events??[]).filter(E=>E.status).sort((E,P)=>E.at-P.at).map((E,P)=>{const _=Math.min(Math.max(E.at,y),S),M=m;return m=_,{key:`${E.name??"sub"}-${E.at}-${P}`,name:E.name??"sub-process",status:E.status,left:(M-a)/d*100,width:Math.max((_-M)/d*100,.8),ms:_-M}});return{step:x,left:(p-a)/d*100,width:Math.max((S-p)/d*100,.8),ms:S-p,subRows:w}});return{span:d,rows:v}},[e,t]);return g.jsxs("div",{className:"flex h-full flex-col",children:[g.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[g.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),g.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",oh(s)]})]}),g.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:o.map(({step:l,left:u,width:a,ms:f,subRows:c})=>{const d=l.status==="failed",h=Km(l),v=!!h,x=v?pd:md(l.kind),S=n===l.seq;return g.jsxs("div",{children:[g.jsxs("button",{type:"button",onClick:()=>h?i(h):r(l.seq),title:v?"Child workflow — click to open its run":void 0,className:`group grid w-full grid-cols-[150px_1fr] items-center gap-3 rounded-md px-2 py-1 text-left transition-colors ${S?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[g.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[g.jsx("span",{className:d?"text-red-400":v?"text-indigo-300":"text-emerald-400",children:g.jsx(x,{width:12,height:12})}),g.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:l.name}),v&&g.jsx("span",{className:"text-indigo-300",children:"↗"})]}),g.jsxs("span",{className:"relative h-5",children:[g.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-[var(--line-soft)]"}),g.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] ${d?"bg-red-500/35 ring-1 ring-red-500/50":S?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${u}%`,width:`${a}%`}}),g.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[10px] text-zinc-500",style:{left:`min(${u+a}%, calc(100% - 44px))`},children:oh(f)})]})]}),c.length>0&&g.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-[var(--line-soft)] pl-2",children:c.map(p=>g.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${p.name} — ${p.status}`,children:[g.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[g.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${rS[p.status]}`}),g.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:p.name})]}),g.jsxs("span",{className:"relative h-3",children:[g.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-[var(--line-soft)]"}),g.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] ${nS[p.status]}`,style:{left:`${p.left}%`,width:`${p.width}%`}})]})]},p.key))})]},l.seq)})})]})}function Ne(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ne(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var sS={value:()=>{}};function Fl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Do(n)}function Do(e){this._=e}function oS(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Do.prototype=Fl.prototype={constructor:Do,on:function(e,t){var n=this._,r=oS(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=lS(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(i=(e=r[s]).type)n[i]=lh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=lh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Do(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function lS(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function lh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=sS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ja="http://www.w3.org/1999/xhtml";const uh={svg:"http://www.w3.org/2000/svg",xhtml:Ja,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Hl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),uh.hasOwnProperty(t)?{space:uh[t],local:e}:e}function uS(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ja&&t.documentElement.namespaceURI===Ja?t.createElement(e):t.createElementNS(n,e)}}function aS(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gm(e){var t=Hl(e);return(t.local?aS:uS)(t)}function cS(){}function gd(e){return e==null?cS:function(){return this.querySelector(e)}}function dS(e){typeof e!="function"&&(e=gd(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,l=r[i]=new Array(o),u,a,f=0;f<o;++f)(u=s[f])&&(a=e.call(u,u.__data__,f,s))&&("__data__"in u&&(a.__data__=u.__data__),l[f]=a);return new ot(r,this._parents)}function fS(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function hS(){return[]}function Zm(e){return e==null?hS:function(){return this.querySelectorAll(e)}}function pS(e){return function(){return fS(e.apply(this,arguments))}}function mS(e){typeof e=="function"?e=pS(e):e=Zm(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var o=t[s],l=o.length,u,a=0;a<l;++a)(u=o[a])&&(r.push(e.call(u,u.__data__,a,o)),i.push(u));return new ot(r,i)}function Jm(e){return function(){return this.matches(e)}}function eg(e){return function(t){return t.matches(e)}}var gS=Array.prototype.find;function yS(e){return function(){return gS.call(this.children,e)}}function vS(){return this.firstElementChild}function xS(e){return this.select(e==null?vS:yS(typeof e=="function"?e:eg(e)))}var wS=Array.prototype.filter;function SS(){return Array.from(this.children)}function kS(e){return function(){return wS.call(this.children,e)}}function ES(e){return this.selectAll(e==null?SS:kS(typeof e=="function"?e:eg(e)))}function _S(e){typeof e!="function"&&(e=Jm(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,l=r[i]=[],u,a=0;a<o;++a)(u=s[a])&&e.call(u,u.__data__,a,s)&&l.push(u);return new ot(r,this._parents)}function tg(e){return new Array(e.length)}function NS(){return new ot(this._enter||this._groups.map(tg),this._parents)}function hl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}hl.prototype={constructor:hl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function CS(e){return function(){return e}}function MS(e,t,n,r,i,s){for(var o=0,l,u=t.length,a=s.length;o<a;++o)(l=t[o])?(l.__data__=s[o],r[o]=l):n[o]=new hl(e,s[o]);for(;o<u;++o)(l=t[o])&&(i[o]=l)}function PS(e,t,n,r,i,s,o){var l,u,a=new Map,f=t.length,c=s.length,d=new Array(f),h;for(l=0;l<f;++l)(u=t[l])&&(d[l]=h=o.call(u,u.__data__,l,t)+"",a.has(h)?i[l]=u:a.set(h,u));for(l=0;l<c;++l)h=o.call(e,s[l],l,s)+"",(u=a.get(h))?(r[l]=u,u.__data__=s[l],a.delete(h)):n[l]=new hl(e,s[l]);for(l=0;l<f;++l)(u=t[l])&&a.get(d[l])===u&&(i[l]=u)}function jS(e){return e.__data__}function bS(e,t){if(!arguments.length)return Array.from(this,jS);var n=t?PS:MS,r=this._parents,i=this._groups;typeof e!="function"&&(e=CS(e));for(var s=i.length,o=new Array(s),l=new Array(s),u=new Array(s),a=0;a<s;++a){var f=r[a],c=i[a],d=c.length,h=zS(e.call(f,f&&f.__data__,a,r)),v=h.length,x=l[a]=new Array(v),S=o[a]=new Array(v),p=u[a]=new Array(d);n(f,c,x,S,p,h,t);for(var y=0,m=0,w,E;y<v;++y)if(w=x[y]){for(y>=m&&(m=y+1);!(E=S[m])&&++m<v;);w._next=E||null}}return o=new ot(o,r),o._enter=l,o._exit=u,o}function zS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TS(){return new ot(this._exit||this._groups.map(tg),this._parents)}function IS(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function RS(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,o=Math.min(i,s),l=new Array(i),u=0;u<o;++u)for(var a=n[u],f=r[u],c=a.length,d=l[u]=new Array(c),h,v=0;v<c;++v)(h=a[v]||f[v])&&(d[v]=h);for(;u<i;++u)l[u]=n[u];return new ot(l,this._parents)}function $S(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function DS(e){e||(e=AS);function t(c,d){return c&&d?e(c.__data__,d.__data__):!c-!d}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],l=o.length,u=i[s]=new Array(l),a,f=0;f<l;++f)(a=o[f])&&(u[f]=a);u.sort(t)}return new ot(i,this._parents).order()}function AS(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function LS(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function OS(){return Array.from(this)}function FS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function HS(){let e=0;for(const t of this)++e;return e}function BS(){return!this.node()}function VS(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,o=i.length,l;s<o;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}function US(e){return function(){this.removeAttribute(e)}}function QS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function WS(e,t){return function(){this.setAttribute(e,t)}}function XS(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function YS(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function qS(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function KS(e,t){var n=Hl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?QS:US:typeof t=="function"?n.local?qS:YS:n.local?XS:WS)(n,t))}function ng(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function GS(e){return function(){this.style.removeProperty(e)}}function ZS(e,t,n){return function(){this.style.setProperty(e,t,n)}}function JS(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ek(e,t,n){return arguments.length>1?this.each((t==null?GS:typeof t=="function"?JS:ZS)(e,t,n??"")):hi(this.node(),e)}function hi(e,t){return e.style.getPropertyValue(t)||ng(e).getComputedStyle(e,null).getPropertyValue(t)}function tk(e){return function(){delete this[e]}}function nk(e,t){return function(){this[e]=t}}function rk(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ik(e,t){return arguments.length>1?this.each((t==null?tk:typeof t=="function"?rk:nk)(e,t)):this.node()[e]}function rg(e){return e.trim().split(/^|\s+/)}function yd(e){return e.classList||new ig(e)}function ig(e){this._node=e,this._names=rg(e.getAttribute("class")||"")}ig.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function sg(e,t){for(var n=yd(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function og(e,t){for(var n=yd(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function sk(e){return function(){sg(this,e)}}function ok(e){return function(){og(this,e)}}function lk(e,t){return function(){(t.apply(this,arguments)?sg:og)(this,e)}}function uk(e,t){var n=rg(e+"");if(arguments.length<2){for(var r=yd(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?lk:t?sk:ok)(n,t))}function ak(){this.textContent=""}function ck(e){return function(){this.textContent=e}}function dk(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function fk(e){return arguments.length?this.each(e==null?ak:(typeof e=="function"?dk:ck)(e)):this.node().textContent}function hk(){this.innerHTML=""}function pk(e){return function(){this.innerHTML=e}}function mk(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gk(e){return arguments.length?this.each(e==null?hk:(typeof e=="function"?mk:pk)(e)):this.node().innerHTML}function yk(){this.nextSibling&&this.parentNode.appendChild(this)}function vk(){return this.each(yk)}function xk(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function wk(){return this.each(xk)}function Sk(e){var t=typeof e=="function"?e:Gm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function kk(){return null}function Ek(e,t){var n=typeof e=="function"?e:Gm(e),r=t==null?kk:typeof t=="function"?t:gd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function _k(){var e=this.parentNode;e&&e.removeChild(this)}function Nk(){return this.each(_k)}function Ck(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Mk(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Pk(e){return this.select(e?Mk:Ck)}function jk(e){return arguments.length?this.property("__data__",e):this.node().__data__}function bk(e){return function(t){e.call(this,t,this.__data__)}}function zk(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Tk(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function Ik(e,t,n){return function(){var r=this.__on,i,s=bk(t);if(r){for(var o=0,l=r.length;o<l;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Rk(e,t,n){var r=zk(e+""),i,s=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,a=l.length,f;u<a;++u)for(i=0,f=l[u];i<s;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(l=t?Ik:Tk,i=0;i<s;++i)this.each(l(r[i],t,n));return this}function lg(e,t,n){var r=ng(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function $k(e,t){return function(){return lg(this,e,t)}}function Dk(e,t){return function(){return lg(this,e,t.apply(this,arguments))}}function Ak(e,t){return this.each((typeof t=="function"?Dk:$k)(e,t))}function*Lk(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var ug=[null];function ot(e,t){this._groups=e,this._parents=t}function Hs(){return new ot([[document.documentElement]],ug)}function Ok(){return this}ot.prototype=Hs.prototype={constructor:ot,select:dS,selectAll:mS,selectChild:xS,selectChildren:ES,filter:_S,data:bS,enter:NS,exit:TS,join:IS,merge:RS,selection:Ok,order:$S,sort:DS,call:LS,nodes:OS,node:FS,size:HS,empty:BS,each:VS,attr:KS,style:ek,property:ik,classed:uk,text:fk,html:gk,raise:vk,lower:wk,append:Sk,insert:Ek,remove:Nk,clone:Pk,datum:jk,on:Rk,dispatch:Ak,[Symbol.iterator]:Lk};function nt(e){return typeof e=="string"?new ot([[document.querySelector(e)]],[document.documentElement]):new ot([[e]],ug)}function Fk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function St(e,t){if(e=Fk(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Hk={passive:!1},Ss={capture:!0,passive:!1};function $u(e){e.stopImmediatePropagation()}function Qr(e){e.preventDefault(),e.stopImmediatePropagation()}function ag(e){var t=e.document.documentElement,n=nt(e).on("dragstart.drag",Qr,Ss);"onselectstart"in t?n.on("selectstart.drag",Qr,Ss):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function cg(e,t){var n=e.document.documentElement,r=nt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Qr,Ss),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const ho=e=>()=>e;function ec(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:o,y:l,dx:u,dy:a,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:f}})}ec.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Bk(e){return!e.ctrlKey&&!e.button}function Vk(){return this.parentNode}function Uk(e,t){return t??{x:e.x,y:e.y}}function Qk(){return navigator.maxTouchPoints||"ontouchstart"in this}function dg(){var e=Bk,t=Vk,n=Uk,r=Qk,i={},s=Fl("start","drag","end"),o=0,l,u,a,f,c=0;function d(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",S).on("touchmove.drag",p,Hk).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,E){if(!(f||!e.call(this,w,E))){var P=m(this,t.call(this,w,E),w,E,"mouse");P&&(nt(w.view).on("mousemove.drag",v,Ss).on("mouseup.drag",x,Ss),ag(w.view),$u(w),a=!1,l=w.clientX,u=w.clientY,P("start",w))}}function v(w){if(Qr(w),!a){var E=w.clientX-l,P=w.clientY-u;a=E*E+P*P>c}i.mouse("drag",w)}function x(w){nt(w.view).on("mousemove.drag mouseup.drag",null),cg(w.view,a),Qr(w),i.mouse("end",w)}function S(w,E){if(e.call(this,w,E)){var P=w.changedTouches,_=t.call(this,w,E),M=P.length,z,T;for(z=0;z<M;++z)(T=m(this,_,w,E,P[z].identifier,P[z]))&&($u(w),T("start",w,P[z]))}}function p(w){var E=w.changedTouches,P=E.length,_,M;for(_=0;_<P;++_)(M=i[E[_].identifier])&&(Qr(w),M("drag",w,E[_]))}function y(w){var E=w.changedTouches,P=E.length,_,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),_=0;_<P;++_)(M=i[E[_].identifier])&&($u(w),M("end",w,E[_]))}function m(w,E,P,_,M,z){var T=s.copy(),A=St(z||P,E),F,O,k;if((k=n.call(w,new ec("beforestart",{sourceEvent:P,target:d,identifier:M,active:o,x:A[0],y:A[1],dx:0,dy:0,dispatch:T}),_))!=null)return F=k.x-A[0]||0,O=k.y-A[1]||0,function $(b,D,N){var j=A,I;switch(b){case"start":i[M]=$,I=o++;break;case"end":delete i[M],--o;case"drag":A=St(N||D,E),I=o;break}T.call(b,w,new ec(b,{sourceEvent:D,subject:k,target:d,identifier:M,active:I,x:A[0]+F,y:A[1]+O,dx:A[0]-j[0],dy:A[1]-j[1],dispatch:T}),_)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:ho(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:ho(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:ho(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:ho(!!w),d):r},d.on=function(){var w=s.on.apply(s,arguments);return w===s?d:w},d.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,d):Math.sqrt(c)},d}function vd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Bs(){}var ks=.7,pl=1/ks,Wr="\\s*([+-]?\\d+)\\s*",Es="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wk=/^#([0-9a-f]{3,8})$/,Xk=new RegExp(`^rgb\\(${Wr},${Wr},${Wr}\\)$`),Yk=new RegExp(`^rgb\\(${Ft},${Ft},${Ft}\\)$`),qk=new RegExp(`^rgba\\(${Wr},${Wr},${Wr},${Es}\\)$`),Kk=new RegExp(`^rgba\\(${Ft},${Ft},${Ft},${Es}\\)$`),Gk=new RegExp(`^hsl\\(${Es},${Ft},${Ft}\\)$`),Zk=new RegExp(`^hsla\\(${Es},${Ft},${Ft},${Es}\\)$`),ah={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vd(Bs,_s,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ch,formatHex:ch,formatHex8:Jk,formatHsl:e2,formatRgb:dh,toString:dh});function ch(){return this.rgb().formatHex()}function Jk(){return this.rgb().formatHex8()}function e2(){return hg(this).formatHsl()}function dh(){return this.rgb().formatRgb()}function _s(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wk.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fh(t):n===3?new Ke(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?po(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?po(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Xk.exec(e))?new Ke(t[1],t[2],t[3],1):(t=Yk.exec(e))?new Ke(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=qk.exec(e))?po(t[1],t[2],t[3],t[4]):(t=Kk.exec(e))?po(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Gk.exec(e))?mh(t[1],t[2]/100,t[3]/100,1):(t=Zk.exec(e))?mh(t[1],t[2]/100,t[3]/100,t[4]):ah.hasOwnProperty(e)?fh(ah[e]):e==="transparent"?new Ke(NaN,NaN,NaN,0):null}function fh(e){return new Ke(e>>16&255,e>>8&255,e&255,1)}function po(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ke(e,t,n,r)}function t2(e){return e instanceof Bs||(e=_s(e)),e?(e=e.rgb(),new Ke(e.r,e.g,e.b,e.opacity)):new Ke}function tc(e,t,n,r){return arguments.length===1?t2(e):new Ke(e,t,n,r??1)}function Ke(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vd(Ke,tc,fg(Bs,{brighter(e){return e=e==null?pl:Math.pow(pl,e),new Ke(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ks:Math.pow(ks,e),new Ke(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ke(ar(this.r),ar(this.g),ar(this.b),ml(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hh,formatHex:hh,formatHex8:n2,formatRgb:ph,toString:ph}));function hh(){return`#${Jn(this.r)}${Jn(this.g)}${Jn(this.b)}`}function n2(){return`#${Jn(this.r)}${Jn(this.g)}${Jn(this.b)}${Jn((isNaN(this.opacity)?1:this.opacity)*255)}`}function ph(){const e=ml(this.opacity);return`${e===1?"rgb(":"rgba("}${ar(this.r)}, ${ar(this.g)}, ${ar(this.b)}${e===1?")":`, ${e})`}`}function ml(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ar(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jn(e){return e=ar(e),(e<16?"0":"")+e.toString(16)}function mh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _t(e,t,n,r)}function hg(e){if(e instanceof _t)return new _t(e.h,e.s,e.l,e.opacity);if(e instanceof Bs||(e=_s(e)),!e)return new _t;if(e instanceof _t)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,l=s-i,u=(s+i)/2;return l?(t===s?o=(n-r)/l+(n<r)*6:n===s?o=(r-t)/l+2:o=(t-n)/l+4,l/=u<.5?s+i:2-s-i,o*=60):l=u>0&&u<1?0:o,new _t(o,l,u,e.opacity)}function r2(e,t,n,r){return arguments.length===1?hg(e):new _t(e,t,n,r??1)}function _t(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vd(_t,r2,fg(Bs,{brighter(e){return e=e==null?pl:Math.pow(pl,e),new _t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ks:Math.pow(ks,e),new _t(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ke(Du(e>=240?e-240:e+120,i,r),Du(e,i,r),Du(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _t(gh(this.h),mo(this.s),mo(this.l),ml(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ml(this.opacity);return`${e===1?"hsl(":"hsla("}${gh(this.h)}, ${mo(this.s)*100}%, ${mo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gh(e){return e=(e||0)%360,e<0?e+360:e}function mo(e){return Math.max(0,Math.min(1,e||0))}function Du(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const pg=e=>()=>e;function i2(e,t){return function(n){return e+n*t}}function s2(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function o2(e){return(e=+e)==1?mg:function(t,n){return n-t?s2(t,n,e):pg(isNaN(t)?n:t)}}function mg(e,t){var n=t-e;return n?i2(e,n):pg(isNaN(e)?t:e)}const yh=function e(t){var n=o2(t);function r(i,s){var o=n((i=tc(i)).r,(s=tc(s)).r),l=n(i.g,s.g),u=n(i.b,s.b),a=mg(i.opacity,s.opacity);return function(f){return i.r=o(f),i.g=l(f),i.b=u(f),i.opacity=a(f),i+""}}return r.gamma=e,r}(1);function vn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Au=new RegExp(nc.source,"g");function l2(e){return function(){return e}}function u2(e){return function(t){return e(t)+""}}function a2(e,t){var n=nc.lastIndex=Au.lastIndex=0,r,i,s,o=-1,l=[],u=[];for(e=e+"",t=t+"";(r=nc.exec(e))&&(i=Au.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),l[o]?l[o]+=s:l[++o]=s),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:vn(r,i)})),n=Au.lastIndex;return n<t.length&&(s=t.slice(n),l[o]?l[o]+=s:l[++o]=s),l.length<2?u[0]?u2(u[0].x):l2(t):(t=u.length,function(a){for(var f=0,c;f<t;++f)l[(c=u[f]).i]=c.x(a);return l.join("")})}var vh=180/Math.PI,rc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gg(e,t,n,r,i,s){var o,l,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*vh,skewX:Math.atan(u)*vh,scaleX:o,scaleY:l}}var go;function c2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rc:gg(t.a,t.b,t.c,t.d,t.e,t.f)}function d2(e){return e==null||(go||(go=document.createElementNS("http://www.w3.org/2000/svg","g")),go.setAttribute("transform",e),!(e=go.transform.baseVal.consolidate()))?rc:(e=e.matrix,gg(e.a,e.b,e.c,e.d,e.e,e.f))}function yg(e,t,n,r){function i(a){return a.length?a.pop()+" ":""}function s(a,f,c,d,h,v){if(a!==c||f!==d){var x=h.push("translate(",null,t,null,n);v.push({i:x-4,x:vn(a,c)},{i:x-2,x:vn(f,d)})}else(c||d)&&h.push("translate("+c+t+d+n)}function o(a,f,c,d){a!==f?(a-f>180?f+=360:f-a>180&&(a+=360),d.push({i:c.push(i(c)+"rotate(",null,r)-2,x:vn(a,f)})):f&&c.push(i(c)+"rotate("+f+r)}function l(a,f,c,d){a!==f?d.push({i:c.push(i(c)+"skewX(",null,r)-2,x:vn(a,f)}):f&&c.push(i(c)+"skewX("+f+r)}function u(a,f,c,d,h,v){if(a!==c||f!==d){var x=h.push(i(h)+"scale(",null,",",null,")");v.push({i:x-4,x:vn(a,c)},{i:x-2,x:vn(f,d)})}else(c!==1||d!==1)&&h.push(i(h)+"scale("+c+","+d+")")}return function(a,f){var c=[],d=[];return a=e(a),f=e(f),s(a.translateX,a.translateY,f.translateX,f.translateY,c,d),o(a.rotate,f.rotate,c,d),l(a.skewX,f.skewX,c,d),u(a.scaleX,a.scaleY,f.scaleX,f.scaleY,c,d),a=f=null,function(h){for(var v=-1,x=d.length,S;++v<x;)c[(S=d[v]).i]=S.x(h);return c.join("")}}}var f2=yg(c2,"px, ","px)","deg)"),h2=yg(d2,", ",")",")"),p2=1e-12;function xh(e){return((e=Math.exp(e))+1/e)/2}function m2(e){return((e=Math.exp(e))-1/e)/2}function g2(e){return((e=Math.exp(2*e))-1)/(e+1)}const y2=function e(t,n,r){function i(s,o){var l=s[0],u=s[1],a=s[2],f=o[0],c=o[1],d=o[2],h=f-l,v=c-u,x=h*h+v*v,S,p;if(x<p2)p=Math.log(d/a)/t,S=function(_){return[l+_*h,u+_*v,a*Math.exp(t*_*p)]};else{var y=Math.sqrt(x),m=(d*d-a*a+r*x)/(2*a*n*y),w=(d*d-a*a-r*x)/(2*d*n*y),E=Math.log(Math.sqrt(m*m+1)-m),P=Math.log(Math.sqrt(w*w+1)-w);p=(P-E)/t,S=function(_){var M=_*p,z=xh(E),T=a/(n*y)*(z*g2(t*M+E)-m2(E));return[l+T*h,u+T*v,a*z/xh(t*M+E)]}}return S.duration=p*1e3*t/Math.SQRT2,S}return i.rho=function(s){var o=Math.max(.001,+s),l=o*o,u=l*l;return e(o,l,u)},i}(Math.SQRT2,2,4);var pi=0,Ui=0,Ai=0,vg=1e3,gl,Qi,yl=0,vr=0,Bl=0,Ns=typeof performance=="object"&&performance.now?performance:Date,xg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function xd(){return vr||(xg(v2),vr=Ns.now()+Bl)}function v2(){vr=0}function vl(){this._call=this._time=this._next=null}vl.prototype=wg.prototype={constructor:vl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?xd():+n)+(t==null?0:+t),!this._next&&Qi!==this&&(Qi?Qi._next=this:gl=this,Qi=this),this._call=e,this._time=n,ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,ic())}};function wg(e,t,n){var r=new vl;return r.restart(e,t,n),r}function x2(){xd(),++pi;for(var e=gl,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pi}function wh(){vr=(yl=Ns.now())+Bl,pi=Ui=0;try{x2()}finally{pi=0,S2(),vr=0}}function w2(){var e=Ns.now(),t=e-yl;t>vg&&(Bl-=t,yl=e)}function S2(){for(var e,t=gl,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:gl=n);Qi=e,ic(r)}function ic(e){if(!pi){Ui&&(Ui=clearTimeout(Ui));var t=e-vr;t>24?(e<1/0&&(Ui=setTimeout(wh,e-Ns.now()-Bl)),Ai&&(Ai=clearInterval(Ai))):(Ai||(yl=Ns.now(),Ai=setInterval(w2,vg)),pi=1,xg(wh))}}function Sh(e,t,n){var r=new vl;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var k2=Fl("start","end","cancel","interrupt"),E2=[],Sg=0,kh=1,sc=2,Ao=3,Eh=4,oc=5,Lo=6;function Vl(e,t,n,r,i,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;_2(e,n,{name:t,index:r,group:i,on:k2,tween:E2,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Sg})}function wd(e,t){var n=bt(e,t);if(n.state>Sg)throw new Error("too late; already scheduled");return n}function Ht(e,t){var n=bt(e,t);if(n.state>Ao)throw new Error("too late; already running");return n}function bt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function _2(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=wg(s,0,n.time);function s(a){n.state=kh,n.timer.restart(o,n.delay,n.time),n.delay<=a&&o(a-n.delay)}function o(a){var f,c,d,h;if(n.state!==kh)return u();for(f in r)if(h=r[f],h.name===n.name){if(h.state===Ao)return Sh(o);h.state===Eh?(h.state=Lo,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[f]):+f<t&&(h.state=Lo,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[f])}if(Sh(function(){n.state===Ao&&(n.state=Eh,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=sc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===sc){for(n.state=Ao,i=new Array(d=n.tween.length),f=0,c=-1;f<d;++f)(h=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function l(a){for(var f=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(u),n.state=oc,1),c=-1,d=i.length;++c<d;)i[c].call(e,f);n.state===oc&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Lo,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function Oo(e,t){var n=e.__transition,r,i,s=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){s=!1;continue}i=r.state>sc&&r.state<oc,r.state=Lo,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}s&&delete e.__transition}}function N2(e){return this.each(function(){Oo(this,e)})}function C2(e,t){var n,r;return function(){var i=Ht(this,e),s=i.tween;if(s!==n){r=n=s;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function M2(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ht(this,e),o=s.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},u=0,a=i.length;u<a;++u)if(i[u].name===t){i[u]=l;break}u===a&&i.push(l)}s.tween=i}}function P2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=bt(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?C2:M2)(n,e,t))}function Sd(e,t,n){var r=e._id;return e.each(function(){var i=Ht(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return bt(i,r).value[t]}}function kg(e,t){var n;return(typeof t=="number"?vn:t instanceof _s?yh:(n=_s(t))?(t=n,yh):a2)(e,t)}function j2(e){return function(){this.removeAttribute(e)}}function b2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function z2(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttribute(e);return o===i?null:o===r?s:s=t(r=o,n)}}function T2(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?s:s=t(r=o,n)}}function I2(e,t,n){var r,i,s;return function(){var o,l=n(this),u;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),u=l+"",o===u?null:o===r&&u===i?s:(i=u,s=t(r=o,l)))}}function R2(e,t,n){var r,i,s;return function(){var o,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),u=l+"",o===u?null:o===r&&u===i?s:(i=u,s=t(r=o,l)))}}function $2(e,t){var n=Hl(e),r=n==="transform"?h2:kg;return this.attrTween(e,typeof t=="function"?(n.local?R2:I2)(n,r,Sd(this,"attr."+e,t)):t==null?(n.local?b2:j2)(n):(n.local?T2:z2)(n,r,t))}function D2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function A2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function L2(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&A2(e,s)),n}return i._value=t,i}function O2(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&D2(e,s)),n}return i._value=t,i}function F2(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Hl(e);return this.tween(n,(r.local?L2:O2)(r,t))}function H2(e,t){return function(){wd(this,e).delay=+t.apply(this,arguments)}}function B2(e,t){return t=+t,function(){wd(this,e).delay=t}}function V2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?H2:B2)(t,e)):bt(this.node(),t).delay}function U2(e,t){return function(){Ht(this,e).duration=+t.apply(this,arguments)}}function Q2(e,t){return t=+t,function(){Ht(this,e).duration=t}}function W2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?U2:Q2)(t,e)):bt(this.node(),t).duration}function X2(e,t){if(typeof t!="function")throw new Error;return function(){Ht(this,e).ease=t}}function Y2(e){var t=this._id;return arguments.length?this.each(X2(t,e)):bt(this.node(),t).ease}function q2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ht(this,e).ease=n}}function K2(e){if(typeof e!="function")throw new Error;return this.each(q2(this._id,e))}function G2(e){typeof e!="function"&&(e=Jm(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,l=r[i]=[],u,a=0;a<o;++a)(u=s[a])&&e.call(u,u.__data__,a,s)&&l.push(u);return new sn(r,this._parents,this._name,this._id)}function Z2(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),o=new Array(r),l=0;l<s;++l)for(var u=t[l],a=n[l],f=u.length,c=o[l]=new Array(f),d,h=0;h<f;++h)(d=u[h]||a[h])&&(c[h]=d);for(;l<r;++l)o[l]=t[l];return new sn(o,this._parents,this._name,this._id)}function J2(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function eE(e,t,n){var r,i,s=J2(t)?wd:Ht;return function(){var o=s(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function tE(e,t){var n=this._id;return arguments.length<2?bt(this.node(),n).on.on(e):this.each(eE(n,e,t))}function nE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function rE(){return this.on("end.remove",nE(this._id))}function iE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gd(e));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var l=r[o],u=l.length,a=s[o]=new Array(u),f,c,d=0;d<u;++d)(f=l[d])&&(c=e.call(f,f.__data__,d,l))&&("__data__"in f&&(c.__data__=f.__data__),a[d]=c,Vl(a[d],t,n,d,a,bt(f,n)));return new sn(s,this._parents,t,n)}function sE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Zm(e));for(var r=this._groups,i=r.length,s=[],o=[],l=0;l<i;++l)for(var u=r[l],a=u.length,f,c=0;c<a;++c)if(f=u[c]){for(var d=e.call(f,f.__data__,c,u),h,v=bt(f,n),x=0,S=d.length;x<S;++x)(h=d[x])&&Vl(h,t,n,x,d,v);s.push(d),o.push(f)}return new sn(s,o,t,n)}var oE=Hs.prototype.constructor;function lE(){return new oE(this._groups,this._parents)}function uE(e,t){var n,r,i;return function(){var s=hi(this,e),o=(this.style.removeProperty(e),hi(this,e));return s===o?null:s===n&&o===r?i:i=t(n=s,r=o)}}function Eg(e){return function(){this.style.removeProperty(e)}}function aE(e,t,n){var r,i=n+"",s;return function(){var o=hi(this,e);return o===i?null:o===r?s:s=t(r=o,n)}}function cE(e,t,n){var r,i,s;return function(){var o=hi(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),hi(this,e))),o===u?null:o===r&&u===i?s:(i=u,s=t(r=o,l))}}function dE(e,t){var n,r,i,s="style."+t,o="end."+s,l;return function(){var u=Ht(this,e),a=u.on,f=u.value[s]==null?l||(l=Eg(t)):void 0;(a!==n||i!==f)&&(r=(n=a).copy()).on(o,i=f),u.on=r}}function fE(e,t,n){var r=(e+="")=="transform"?f2:kg;return t==null?this.styleTween(e,uE(e,r)).on("end.style."+e,Eg(e)):typeof t=="function"?this.styleTween(e,cE(e,r,Sd(this,"style."+e,t))).each(dE(this._id,e)):this.styleTween(e,aE(e,r,t),n).on("end.style."+e,null)}function hE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function pE(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&hE(e,o,n)),r}return s._value=t,s}function mE(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,pE(e,t,n??""))}function gE(e){return function(){this.textContent=e}}function yE(e){return function(){var t=e(this);this.textContent=t??""}}function vE(e){return this.tween("text",typeof e=="function"?yE(Sd(this,"text",e)):gE(e==null?"":e+""))}function xE(e){return function(t){this.textContent=e.call(this,t)}}function wE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&xE(i)),t}return r._value=e,r}function SE(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,wE(e))}function kE(){for(var e=this._name,t=this._id,n=_g(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],l=o.length,u,a=0;a<l;++a)if(u=o[a]){var f=bt(u,t);Vl(u,e,n,a,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new sn(r,this._parents,e,n)}function EE(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var l={value:o},u={value:function(){--i===0&&s()}};n.each(function(){var a=Ht(this,r),f=a.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),a.on=t}),i===0&&s()})}var _E=0;function sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _g(){return++_E}var Bt=Hs.prototype;sn.prototype={constructor:sn,select:iE,selectAll:sE,selectChild:Bt.selectChild,selectChildren:Bt.selectChildren,filter:G2,merge:Z2,selection:lE,transition:kE,call:Bt.call,nodes:Bt.nodes,node:Bt.node,size:Bt.size,empty:Bt.empty,each:Bt.each,on:tE,attr:$2,attrTween:F2,style:fE,styleTween:mE,text:vE,textTween:SE,remove:rE,tween:P2,delay:V2,duration:W2,ease:Y2,easeVarying:K2,end:EE,[Symbol.iterator]:Bt[Symbol.iterator]};function NE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CE={time:null,delay:0,duration:250,ease:NE};function ME(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function PE(e){var t,n;e instanceof sn?(t=e._id,e=e._name):(t=_g(),(n=CE).time=xd(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],l=o.length,u,a=0;a<l;++a)(u=o[a])&&Vl(u,e,t,a,o,n||ME(u,t));return new sn(r,this._parents,e,t)}Hs.prototype.interrupt=N2;Hs.prototype.transition=PE;const yo=e=>()=>e;function jE(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function qt(e,t,n){this.k=e,this.x=t,this.y=n}qt.prototype={constructor:qt,scale:function(e){return e===1?this:new qt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ul=new qt(1,0,0);Ng.prototype=qt.prototype;function Ng(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ul;return e.__zoom}function Lu(e){e.stopImmediatePropagation()}function Li(e){e.preventDefault(),e.stopImmediatePropagation()}function bE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function zE(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function _h(){return this.__zoom||Ul}function TE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function IE(){return navigator.maxTouchPoints||"ontouchstart"in this}function RE(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function Cg(){var e=bE,t=zE,n=RE,r=TE,i=IE,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,u=y2,a=Fl("start","zoom","end"),f,c,d,h=500,v=150,x=0,S=10;function p(k){k.property("__zoom",_h).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",T).filter(i).on("touchstart.zoom",A).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(k,$,b,D){var N=k.selection?k.selection():k;N.property("__zoom",_h),k!==N?E(k,$,b,D):N.interrupt().each(function(){P(this,arguments).event(D).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},p.scaleBy=function(k,$,b,D){p.scaleTo(k,function(){var N=this.__zoom.k,j=typeof $=="function"?$.apply(this,arguments):$;return N*j},b,D)},p.scaleTo=function(k,$,b,D){p.transform(k,function(){var N=t.apply(this,arguments),j=this.__zoom,I=b==null?w(N):typeof b=="function"?b.apply(this,arguments):b,L=j.invert(I),H=typeof $=="function"?$.apply(this,arguments):$;return n(m(y(j,H),I,L),N,o)},b,D)},p.translateBy=function(k,$,b,D){p.transform(k,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),o)},null,D)},p.translateTo=function(k,$,b,D,N){p.transform(k,function(){var j=t.apply(this,arguments),I=this.__zoom,L=D==null?w(j):typeof D=="function"?D.apply(this,arguments):D;return n(Ul.translate(L[0],L[1]).scale(I.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof b=="function"?-b.apply(this,arguments):-b),j,o)},D,N)};function y(k,$){return $=Math.max(s[0],Math.min(s[1],$)),$===k.k?k:new qt($,k.x,k.y)}function m(k,$,b){var D=$[0]-b[0]*k.k,N=$[1]-b[1]*k.k;return D===k.x&&N===k.y?k:new qt(k.k,D,N)}function w(k){return[(+k[0][0]+ +k[1][0])/2,(+k[0][1]+ +k[1][1])/2]}function E(k,$,b,D){k.on("start.zoom",function(){P(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(D).end()}).tween("zoom",function(){var N=this,j=arguments,I=P(N,j).event(D),L=t.apply(N,j),H=b==null?w(L):typeof b=="function"?b.apply(N,j):b,q=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),U=N.__zoom,Y=typeof $=="function"?$.apply(N,j):$,X=u(U.invert(H).concat(q/U.k),Y.invert(H).concat(q/Y.k));return function(G){if(G===1)G=Y;else{var V=X(G),ee=q/V[2];G=new qt(ee,H[0]-V[0]*ee,H[1]-V[1]*ee)}I.zoom(null,G)}})}function P(k,$,b){return!b&&k.__zooming||new _(k,$)}function _(k,$){this.that=k,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(k,$),this.taps=0}_.prototype={event:function(k){return k&&(this.sourceEvent=k),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(k,$){return this.mouse&&k!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&k!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&k!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(k){var $=nt(this.that).datum();a.call(k,this.that,new jE(k,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:a}),$)}};function M(k,...$){if(!e.apply(this,arguments))return;var b=P(this,$).event(k),D=this.__zoom,N=Math.max(s[0],Math.min(s[1],D.k*Math.pow(2,r.apply(this,arguments)))),j=St(k);if(b.wheel)(b.mouse[0][0]!==j[0]||b.mouse[0][1]!==j[1])&&(b.mouse[1]=D.invert(b.mouse[0]=j)),clearTimeout(b.wheel);else{if(D.k===N)return;b.mouse=[j,D.invert(j)],Oo(this),b.start()}Li(k),b.wheel=setTimeout(I,v),b.zoom("mouse",n(m(y(D,N),b.mouse[0],b.mouse[1]),b.extent,o));function I(){b.wheel=null,b.end()}}function z(k,...$){if(d||!e.apply(this,arguments))return;var b=k.currentTarget,D=P(this,$,!0).event(k),N=nt(k.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",q,!0),j=St(k,b),I=k.clientX,L=k.clientY;ag(k.view),Lu(k),D.mouse=[j,this.__zoom.invert(j)],Oo(this),D.start();function H(U){if(Li(U),!D.moved){var Y=U.clientX-I,X=U.clientY-L;D.moved=Y*Y+X*X>x}D.event(U).zoom("mouse",n(m(D.that.__zoom,D.mouse[0]=St(U,b),D.mouse[1]),D.extent,o))}function q(U){N.on("mousemove.zoom mouseup.zoom",null),cg(U.view,D.moved),Li(U),D.event(U).end()}}function T(k,...$){if(e.apply(this,arguments)){var b=this.__zoom,D=St(k.changedTouches?k.changedTouches[0]:k,this),N=b.invert(D),j=b.k*(k.shiftKey?.5:2),I=n(m(y(b,j),D,N),t.apply(this,$),o);Li(k),l>0?nt(this).transition().duration(l).call(E,I,D,k):nt(this).call(p.transform,I,D,k)}}function A(k,...$){if(e.apply(this,arguments)){var b=k.touches,D=b.length,N=P(this,$,k.changedTouches.length===D).event(k),j,I,L,H;for(Lu(k),I=0;I<D;++I)L=b[I],H=St(L,this),H=[H,this.__zoom.invert(H),L.identifier],N.touch0?!N.touch1&&N.touch0[2]!==H[2]&&(N.touch1=H,N.taps=0):(N.touch0=H,j=!0,N.taps=1+!!f);f&&(f=clearTimeout(f)),j&&(N.taps<2&&(c=H[0],f=setTimeout(function(){f=null},h)),Oo(this),N.start())}}function F(k,...$){if(this.__zooming){var b=P(this,$).event(k),D=k.changedTouches,N=D.length,j,I,L,H;for(Li(k),j=0;j<N;++j)I=D[j],L=St(I,this),b.touch0&&b.touch0[2]===I.identifier?b.touch0[0]=L:b.touch1&&b.touch1[2]===I.identifier&&(b.touch1[0]=L);if(I=b.that.__zoom,b.touch1){var q=b.touch0[0],U=b.touch0[1],Y=b.touch1[0],X=b.touch1[1],G=(G=Y[0]-q[0])*G+(G=Y[1]-q[1])*G,V=(V=X[0]-U[0])*V+(V=X[1]-U[1])*V;I=y(I,Math.sqrt(G/V)),L=[(q[0]+Y[0])/2,(q[1]+Y[1])/2],H=[(U[0]+X[0])/2,(U[1]+X[1])/2]}else if(b.touch0)L=b.touch0[0],H=b.touch0[1];else return;b.zoom("touch",n(m(I,L,H),b.extent,o))}}function O(k,...$){if(this.__zooming){var b=P(this,$).event(k),D=k.changedTouches,N=D.length,j,I;for(Lu(k),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),j=0;j<N;++j)I=D[j],b.touch0&&b.touch0[2]===I.identifier?delete b.touch0:b.touch1&&b.touch1[2]===I.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(I=St(I,this),Math.hypot(c[0]-I[0],c[1]-I[1])<S)){var L=nt(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return p.wheelDelta=function(k){return arguments.length?(r=typeof k=="function"?k:yo(+k),p):r},p.filter=function(k){return arguments.length?(e=typeof k=="function"?k:yo(!!k),p):e},p.touchable=function(k){return arguments.length?(i=typeof k=="function"?k:yo(!!k),p):i},p.extent=function(k){return arguments.length?(t=typeof k=="function"?k:yo([[+k[0][0],+k[0][1]],[+k[1][0],+k[1][1]]]),p):t},p.scaleExtent=function(k){return arguments.length?(s[0]=+k[0],s[1]=+k[1],p):[s[0],s[1]]},p.translateExtent=function(k){return arguments.length?(o[0][0]=+k[0][0],o[1][0]=+k[1][0],o[0][1]=+k[0][1],o[1][1]=+k[1][1],p):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},p.constrain=function(k){return arguments.length?(n=k,p):n},p.duration=function(k){return arguments.length?(l=+k,p):l},p.interpolate=function(k){return arguments.length?(u=k,p):u},p.on=function(){var k=a.on.apply(a,arguments);return k===a?p:k},p.clickDistance=function(k){return arguments.length?(x=(k=+k)*k,p):Math.sqrt(x)},p.tapDistance=function(k){return arguments.length?(S=+k,p):S},p}const ln={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},Cs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Mg=["Enter"," ","Escape"];var mi;(function(e){e.Strict="strict",e.Loose="loose"})(mi||(mi={}));var cr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(cr||(cr={}));var Ms;(function(e){e.Partial="partial",e.Full="full"})(Ms||(Ms={}));const Pg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Sn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Sn||(Sn={}));var xl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(xl||(xl={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const Nh={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function jg(e){return e===null?null:e?"valid":"invalid"}const bg=e=>"id"in e&&"source"in e&&"target"in e,$E=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),kd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vs=(e,t=[0,0])=>{const{width:n,height:r}=un(e),i=e.origin??t,s=n*i[0],o=r*i[1];return{x:e.position.x-s,y:e.position.y-o}},DE=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const s=typeof i=="string";let o=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(i):kd(i)?i:t.nodeLookup.get(i.id));const l=o?wl(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ql(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Wl(n)},Us=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const i=wl(r);n=Ql(n,i)}}),Wl(n)},zg=(e,t,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const l={...Qs(t,[n,r,i]),width:t.width/i,height:t.height/i},u=[];for(const a of e.values()){const{measured:f,selectable:c=!0,hidden:d=!1}=a;if(o&&!c||d)continue;const h=f.width??a.width??a.initialWidth??null,v=f.height??a.height??a.initialHeight??null,x=Ps(l,yi(a)),S=(h??0)*(v??0),p=s&&x>0;(!a.internals.handleBounds||p||x>=S||a.dragging)&&u.push(a)}return u},AE=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function lc(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function uc({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(e.size===0)return Promise.resolve(!1);const l=Us(e),u=Ed(l,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await r.setViewport(u,{duration:o==null?void 0:o.duration}),Promise.resolve(!0)}function Tg({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},f=o.origin??r;let c=i;if(o.extent==="parent"&&!o.expandParent)if(!l)s==null||s("005",ln.error005());else{const h=l.measured.width,v=l.measured.height;h&&v&&(c=[[u,a],[u+h,a+v]])}else l&&vi(o.extent)&&(c=[[o.extent[0][0]+u,o.extent[0][1]+a],[o.extent[1][0]+u,o.extent[1][1]+a]]);const d=vi(c)?xr(t,c,o.measured):t;return{position:{x:d.x-u+o.measured.width*f[0],y:d.y-a+o.measured.height*f[1]},positionAbsolute:d}}async function LE({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(d=>d.id)),o=[];for(const d of n){if(d.deletable===!1)continue;const h=s.has(d.id),v=!h&&d.parentId&&o.find(x=>x.id===d.parentId);(h||v)&&o.push(d)}const l=new Set(t.map(d=>d.id)),u=r.filter(d=>d.deletable!==!1),f=AE(o,u);for(const d of u)l.has(d.id)&&!f.find(v=>v.id===d.id)&&f.push(d);if(!i)return{edges:f,nodes:o};const c=await i({nodes:o,edges:f});return typeof c=="boolean"?c?{edges:f,nodes:o}:{edges:[],nodes:[]}:c}const gi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),xr=(e={x:0,y:0},t,n)=>({x:gi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:gi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Ig(e,t,n){const{width:r,height:i}=un(n),{x:s,y:o}=n.internals.positionAbsolute;return xr(e,[[s,o],[s+r,o+i]],t)}const Ch=(e,t,n)=>e<t?gi(Math.abs(e-t),1,t)/t:e>n?-gi(Math.abs(e-n),1,t)/t:0,Rg=(e,t,n=15,r=40)=>{const i=Ch(e.x,r,t.width-r)*n,s=Ch(e.y,r,t.height-r)*n;return[i,s]},Ql=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),ac=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Wl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),yi=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=kd(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},wl=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=kd(e)?e.internals.positionAbsolute:Vs(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},$g=(e,t)=>Wl(Ql(ac(e),ac(t))),Ps=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Mh=e=>Nt(e.width)&&Nt(e.height)&&Nt(e.x)&&Nt(e.y),Nt=e=>!isNaN(e)&&isFinite(e),OE=(e,t)=>{},Xl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Qs=({x:e,y:t},[n,r,i],s=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return s?Xl(l,o):l},Dg=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Ed=(e,t,n,r,i,s)=>{const o=t/(e.width*(1+s)),l=n/(e.height*(1+s)),u=Math.min(o,l),a=gi(u,r,i),f=e.x+e.width/2,c=e.y+e.height/2,d=t/2-f*a,h=n/2-c*a;return{x:d,y:h,zoom:a}},Sl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function vi(e){return e!==void 0&&e!=="parent"}function un(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Ag(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Lg(e,t={width:0,height:0},n,r,i){const s={...e},o=r.get(n);if(o){const l=o.origin||i;s.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}function ts(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:o}=Gt(e),l=Qs({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:u,y:a}=n?Xl(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const Yl=e=>({width:e.offsetWidth,height:e.offsetHeight}),Og=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},FE=["INPUT","SELECT","TEXTAREA"];function cc(e){var r,i,s;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return FE.includes(t==null?void 0:t.nodeName)||((s=t==null?void 0:t.hasAttribute)==null?void 0:s.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const Fg=e=>"clientX"in e,Gt=(e,t)=>{var s,o;const n=Fg(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Ph=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Yl(o)}})};function Hg({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:l}){const u=e*.125+i*.375+o*.375+n*.125,a=t*.125+s*.375+l*.375+r*.125,f=Math.abs(u-e),c=Math.abs(a-t);return[u,a,f,c]}function vo(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function jh({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case K.Left:return[t-vo(t-r,s),n];case K.Right:return[t+vo(r-t,s),n];case K.Top:return[t,n-vo(n-i,s)];case K.Bottom:return[t,n+vo(i-n,s)]}}function Bg({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,curvature:o=.25}){const[l,u]=jh({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[a,f]=jh({pos:s,x1:r,y1:i,x2:e,y2:t,c:o}),[c,d,h,v]=Hg({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:f});return[`M${e},${t} C${l},${u} ${a},${f} ${r},${i}`,c,d,h,v]}function Vg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[s,l,i,o]}function HE({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;const s=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(s?o:0)}function BE({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=Ql(wl(e),wl(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Ps(o,Wl(s))>0}const VE=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,UE=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),QE=(e,t)=>{if(!e.source||!e.target)return t;let n;return bg(e)?n={...e}:n={...e,id:VE(e)},UE(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Ug({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,l]=Vg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,o,l]}const bh={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},WE=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},zh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function XE({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:i,offset:s}){const o=bh[t],l=bh[r],u={x:e.x+o.x*s,y:e.y+o.y*s},a={x:n.x+l.x*s,y:n.y+l.y*s},f=WE({source:u,sourcePosition:t,target:a}),c=f.x!==0?"x":"y",d=f[c];let h=[],v,x;const S={x:0,y:0},p={x:0,y:0},[y,m,w,E]=Vg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[c]*l[c]===-1){v=i.x??y,x=i.y??m;const _=[{x:v,y:u.y},{x:v,y:a.y}],M=[{x:u.x,y:x},{x:a.x,y:x}];o[c]===d?h=c==="x"?_:M:h=c==="x"?M:_}else{const _=[{x:u.x,y:a.y}],M=[{x:a.x,y:u.y}];if(c==="x"?h=o.x===d?M:_:h=o.y===d?_:M,t===r){const O=Math.abs(e[c]-n[c]);if(O<=s){const k=Math.min(s-1,s-O);o[c]===d?S[c]=(u[c]>e[c]?-1:1)*k:p[c]=(a[c]>n[c]?-1:1)*k}}if(t!==r){const O=c==="x"?"y":"x",k=o[c]===l[O],$=u[O]>a[O],b=u[O]<a[O];(o[c]===1&&(!k&&$||k&&b)||o[c]!==1&&(!k&&b||k&&$))&&(h=c==="x"?_:M)}const z={x:u.x+S.x,y:u.y+S.y},T={x:a.x+p.x,y:a.y+p.y},A=Math.max(Math.abs(z.x-h[0].x),Math.abs(T.x-h[0].x)),F=Math.max(Math.abs(z.y-h[0].y),Math.abs(T.y-h[0].y));A>=F?(v=(z.x+T.x)/2,x=h[0].y):(v=h[0].x,x=(z.y+T.y)/2)}return[[e,{x:u.x+S.x,y:u.y+S.y},...h,{x:a.x+p.x,y:a.y+p.y},n],v,x,w,E]}function YE(e,t,n,r){const i=Math.min(zh(e,t)/2,zh(t,n)/2,r),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const a=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${s+i*a},${o}Q ${s},${o} ${s},${o+i*f}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${s},${o+i*u}Q ${s},${o} ${s+i*l},${o}`}function dc({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,borderRadius:o=5,centerX:l,centerY:u,offset:a=20}){const[f,c,d,h,v]=XE({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:u},offset:a});return[f.reduce((S,p,y)=>{let m="";return y>0&&y<f.length-1?m=YE(f[y-1],p,f[y+1],o):m=`${y===0?"M":"L"}${p.x} ${p.y}`,S+=m,S},""),c,d,h,v]}function Th(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function qE(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Th(t)||!Th(n))return null;const r=t.internals.handleBounds||Ih(t.handles),i=n.internals.handleBounds||Ih(n.handles),s=Rh((r==null?void 0:r.source)??[],e.sourceHandle),o=Rh(e.connectionMode===mi.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!o)return(c=e.onError)==null||c.call(e,"008",ln.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(s==null?void 0:s.position)||K.Bottom,u=(o==null?void 0:o.position)||K.Top,a=js(t,s,l),f=js(n,o,u);return{sourceX:a.x,sourceY:a.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:u}}function Ih(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function js(e,t,n=K.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??un(e);if(r)return{x:i+o/2,y:s+l/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:i+o/2,y:s};case K.Right:return{x:i+o,y:s+l/2};case K.Bottom:return{x:i+o/2,y:s+l};case K.Left:return{x:i,y:s+l/2}}}function Rh(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function fc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function KE(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(u=>{if(u&&typeof u=="object"){const a=fc(u,t);s.has(a)||(o.push({id:a,color:u.color||n,...u}),s.add(a))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const _d={nodeOrigin:[0,0],nodeExtent:Cs,elevateNodesOnSelect:!0,defaults:{}},GE={..._d,checkEquality:!0};function Nd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function ZE(e,t,n){const r=Nd(_d,n);for(const i of e.values())if(i.parentId)Cd(i,e,t,r);else{const s=Vs(i,r.nodeOrigin),o=vi(i.extent)?i.extent:r.nodeExtent,l=xr(s,o,un(i));i.internals.positionAbsolute=l}}function hc(e,t,n,r){var l,u;const i=Nd(GE,r),s=new Map(t),o=i!=null&&i.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const a of e){let f=s.get(a.id);if(i.checkEquality&&a===(f==null?void 0:f.internals.userNode))t.set(a.id,f);else{const c=Vs(a,i.nodeOrigin),d=vi(a.extent)?a.extent:i.nodeExtent,h=xr(c,d,un(a));f={...i.defaults,...a,measured:{width:(l=a.measured)==null?void 0:l.width,height:(u=a.measured)==null?void 0:u.height},internals:{positionAbsolute:h,handleBounds:a.measured?f==null?void 0:f.internals.handleBounds:void 0,z:Qg(a,o),userNode:a}},t.set(a.id,f)}a.parentId&&Cd(f,t,n,r)}}function JE(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Cd(e,t,n,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:o}=Nd(_d,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}JE(e,n);const a=i?1e3:0,{x:f,y:c,z:d}=e_(e,u,s,o,a),{positionAbsolute:h}=e.internals,v=f!==h.x||c!==h.y;(v||d!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:v?{x:f,y:c}:h,z:d})}function Qg(e,t){return(Nt(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function e_(e,t,n,r,i){const{x:s,y:o}=t.internals.positionAbsolute,l=un(e),u=Vs(e,n),a=vi(e.extent)?xr(u,e.extent,l):u;let f=xr({x:s+a.x,y:o+a.y},r,l);e.extent==="parent"&&(f=Ig(f,l,t));const c=Qg(e,i),d=t.internals.z??0;return{x:f.x,y:f.y,z:d>c?d:c}}function Md(e,t,n,r=[0,0]){var o;const i=[],s=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((o=s.get(l.parentId))==null?void 0:o.expandedRect)??yi(u),f=$g(a,l.rect);s.set(l.parentId,{expandedRect:f,parent:u})}return s.size>0&&s.forEach(({expandedRect:l,parent:u},a)=>{var m;const f=u.internals.positionAbsolute,c=un(u),d=u.origin??r,h=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,v=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,x=Math.max(c.width,Math.round(l.width)),S=Math.max(c.height,Math.round(l.height)),p=(x-c.width)*d[0],y=(S-c.height)*d[1];(h>0||v>0||p||y)&&(i.push({id:a,type:"position",position:{x:u.position.x-h+p,y:u.position.y-v+y}}),(m=n.get(a))==null||m.forEach(w=>{e.some(E=>E.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+v}})})),(c.width<l.width||c.height<l.height||h||v)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?d[0]*h-p:0),height:S+(v?d[1]*v-y:0)}})}),i}function t_(e,t,n,r,i,s){const o=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!o)return{changes:[],updatedInternals:l};const u=[],a=window.getComputedStyle(o),{m22:f}=new window.DOMMatrixReadOnly(a.transform),c=[];for(const d of e.values()){const h=t.get(d.id);if(h)if(h.hidden)h.internals={...h.internals,handleBounds:void 0},l=!0;else{const v=Yl(d.nodeElement),x=h.measured.width!==v.width||h.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!h.internals.handleBounds||d.force))){const p=d.nodeElement.getBoundingClientRect(),y=vi(h.extent)?h.extent:s;let{positionAbsolute:m}=h.internals;h.parentId&&h.extent==="parent"?m=Ig(m,v,t.get(h.parentId)):y&&(m=xr(m,y,v)),h.measured=v,h.internals={...h.internals,positionAbsolute:m,handleBounds:{source:Ph("source",d.nodeElement,p,f,h.id),target:Ph("target",d.nodeElement,p,f,h.id)}},h.parentId&&Cd(h,t,n,{nodeOrigin:i}),l=!0,x&&(u.push({id:h.id,type:"dimensions",dimensions:v}),h.expandParent&&h.parentId&&c.push({id:h.id,parentId:h.parentId,rect:yi(h,i)}))}}}if(c.length>0){const d=Md(c,t,n,i);u.push(...d)}return{changes:u,updatedInternals:l}}async function n_({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function Wg(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:l=null}=r,u=`${i}-source-${o}`,a=`${s}-target-${l}`,f=e.get(u)||new Map,c=e.get(a)||new Map,d={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:l};t.set(r.id,r),e.set(u,f.set(`${s}-${l}`,d)),e.set(a,c.set(`${i}-${o}`,d))}}function Xg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Xg(n,t):!1}function $h(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function r_(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Xg(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(s);l&&i.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Ou({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,u;const i=[];for(const[a,f]of t){const c=(o=n.get(a))==null?void 0:o.internals.userNode;c&&i.push({...c,position:f.position,dragging:r})}if(!e)return[i[0],i];const s=(l=n.get(e))==null?void 0:l.internals.userNode;return[s?{...s,position:((u=t.get(e))==null?void 0:u.position)||s.position,dragging:r}:i[0],i]}function i_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,l=new Map,u=!1,a={x:0,y:0},f=null,c=!1,d=null,h=!1;function v({noDragClassName:S,handleSelector:p,domNode:y,isSelectable:m,nodeId:w,nodeClickDistance:E=0}){d=nt(y);function P({x:T,y:A},F){const{nodeLookup:O,nodeExtent:k,snapGrid:$,snapToGrid:b,nodeOrigin:D,onNodeDrag:N,onSelectionDrag:j,onError:I,updateNodePositions:L}=t();s={x:T,y:A};let H=!1,q={x:0,y:0,x2:0,y2:0};if(l.size>1&&k){const U=Us(l);q=ac(U)}for(const[U,Y]of l){if(!O.has(U))continue;let X={x:T-Y.distance.x,y:A-Y.distance.y};b&&(X=Xl(X,$));let G=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];if(l.size>1&&k&&!Y.extent){const{positionAbsolute:se}=Y.internals,ne=se.x-q.x+k[0][0],Z=se.x+Y.measured.width-q.x2+k[1][0],ue=se.y-q.y+k[0][1],fe=se.y+Y.measured.height-q.y2+k[1][1];G=[[ne,ue],[Z,fe]]}const{position:V,positionAbsolute:ee}=Tg({nodeId:U,nextPosition:X,nodeLookup:O,nodeExtent:G,nodeOrigin:D,onError:I});H=H||Y.position.x!==V.x||Y.position.y!==V.y,Y.position=V,Y.internals.positionAbsolute=ee}if(H&&(L(l,!0),F&&(r||N||!w&&j))){const[U,Y]=Ou({nodeId:w,dragItems:l,nodeLookup:O});r==null||r(F,l,U,Y),N==null||N(F,U,Y),w||j==null||j(F,Y)}}async function _(){if(!f)return;const{transform:T,panBy:A,autoPanSpeed:F}=t(),[O,k]=Rg(a,f,F);(O!==0||k!==0)&&(s.x=(s.x??0)-O/T[2],s.y=(s.y??0)-k/T[2],await A({x:O,y:k})&&P(s,null)),o=requestAnimationFrame(_)}function M(T){var H;const{nodeLookup:A,multiSelectionActive:F,nodesDraggable:O,transform:k,snapGrid:$,snapToGrid:b,selectNodesOnDrag:D,onNodeDragStart:N,onSelectionDragStart:j,unselectNodesAndEdges:I}=t();c=!0,(!D||!m)&&!F&&w&&((H=A.get(w))!=null&&H.selected||I()),m&&D&&w&&(e==null||e(w));const L=ts(T.sourceEvent,{transform:k,snapGrid:$,snapToGrid:b,containerBounds:f});if(s=L,l=r_(A,O,L,w),l.size>0&&(n||N||!w&&j)){const[q,U]=Ou({nodeId:w,dragItems:l,nodeLookup:A});n==null||n(T.sourceEvent,l,q,U),N==null||N(T.sourceEvent,q,U),w||j==null||j(T.sourceEvent,U)}}const z=dg().clickDistance(E).on("start",T=>{const{domNode:A,nodeDragThreshold:F,transform:O,snapGrid:k,snapToGrid:$}=t();f=(A==null?void 0:A.getBoundingClientRect())||null,h=!1,F===0&&M(T),s=ts(T.sourceEvent,{transform:O,snapGrid:k,snapToGrid:$,containerBounds:f}),a=Gt(T.sourceEvent,f)}).on("drag",T=>{const{autoPanOnNodeDrag:A,transform:F,snapGrid:O,snapToGrid:k,nodeDragThreshold:$,nodeLookup:b}=t(),D=ts(T.sourceEvent,{transform:F,snapGrid:O,snapToGrid:k,containerBounds:f});if((T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||w&&!b.has(w))&&(h=!0),!h){if(!u&&A&&c&&(u=!0,_()),!c){const N=D.xSnapped-(s.x??0),j=D.ySnapped-(s.y??0);Math.sqrt(N*N+j*j)>$&&M(T)}(s.x!==D.xSnapped||s.y!==D.ySnapped)&&l&&c&&(a=Gt(T.sourceEvent,f),P(D,T.sourceEvent))}}).on("end",T=>{if(!(!c||h)&&(u=!1,c=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:A,updateNodePositions:F,onNodeDragStop:O,onSelectionDragStop:k}=t();if(F(l,!1),i||O||!w&&k){const[$,b]=Ou({nodeId:w,dragItems:l,nodeLookup:A,dragging:!1});i==null||i(T.sourceEvent,l,$,b),O==null||O(T.sourceEvent,$,b),w||k==null||k(T.sourceEvent,b)}}}).filter(T=>{const A=T.target;return!T.button&&(!S||!$h(A,`.${S}`,y))&&(!p||$h(A,p,y))});d.call(z)}function x(){d==null||d.on(".drag",null)}return{update:v,destroy:x}}function s_(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Ps(i,yi(s))>0&&r.push(s);return r}const o_=250;function l_(e,t,n,r){var l,u;let i=[],s=1/0;const o=s_(e,n,t+o_);for(const a of o){const f=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const c of f){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:d,y:h}=js(a,c,c.position,!0),v=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));v>t||(v<s?(i=[{...c,x:d,y:h}],s=v):v===s&&i.push({...c,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){const a=r.type==="source"?"target":"source";return i.find(f=>f.type===a)??i[0]}return i[0]}function Yg(e,t,n,r,i,s=!1){var a,f,c;const o=r.get(e);if(!o)return null;const l=i==="strict"?(a=o.internals.handleBounds)==null?void 0:a[t]:[...((f=o.internals.handleBounds)==null?void 0:f.source)??[],...((c=o.internals.handleBounds)==null?void 0:c.target)??[]],u=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return u&&s?{...u,...js(o,u,u.position,!0)}:u}function qg(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function u_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Kg=()=>!0;function a_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:f,flowId:c,panBy:d,cancelConnection:h,onConnectStart:v,onConnect:x,onConnectEnd:S,isValidConnection:p=Kg,onReconnectEnd:y,updateConnection:m,getTransform:w,getFromHandle:E,autoPanSpeed:P}){const _=Og(e.target);let M=0,z;const{x:T,y:A}=Gt(e),F=_==null?void 0:_.elementFromPoint(T,A),O=qg(s,F),k=l==null?void 0:l.getBoundingClientRect();if(!k||!O)return;const $=Yg(i,O,r,u,t);if(!$)return;let b=Gt(e,k),D=!1,N=null,j=!1,I=null;function L(){if(!f||!k)return;const[ee,se]=Rg(b,k,P);d({x:ee,y:se}),M=requestAnimationFrame(L)}const H={...$,nodeId:i,type:O,position:$.position},q=u.get(i),Y={inProgress:!0,isValid:null,from:js(q,H,K.Left,!0),fromHandle:H,fromPosition:H.position,fromNode:q,to:b,toHandle:null,toPosition:Nh[H.position],toNode:null};m(Y);let X=Y;v==null||v(e,{nodeId:i,handleId:r,handleType:O});function G(ee){if(!E()||!H){V(ee);return}const se=w();b=Gt(ee,k),z=l_(Qs(b,se,!1,[1,1]),n,u,H),D||(L(),D=!0);const ne=Gg(ee,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:p,doc:_,lib:a,flowId:c,nodeLookup:u});I=ne.handleDomNode,N=ne.connection,j=u_(!!z,ne.isValid);const Z={...X,isValid:j,to:z&&j?Dg({x:z.x,y:z.y},se):b,toHandle:ne.toHandle,toPosition:j&&ne.toHandle?ne.toHandle.position:Nh[H.position],toNode:ne.toHandle?u.get(ne.toHandle.nodeId):null};j&&z&&X.toHandle&&Z.toHandle&&X.toHandle.type===Z.toHandle.type&&X.toHandle.nodeId===Z.toHandle.nodeId&&X.toHandle.id===Z.toHandle.id&&X.to.x===Z.to.x&&X.to.y===Z.to.y||(m(Z),X=Z)}function V(ee){(z||I)&&N&&j&&(x==null||x(N));const{inProgress:se,...ne}=X,Z={...ne,toPosition:X.toHandle?X.toPosition:null};S==null||S(ee,Z),s&&(y==null||y(ee,Z)),h(),cancelAnimationFrame(M),D=!1,j=!1,N=null,I=null,_.removeEventListener("mousemove",G),_.removeEventListener("mouseup",V),_.removeEventListener("touchmove",G),_.removeEventListener("touchend",V)}_.addEventListener("mousemove",G),_.addEventListener("mouseup",V),_.addEventListener("touchmove",G),_.addEventListener("touchend",V)}function Gg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:l,flowId:u,isValidConnection:a=Kg,nodeLookup:f}){const c=s==="target",d=t?o.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:v}=Gt(e),x=o.elementFromPoint(h,v),S=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:d,p={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const y=qg(void 0,S),m=S.getAttribute("data-nodeid"),w=S.getAttribute("data-handleid"),E=S.classList.contains("connectable"),P=S.classList.contains("connectableend");if(!m||!y)return p;const _={source:c?m:r,sourceHandle:c?w:i,target:c?r:m,targetHandle:c?i:w};p.connection=_;const z=E&&P&&(n===mi.Strict?c&&y==="source"||!c&&y==="target":m!==r||w!==i);p.isValid=z&&a(_),p.toHandle=Yg(m,y,w,f,n,!1)}return p}const pc={onPointerDown:a_,isValid:Gg};function c_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=nt(e);function s({translateExtent:l,width:u,height:a,zoomStep:f=10,pannable:c=!0,zoomable:d=!0,inversePan:h=!1}){const v=m=>{const w=n();if(m.sourceEvent.type!=="wheel"||!t)return;const E=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*f,P=w[2]*Math.pow(2,E);t.scaleTo(P)};let x=[0,0];const S=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(x=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},p=m=>{const w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const E=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],P=[E[0]-x[0],E[1]-x[1]];x=E;const _=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),M={x:w[0]-P[0]*_,y:w[1]-P[1]*_},z=[[0,0],[u,a]];t.setViewportConstrained({x:M.x,y:M.y,zoom:w[2]},z,l)},y=Cg().on("start",S).on("zoom",c?p:null).on("zoom.wheel",d?v:null);i.call(y,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:St}}const d_=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ql=e=>({x:e.x,y:e.y,zoom:e.k}),Fu=({x:e,y:t,zoom:n})=>Ul.translate(e,t).scale(n),Dr=(e,t)=>e.target.closest(`.${t}`),Zg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Hu=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},Jg=e=>{const t=e.ctrlKey&&Sl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function f_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return f=>{if(Dr(f,t))return!1;f.preventDefault(),f.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(f.ctrlKey&&o){const S=St(f),p=Jg(f),y=c*Math.pow(2,p);r.scaleTo(n,y,S,f);return}const d=f.deltaMode===1?20:1;let h=i===cr.Vertical?0:f.deltaX*d,v=i===cr.Horizontal?0:f.deltaY*d;!Sl()&&f.shiftKey&&i!==cr.Vertical&&(h=f.deltaY*d,v=0),r.translateBy(n,-(h/c)*s,-(v/c)*s,{internal:!0});const x=ql(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l==null||l(f,x)),e.isPanScrolling&&(u==null||u(f,x),e.panScrollTimeout=setTimeout(()=>{a==null||a(f,x),e.isPanScrolling=!1},150))}}function h_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type==="wheel"&&!r.ctrlKey||Dr(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function p_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,o,l;if((s=r.sourceEvent)!=null&&s.internal)return;const i=ql(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function m_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,l;e.usedRightMouseButton=!!(n&&Zg(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((l=s.sourceEvent)!=null&&l.internal)&&(i==null||i(s.sourceEvent,ql(s.transform)))}}function g_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,s&&Zg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&d_(e.prevViewport,o.transform))){const u=ql(o.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,u)},n?150:0)}}}function y_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:l,noPanClassName:u,lib:a}){return f=>{var v;const c=e||t,d=n&&f.ctrlKey;if(f.button===1&&f.type==="mousedown"&&(Dr(f,`${a}-flow__node`)||Dr(f,`${a}-flow__edge`)))return!0;if(!r&&!c&&!i&&!s&&!n||o||Dr(f,l)&&f.type==="wheel"||Dr(f,u)&&(f.type!=="wheel"||i&&f.type==="wheel"&&!e)||!n&&f.ctrlKey&&f.type==="wheel")return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!c&&!i&&!d&&f.type==="wheel"||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const h=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||f.type==="wheel")&&h}}function v_({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:a}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),d=Cg().clickDistance(!Nt(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),h=nt(e).call(d);m({x:s.x,y:s.y,zoom:gi(s.zoom,t,n)},[[0,0],[c.width,c.height]],i);const v=h.on("wheel.zoom"),x=h.on("dblclick.zoom");d.wheelDelta(Jg);function S(F,O){return h?new Promise(k=>{d==null||d.transform(Hu(h,O==null?void 0:O.duration,()=>k(!0)),F)}):Promise.resolve(!1)}function p({noWheelClassName:F,noPanClassName:O,onPaneContextMenu:k,userSelectionActive:$,panOnScroll:b,panOnDrag:D,panOnScrollMode:N,panOnScrollSpeed:j,preventScrolling:I,zoomOnPinch:L,zoomOnScroll:H,zoomOnDoubleClick:q,zoomActivationKeyPressed:U,lib:Y,onTransformChange:X}){$&&!f.isZoomingOrPanning&&y();const V=b&&!U&&!$?f_({zoomPanValues:f,noWheelClassName:F,d3Selection:h,d3Zoom:d,panOnScrollMode:N,panOnScrollSpeed:j,zoomOnPinch:L,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:u}):h_({noWheelClassName:F,preventScrolling:I,d3ZoomHandler:v});if(h.on("wheel.zoom",V,{passive:!1}),!$){const se=p_({zoomPanValues:f,onDraggingChange:a,onPanZoomStart:l});d.on("start",se);const ne=m_({zoomPanValues:f,panOnDrag:D,onPaneContextMenu:!!k,onPanZoom:o,onTransformChange:X});d.on("zoom",ne);const Z=g_({zoomPanValues:f,panOnDrag:D,panOnScroll:b,onPaneContextMenu:k,onPanZoomEnd:u,onDraggingChange:a});d.on("end",Z)}const ee=y_({zoomActivationKeyPressed:U,panOnDrag:D,zoomOnScroll:H,panOnScroll:b,zoomOnDoubleClick:q,zoomOnPinch:L,userSelectionActive:$,noPanClassName:O,noWheelClassName:F,lib:Y});d.filter(ee),q?h.on("dblclick.zoom",x):h.on("dblclick.zoom",null)}function y(){d.on("zoom",null)}async function m(F,O,k){const $=Fu(F),b=d==null?void 0:d.constrain()($,O,k);return b&&await S(b),new Promise(D=>D(b))}async function w(F,O){const k=Fu(F);return await S(k,O),new Promise($=>$(k))}function E(F){if(h){const O=Fu(F),k=h.property("__zoom");(k.k!==F.zoom||k.x!==F.x||k.y!==F.y)&&(d==null||d.transform(h,O,null,{sync:!0}))}}function P(){const F=h?Ng(h.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}function _(F,O){return h?new Promise(k=>{d==null||d.scaleTo(Hu(h,O==null?void 0:O.duration,()=>k(!0)),F)}):Promise.resolve(!1)}function M(F,O){return h?new Promise(k=>{d==null||d.scaleBy(Hu(h,O==null?void 0:O.duration,()=>k(!0)),F)}):Promise.resolve(!1)}function z(F){d==null||d.scaleExtent(F)}function T(F){d==null||d.translateExtent(F)}function A(F){const O=!Nt(F)||F<0?0:F;d==null||d.clickDistance(O)}return{update:p,destroy:y,setViewport:w,setViewportConstrained:m,getViewport:P,scaleTo:_,scaleBy:M,setScaleExtent:z,setTranslateExtent:T,syncViewport:E,setClickDistance:A}}var ns;(function(e){e.Line="line",e.Handle="handle"})(ns||(ns={}));function x_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const o=e-t,l=n-r,u=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(u[0]=u[0]*-1),l&&s&&(u[1]=u[1]*-1),u}function w_(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function fn(e,t){return Math.max(0,t-e)}function hn(e,t){return Math.max(0,e-t)}function xo(e,t,n){return Math.max(0,t-e,e-n)}function Dh(e,t){return e?!t:t}function S_(e,t,n,r,i,s,o,l){let{affectsX:u,affectsY:a}=t;const{isHorizontal:f,isVertical:c}=t,d=f&&c,{xSnapped:h,ySnapped:v}=n,{minWidth:x,maxWidth:S,minHeight:p,maxHeight:y}=r,{x:m,y:w,width:E,height:P,aspectRatio:_}=e;let M=Math.floor(f?h-e.pointerX:0),z=Math.floor(c?v-e.pointerY:0);const T=E+(u?-M:M),A=P+(a?-z:z),F=-s[0]*E,O=-s[1]*P;let k=xo(T,x,S),$=xo(A,p,y);if(o){let N=0,j=0;u&&M<0?N=fn(m+M+F,o[0][0]):!u&&M>0&&(N=hn(m+T+F,o[1][0])),a&&z<0?j=fn(w+z+O,o[0][1]):!a&&z>0&&(j=hn(w+A+O,o[1][1])),k=Math.max(k,N),$=Math.max($,j)}if(l){let N=0,j=0;u&&M>0?N=hn(m+M,l[0][0]):!u&&M<0&&(N=fn(m+T,l[1][0])),a&&z>0?j=hn(w+z,l[0][1]):!a&&z<0&&(j=fn(w+A,l[1][1])),k=Math.max(k,N),$=Math.max($,j)}if(i){if(f){const N=xo(T/_,p,y)*_;if(k=Math.max(k,N),o){let j=0;!u&&!a||u&&!a&&d?j=hn(w+O+T/_,o[1][1])*_:j=fn(w+O+(u?M:-M)/_,o[0][1])*_,k=Math.max(k,j)}if(l){let j=0;!u&&!a||u&&!a&&d?j=fn(w+T/_,l[1][1])*_:j=hn(w+(u?M:-M)/_,l[0][1])*_,k=Math.max(k,j)}}if(c){const N=xo(A*_,x,S)/_;if($=Math.max($,N),o){let j=0;!u&&!a||a&&!u&&d?j=hn(m+A*_+F,o[1][0])/_:j=fn(m+(a?z:-z)*_+F,o[0][0])/_,$=Math.max($,j)}if(l){let j=0;!u&&!a||a&&!u&&d?j=fn(m+A*_,l[1][0])/_:j=hn(m+(a?z:-z)*_,l[0][0])/_,$=Math.max($,j)}}}z=z+(z<0?$:-$),M=M+(M<0?k:-k),i&&(d?T>A*_?z=(Dh(u,a)?-M:M)/_:M=(Dh(u,a)?-z:z)*_:f?(z=M/_,a=u):(M=z*_,u=a));const b=u?m+M:m,D=a?w+z:w;return{width:E+(u?-M:M),height:P+(a?-z:z),x:s[0]*M*(u?-1:1)+b,y:s[1]*z*(a?-1:1)+D}}const ey={width:0,height:0,x:0,y:0},k_={...ey,pointerX:0,pointerY:0,aspectRatio:1};function E_(e){return[[0,0],[e.measured.width,e.measured.height]]}function __(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,l=n[0]*s,u=n[1]*o;return[[r-l,i-u],[r+s-l,i+o-u]]}function N_({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=nt(e);function o({controlPosition:u,boundaries:a,keepAspectRatio:f,onResizeStart:c,onResize:d,onResizeEnd:h,shouldResize:v}){let x={...ey},S={...k_};const p=w_(u);let y,m=null,w=[],E,P,_;const M=dg().on("start",z=>{const{nodeLookup:T,transform:A,snapGrid:F,snapToGrid:O,nodeOrigin:k,paneDomNode:$}=n();if(y=T.get(t),!y)return;m=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:b,ySnapped:D}=ts(z.sourceEvent,{transform:A,snapGrid:F,snapToGrid:O,containerBounds:m});x={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},S={...x,pointerX:b,pointerY:D,aspectRatio:x.width/x.height},E=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=T.get(y.parentId),P=E&&y.extent==="parent"?E_(E):void 0),w=[],_=void 0;for(const[N,j]of T)if(j.parentId===t&&(w.push({id:N,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const I=__(j,y,j.origin??k);_?_=[[Math.min(I[0][0],_[0][0]),Math.min(I[0][1],_[0][1])],[Math.max(I[1][0],_[1][0]),Math.max(I[1][1],_[1][1])]]:_=I}c==null||c(z,{...x})}).on("drag",z=>{const{transform:T,snapGrid:A,snapToGrid:F,nodeOrigin:O}=n(),k=ts(z.sourceEvent,{transform:T,snapGrid:A,snapToGrid:F,containerBounds:m}),$=[];if(!y)return;const{x:b,y:D,width:N,height:j}=x,I={},L=y.origin??O,{width:H,height:q,x:U,y:Y}=S_(S,p,k,a,f,L,P,_),X=H!==N,G=q!==j,V=U!==b&&X,ee=Y!==D&&G;if(!V&&!ee&&!X&&!G)return;if((V||ee||L[0]===1||L[1]===1)&&(I.x=V?U:x.x,I.y=ee?Y:x.y,x.x=I.x,x.y=I.y,w.length>0)){const ue=U-b,fe=Y-D;for(const Re of w)Re.position={x:Re.position.x-ue+L[0]*(H-N),y:Re.position.y-fe+L[1]*(q-j)},$.push(Re)}if((X||G)&&(I.width=X?H:x.width,I.height=G?q:x.height,x.width=I.width,x.height=I.height),E&&y.expandParent){const ue=L[0]*(I.width??0);I.x&&I.x<ue&&(x.x=ue,S.x=S.x-(I.x-ue));const fe=L[1]*(I.height??0);I.y&&I.y<fe&&(x.y=fe,S.y=S.y-(I.y-fe))}const se=x_({width:x.width,prevWidth:N,height:x.height,prevHeight:j,affectsX:p.affectsX,affectsY:p.affectsY}),ne={...x,direction:se};(v==null?void 0:v(z,ne))!==!1&&(d==null||d(z,ne),r(I,$))}).on("end",z=>{h==null||h(z,{...x}),i==null||i()});s.call(M)}function l(){s.on(".drag",null)}return{update:o,destroy:l}}var ty={exports:{}},ny={},ry={exports:{}},iy={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var xi=R;function C_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var M_=typeof Object.is=="function"?Object.is:C_,P_=xi.useState,j_=xi.useEffect,b_=xi.useLayoutEffect,z_=xi.useDebugValue;function T_(e,t){var n=t(),r=P_({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return b_(function(){i.value=n,i.getSnapshot=t,Bu(i)&&s({inst:i})},[e,n,t]),j_(function(){return Bu(i)&&s({inst:i}),e(function(){Bu(i)&&s({inst:i})})},[e]),z_(n),n}function Bu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!M_(e,n)}catch{return!0}}function I_(e,t){return t()}var R_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?I_:T_;iy.useSyncExternalStore=xi.useSyncExternalStore!==void 0?xi.useSyncExternalStore:R_;ry.exports=iy;var $_=ry.exports;/**
49
+ * @license React
50
+ * use-sync-external-store-shim/with-selector.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var Kl=R,D_=$_;function A_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var L_=typeof Object.is=="function"?Object.is:A_,O_=D_.useSyncExternalStore,F_=Kl.useRef,H_=Kl.useEffect,B_=Kl.useMemo,V_=Kl.useDebugValue;ny.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=F_(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=B_(function(){function u(h){if(!a){if(a=!0,f=h,h=r(h),i!==void 0&&o.hasValue){var v=o.value;if(i(v,h))return c=v}return c=h}if(v=c,L_(f,h))return v;var x=r(h);return i!==void 0&&i(v,x)?(f=h,v):(f=h,c=x)}var a=!1,f,c,d=n===void 0?null:n;return[function(){return u(t())},d===null?void 0:function(){return u(d())}]},[t,n,r,i]);var l=O_(e,s[0],s[1]);return H_(function(){o.hasValue=!0,o.value=l},[l]),V_(l),l};ty.exports=ny;var U_=ty.exports;const Q_=yp(U_),W_={},Ah=e=>{let t;const n=new Set,r=(f,c)=>{const d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){const h=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(v=>v(t,h))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>a,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(W_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,i,u);return u},X_=e=>e?Ah(e):Ah,{useDebugValue:Y_}=tx,{useSyncExternalStoreWithSelector:q_}=Q_,K_=e=>e;function sy(e,t=K_,n){const r=q_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Y_(r),r}const Lh=(e,t)=>{const n=X_(e),r=(i,s=t)=>sy(n,i,s);return Object.assign(r,n),r},G_=(e,t)=>e?Lh(e,t):Lh;function ke(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Gl=R.createContext(null),Z_=Gl.Provider,oy=ln.error001();function le(e,t){const n=R.useContext(Gl);if(n===null)throw new Error(oy);return sy(n,e,t)}function ge(){const e=R.useContext(Gl);if(e===null)throw new Error(oy);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Oh={display:"none"},J_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ly="react-flow__node-desc",uy="react-flow__edge-desc",eN="react-flow__aria-live",tN=e=>e.ariaLiveMessage;function nN({rfId:e}){const t=le(tN);return g.jsx("div",{id:`${eN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:J_,children:t})}function rN({rfId:e,disableKeyboardA11y:t}){return g.jsxs(g.Fragment,{children:[g.jsxs("div",{id:`${ly}-${e}`,style:Oh,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),g.jsx("div",{id:`${uy}-${e}`,style:Oh,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&g.jsx(nN,{rfId:e})]})}const iN=e=>e.userSelectionActive?"none":"all",Pd=R.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const o=le(iN),l=`${e}`.split("-");return g.jsx("div",{className:Ne(["react-flow__panel",n,...l]),style:{...r,pointerEvents:o},ref:s,...i,children:t})});function sN({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:g.jsx(Pd,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:g.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const oN=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},wo=e=>e.id;function lN(e,t){return ke(e.selectedNodes.map(wo),t.selectedNodes.map(wo))&&ke(e.selectedEdges.map(wo),t.selectedEdges.map(wo))}function uN({onSelectionChange:e}){const t=ge(),{selectedNodes:n,selectedEdges:r}=le(oN,lN);return R.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const aN=e=>!!e.onSelectionChangeHandlers;function cN({onSelectionChange:e}){const t=le(aN);return e||t?g.jsx(uN,{onSelectionChange:e}):null}const ay=[0,0],dN={x:0,y:0,zoom:1},fN=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Fh=[...fN,"rfId"],hN=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),Hh={translateExtent:Cs,nodeOrigin:ay,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function pN(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:u,setPaneClickDistance:a}=le(hN,ke),f=ge();R.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{c.current=Hh,l()}),[]);const c=R.useRef(Hh);return R.useEffect(()=>{for(const d of Fh){const h=e[d],v=c.current[d];h!==v&&(typeof e[d]>"u"||(d==="nodes"?t(h):d==="edges"?n(h):d==="minZoom"?r(h):d==="maxZoom"?i(h):d==="translateExtent"?s(h):d==="nodeExtent"?o(h):d==="paneClickDistance"?a(h):d==="fitView"?f.setState({fitViewOnInit:h}):d==="fitViewOptions"?f.setState({fitViewOnInitOptions:h}):f.setState({[d]:h})))}c.current=e},Fh.map(d=>e[d])),null}function Bh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function mN(e){var r;const[t,n]=R.useState(e==="system"?null:e);return R.useEffect(()=>{if(e!=="system"){n(e);return}const i=Bh(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[e]),t!==null?t:(r=Bh())!=null&&r.matches?"dark":"light"}const Vh=typeof document<"u"?document:null;function bs(e=null,t={target:Vh,actInsideInputWithModifier:!0}){const[n,r]=R.useState(!1),i=R.useRef(!1),s=R.useRef(new Set([])),[o,l]=R.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),f=a.reduce((c,d)=>c.concat(...d),[]);return[a,f]}return[[],[]]},[e]);return R.useEffect(()=>{const u=(t==null?void 0:t.target)||Vh;if(e!==null){const a=d=>{if(i.current=d.ctrlKey||d.metaKey||d.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&cc(d))return!1;const v=Qh(d.code,l);s.current.add(d[v]),Uh(o,s.current,!1)&&(d.preventDefault(),r(!0))},f=d=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&cc(d))return!1;const v=Qh(d.code,l);Uh(o,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(d[v]),d.key==="Meta"&&s.current.clear(),i.current=!1},c=()=>{s.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",a),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",c),window.addEventListener("contextmenu",c),()=>{u==null||u.removeEventListener("keydown",a),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",c),window.removeEventListener("contextmenu",c)}}},[e,r]),n}function Uh(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Qh(e,t){return t.includes(e)?"code":"key"}const gN=()=>{const e=ge();return R.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:s,domNode:o}=e.getState();if(!s||!o)return Promise.resolve(!1);const l=lc(n,t),{width:u,height:a}=Yl(o);return uc({nodes:l,width:u,height:a,minZoom:r,maxZoom:i,panZoom:s},t)},setCenter:async(t,n,r)=>{const{width:i,height:s,maxZoom:o,panZoom:l}=e.getState(),u=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:o,a=i/2-t*u,f=s/2-n*u;return l?(await l.setViewport({x:a,y:f,zoom:u},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:o,panZoom:l}=e.getState(),u=Ed(t,r,i,s,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:o,y:l}=s.getBoundingClientRect(),u={x:t.x-o,y:t.y-l};return Qs(u,r,n.snapToGrid,i)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),o=Dg(t,n);return{x:o.x+i,y:o.y+s}}}),[])};function cy(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const o=r.get(s.id);o?o.push(s):r.set(s.id,[s])}for(const s of t){const o=r.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...s};for(const u of o)yN(u,l);n.push(l)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function yN(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function vN(e,t){return cy(e,t)}function xN(e,t){return cy(e,t)}function qn(e,t){return{id:e,type:"select",selected:t}}function Ar(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const o=t.has(i);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),r.push(qn(s.id,o)))}return r}function Wh({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const l=t.get(o.id),u=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;u!==void 0&&u!==o&&n.push({id:o.id,item:o,type:"replace"}),u===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Xh(e){return{id:e.id,type:"remove"}}const Yh=e=>$E(e),wN=e=>bg(e);function dy(e){return R.forwardRef(e)}const SN=typeof window<"u"?R.useLayoutEffect:R.useEffect;function qh(e){const[t,n]=R.useState(BigInt(0)),[r]=R.useState(()=>kN(()=>n(i=>i+BigInt(1))));return SN(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function kN(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fy=R.createContext(null);function EN({children:e}){const t=ge(),n=R.useCallback(l=>{const{nodes:u=[],setNodes:a,hasDefaultNodes:f,onNodesChange:c,nodeLookup:d}=t.getState();let h=u;for(const v of l)h=typeof v=="function"?v(h):v;f?a(h):c&&c(Wh({items:h,lookup:d}))},[]),r=qh(n),i=R.useCallback(l=>{const{edges:u=[],setEdges:a,hasDefaultEdges:f,onEdgesChange:c,edgeLookup:d}=t.getState();let h=u;for(const v of l)h=typeof v=="function"?v(h):v;f?a(h):c&&c(Wh({items:h,lookup:d}))},[]),s=qh(i),o=R.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return g.jsx(fy.Provider,{value:o,children:e})}function _N(){const e=R.useContext(fy);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const NN=e=>!!e.panZoom;function jd(){const e=gN(),t=ge(),n=_N(),r=le(NN),i=R.useMemo(()=>{const s=c=>t.getState().nodeLookup.get(c),o=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},u=c=>{var p,y;const{nodeLookup:d,nodeOrigin:h}=t.getState(),v=Yh(c)?c:d.get(c.id),x=v.parentId?Lg(v.position,v.measured,v.parentId,d,h):v.position,S={...v,position:x,width:((p=v.measured)==null?void 0:p.width)??v.width,height:((y=v.measured)==null?void 0:y.height)??v.height};return yi(S)},a=(c,d,h={replace:!1})=>{o(v=>v.map(x=>{if(x.id===c){const S=typeof d=="function"?d(x):d;return h.replace&&Yh(S)?S:{...x,...S}}return x}))},f=(c,d,h={replace:!1})=>{l(v=>v.map(x=>{if(x.id===c){const S=typeof d=="function"?d(x):d;return h.replace&&wN(S)?S:{...x,...S}}return x}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var d;return(d=s(c))==null?void 0:d.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(d=>({...d}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:o,setEdges:l,addNodes:c=>{const d=Array.isArray(c)?c:[c];n.nodeQueue.push(h=>[...h,...d])},addEdges:c=>{const d=Array.isArray(c)?c:[c];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:c=[],edges:d=[],transform:h}=t.getState(),[v,x,S]=h;return{nodes:c.map(p=>({...p})),edges:d.map(p=>({...p})),viewport:{x:v,y:x,zoom:S}}},deleteElements:async({nodes:c=[],edges:d=[]})=>{const{nodes:h,edges:v,onNodesDelete:x,onEdgesDelete:S,triggerNodeChanges:p,triggerEdgeChanges:y,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:E,edges:P}=await LE({nodesToRemove:c,edgesToRemove:d,nodes:h,edges:v,onBeforeDelete:w}),_=P.length>0,M=E.length>0;if(_){const z=P.map(Xh);S==null||S(P),y(z)}if(M){const z=E.map(Xh);x==null||x(E),p(z)}return(M||_)&&(m==null||m({nodes:E,edges:P})),{deletedNodes:E,deletedEdges:P}},getIntersectingNodes:(c,d=!0,h)=>{const v=Mh(c),x=v?c:u(c),S=h!==void 0;return x?(h||t.getState().nodes).filter(p=>{const y=t.getState().nodeLookup.get(p.id);if(y&&!v&&(p.id===c.id||!y.internals.positionAbsolute))return!1;const m=yi(S?p:y),w=Ps(m,x);return d&&w>0||w>=x.width*x.height}):[]},isNodeIntersecting:(c,d,h=!0)=>{const x=Mh(c)?c:u(c);if(!x)return!1;const S=Ps(x,d);return h&&S>0||S>=x.width*x.height},updateNode:a,updateNodeData:(c,d,h={replace:!1})=>{a(c,v=>{const x=typeof d=="function"?d(v):d;return h.replace?{...v,data:x}:{...v,data:{...v.data,...x}}},h)},updateEdge:f,updateEdgeData:(c,d,h={replace:!1})=>{f(c,v=>{const x=typeof d=="function"?d(v):d;return h.replace?{...v,data:x}:{...v,data:{...v.data,...x}}},h)},getNodesBounds:c=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return DE(c,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:c,id:d,nodeId:h})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${h}-${c}-${d??null}`))==null?void 0:v.values())??[])}}},[]);return R.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const Kh=e=>e.selected,CN={actInsideInputWithModifier:!1},MN=typeof window<"u"?window:void 0;function PN({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ge(),{deleteElements:r}=jd(),i=bs(e,CN),s=bs(t,{target:MN});R.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(Kh),edges:o.filter(Kh)}),n.setState({nodesSelectionActive:!1})}},[i]),R.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function jN(e){const t=ge();R.useEffect(()=>{const n=()=>{var i,s;if(!e.current)return!1;const r=Yl(e.current);(r.height===0||r.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",ln.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Zl={position:"absolute",width:"100%",height:"100%",top:0,left:0},bN=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function zN({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=cr.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:a,minZoom:f,maxZoom:c,zoomActivationKeyCode:d,preventScrolling:h=!0,children:v,noWheelClassName:x,noPanClassName:S,onViewportChange:p,isControlledViewport:y,paneClickDistance:m}){const w=ge(),E=R.useRef(null),{userSelectionActive:P,lib:_}=le(bN,ke),M=bs(d),z=R.useRef();jN(E);const T=R.useCallback(A=>{p==null||p({x:A[0],y:A[1],zoom:A[2]}),y||w.setState({transform:A})},[p,y]);return R.useEffect(()=>{if(E.current){z.current=v_({domNode:E.current,minZoom:f,maxZoom:c,translateExtent:a,viewport:u,paneClickDistance:m,onDraggingChange:k=>w.setState({paneDragging:k}),onPanZoomStart:(k,$)=>{const{onViewportChangeStart:b,onMoveStart:D}=w.getState();D==null||D(k,$),b==null||b($)},onPanZoom:(k,$)=>{const{onViewportChange:b,onMove:D}=w.getState();D==null||D(k,$),b==null||b($)},onPanZoomEnd:(k,$)=>{const{onViewportChangeEnd:b,onMoveEnd:D}=w.getState();D==null||D(k,$),b==null||b($)}});const{x:A,y:F,zoom:O}=z.current.getViewport();return w.setState({panZoom:z.current,transform:[A,F,O],domNode:E.current.closest(".react-flow")}),()=>{var k;(k=z.current)==null||k.destroy()}}},[]),R.useEffect(()=>{var A;(A=z.current)==null||A.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:M,preventScrolling:h,noPanClassName:S,userSelectionActive:P,noWheelClassName:x,lib:_,onTransformChange:T})},[e,t,n,r,i,s,o,l,M,h,S,P,x,_,T]),g.jsx("div",{className:"react-flow__renderer",ref:E,style:Zl,children:v})}const TN=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function IN(){const{userSelectionActive:e,userSelectionRect:t}=le(TN,ke);return e&&t?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Vu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},RN=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function $N({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ms.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:a,onPaneMouseEnter:f,onPaneMouseMove:c,onPaneMouseLeave:d,children:h}){const v=R.useRef(null),x=ge(),S=R.useRef(0),p=R.useRef(0),y=R.useRef(),m=R.useRef(new Map),{userSelectionActive:w,elementsSelectable:E,dragging:P}=le(RN,ke),_=E&&(e||w),M=R.useRef(!1),z=R.useRef(!1),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,p.current=0},A=N=>{if(M.current){M.current=!1;return}l==null||l(N),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},F=N=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){N.preventDefault();return}u==null||u(N)},O=a?N=>a(N):void 0,k=N=>{var U,Y,X,G;const{resetSelectedElements:j,domNode:I,edgeLookup:L}=x.getState();if(y.current=I==null?void 0:I.getBoundingClientRect(),!E||!e||N.button!==0||N.target!==v.current||!y.current)return;(Y=(U=N.target)==null?void 0:U.setPointerCapture)==null||Y.call(U,N.pointerId),z.current=!0,M.current=!1,m.current=new Map;for(const[V,ee]of L)m.current.set(ee.source,((X=m.current.get(ee.source))==null?void 0:X.add(V))||new Set([V])),m.current.set(ee.target,((G=m.current.get(ee.target))==null?void 0:G.add(V))||new Set([V]));const{x:H,y:q}=Gt(N.nativeEvent,y.current);j(),x.setState({userSelectionRect:{width:0,height:0,startX:H,startY:q,x:H,y:q}}),s==null||s(N)},$=N=>{const{userSelectionRect:j,edgeLookup:I,transform:L,nodeLookup:H,triggerNodeChanges:q,triggerEdgeChanges:U}=x.getState();if(!y.current||!j)return;M.current=!0;const{x:Y,y:X}=Gt(N.nativeEvent,y.current),{startX:G,startY:V}=j,ee={startX:G,startY:V,x:Y<G?Y:G,y:X<V?X:V,width:Math.abs(Y-G),height:Math.abs(X-V)},se=zg(H,ee,L,n===Ms.Partial,!0),ne=new Set,Z=new Set;for(const ue of se){Z.add(ue.id);const fe=m.current.get(ue.id);if(fe)for(const Re of fe)ne.add(Re)}if(S.current!==Z.size){S.current=Z.size;const ue=Ar(H,Z,!0);q(ue)}if(p.current!==ne.size){p.current=ne.size;const ue=Ar(I,ne);U(ue)}x.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},b=N=>{var I,L;if(N.button!==0||!z.current)return;(L=(I=N.target)==null?void 0:I.releasePointerCapture)==null||L.call(I,N.pointerId);const{userSelectionRect:j}=x.getState();!w&&j&&N.target===v.current&&(A==null||A(N)),S.current>0&&x.setState({nodesSelectionActive:!0}),T(),o==null||o(N),(t||i)&&(M.current=!1),z.current=!1},D=r===!0||Array.isArray(r)&&r.includes(0);return g.jsxs("div",{className:Ne(["react-flow__pane",{draggable:D,dragging:P,selection:e}]),onClick:_?void 0:Vu(A,v),onContextMenu:Vu(F,v),onWheel:Vu(O,v),onPointerEnter:_?void 0:f,onPointerDown:_?k:c,onPointerMove:_?$:c,onPointerUp:_?b:void 0,onPointerLeave:d,ref:v,style:Zl,children:[h,g.jsx(IN,{})]})}function mc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:l,onError:u}=t.getState(),a=l.get(e);if(!a){u==null||u("012",ln.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&o)&&(s({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):i([e])}function hy({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:o}){const l=ge(),[u,a]=R.useState(!1),f=R.useRef();return R.useEffect(()=>{f.current=i_({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{mc({id:c,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),R.useEffect(()=>{var c,d;if(t)(c=f.current)==null||c.destroy();else if(e.current)return(d=f.current)==null||d.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:o}),()=>{var h;(h=f.current)==null||h.destroy()}},[n,r,t,s,e,i]),u}const DN=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function py(){const e=ge();return R.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:o,onError:l,updateNodePositions:u,nodeLookup:a,nodeOrigin:f}=e.getState(),c=new Map,d=DN(o),h=i?s[0]:5,v=i?s[1]:5,x=n.direction.x*h*n.factor,S=n.direction.y*v*n.factor;for(const[,p]of a){if(!d(p))continue;let y={x:p.internals.positionAbsolute.x+x,y:p.internals.positionAbsolute.y+S};i&&(y=Xl(y,s));const{position:m,positionAbsolute:w}=Tg({nodeId:p.id,nextPosition:y,nodeLookup:a,nodeExtent:r,nodeOrigin:f,onError:l});p.position=m,p.internals.positionAbsolute=w,c.set(p.id,p)}u(c)},[])}const bd=R.createContext(null),AN=bd.Provider;bd.Consumer;const my=()=>R.useContext(bd),LN=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ON=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:o}=r,{fromHandle:l,toHandle:u,isValid:a}=o,f=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:f,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===mi.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,valid:f&&a}};function FN({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:o,onConnect:l,children:u,className:a,onMouseDown:f,onTouchStart:c,...d},h){var k,$;const v=o||null,x=e==="target",S=ge(),p=my(),{connectOnClick:y,noPanClassName:m,rfId:w}=le(LN,ke),{connectingFrom:E,connectingTo:P,clickConnecting:_,isPossibleEndHandle:M,connectionInProcess:z,valid:T}=le(ON(p,v,e),ke);p||($=(k=S.getState()).onError)==null||$.call(k,"010",ln.error010());const A=b=>{const{defaultEdgeOptions:D,onConnect:N,hasDefaultEdges:j}=S.getState(),I={...D,...b};if(j){const{edges:L,setEdges:H}=S.getState();H(QE(I,L))}N==null||N(I),l==null||l(I)},F=b=>{if(!p)return;const D=Fg(b.nativeEvent);if(i&&(D&&b.button===0||!D)){const N=S.getState();pc.onPointerDown(b.nativeEvent,{autoPanOnConnect:N.autoPanOnConnect,connectionMode:N.connectionMode,connectionRadius:N.connectionRadius,domNode:N.domNode,nodeLookup:N.nodeLookup,lib:N.lib,isTarget:x,handleId:v,nodeId:p,flowId:N.rfId,panBy:N.panBy,cancelConnection:N.cancelConnection,onConnectStart:N.onConnectStart,onConnectEnd:N.onConnectEnd,updateConnection:N.updateConnection,onConnect:A,isValidConnection:n||N.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:N.autoPanSpeed})}D?f==null||f(b):c==null||c(b)},O=b=>{const{onClickConnectStart:D,onClickConnectEnd:N,connectionClickStartHandle:j,connectionMode:I,isValidConnection:L,lib:H,rfId:q,nodeLookup:U,connection:Y}=S.getState();if(!p||!j&&!i)return;if(!j){D==null||D(b.nativeEvent,{nodeId:p,handleId:v,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:p,type:e,id:v}});return}const X=Og(b.target),G=n||L,{connection:V,isValid:ee}=pc.isValid(b.nativeEvent,{handle:{nodeId:p,id:v,type:e},connectionMode:I,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:G,flowId:q,doc:X,lib:H,nodeLookup:U});ee&&V&&A(V);const se=structuredClone(Y);delete se.inProgress,se.toPosition=se.toHandle?se.toHandle.position:null,N==null||N(b,se),S.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":v,"data-nodeid":p,"data-handlepos":t,"data-id":`${w}-${p}-${v}-${e}`,className:Ne(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,a,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:s,clickconnecting:_,connectingfrom:E,connectingto:P,valid:T,connectionindicator:r&&(!z||M)&&(z?s:i)}]),onMouseDown:F,onTouchStart:F,onClick:y?O:void 0,ref:h,...d,children:u})}const Vn=R.memo(dy(FN));function HN({data:e,isConnectable:t,sourcePosition:n=K.Bottom}){return g.jsxs(g.Fragment,{children:[e==null?void 0:e.label,g.jsx(Vn,{type:"source",position:n,isConnectable:t})]})}function BN({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(Vn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,g.jsx(Vn,{type:"source",position:r,isConnectable:t})]})}function VN(){return null}function UN({data:e,isConnectable:t,targetPosition:n=K.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(Vn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const kl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Gh={input:HN,default:BN,output:UN,group:VN};function QN(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const WN=e=>{const{width:t,height:n,x:r,y:i}=Us(e.nodeLookup,{filter:s=>!!s.selected});return{width:Nt(t)?t:null,height:Nt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function XN({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ge(),{width:i,height:s,transformString:o,userSelectionActive:l}=le(WN,ke),u=py(),a=R.useRef(null);if(R.useEffect(()=>{var d;n||(d=a.current)==null||d.focus({preventScroll:!0})},[n]),hy({nodeRef:a}),l||!i||!s)return null;const f=e?d=>{const h=r.getState().nodes.filter(v=>v.selected);e(d,h)}:void 0,c=d=>{Object.prototype.hasOwnProperty.call(kl,d.key)&&(d.preventDefault(),u({direction:kl[d.key],factor:d.shiftKey?4:1}))};return g.jsx("div",{className:Ne(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:g.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:c,style:{width:i,height:s}})})}const Zh=typeof window<"u"?window:void 0,YN=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gy({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:a,selectionOnDrag:f,selectionMode:c,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:v,panActivationKeyCode:x,zoomActivationKeyCode:S,elementsSelectable:p,zoomOnScroll:y,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:P,zoomOnDoubleClick:_,panOnDrag:M,defaultViewport:z,translateExtent:T,minZoom:A,maxZoom:F,preventScrolling:O,onSelectionContextMenu:k,noWheelClassName:$,noPanClassName:b,disableKeyboardA11y:D,onViewportChange:N,isControlledViewport:j}){const{nodesSelectionActive:I,userSelectionActive:L}=le(YN),H=bs(a,{target:Zh}),q=bs(x,{target:Zh}),U=q||M,Y=q||w,X=f&&U!==!0,G=H||L||X;return PN({deleteKeyCode:u,multiSelectionKeyCode:v}),g.jsx(zN,{onPaneContextMenu:s,elementsSelectable:p,zoomOnScroll:y,zoomOnPinch:m,panOnScroll:Y,panOnScrollSpeed:E,panOnScrollMode:P,zoomOnDoubleClick:_,panOnDrag:!H&&U,defaultViewport:z,translateExtent:T,minZoom:A,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:O,noWheelClassName:$,noPanClassName:b,onViewportChange:N,isControlledViewport:j,paneClickDistance:l,children:g.jsxs($N,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:U,isSelecting:!!G,selectionMode:c,selectionKeyPressed:H,selectionOnDrag:X,children:[e,I&&g.jsx(XN,{onSelectionContextMenu:k,noPanClassName:b,disableKeyboardA11y:D})]})})}gy.displayName="FlowRenderer";const qN=R.memo(gy),KN=e=>t=>e?zg(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function GN(e){return le(R.useCallback(KN(e),[e]),ke)}const ZN=e=>e.updateNodeInternals;function JN(){const e=le(ZN),[t]=R.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return R.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function eC({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=ge(),s=R.useRef(null),o=R.useRef(null),l=R.useRef(e.sourcePosition),u=R.useRef(e.targetPosition),a=R.useRef(t),f=n&&!!e.internals.handleBounds;return R.useEffect(()=>{s.current&&!e.hidden&&(!f||o.current!==s.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(s.current),o.current=s.current)},[f,e.hidden]),R.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),R.useEffect(()=>{if(s.current){const c=a.current!==t,d=l.current!==e.sourcePosition,h=u.current!==e.targetPosition;(c||d||h)&&(a.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function tC({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:o,nodesDraggable:l,elementsSelectable:u,nodesConnectable:a,nodesFocusable:f,resizeObserver:c,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:v,rfId:x,nodeTypes:S,nodeExtent:p,nodeClickDistance:y,onError:m}){const{node:w,internals:E,isParent:P}=le(V=>{const ee=V.nodeLookup.get(e),se=V.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},ke);let _=w.type||"default",M=(S==null?void 0:S[_])||Gh[_];M===void 0&&(m==null||m("003",ln.error003(_)),_="default",M=Gh.default);const z=!!(w.draggable||l&&typeof w.draggable>"u"),T=!!(w.selectable||u&&typeof w.selectable>"u"),A=!!(w.connectable||a&&typeof w.connectable>"u"),F=!!(w.focusable||f&&typeof w.focusable>"u"),O=ge(),k=Ag(w),$=eC({node:w,nodeType:_,hasDimensions:k,resizeObserver:c}),b=hy({nodeRef:$,disabled:w.hidden||!z,noDragClassName:d,handleSelector:w.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:y}),D=py();if(w.hidden)return null;const N=un(w),j=QN(w),I=T||z||t||n||r||i,L=n?V=>n(V,{...E.userNode}):void 0,H=r?V=>r(V,{...E.userNode}):void 0,q=i?V=>i(V,{...E.userNode}):void 0,U=s?V=>s(V,{...E.userNode}):void 0,Y=o?V=>o(V,{...E.userNode}):void 0,X=V=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=O.getState();T&&(!ee||!z||se>0)&&mc({id:e,store:O,nodeRef:$}),t&&t(V,{...E.userNode})},G=V=>{if(!(cc(V.nativeEvent)||v))if(Mg.includes(V.key)&&T){const ee=V.key==="Escape";mc({id:e,store:O,unselect:ee,nodeRef:$})}else z&&w.selected&&Object.prototype.hasOwnProperty.call(kl,V.key)&&(V.preventDefault(),O.setState({ariaLiveMessage:`Moved selected node ${V.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~E.positionAbsolute.x}, y: ${~~E.positionAbsolute.y}`}),D({direction:kl[V.key],factor:V.shiftKey?4:1}))};return g.jsx("div",{className:Ne(["react-flow__node",`react-flow__node-${_}`,{[h]:z},w.className,{selected:w.selected,selectable:T,parent:P,draggable:z,dragging:b}]),ref:$,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:k?"visible":"hidden",...w.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:H,onMouseLeave:q,onContextMenu:U,onClick:X,onDoubleClick:Y,onKeyDown:F?G:void 0,tabIndex:F?0:void 0,role:F?"button":void 0,"aria-describedby":v?void 0:`${ly}-${x}`,"aria-label":w.ariaLabel,children:g.jsx(AN,{value:e,children:g.jsx(M,{id:e,data:w.data,type:_,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:w.selected,selectable:T,draggable:z,deletable:w.deletable??!0,isConnectable:A,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:b,dragHandle:w.dragHandle,zIndex:E.z,parentId:w.parentId,...N})})})}const nC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function yy(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=le(nC,ke),o=GN(e.onlyRenderVisibleElements),l=JN();return g.jsx("div",{className:"react-flow__nodes",style:Zl,children:o.map(u=>g.jsx(tC,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:s},u))})}yy.displayName="NodeRenderer";const rC=R.memo(yy);function iC(e){return le(R.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);s&&o&&BE({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),ke)}const sC=({color:e="none",strokeWidth:t=1})=>g.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),oC=({color:e="none",strokeWidth:t=1})=>g.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Jh={[xl.Arrow]:sC,[xl.ArrowClosed]:oC};function lC(e){const t=ge();return R.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(Jh,e)?Jh[e]:((s=(i=t.getState()).onError)==null||s.call(i,"009",ln.error009(e)),null)},[e])}const uC=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const u=lC(t);return u?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0",children:g.jsx(u,{color:n,strokeWidth:o})}):null},vy=({defaultColor:e,rfId:t})=>{const n=le(s=>s.edges),r=le(s=>s.defaultEdgeOptions),i=R.useMemo(()=>KE(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?g.jsx("svg",{className:"react-flow__marker",children:g.jsx("defs",{children:i.map(s=>g.jsx(uC,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};vy.displayName="MarkerDefinitions";var aC=R.memo(vy);function xy({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:s={},labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:u,className:a,...f}){const[c,d]=R.useState({x:1,y:0,width:0,height:0}),h=Ne(["react-flow__edge-textwrapper",a]),v=R.useRef(null);return R.useEffect(()=>{if(v.current){const x=v.current.getBBox();d({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),typeof n>"u"||!n?null:g.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:h,visibility:c.width?"visible":"hidden",...f,children:[i&&g.jsx("rect",{width:c.width+2*o[0],x:-o[0],y:-o[1],height:c.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),g.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:v,style:r,children:n}),u]})}xy.displayName="EdgeText";const cC=R.memo(xy);function Jl({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:a=20,...f}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...f,d:e,fill:"none",className:Ne(["react-flow__edge-path",f.className])}),a&&g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}),r&&Nt(t)&&Nt(n)?g.jsx(cC,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function ep({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function wy({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top}){const[o,l]=ep({pos:n,x1:e,y1:t,x2:r,y2:i}),[u,a]=ep({pos:s,x1:r,y1:i,x2:e,y2:t}),[f,c,d,h]=Hg({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:a});return[`M${e},${t} C${o},${l} ${u},${a} ${r},${i}`,f,c,d,h]}function Sy(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=K.Bottom,targetPosition:l=K.Top,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:x,markerStart:S,interactionWidth:p})=>{const[y,m,w]=wy({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l}),E=e.isInternal?void 0:t;return g.jsx(Jl,{id:E,path:y,labelX:m,labelY:w,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:x,markerStart:S,interactionWidth:p})})}const dC=Sy({isInternal:!1}),ky=Sy({isInternal:!0});dC.displayName="SimpleBezierEdge";ky.displayName="SimpleBezierEdgeInternal";function Ey(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,sourcePosition:h=K.Bottom,targetPosition:v=K.Top,markerEnd:x,markerStart:S,pathOptions:p,interactionWidth:y})=>{const[m,w,E]=dc({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:s,targetPosition:v,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset}),P=e.isInternal?void 0:t;return g.jsx(Jl,{id:P,path:m,labelX:w,labelY:E,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:x,markerStart:S,interactionWidth:y})})}const _y=Ey({isInternal:!1}),Ny=Ey({isInternal:!0});_y.displayName="SmoothStepEdge";Ny.displayName="SmoothStepEdgeInternal";function Cy(e){return R.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return g.jsx(_y,{...n,id:r,pathOptions:R.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const fC=Cy({isInternal:!1}),My=Cy({isInternal:!0});fC.displayName="StepEdge";My.displayName="StepEdgeInternal";function Py(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:v,interactionWidth:x})=>{const[S,p,y]=Ug({sourceX:n,sourceY:r,targetX:i,targetY:s}),m=e.isInternal?void 0:t;return g.jsx(Jl,{id:m,path:S,labelX:p,labelY:y,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:v,interactionWidth:x})})}const hC=Py({isInternal:!1}),jy=Py({isInternal:!0});hC.displayName="StraightEdge";jy.displayName="StraightEdgeInternal";function by(e){return R.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=K.Bottom,targetPosition:l=K.Top,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:x,markerStart:S,pathOptions:p,interactionWidth:y})=>{const[m,w,E]=Bg({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:l,curvature:p==null?void 0:p.curvature}),P=e.isInternal?void 0:t;return g.jsx(Jl,{id:P,path:m,labelX:w,labelY:E,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:v,markerEnd:x,markerStart:S,interactionWidth:y})})}const pC=by({isInternal:!1}),zy=by({isInternal:!0});pC.displayName="BezierEdge";zy.displayName="BezierEdgeInternal";const tp={default:zy,straight:jy,step:My,smoothstep:Ny,simplebezier:ky},np={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},mC=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,gC=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,rp="react-flow__edgeupdater";function ip({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:o,type:l}){return g.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:o,className:Ne([rp,`${rp}-${l}`]),cx:mC(t,r,e),cy:gC(n,r,e),r,stroke:"transparent",fill:"transparent"})}function yC({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:o,sourcePosition:l,targetPosition:u,onReconnect:a,onReconnectStart:f,onReconnectEnd:c,setReconnecting:d,setUpdateHover:h}){const v=ge(),x=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:P,domNode:_,isValidConnection:M,connectionMode:z,connectionRadius:T,lib:A,onConnectStart:F,onConnectEnd:O,cancelConnection:k,nodeLookup:$,rfId:b,panBy:D,updateConnection:N}=v.getState(),j=E.type==="target";d(!0),f==null||f(w,n,E.type);const I=(H,q)=>{d(!1),c==null||c(H,n,E.type,q)},L=H=>a==null?void 0:a(n,H);pc.onPointerDown(w.nativeEvent,{autoPanOnConnect:P,connectionMode:z,connectionRadius:T,domNode:_,handleId:E.id,nodeId:E.nodeId,nodeLookup:$,isTarget:j,edgeUpdaterType:E.type,lib:A,flowId:b,cancelConnection:k,panBy:D,isValidConnection:M,onConnect:L,onConnectStart:F,onConnectEnd:O,onReconnectEnd:I,updateConnection:N,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle})},S=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>h(!0),m=()=>h(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx(ip,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:y,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&g.jsx(ip,{position:u,centerX:s,centerY:o,radius:t,onMouseDown:p,onMouseEnter:y,onMouseOut:m,type:"target"})]})}function vC({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,reconnectRadius:f,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,rfId:v,edgeTypes:x,noPanClassName:S,onError:p,disableKeyboardA11y:y}){let m=le(Z=>Z.edgeLookup.get(e));const w=le(Z=>Z.defaultEdgeOptions);m=w?{...w,...m}:m;let E=m.type||"default",P=(x==null?void 0:x[E])||tp[E];P===void 0&&(p==null||p("011",ln.error011(E)),E="default",P=tp.default);const _=!!(m.focusable||t&&typeof m.focusable>"u"),M=typeof c<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),z=!!(m.selectable||r&&typeof m.selectable>"u"),T=R.useRef(null),[A,F]=R.useState(!1),[O,k]=R.useState(!1),$=ge(),{zIndex:b,sourceX:D,sourceY:N,targetX:j,targetY:I,sourcePosition:L,targetPosition:H}=le(R.useCallback(Z=>{const ue=Z.nodeLookup.get(m.source),fe=Z.nodeLookup.get(m.target);if(!ue||!fe)return{zIndex:m.zIndex,...np};const Re=qE({id:e,sourceNode:ue,targetNode:fe,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:p});return{zIndex:HE({selected:m.selected,zIndex:m.zIndex,sourceNode:ue,targetNode:fe,elevateOnSelect:Z.elevateEdgesOnSelect}),...Re||np}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),ke),q=R.useMemo(()=>m.markerStart?`url('#${fc(m.markerStart,v)}')`:void 0,[m.markerStart,v]),U=R.useMemo(()=>m.markerEnd?`url('#${fc(m.markerEnd,v)}')`:void 0,[m.markerEnd,v]);if(m.hidden||D===null||N===null||j===null||I===null)return null;const Y=Z=>{var an;const{addSelectedEdges:ue,unselectNodesAndEdges:fe,multiSelectionActive:Re}=$.getState();z&&($.setState({nodesSelectionActive:!1}),m.selected&&Re?(fe({nodes:[],edges:[m]}),(an=T.current)==null||an.blur()):ue([e])),i&&i(Z,m)},X=s?Z=>{s(Z,{...m})}:void 0,G=o?Z=>{o(Z,{...m})}:void 0,V=l?Z=>{l(Z,{...m})}:void 0,ee=u?Z=>{u(Z,{...m})}:void 0,se=a?Z=>{a(Z,{...m})}:void 0,ne=Z=>{var ue;if(!y&&Mg.includes(Z.key)&&z){const{unselectNodesAndEdges:fe,addSelectedEdges:Re}=$.getState();Z.key==="Escape"?((ue=T.current)==null||ue.blur(),fe({edges:[m]})):Re([e])}};return g.jsx("svg",{style:{zIndex:b},children:g.jsxs("g",{className:Ne(["react-flow__edge",`react-flow__edge-${E}`,m.className,S,{selected:m.selected,animated:m.animated,inactive:!z&&!i,updating:A,selectable:z}]),onClick:Y,onDoubleClick:X,onContextMenu:G,onMouseEnter:V,onMouseMove:ee,onMouseLeave:se,onKeyDown:_?ne:void 0,tabIndex:_?0:void 0,role:_?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":_?`${uy}-${v}`:void 0,ref:T,children:[!O&&g.jsx(P,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:z,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:D,sourceY:N,targetX:j,targetY:I,sourcePosition:L,targetPosition:H,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:q,markerEnd:U,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),M&&g.jsx(yC,{edge:m,isReconnectable:M,reconnectRadius:f,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,sourceX:D,sourceY:N,targetX:j,targetY:I,sourcePosition:L,targetPosition:H,setUpdateHover:F,setReconnecting:k})]})})}const xC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ty({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:a,onEdgeClick:f,reconnectRadius:c,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:v,disableKeyboardA11y:x}){const{edgesFocusable:S,edgesReconnectable:p,elementsSelectable:y,onError:m}=le(xC,ke),w=iC(t);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(aC,{defaultColor:e,rfId:n}),w.map(E=>g.jsx(vC,{id:E,edgesFocusable:S,edgesReconnectable:p,elementsSelectable:y,noPanClassName:i,onReconnect:s,onContextMenu:o,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,onClick:f,reconnectRadius:c,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:v,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:x},E))]})}Ty.displayName="EdgeRenderer";const wC=R.memo(Ty),SC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function kC({children:e}){const t=le(SC);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function EC(e){const t=jd(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const _C=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function NC(e){const t=le(_C),n=ge();return R.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function CC(e){return e.connection.inProgress?{...e.connection,to:Qs(e.connection.to,e.transform)}:{...e.connection}}function MC(e){return CC}function PC(e){const t=MC();return le(t,ke)}const jC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function bC({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:o,isValid:l,inProgress:u}=le(jC,ke);return!(s&&i&&u)?null:g.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:Ne(["react-flow__connection",jg(l)]),children:g.jsx(Iy,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Iy=({style:e,type:t=Sn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:o,fromHandle:l,fromPosition:u,to:a,toNode:f,toHandle:c,toPosition:d}=PC();if(!i)return;if(n)return g.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:s.x,fromY:s.y,toX:a.x,toY:a.y,fromPosition:u,toPosition:d,connectionStatus:jg(r),toNode:f,toHandle:c});let h="";const v={sourceX:s.x,sourceY:s.y,sourcePosition:u,targetX:a.x,targetY:a.y,targetPosition:d};switch(t){case Sn.Bezier:[h]=Bg(v);break;case Sn.SimpleBezier:[h]=wy(v);break;case Sn.Step:[h]=dc({...v,borderRadius:0});break;case Sn.SmoothStep:[h]=dc(v);break;default:[h]=Ug(v)}return g.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Iy.displayName="ConnectionLine";const zC={};function sp(e=zC){R.useRef(e),ge(),R.useEffect(()=>{},[e])}function TC(){ge(),R.useRef(!1),R.useEffect(()=>{},[])}function Ry({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:f,onSelectionContextMenu:c,onSelectionStart:d,onSelectionEnd:h,connectionLineType:v,connectionLineStyle:x,connectionLineComponent:S,connectionLineContainerStyle:p,selectionKeyCode:y,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:P,zoomActivationKeyCode:_,deleteKeyCode:M,onlyRenderVisibleElements:z,elementsSelectable:T,defaultViewport:A,translateExtent:F,minZoom:O,maxZoom:k,preventScrolling:$,defaultMarkerColor:b,zoomOnScroll:D,zoomOnPinch:N,panOnScroll:j,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:q,onPaneClick:U,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneScroll:V,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:ne,onEdgeContextMenu:Z,onEdgeMouseEnter:ue,onEdgeMouseMove:fe,onEdgeMouseLeave:Re,reconnectRadius:an,onReconnect:eu,onReconnectStart:tu,onReconnectEnd:nu,noDragClassName:_i,noWheelClassName:ru,noPanClassName:Ni,disableKeyboardA11y:Ci,nodeExtent:iu,rfId:Mi,viewport:Pi,onViewportChange:Ws}){return sp(e),sp(t),TC(),EC(n),NC(Pi),g.jsx(qN,{onPaneClick:U,onPaneMouseEnter:Y,onPaneMouseMove:X,onPaneMouseLeave:G,onPaneContextMenu:ee,onPaneScroll:V,paneClickDistance:se,deleteKeyCode:M,selectionKeyCode:y,selectionOnDrag:m,selectionMode:w,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:E,panActivationKeyCode:P,zoomActivationKeyCode:_,elementsSelectable:T,zoomOnScroll:D,zoomOnPinch:N,zoomOnDoubleClick:H,panOnScroll:j,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:q,defaultViewport:A,translateExtent:F,minZoom:O,maxZoom:k,onSelectionContextMenu:c,preventScrolling:$,noDragClassName:_i,noWheelClassName:ru,noPanClassName:Ni,disableKeyboardA11y:Ci,onViewportChange:Ws,isControlledViewport:!!Pi,children:g.jsxs(kC,{children:[g.jsx(wC,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:eu,onReconnectStart:tu,onReconnectEnd:nu,onlyRenderVisibleElements:z,onEdgeContextMenu:Z,onEdgeMouseEnter:ue,onEdgeMouseMove:fe,onEdgeMouseLeave:Re,reconnectRadius:an,defaultMarkerColor:b,noPanClassName:Ni,disableKeyboardA11y:Ci,rfId:Mi}),g.jsx(bC,{style:x,type:v,component:S,containerStyle:p}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(rC,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:f,nodeClickDistance:ne,onlyRenderVisibleElements:z,noPanClassName:Ni,noDragClassName:_i,disableKeyboardA11y:Ci,nodeExtent:iu,rfId:Mi}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ry.displayName="GraphView";const IC=R.memo(Ry),op=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:u}={})=>{const a=new Map,f=new Map,c=new Map,d=new Map,h=r??t??[],v=n??e??[],x=l??[0,0],S=u??Cs;Wg(c,d,h),hc(v,a,f,{nodeOrigin:x,nodeExtent:S,elevateNodesOnSelect:!1});let p=[0,0,1];if(o&&i&&s){const y=Us(a,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:m,y:w,zoom:E}=Ed(y,i,s,.5,2,.1);p=[m,w,E]}return{rfId:"1",width:0,height:0,transform:p,nodes:v,nodeLookup:a,parentLookup:f,edges:h,edgeLookup:d,connectionLookup:c,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Cs,nodeExtent:S,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:mi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...Pg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:OE,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},RC=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:u})=>G_((a,f)=>({...op({nodes:e,edges:t,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:u,defaultNodes:n,defaultEdges:r}),setNodes:c=>{const{nodeLookup:d,parentLookup:h,nodeOrigin:v,elevateNodesOnSelect:x}=f();hc(c,d,h,{nodeOrigin:v,nodeExtent:u,elevateNodesOnSelect:x,checkEquality:!0}),a({nodes:c})},setEdges:c=>{const{connectionLookup:d,edgeLookup:h}=f();Wg(d,h,c),a({edges:c})},setDefaultNodesAndEdges:(c,d)=>{if(c){const{setNodes:h}=f();h(c),a({hasDefaultNodes:!0})}if(d){const{setEdges:h}=f();h(d),a({hasDefaultEdges:!0})}},updateNodeInternals:(c,d={triggerFitView:!0})=>{const{triggerNodeChanges:h,nodeLookup:v,parentLookup:x,fitViewOnInit:S,fitViewDone:p,fitViewOnInitOptions:y,domNode:m,nodeOrigin:w,nodeExtent:E,debug:P,fitViewSync:_}=f(),{changes:M,updatedInternals:z}=t_(c,v,x,m,w,E);if(z){if(ZE(v,x,{nodeOrigin:w,nodeExtent:E}),d.triggerFitView){let T=p;!p&&S&&(T=_({...y,nodes:y==null?void 0:y.nodes})),a({fitViewDone:T})}else a({});(M==null?void 0:M.length)>0&&(P&&console.log("React Flow: trigger node changes",M),h==null||h(M))}},updateNodePositions:(c,d=!1)=>{const h=[],v=[];for(const[x,S]of c){const p=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(S!=null&&S.position)),y={id:x,type:"position",position:p?{x:Math.max(0,S.position.x),y:Math.max(0,S.position.y)}:S.position,dragging:d};p&&h.push({id:x,parentId:S.parentId,rect:{...S.internals.positionAbsolute,width:S.measured.width,height:S.measured.height}}),v.push(y)}if(h.length>0){const{nodeLookup:x,parentLookup:S,nodeOrigin:p}=f(),y=Md(h,x,S,p);v.push(...y)}f().triggerNodeChanges(v)},triggerNodeChanges:c=>{const{onNodesChange:d,setNodes:h,nodes:v,hasDefaultNodes:x,debug:S}=f();if(c!=null&&c.length){if(x){const p=vN(c,v);h(p)}S&&console.log("React Flow: trigger node changes",c),d==null||d(c)}},triggerEdgeChanges:c=>{const{onEdgesChange:d,setEdges:h,edges:v,hasDefaultEdges:x,debug:S}=f();if(c!=null&&c.length){if(x){const p=xN(c,v);h(p)}S&&console.log("React Flow: trigger edge changes",c),d==null||d(c)}},addSelectedNodes:c=>{const{multiSelectionActive:d,edgeLookup:h,nodeLookup:v,triggerNodeChanges:x,triggerEdgeChanges:S}=f();if(d){const p=c.map(y=>qn(y,!0));x(p);return}x(Ar(v,new Set([...c]),!0)),S(Ar(h))},addSelectedEdges:c=>{const{multiSelectionActive:d,edgeLookup:h,nodeLookup:v,triggerNodeChanges:x,triggerEdgeChanges:S}=f();if(d){const p=c.map(y=>qn(y,!0));S(p);return}S(Ar(h,new Set([...c]))),x(Ar(v,new Set,!0))},unselectNodesAndEdges:({nodes:c,edges:d}={})=>{const{edges:h,nodes:v,nodeLookup:x,triggerNodeChanges:S,triggerEdgeChanges:p}=f(),y=c||v,m=d||h,w=y.map(P=>{const _=x.get(P.id);return _&&(_.selected=!1),qn(P.id,!1)}),E=m.map(P=>qn(P.id,!1));S(w),p(E)},setMinZoom:c=>{const{panZoom:d,maxZoom:h}=f();d==null||d.setScaleExtent([c,h]),a({minZoom:c})},setMaxZoom:c=>{const{panZoom:d,minZoom:h}=f();d==null||d.setScaleExtent([h,c]),a({maxZoom:c})},setTranslateExtent:c=>{var d;(d=f().panZoom)==null||d.setTranslateExtent(c),a({translateExtent:c})},setPaneClickDistance:c=>{var d;(d=f().panZoom)==null||d.setClickDistance(c)},resetSelectedElements:()=>{const{edges:c,nodes:d,triggerNodeChanges:h,triggerEdgeChanges:v}=f(),x=d.reduce((p,y)=>y.selected?[...p,qn(y.id,!1)]:p,[]),S=c.reduce((p,y)=>y.selected?[...p,qn(y.id,!1)]:p,[]);h(x),v(S)},setNodeExtent:c=>{const{nodes:d,nodeLookup:h,parentLookup:v,nodeOrigin:x,elevateNodesOnSelect:S,nodeExtent:p}=f();c[0][0]===p[0][0]&&c[0][1]===p[0][1]&&c[1][0]===p[1][0]&&c[1][1]===p[1][1]||(hc(d,h,v,{nodeOrigin:x,nodeExtent:c,elevateNodesOnSelect:S,checkEquality:!1}),a({nodeExtent:c}))},panBy:c=>{const{transform:d,width:h,height:v,panZoom:x,translateExtent:S}=f();return n_({delta:c,panZoom:x,transform:d,translateExtent:S,width:h,height:v})},fitView:c=>{const{panZoom:d,width:h,height:v,minZoom:x,maxZoom:S,nodeLookup:p}=f();if(!d)return Promise.resolve(!1);const y=lc(p,c);return uc({nodes:y,width:h,height:v,panZoom:d,minZoom:x,maxZoom:S},c)},fitViewSync:c=>{const{panZoom:d,width:h,height:v,minZoom:x,maxZoom:S,nodeLookup:p}=f();if(!d)return!1;const y=lc(p,c);return uc({nodes:y,width:h,height:v,panZoom:d,minZoom:x,maxZoom:S},c),y.size>0},cancelConnection:()=>{a({connection:{...Pg}})},updateConnection:c=>{a({connection:c})},reset:()=>a({...op()})}),Object.is);function $C({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:o,nodeOrigin:l,nodeExtent:u,children:a}){const[f]=R.useState(()=>RC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,nodeOrigin:l,nodeExtent:u}));return g.jsx(Z_,{value:f,children:g.jsx(EN,{children:a})})}function DC({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:o,fitView:l,nodeOrigin:u,nodeExtent:a}){return R.useContext(Gl)?g.jsx(g.Fragment,{children:e}):g.jsx($C,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:o,fitView:l,nodeOrigin:u,nodeExtent:a,children:e})}const AC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function LC({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:o,onNodeClick:l,onEdgeClick:u,onInit:a,onMove:f,onMoveStart:c,onMoveEnd:d,onConnect:h,onConnectStart:v,onConnectEnd:x,onClickConnectStart:S,onClickConnectEnd:p,onNodeMouseEnter:y,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:P,onNodeDragStart:_,onNodeDrag:M,onNodeDragStop:z,onNodesDelete:T,onEdgesDelete:A,onDelete:F,onSelectionChange:O,onSelectionDragStart:k,onSelectionDrag:$,onSelectionDragStop:b,onSelectionContextMenu:D,onSelectionStart:N,onSelectionEnd:j,onBeforeDelete:I,connectionMode:L,connectionLineType:H=Sn.Bezier,connectionLineStyle:q,connectionLineComponent:U,connectionLineContainerStyle:Y,deleteKeyCode:X="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:V=!1,selectionMode:ee=Ms.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:ne=Sl()?"Meta":"Control",zoomActivationKeyCode:Z=Sl()?"Meta":"Control",snapToGrid:ue,snapGrid:fe,onlyRenderVisibleElements:Re=!1,selectNodesOnDrag:an,nodesDraggable:eu,nodesConnectable:tu,nodesFocusable:nu,nodeOrigin:_i=ay,edgesFocusable:ru,edgesReconnectable:Ni,elementsSelectable:Ci=!0,defaultViewport:iu=dN,minZoom:Mi=.5,maxZoom:Pi=2,translateExtent:Ws=Cs,preventScrolling:Fy=!0,nodeExtent:su,defaultMarkerColor:Hy="#b1b1b7",zoomOnScroll:By=!0,zoomOnPinch:Vy=!0,panOnScroll:Uy=!1,panOnScrollSpeed:Qy=.5,panOnScrollMode:Wy=cr.Free,zoomOnDoubleClick:Xy=!0,panOnDrag:Yy=!0,onPaneClick:qy,onPaneMouseEnter:Ky,onPaneMouseMove:Gy,onPaneMouseLeave:Zy,onPaneScroll:Jy,onPaneContextMenu:ev,paneClickDistance:zd=0,nodeClickDistance:tv=0,children:nv,onReconnect:rv,onReconnectStart:iv,onReconnectEnd:sv,onEdgeContextMenu:ov,onEdgeDoubleClick:lv,onEdgeMouseEnter:uv,onEdgeMouseMove:av,onEdgeMouseLeave:cv,reconnectRadius:dv=10,onNodesChange:fv,onEdgesChange:hv,noDragClassName:pv="nodrag",noWheelClassName:mv="nowheel",noPanClassName:Td="nopan",fitView:Id,fitViewOptions:gv,connectOnClick:yv,attributionPosition:vv,proOptions:xv,defaultEdgeOptions:wv,elevateNodesOnSelect:Sv,elevateEdgesOnSelect:kv,disableKeyboardA11y:Rd=!1,autoPanOnConnect:Ev,autoPanOnNodeDrag:_v,autoPanSpeed:Nv,connectionRadius:Cv,isValidConnection:Mv,onError:Pv,style:jv,id:$d,nodeDragThreshold:bv,viewport:zv,onViewportChange:Tv,width:Iv,height:Rv,colorMode:$v="light",debug:Dv,...Av},Lv){const ou=$d||"1",Ov=mN($v);return g.jsx("div",{"data-testid":"rf__wrapper",...Av,style:{...jv,...AC},ref:Lv,className:Ne(["react-flow",i,Ov]),id:$d,children:g.jsxs(DC,{nodes:e,edges:t,width:Iv,height:Rv,fitView:Id,nodeOrigin:_i,nodeExtent:su,children:[g.jsx(IC,{onInit:a,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:y,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:P,nodeTypes:s,edgeTypes:o,connectionLineType:H,connectionLineStyle:q,connectionLineComponent:U,connectionLineContainerStyle:Y,selectionKeyCode:G,selectionOnDrag:V,selectionMode:ee,deleteKeyCode:X,multiSelectionKeyCode:ne,panActivationKeyCode:se,zoomActivationKeyCode:Z,onlyRenderVisibleElements:Re,defaultViewport:iu,translateExtent:Ws,minZoom:Mi,maxZoom:Pi,preventScrolling:Fy,zoomOnScroll:By,zoomOnPinch:Vy,zoomOnDoubleClick:Xy,panOnScroll:Uy,panOnScrollSpeed:Qy,panOnScrollMode:Wy,panOnDrag:Yy,onPaneClick:qy,onPaneMouseEnter:Ky,onPaneMouseMove:Gy,onPaneMouseLeave:Zy,onPaneScroll:Jy,onPaneContextMenu:ev,paneClickDistance:zd,nodeClickDistance:tv,onSelectionContextMenu:D,onSelectionStart:N,onSelectionEnd:j,onReconnect:rv,onReconnectStart:iv,onReconnectEnd:sv,onEdgeContextMenu:ov,onEdgeDoubleClick:lv,onEdgeMouseEnter:uv,onEdgeMouseMove:av,onEdgeMouseLeave:cv,reconnectRadius:dv,defaultMarkerColor:Hy,noDragClassName:pv,noWheelClassName:mv,noPanClassName:Td,rfId:ou,disableKeyboardA11y:Rd,nodeExtent:su,viewport:zv,onViewportChange:Tv}),g.jsx(pN,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:v,onConnectEnd:x,onClickConnectStart:S,onClickConnectEnd:p,nodesDraggable:eu,nodesConnectable:tu,nodesFocusable:nu,edgesFocusable:ru,edgesReconnectable:Ni,elementsSelectable:Ci,elevateNodesOnSelect:Sv,elevateEdgesOnSelect:kv,minZoom:Mi,maxZoom:Pi,nodeExtent:su,onNodesChange:fv,onEdgesChange:hv,snapToGrid:ue,snapGrid:fe,connectionMode:L,translateExtent:Ws,connectOnClick:yv,defaultEdgeOptions:wv,fitView:Id,fitViewOptions:gv,onNodesDelete:T,onEdgesDelete:A,onDelete:F,onNodeDragStart:_,onNodeDrag:M,onNodeDragStop:z,onSelectionDrag:$,onSelectionDragStart:k,onSelectionDragStop:b,onMove:f,onMoveStart:c,onMoveEnd:d,noPanClassName:Td,nodeOrigin:_i,rfId:ou,autoPanOnConnect:Ev,autoPanOnNodeDrag:_v,autoPanSpeed:Nv,onError:Pv,connectionRadius:Cv,isValidConnection:Mv,selectNodesOnDrag:an,nodeDragThreshold:bv,onBeforeDelete:I,paneClickDistance:zd,debug:Dv}),g.jsx(cN,{onSelectionChange:O}),nv,g.jsx(sN,{proOptions:xv,position:vv}),g.jsx(rN,{rfId:ou,disableKeyboardA11y:Rd})]})})}var OC=dy(LC);function FC({dimensions:e,lineWidth:t,variant:n,className:r}){return g.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ne(["react-flow__background-pattern",n,r])})}function HC({radius:e,className:t}){return g.jsx("circle",{cx:e,cy:e,r:e,className:Ne(["react-flow__background-pattern","dots",t])})}var Zt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Zt||(Zt={}));const BC={[Zt.Dots]:1,[Zt.Lines]:1,[Zt.Cross]:6},VC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $y({id:e,variant:t=Zt.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:o,bgColor:l,style:u,className:a,patternClassName:f}){const c=R.useRef(null),{transform:d,patternId:h}=le(VC,ke),v=r||BC[t],x=t===Zt.Dots,S=t===Zt.Cross,p=Array.isArray(n)?n:[n,n],y=[p[0]*d[2]||1,p[1]*d[2]||1],m=v*d[2],w=Array.isArray(s)?s:[s,s],E=S?[m,m]:y,P=[w[0]*d[2]||1+E[0]/2,w[1]*d[2]||1+E[1]/2],_=`${h}${e||""}`;return g.jsxs("svg",{className:Ne(["react-flow__background",a]),style:{...u,...Zl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:c,"data-testid":"rf__background",children:[g.jsx("pattern",{id:_,x:d[0]%y[0],y:d[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:x?g.jsx(HC,{radius:m/2,className:f}):g.jsx(FC,{dimensions:E,lineWidth:i,variant:t,className:f})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}$y.displayName="Background";const UC=R.memo($y);function QC(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function WC(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function XC(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function YC(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function qC(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function So({children:e,className:t,...n}){return g.jsx("button",{type:"button",className:Ne(["react-flow__controls-button",t]),...n,children:e})}const KC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Dy({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:o,onFitView:l,onInteractiveChange:u,className:a,children:f,position:c="bottom-left",orientation:d="vertical","aria-label":h="React Flow controls"}){const v=ge(),{isInteractive:x,minZoomReached:S,maxZoomReached:p}=le(KC,ke),{zoomIn:y,zoomOut:m,fitView:w}=jd(),E=()=>{y(),s==null||s()},P=()=>{m(),o==null||o()},_=()=>{w(i),l==null||l()},M=()=>{v.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),u==null||u(!x)},z=d==="horizontal"?"horizontal":"vertical";return g.jsxs(Pd,{className:Ne(["react-flow__controls",z,a]),position:c,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(So,{onClick:E,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:p,children:g.jsx(QC,{})}),g.jsx(So,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S,children:g.jsx(WC,{})})]}),n&&g.jsx(So,{className:"react-flow__controls-fitview",onClick:_,title:"fit view","aria-label":"fit view",children:g.jsx(XC,{})}),r&&g.jsx(So,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity",children:x?g.jsx(qC,{}):g.jsx(YC,{})}),f]})}Dy.displayName="Controls";const GC=R.memo(Dy);function ZC({id:e,x:t,y:n,width:r,height:i,style:s,color:o,strokeColor:l,strokeWidth:u,className:a,borderRadius:f,shapeRendering:c,selected:d,onClick:h}){const{background:v,backgroundColor:x}=s||{},S=o||v||x;return g.jsx("rect",{className:Ne(["react-flow__minimap-node",{selected:d},a]),x:t,y:n,rx:f,ry:f,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:c,onClick:h?p=>h(p,e):void 0})}const JC=R.memo(ZC),e3=e=>e.nodes.map(t=>t.id),Uu=e=>e instanceof Function?e:()=>e;function t3({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=JC,onClick:o}){const l=le(e3,ke),u=Uu(t),a=Uu(e),f=Uu(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:l.map(d=>g.jsx(r3,{id:d,nodeColorFunc:u,nodeStrokeColorFunc:a,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:o,shapeRendering:c},d))})}function n3({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:l,onClick:u}){const{node:a,x:f,y:c,width:d,height:h}=le(v=>{const x=v.nodeLookup.get(e),{x:S,y:p}=x.internals.positionAbsolute,{width:y,height:m}=un(x);return{node:x,x:S,y:p,width:y,height:m}},ke);return!a||a.hidden||!Ag(a)?null:g.jsx(l,{x:f,y:c,width:d,height:h,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:i,strokeColor:n(a),strokeWidth:s,shapeRendering:o,onClick:u,id:a.id})}const r3=R.memo(n3);var i3=R.memo(t3);const s3=200,o3=150,l3=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?$g(Us(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},u3="react-flow__minimap-desc";function Ay({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:u,maskColor:a,maskStrokeColor:f,maskStrokeWidth:c,position:d="bottom-right",onClick:h,onNodeClick:v,pannable:x=!1,zoomable:S=!1,ariaLabel:p="React Flow mini map",inversePan:y,zoomStep:m=10,offsetScale:w=5}){const E=ge(),P=R.useRef(null),{boundingRect:_,viewBB:M,rfId:z,panZoom:T,translateExtent:A,flowWidth:F,flowHeight:O}=le(l3,ke),k=(e==null?void 0:e.width)??s3,$=(e==null?void 0:e.height)??o3,b=_.width/k,D=_.height/$,N=Math.max(b,D),j=N*k,I=N*$,L=w*N,H=_.x-(j-_.width)/2-L,q=_.y-(I-_.height)/2-L,U=j+L*2,Y=I+L*2,X=`${u3}-${z}`,G=R.useRef(0),V=R.useRef();G.current=N,R.useEffect(()=>{if(P.current&&T)return V.current=c_({domNode:P.current,panZoom:T,getTransform:()=>E.getState().transform,getViewScale:()=>G.current}),()=>{var ne;(ne=V.current)==null||ne.destroy()}},[T]),R.useEffect(()=>{var ne;(ne=V.current)==null||ne.update({translateExtent:A,width:F,height:O,inversePan:y,pannable:x,zoomStep:m,zoomable:S})},[x,S,y,m,A,F,O]);const ee=h?ne=>{var fe;const[Z,ue]=((fe=V.current)==null?void 0:fe.pointer(ne))||[0,0];h(ne,{x:Z,y:ue})}:void 0,se=v?R.useCallback((ne,Z)=>{const ue=E.getState().nodeLookup.get(Z);v(ne,ue)},[]):void 0;return g.jsx(Pd,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*N:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="string"?o:void 0},className:Ne(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:k,height:$,viewBox:`${H} ${q} ${U} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:P,onClick:ee,children:[p&&g.jsx("title",{id:X,children:p}),g.jsx(i3,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-L},${q-L}h${U+L*2}v${Y+L*2}h${-U-L*2}z
62
+ M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Ay.displayName="MiniMap";R.memo(Ay);function a3({nodeId:e,position:t,variant:n=ns.Handle,className:r,style:i={},children:s,color:o,minWidth:l=10,minHeight:u=10,maxWidth:a=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:c=!1,shouldResize:d,onResizeStart:h,onResize:v,onResizeEnd:x}){const S=my(),p=typeof e=="string"?e:S,y=ge(),m=R.useRef(null),w=n===ns.Line?"right":"bottom-right",E=t??w,P=R.useRef(null);R.useEffect(()=>{if(!(!m.current||!p))return P.current||(P.current=N_({domNode:m.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:T,transform:A,snapGrid:F,snapToGrid:O,nodeOrigin:k,domNode:$}=y.getState();return{nodeLookup:T,transform:A,snapGrid:F,snapToGrid:O,nodeOrigin:k,paneDomNode:$}},onChange:(T,A)=>{const{triggerNodeChanges:F,nodeLookup:O,parentLookup:k,nodeOrigin:$}=y.getState(),b=[],D={x:T.x,y:T.y},N=O.get(p);if(N&&N.expandParent&&N.parentId){const j=N.origin??$,I=T.width??N.measured.width,L=T.height??N.measured.height,H={id:N.id,parentId:N.parentId,rect:{width:I,height:L,...Lg({x:T.x??N.position.x,y:T.y??N.position.y},{width:I,height:L},N.parentId,O,j)}},q=Md([H],O,k,$);b.push(...q),D.x=T.x?Math.max(j[0]*I,T.x):void 0,D.y=T.y?Math.max(j[1]*L,T.y):void 0}if(D.x!==void 0&&D.y!==void 0){const j={id:p,type:"position",position:{...D}};b.push(j)}if(T.width!==void 0&&T.height!==void 0){const j={id:p,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:T.width,height:T.height}};b.push(j)}for(const j of A){const I={...j,type:"position"};b.push(I)}F(b)},onEnd:()=>{const T={id:p,type:"dimensions",resizing:!1};y.getState().triggerNodeChanges([T])}})),P.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:u,maxWidth:a,maxHeight:f},keepAspectRatio:c,onResizeStart:h,onResize:v,onResizeEnd:x,shouldResize:d}),()=>{var T;(T=P.current)==null||T.destroy()}},[E,l,u,a,f,c,h,v,x,d]);const _=E.split("-"),M=n===ns.Line?"borderColor":"backgroundColor",z=o?{...i,[M]:o}:i;return g.jsx("div",{className:Ne(["react-flow__resize-control","nodrag",..._,n,r]),ref:m,style:z,children:s})}R.memo(a3);function c3({data:e}){const t=e.status==="failed",n=e.status==="pending",r=!!e.childRunId,i=r?pd:md(e.kind),s=t?{rail:"bg-red-400",badge:"bg-red-500/15 text-red-300",pill:"bg-red-500/20 text-red-300"}:n?{rail:"bg-amber-400",badge:"bg-amber-500/15 text-amber-300",pill:"bg-amber-500/20 text-amber-300"}:{rail:"bg-emerald-400",badge:"bg-emerald-500/15 text-emerald-300",pill:"bg-emerald-500/20 text-emerald-300"};return g.jsxs("div",{title:r?Za.child:Za[e.kind]??e.kind,className:`group relative w-[208px] cursor-pointer overflow-hidden rounded-xl border bg-[var(--panel)]/95 shadow-lg backdrop-blur transition-all duration-150 hover:-translate-y-0.5 ${e.selected?"border-emerald-400/60 ring-2 ring-emerald-400/30":t?"border-red-500/40 hover:border-red-400/60":r?"border-indigo-500/40 hover:border-indigo-400/60":"border-[var(--line)] hover:border-zinc-600"}`,children:[g.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${s.rail} ${n?"animate-pulse":""}`}),g.jsx(Vn,{type:"target",position:K.Left,className:"!border-0 !bg-zinc-600"}),g.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${s.badge}`,children:g.jsx(i,{width:12,height:12})}),g.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),g.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${s.pill} ${n?"animate-pulse":""}`,children:t?g.jsx(Fs,{width:9,height:9}):n?g.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):g.jsx(Wm,{width:9,height:9})})]}),g.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?g.jsx("span",{className:"rounded border border-indigo-500/30 bg-indigo-500/10 px-1 text-indigo-300",children:"child ↗"}):g.jsx("span",{className:"rounded border border-[var(--line)] px-1 text-zinc-400",children:e.kind}),e.attempts>1&&g.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[g.jsx(Xm,{width:9,height:9}),e.attempts]}),e.workerGroup&&g.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),g.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&g.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&g.jsxs("div",{className:"mono mt-1.5 flex items-center gap-2 border-t border-[var(--line)] pt-1.5 text-[10px]",children:[e.subs.ok>0&&g.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&g.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&g.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),g.jsx(Vn,{type:"source",position:K.Right,className:"!border-0 !bg-zinc-600"})]})}function d3({data:e}){const t=e.status==="running"||e.status==="suspended";return g.jsxs("div",{className:`s-${e.status} flex items-center gap-2 rounded-full border border-current/30 bg-[var(--panel)] px-3.5 py-1.5`,children:[g.jsx(Vn,{type:"target",position:K.Left,className:"!border-0 !bg-zinc-600"}),g.jsx("span",{className:`dot ${t?"pulse":""}`}),g.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),g.jsx(Vn,{type:"source",position:K.Right,className:"!border-0 !bg-zinc-600"})]})}const f3={step:c3,terminal:d3};function h3(e){var n;const t=(n=e.events)==null?void 0:n.filter(r=>r.status);if(!(!t||t.length===0))return{ok:t.filter(r=>r.status==="ok").length,failed:t.filter(r=>r.status==="failed").length,skipped:t.filter(r=>r.status==="skipped").length}}function p3({run:e,timeline:t,selected:n,onSelect:r,onOpenRun:i,fmtDuration:s}){const{nodes:o,edges:l}=R.useMemo(()=>{const c={id:"start",type:"terminal",position:{x:0,y:0},data:{status:"running",label:e.workflow},draggable:!1},d=t.map((p,y)=>({id:`s${p.seq}`,type:"step",position:{x:(y+1)*248,y:0},draggable:!1,data:{seq:p.seq,name:p.name,kind:p.kind,status:p.status,workerGroup:p.workerGroup,attempts:p.attempts,duration:s(p.startedAt,p.finishedAt),subs:h3(p),selected:n===p.seq,childRunId:Km(p)}})),h={id:"end",type:"terminal",position:{x:(t.length+1)*248,y:0},draggable:!1,data:{status:e.status,label:e.status}},v=[c,...d,h],x=e.status==="running"||e.status==="suspended",S=[];for(let p=1;p<v.length;p+=1){const y=v[p-1],m=v[p];if(!y||!m)continue;const w=m.type==="step"&&m.data.status==="failed",E=x&&p===v.length-1;S.push({id:`e${p}`,source:y.id,target:m.id,animated:E,style:{stroke:w?"#f87171":E?"var(--accent)":"var(--line)",strokeWidth:E?2:1.5}})}return{nodes:v,edges:S}},[e,t,s,n]),u=R.useCallback((a,f)=>{if(f.type!=="step")return;const c=f.data;c.childRunId?i(c.childRunId):r(c.seq)},[r,i]);return g.jsxs(OC,{nodes:o,edges:l,nodeTypes:f3,onNodeClick:u,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[g.jsx(UC,{variant:Zt.Dots,gap:22,size:1,color:"#1c1c22"}),g.jsx(GC,{showInteractive:!1,position:"bottom-right"})]})}const m3=["running","suspended","completed","failed","cancelled","dead"];function g3(e){const t=Date.now()-new Date(e).getTime(),n=Math.round(t/1e3);if(n<60)return`${n}s ago`;const r=Math.round(n/60);if(r<60)return`${r}m ago`;const i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function y3(e,t){const n=new Date(t).getTime()-new Date(e).getTime();return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function Ly({status:e}){const t=e==="running";return g.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function Oy({status:e}){return g.jsxs("span",{className:`s-${e} inline-flex items-center gap-1.5 text-[11px] uppercase tracking-wider`,children:[g.jsx(Ly,{status:e}),e]})}function v3({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((s,o)=>s+o,0),i=(s,o,l)=>g.jsxs("button",{type:"button",onClick:()=>n(s),className:`group flex items-center gap-2 rounded-md border px-2.5 py-1 text-xs transition-colors ${t===s?"border-zinc-600 bg-zinc-900 text-zinc-100":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:[s!=="all"&&g.jsx(Ly,{status:s}),g.jsx("span",{className:"uppercase tracking-wide",children:o}),g.jsx("span",{className:"mono tnum text-zinc-600",children:l})]},s);return g.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-[var(--line)] px-5 py-3",children:[g.jsxs("div",{className:"flex items-center gap-2.5",children:[g.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-emerald-500/30 bg-emerald-500/10",children:g.jsx("span",{className:"text-emerald-400","aria-hidden":!0,children:"◆"})}),g.jsxs("div",{className:"leading-none",children:[g.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),g.jsx("div",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-600",children:"control plane"})]})]}),g.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[i("all","all",r),m3.map(s=>i(s,s,e[s]??0))]}),g.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs text-zinc-500",children:[g.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function x3({runs:e,selected:t,onSelect:n,onSelectTag:r}){return e.length===0?g.jsx("div",{className:"p-6 text-sm text-zinc-600",children:"No runs yet."}):g.jsx("ul",{className:"divide-y divide-[var(--line-soft)]",children:e.map(i=>g.jsx("li",{children:g.jsxs("button",{type:"button",onClick:()=>n(i.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${t===i.id?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[g.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:i.workflow}),i.id.startsWith("dlq:")&&g.jsx("span",{className:"mono shrink-0 rounded border border-rose-500/40 bg-rose-500/10 px-1 text-[9px] uppercase tracking-wider text-rose-300",children:"dlq"})]}),g.jsx(Oy,{status:i.status})]}),g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:i.id}),g.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:g3(i.updatedAt)})]}),i.tags&&i.tags.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1",children:i.tags.map(s=>g.jsxs("span",{onClick:o=>{o.stopPropagation(),r(s)},className:"mono cursor-pointer rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400 hover:border-zinc-500 hover:text-zinc-200",children:["#",s]},s))})]})},i.id))})}function w3({id:e,onOpenRun:t}){const n=_l(),{data:r}=sa({queryKey:["run",e],queryFn:()=>yn.run(e),refetchInterval:M=>{var T;const z=(T=M.state.data)==null?void 0:T.run.status;return z==="running"||z==="suspended"?1500:!1}}),i=(r==null?void 0:r.run.status)==="dead"?`dlq:${e}`:void 0,{data:s}=sa({queryKey:["run",i],queryFn:()=>yn.run(i),enabled:!!i,retry:!1}),o=()=>{n.invalidateQueries({queryKey:["run",e]}),n.invalidateQueries({queryKey:["runs"]})},l=r==null?void 0:r.run.status,u=l==="running"||l==="suspended";R.useEffect(()=>{if(u)return yn.streamRun(e,()=>{n.invalidateQueries({queryKey:["run",e]})})},[e,u,n]);const a=No({mutationFn:()=>yn.retry(e),onSuccess:o}),f=No({mutationFn:M=>yn.cancel(e,{compensate:M}),onSuccess:o}),c=No({mutationFn:()=>yn.continue(e),onSuccess:o}),[d,h]=R.useState(),[v,x]=R.useState(!1);if(!r)return g.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:S,timeline:p}=r,y=S.id.startsWith("dlq:"),m=y?{id:S.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${S.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:s?{id:`dlq:${S.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,w=S.status==="failed"||S.status==="suspended",E=S.status==="running"||S.status==="suspended",P=p.some(M=>M.status==="pending"&&M.kind==="signal"&&M.name.startsWith("breakpoint")),_=p.find(M=>M.seq===d);return g.jsxs("div",{className:"flex h-full flex-col",children:[g.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--line)] px-7 py-5",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:S.workflow}),y&&g.jsx("span",{className:"mono rounded border border-rose-500/40 bg-rose-500/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-rose-300",children:"dlq"}),g.jsx(Oy,{status:S.status}),g.jsxs("span",{className:"mono rounded border border-[var(--line)] px-1.5 py-0.5 text-[10px] text-zinc-500",children:["v",S.workflowVersion]}),g.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[p.length," ",p.length===1?"step":"steps"]})]}),g.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:S.id}),S.tags&&S.tags.length>0&&g.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:S.tags.map(M=>g.jsxs("span",{className:"mono rounded border border-[var(--line)] bg-zinc-800/40 px-1.5 text-[10px] text-zinc-400",children:["#",M]},M))})]}),g.jsxs("div",{className:"flex shrink-0 gap-2",children:[g.jsx("button",{type:"button",onClick:()=>x(!0),className:"mono rounded-md border border-[var(--line)] px-2.5 py-1.5 text-xs text-zinc-400 transition-colors hover:bg-zinc-800 hover:text-zinc-100",title:"Run input / output",children:"{ }"}),P&&g.jsxs("button",{type:"button",disabled:c.isPending,onClick:()=>c.mutate(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/40 bg-amber-500/15 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-amber-200 transition-colors enabled:hover:bg-amber-500/25 disabled:opacity-30",children:[g.jsx(Yw,{width:12,height:12}),"Continue"]}),g.jsxs("button",{type:"button",disabled:!w||a.isPending,onClick:()=>a.mutate(),className:"flex items-center gap-1.5 rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-emerald-300 transition-colors enabled:hover:bg-emerald-500/20 disabled:opacity-30",children:[g.jsx(nh,{width:12,height:12}),"Retry"]}),E&&g.jsxs("button",{type:"button",disabled:f.isPending,onClick:()=>f.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"flex items-center gap-1.5 rounded-md border border-amber-600/30 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-amber-300/90 transition-colors enabled:hover:bg-amber-900/20 disabled:opacity-30",children:[g.jsx(nh,{width:12,height:12}),"Cancel + Undo"]}),g.jsxs("button",{type:"button",disabled:!E||f.isPending,onClick:()=>f.mutate(!1),className:"flex items-center gap-1.5 rounded-md border border-zinc-700 px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-zinc-300 transition-colors enabled:hover:bg-zinc-800 disabled:opacity-30",children:[g.jsx(Fs,{width:12,height:12}),"Cancel"]})]})]}),m&&g.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[g.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-rose-500/40 bg-rose-500/15 text-sm text-rose-300","aria-hidden":!0,children:"⚠"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:m.title}),g.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:m.subtitle})]}),g.jsx("button",{type:"button",onClick:()=>t(m.id),className:"mono shrink-0 rounded-md border border-rose-500/40 bg-rose-500/15 px-2.5 py-1.5 text-[11px] text-rose-200 transition-colors hover:bg-rose-500/25",children:m.cta})]}),g.jsxs("div",{className:"relative grid min-h-0 flex-1 grid-rows-[1fr_auto]",children:[g.jsxs("div",{className:"relative min-h-0",children:[p.length===0?g.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):g.jsx(p3,{run:S,timeline:p,selected:d,onSelect:h,onOpenRun:t,fmtDuration:y3}),(S.status==="failed"||S.status==="cancelled")&&S.error&&g.jsx("div",{className:"mono absolute inset-x-6 bottom-6 rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-300 backdrop-blur",children:S.error.message})]}),p.length>0&&g.jsx("div",{className:"h-[clamp(120px,34%,260px)] border-t border-[var(--line)] bg-black/20",children:g.jsx(iS,{run:S,timeline:p,selected:d,onSelect:h,onOpenRun:t})}),_&&g.jsx(eS,{step:_,run:S,onClose:()=>h(void 0)}),v&&g.jsx(tS,{run:S,onClose:()=>x(!1)})]})]})}function S3(){const[e,t]=R.useState("all"),[n,r]=R.useState(""),[i,s]=R.useState(),o=_l(),{data:l=[]}=sa({queryKey:["runs",n],queryFn:()=>yn.runs(void 0,n||void 0),refetchInterval:3e3}),u=No({mutationFn:c=>yn.bulk(c,{status:e!=="all"?e:void 0,tag:n||void 0}),onSuccess:()=>o.invalidateQueries({queryKey:["runs"]})}),a=l.reduce((c,d)=>(c[d.status]=(c[d.status]??0)+1,c),{}),f=e==="all"?l:l.filter(c=>c.status===e);return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"app-bg"}),g.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[g.jsx(v3,{counts:a,filter:e,onFilter:t}),g.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[g.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-[var(--line)]",children:[g.jsx("div",{className:"border-b border-[var(--line)] p-2",children:g.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-[var(--line)] px-2",children:[g.jsx("span",{className:"text-zinc-600",children:"#"}),g.jsx("input",{value:n,onChange:c=>r(c.target.value),placeholder:"filter by tag…",className:"mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none"}),n&&g.jsx("button",{type:"button",onClick:()=>r(""),className:"text-zinc-600 hover:text-zinc-300",title:"clear tag filter",children:g.jsx(Fs,{width:12,height:12})})]})}),(e!=="all"||n)&&f.length>0&&g.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--line)] px-3 py-1.5",children:[g.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[f.length," ",e!=="all"?e:""," ",n&&`#${n}`]}),g.jsx("button",{type:"button",disabled:u.isPending,onClick:()=>u.mutate("retry"),className:"mono ml-auto rounded border border-emerald-500/30 bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-300 transition-colors hover:bg-emerald-500/20 disabled:opacity-40",children:"retry all"}),g.jsx("button",{type:"button",disabled:u.isPending,onClick:()=>u.mutate("cancel"),className:"mono rounded border border-rose-500/30 bg-rose-500/10 px-1.5 py-0.5 text-[10px] text-rose-300 transition-colors hover:bg-rose-500/20 disabled:opacity-40",children:"cancel all"})]}),g.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:g.jsx(x3,{runs:f,selected:i,onSelect:s,onSelectTag:r})})]}),g.jsx("main",{className:"min-h-0",children:i?g.jsx(w3,{id:i,onOpenRun:s},i):g.jsx("div",{className:"grid h-full place-items-center text-center",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-4xl text-zinc-800","aria-hidden":!0,children:"◆"}),g.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const k3=new kx({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});Vm(document.getElementById("root")).render(g.jsx(R.StrictMode,{children:g.jsx(Mx,{client:k3,children:g.jsx(S3,{})})}));