@adonis-agora/durable 0.22.0 → 0.24.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.
- package/CHANGELOG.md +45 -0
- package/dist/assets/spa/assets/index-CV232q_B.js +67 -0
- package/dist/assets/spa/assets/index-CV232q_B.js.map +1 -0
- package/dist/assets/spa/index.html +1 -1
- package/dist/providers/durable_provider.d.ts.map +1 -1
- package/dist/providers/durable_provider.js +31 -5
- package/dist/providers/durable_provider.js.map +1 -1
- package/dist/src/admission.d.ts +1 -1
- package/dist/src/admissions/factory.d.ts +73 -0
- package/dist/src/admissions/factory.d.ts.map +1 -0
- package/dist/src/admissions/factory.js +41 -0
- package/dist/src/admissions/factory.js.map +1 -0
- package/dist/src/dashboard/gateway-adapter.d.ts +4 -1
- package/dist/src/dashboard/gateway-adapter.d.ts.map +1 -1
- package/dist/src/dashboard/gateway-adapter.js +5 -0
- package/dist/src/dashboard/gateway-adapter.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +15 -2
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +78 -9
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +1 -1
- package/dist/src/dashboard/index.js +1 -1
- package/dist/src/define_config.d.ts +35 -2
- package/dist/src/define_config.d.ts.map +1 -1
- package/dist/src/define_config.js +2 -1
- package/dist/src/define_config.js.map +1 -1
- package/dist/src/dispatch-routing.d.ts +1 -1
- package/dist/src/dispatch-routing.js +1 -1
- package/dist/src/engine.d.ts +12 -3
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +11 -0
- package/dist/src/engine.js.map +1 -1
- package/dist/src/index.d.ts +6 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.d.ts +15 -0
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/protocol.js +1 -1
- package/dist/src/queue.d.ts +2 -2
- package/dist/src/run-waiting.d.ts +25 -0
- package/dist/src/run-waiting.d.ts.map +1 -0
- package/dist/src/run-waiting.js +59 -0
- package/dist/src/run-waiting.js.map +1 -0
- package/dist/src/telescope/extension.d.ts.map +1 -1
- package/dist/src/telescope/extension.js +1 -0
- package/dist/src/telescope/extension.js.map +1 -1
- package/dist/src/testing/in-memory-transport.js +1 -1
- package/dist/src/transports/event-emitter.js +1 -1
- package/dist/src/transports/factory.d.ts +56 -2
- package/dist/src/transports/factory.d.ts.map +1 -1
- package/dist/src/transports/factory.js +14 -0
- package/dist/src/transports/factory.js.map +1 -1
- package/package.json +6 -6
- package/dist/assets/spa/assets/index-BpH1yTMa.js +0 -81
- package/dist/assets/spa/assets/index-BpH1yTMa.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var vR=Object.defineProperty;var g0=e=>{throw TypeError(e)};var wR=(e,t,n)=>t in e?vR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ie=(e,t,n)=>wR(e,typeof t!="symbol"?t+"":t,n),Wd=(e,t,n)=>t.has(e)||g0("Cannot "+n);var F=(e,t,n)=>(Wd(e,t,"read from private field"),n?n.call(e):t.get(e)),ae=(e,t,n)=>t.has(e)?g0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),re=(e,t,n,r)=>(Wd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ge=(e,t,n)=>(Wd(e,t,"access private method"),n);var Da=(e,t,n,r)=>({set _(s){re(e,t,s,n)},get _(){return F(e,t,r)}});function bR(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function cw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uw={exports:{}},Wu={},dw={exports:{}},ke={};/**
|
|
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 da=Symbol.for("react.element"),SR=Symbol.for("react.portal"),ER=Symbol.for("react.fragment"),kR=Symbol.for("react.strict_mode"),CR=Symbol.for("react.profiler"),RR=Symbol.for("react.provider"),PR=Symbol.for("react.context"),TR=Symbol.for("react.forward_ref"),NR=Symbol.for("react.suspense"),IR=Symbol.for("react.memo"),MR=Symbol.for("react.lazy"),m0=Symbol.iterator;function _R(e){return e===null||typeof e!="object"?null:(e=m0&&e[m0]||e["@@iterator"],typeof e=="function"?e:null)}var fw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hw=Object.assign,pw={};function _i(e,t,n){this.props=e,this.context=t,this.refs=pw,this.updater=n||fw}_i.prototype.isReactComponent={};_i.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")};_i.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gw(){}gw.prototype=_i.prototype;function Kp(e,t,n){this.props=e,this.context=t,this.refs=pw,this.updater=n||fw}var Yp=Kp.prototype=new gw;Yp.constructor=Kp;hw(Yp,_i.prototype);Yp.isPureReactComponent=!0;var y0=Array.isArray,mw=Object.prototype.hasOwnProperty,qp={current:null},yw={key:!0,ref:!0,__self:!0,__source:!0};function xw(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)mw.call(t,r)&&!yw.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];s.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:da,type:e,key:o,ref:i,props:s,_owner:qp.current}}function OR(e,t){return{$$typeof:da,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Qp(e){return typeof e=="object"&&e!==null&&e.$$typeof===da}function AR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var x0=/\/+/g;function Ud(e,t){return typeof e=="object"&&e!==null&&e.key!=null?AR(""+e.key):t.toString(36)}function bc(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case da:case SR:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+Ud(i,0):r,y0(s)?(n="",e!=null&&(n=e.replace(x0,"$&/")+"/"),bc(s,t,n,"",function(c){return c})):s!=null&&(Qp(s)&&(s=OR(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(x0,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",y0(e))for(var l=0;l<e.length;l++){o=e[l];var a=r+Ud(o,l);i+=bc(o,t,n,a,s)}else if(a=_R(e),typeof a=="function")for(e=a.call(e),l=0;!(o=e.next()).done;)o=o.value,a=r+Ud(o,l++),i+=bc(o,t,n,a,s);else if(o==="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 i}function Fa(e,t,n){if(e==null)return e;var r=[],s=0;return bc(e,r,"","",function(o){return t.call(n,o,s++)}),r}function jR(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 At={current:null},Sc={transition:null},zR={ReactCurrentDispatcher:At,ReactCurrentBatchConfig:Sc,ReactCurrentOwner:qp};function vw(){throw Error("act(...) is not supported in production builds of React.")}ke.Children={map:Fa,forEach:function(e,t,n){Fa(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fa(e,function(){t++}),t},toArray:function(e){return Fa(e,function(t){return t})||[]},only:function(e){if(!Qp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ke.Component=_i;ke.Fragment=ER;ke.Profiler=CR;ke.PureComponent=Kp;ke.StrictMode=kR;ke.Suspense=NR;ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zR;ke.act=vw;ke.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=hw({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=qp.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)mw.call(t,a)&&!yw.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:da,type:e.type,key:s,ref:o,props:r,_owner:i}};ke.createContext=function(e){return e={$$typeof:PR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:RR,_context:e},e.Consumer=e};ke.createElement=xw;ke.createFactory=function(e){var t=xw.bind(null,e);return t.type=e,t};ke.createRef=function(){return{current:null}};ke.forwardRef=function(e){return{$$typeof:TR,render:e}};ke.isValidElement=Qp;ke.lazy=function(e){return{$$typeof:MR,_payload:{_status:-1,_result:e},_init:jR}};ke.memo=function(e,t){return{$$typeof:IR,type:e,compare:t===void 0?null:t}};ke.startTransition=function(e){var t=Sc.transition;Sc.transition={};try{e()}finally{Sc.transition=t}};ke.unstable_act=vw;ke.useCallback=function(e,t){return At.current.useCallback(e,t)};ke.useContext=function(e){return At.current.useContext(e)};ke.useDebugValue=function(){};ke.useDeferredValue=function(e){return At.current.useDeferredValue(e)};ke.useEffect=function(e,t){return At.current.useEffect(e,t)};ke.useId=function(){return At.current.useId()};ke.useImperativeHandle=function(e,t,n){return At.current.useImperativeHandle(e,t,n)};ke.useInsertionEffect=function(e,t){return At.current.useInsertionEffect(e,t)};ke.useLayoutEffect=function(e,t){return At.current.useLayoutEffect(e,t)};ke.useMemo=function(e,t){return At.current.useMemo(e,t)};ke.useReducer=function(e,t,n){return At.current.useReducer(e,t,n)};ke.useRef=function(e){return At.current.useRef(e)};ke.useState=function(e){return At.current.useState(e)};ke.useSyncExternalStore=function(e,t,n){return At.current.useSyncExternalStore(e,t,n)};ke.useTransition=function(){return At.current.useTransition()};ke.version="18.3.1";dw.exports=ke;var S=dw.exports;const ww=cw(S),DR=bR({__proto__:null,default:ww},[S]);/**
|
|
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 FR=S,LR=Symbol.for("react.element"),$R=Symbol.for("react.fragment"),HR=Object.prototype.hasOwnProperty,BR=FR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,VR={key:!0,ref:!0,__self:!0,__source:!0};function bw(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)HR.call(t,r)&&!VR.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:LR,type:e,key:o,ref:i,props:s,_owner:BR.current}}Wu.Fragment=$R;Wu.jsx=bw;Wu.jsxs=bw;uw.exports=Wu;var x=uw.exports,ho=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(){}},Ls,Ur,Zo,Xv,WR=(Xv=class extends ho{constructor(){super();ae(this,Ls);ae(this,Ur);ae(this,Zo);re(this,Zo,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Ur)||this.setEventListener(F(this,Zo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Ur))==null||t.call(this),re(this,Ur,void 0))}setEventListener(t){var n;re(this,Zo,t),(n=F(this,Ur))==null||n.call(this),re(this,Ur,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,Ls)!==t&&(re(this,Ls,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,Ls)=="boolean"?F(this,Ls):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ls=new WeakMap,Ur=new WeakMap,Zo=new WeakMap,Xv),Xp=new WR,UR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Kr,Up,Gv,KR=(Gv=class{constructor(){ae(this,Kr,UR);ae(this,Up,!1)}setTimeoutProvider(e){re(this,Kr,e)}setTimeout(e,t){return F(this,Kr).setTimeout(e,t)}clearTimeout(e){F(this,Kr).clearTimeout(e)}setInterval(e,t){return F(this,Kr).setInterval(e,t)}clearInterval(e){F(this,Kr).clearInterval(e)}},Kr=new WeakMap,Up=new WeakMap,Gv),As=new KR;function YR(e){setTimeout(e,0)}var qR=typeof window>"u"||"Deno"in globalThis;function Et(){}function QR(e,t){return typeof e=="function"?e(t):e}function Yf(e){return typeof e=="number"&&e>=0&&e!==1/0}function Sw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ss(e,t){return typeof e=="function"?e(t):e}function Gt(e,t){return typeof e=="function"?e(t):e}function v0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==Gp(i,t.options))return!1}else if(!hi(t.queryKey,i))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||o&&!o(t))}function w0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Js(t.options.mutationKey)!==Js(o))return!1}else if(!hi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Gp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Js)(e)}function Js(e){return JSON.stringify(e,(t,n)=>qf(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function hi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){for(let r=0;r<t.length;r++)if(!hi(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!hi(e[r],t[r]))return!1;return!0}return!1}var XR=Object.prototype.hasOwnProperty;function Zp(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=b0(e)&&b0(t);if(!r&&!(qf(e)&&qf(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),l=i.length,a=r?new Array(l):{};let c=0;for(let u=0;u<l;u++){const f=r?u:i[u],d=e[f],p=t[f];if(d===p){a[f]=d,(r?u<o:XR.call(e,f))&&c++;continue}if(d===null||p===null||typeof d!="object"||typeof p!="object"){a[f]=p;continue}const m=Zp(d,p,n+1);a[f]=m,m===d&&c++}return o===l&&c===o?e:a}function kl(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 b0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qf(e){if(!S0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!S0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function S0(e){return Object.prototype.toString.call(e)==="[object Object]"}function GR(e){return new Promise(t=>{As.setTimeout(t,e)})}function Qf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zp(e,t):t}function ZR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function JR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Jp=Symbol();function Ew(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Jp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eg(e,t){return typeof e=="function"?e(...t):!!e}function eP(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Cl=(()=>{let e=()=>qR;return{isServer(){return e()},setIsServer(t){e=t}}})();function Xf(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var tP=YR;function nP(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=tP;const o=l=>{t?e.push(l):s(()=>{n(l)})},i=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||i()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var Je=nP(),Jo,Yr,ei,Zv,rP=(Zv=class extends ho{constructor(){super();ae(this,Jo,!0);ae(this,Yr);ae(this,ei);re(this,ei,t=>{if(typeof window<"u"&&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(){F(this,Yr)||this.setEventListener(F(this,ei))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Yr))==null||t.call(this),re(this,Yr,void 0))}setEventListener(t){var n;re(this,ei,t),(n=F(this,Yr))==null||n.call(this),re(this,Yr,t(this.setOnline.bind(this)))}setOnline(t){F(this,Jo)!==t&&(re(this,Jo,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return F(this,Jo)}},Jo=new WeakMap,Yr=new WeakMap,ei=new WeakMap,Zv),Uc=new rP;function sP(e){return Math.min(1e3*2**e,3e4)}function kw(e){return(e??"online")==="online"?Uc.isOnline():!0}var Gf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cw(e){let t=!1,n=0,r;const s=Xf(),o=()=>s.status!=="pending",i=v=>{var b;if(!o()){const h=new Gf(v);d(h),(b=e.onCancel)==null||b.call(e,h)}},l=()=>{t=!0},a=()=>{t=!1},c=()=>Xp.isFocused()&&(e.networkMode==="always"||Uc.isOnline())&&e.canRun(),u=()=>kw(e.networkMode)&&e.canRun(),f=v=>{o()||(r==null||r(),s.resolve(v))},d=v=>{o()||(r==null||r(),s.reject(v))},p=()=>new Promise(v=>{var b;r=h=>{(o()||c())&&v(h)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;r=void 0,o()||(v=e.onContinue)==null||v.call(e)}),m=()=>{if(o())return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(h){v=Promise.reject(h)}Promise.resolve(v).then(f).catch(h=>{var C;if(o())return;const y=e.retry??(Cl.isServer()?0:3),g=e.retryDelay??sP,w=typeof g=="function"?g(n,h):g,E=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,h);if(t||!E){d(h);return}n++,(C=e.onFail)==null||C.call(e,n,h),GR(w).then(()=>c()?void 0:p()).then(()=>{t?d(h):m()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r==null||r(),s),cancelRetry:l,continueRetry:a,canStart:u,start:()=>(u()?m():p().then(m),s)}}var $s,Jv,Rw=(Jv=class{constructor(){ae(this,$s)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yf(this.gcTime)&&re(this,$s,As.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){F(this,$s)!==void 0&&(As.clearTimeout(F(this,$s)),re(this,$s,void 0))}},$s=new WeakMap,Jv);function oP(e){return{onFetch:(t,n)=>{var u,f,d,p,m;const r=t.options,s=(d=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],i=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let v=!1;const b=g=>{eP(g,()=>t.signal,()=>v=!0)},h=Ew(t.options,t.fetchOptions),y=async(g,w,E)=>{if(v)return Promise.reject(t.signal.reason);if(w==null&&g.pages.length)return Promise.resolve(g);const R=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:w,direction:E?"backward":"forward",meta:t.options.meta};return b(j),j})(),k=await h(R),{maxPages:N}=t.options,I=E?JR:ZR;return{pages:I(g.pages,k,N),pageParams:I(g.pageParams,w,N)}};if(s&&o.length){const g=s==="backward",w=g?Pw:Zf,E={pages:o,pageParams:i},C=w(r,E);l=await y(E,C,g)}else{const g=e??o.length;do{const w=a===0?i[0]??r.initialPageParam:Zf(r,l);if(a>0&&w==null)break;l=await y(l,w),a++}while(a<g)}return l};t.options.persister?t.fetchFn=()=>{var v,b;return(b=(v=t.options).persister)==null?void 0:b.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Zf(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 Pw(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}function iP(e,t){return t?Zf(e,t)!=null:!1}function lP(e,t){return!t||!e.getPreviousPageParam?!1:Pw(e,t)!=null}var ti,Hs,ni,cn,Bs,ct,na,Vs,Xt,Tw,ir,ew,aP=(ew=class extends Rw{constructor(t){super();ae(this,Xt);ae(this,ti);ae(this,Hs);ae(this,ni);ae(this,cn);ae(this,Bs);ae(this,ct);ae(this,na);ae(this,Vs);re(this,Vs,!1),re(this,na,t.defaultOptions),this.setOptions(t.options),this.observers=[],re(this,Bs,t.client),re(this,cn,F(this,Bs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,re(this,Hs,k0(this.options)),this.state=t.state??F(this,Hs),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,ti)}get promise(){var t;return(t=F(this,ct))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,na),...t},t!=null&&t._type&&re(this,ti,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=k0(this.options);n.data!==void 0&&(this.setState(E0(n.data,n.dataUpdatedAt)),re(this,Hs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,cn).remove(this)}setData(t,n){const r=Qf(this.state.data,t,this.options);return ge(this,Xt,ir).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){ge(this,Xt,ir).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=F(this,ct))==null?void 0:r.promise;return(s=F(this,ct))==null||s.cancel(t),n?n.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Hs)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Gt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ss(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Sw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,ct))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,ct))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,cn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(F(this,ct)&&(F(this,Vs)||ge(this,Xt,Tw).call(this)?F(this,ct).cancel({revert:!0}):F(this,ct).cancelRetry()),this.scheduleGc()),F(this,cn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,Xt,ir).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,f,d,p,m,v,b,h,y,g;if(this.state.fetchStatus!=="idle"&&((c=F(this,ct))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,ct))return F(this,ct).continueRetry(),F(this,ct).promise}if(t&&this.setOptions(t),!this.options.queryFn){const w=this.observers.find(E=>E.options.queryFn);w&&this.setOptions(w.options)}const r=new AbortController,s=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(re(this,Vs,!0),r.signal)})},o=()=>{const w=Ew(this.options,n),C=(()=>{const R={client:F(this,Bs),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return re(this,Vs,!1),this.options.persister?this.options.persister(w,C,this):w(C)},l=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,Bs),state:this.state,fetchFn:o};return s(w),w})(),a=F(this,ti)==="infinite"?oP(this.options.pages):this.options.behavior;a==null||a.onFetch(l,this),re(this,ni,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&ge(this,Xt,ir).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),re(this,ct,Cw({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:w=>{w instanceof Gf&&w.revert&&this.setState({...F(this,ni),fetchStatus:"idle"}),r.abort()},onFail:(w,E)=>{ge(this,Xt,ir).call(this,{type:"failed",failureCount:w,error:E})},onPause:()=>{ge(this,Xt,ir).call(this,{type:"pause"})},onContinue:()=>{ge(this,Xt,ir).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const w=await F(this,ct).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(d=F(this,cn).config).onSuccess)==null||p.call(d,w,this),(v=(m=F(this,cn).config).onSettled)==null||v.call(m,w,this.state.error,this),w}catch(w){if(w instanceof Gf){if(w.silent)return F(this,ct).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw ge(this,Xt,ir).call(this,{type:"error",error:w}),(h=(b=F(this,cn).config).onError)==null||h.call(b,w,this),(g=(y=F(this,cn).config).onSettled)==null||g.call(y,this.state.data,w,this),w}finally{this.scheduleGc()}}},ti=new WeakMap,Hs=new WeakMap,ni=new WeakMap,cn=new WeakMap,Bs=new WeakMap,ct=new WeakMap,na=new WeakMap,Vs=new WeakMap,Xt=new WeakSet,Tw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ir=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,...Nw(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...E0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return re(this,ni,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Je.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),F(this,cn).notify({query:this,type:"updated",action:t})})},ew);function Nw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function E0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function k0(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 Dt,Pe,ra,It,Ws,ri,ur,qr,sa,si,oi,Us,Ks,Qr,ii,Oe,sl,Jf,eh,th,nh,rh,sh,oh,Iw,tw,Uu=(tw=class extends ho{constructor(t,n){super();ae(this,Oe);ae(this,Dt);ae(this,Pe);ae(this,ra);ae(this,It);ae(this,Ws);ae(this,ri);ae(this,ur);ae(this,qr);ae(this,sa);ae(this,si);ae(this,oi);ae(this,Us);ae(this,Ks);ae(this,Qr);ae(this,ii,new Set);this.options=n,re(this,Dt,t),re(this,qr,null),re(this,ur,Xf()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Pe).addObserver(this),C0(F(this,Pe),this.options)?ge(this,Oe,sl).call(this):this.updateResult(),ge(this,Oe,nh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ih(F(this,Pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ih(F(this,Pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,Oe,rh).call(this),ge(this,Oe,sh).call(this),F(this,Pe).removeObserver(this)}setOptions(t){const n=this.options,r=F(this,Pe);if(this.options=F(this,Dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Gt(this.options.enabled,F(this,Pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,Oe,oh).call(this),F(this,Pe).setOptions(this.options),n._defaulted&&!kl(this.options,n)&&F(this,Dt).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Pe),observer:this});const s=this.hasListeners();s&&R0(F(this,Pe),r,this.options,n)&&ge(this,Oe,sl).call(this),this.updateResult(),s&&(F(this,Pe)!==r||Gt(this.options.enabled,F(this,Pe))!==Gt(n.enabled,F(this,Pe))||ss(this.options.staleTime,F(this,Pe))!==ss(n.staleTime,F(this,Pe)))&&ge(this,Oe,Jf).call(this);const o=ge(this,Oe,eh).call(this);s&&(F(this,Pe)!==r||Gt(this.options.enabled,F(this,Pe))!==Gt(n.enabled,F(this,Pe))||o!==F(this,Qr))&&ge(this,Oe,th).call(this,o)}getOptimisticResult(t){const n=F(this,Dt).getQueryCache().build(F(this,Dt),t),r=this.createResult(n,t);return uP(this,r)&&(re(this,It,r),re(this,ri,this.options),re(this,Ws,F(this,Pe).state)),r}getCurrentResult(){return F(this,It)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,ur).status==="pending"&&F(this,ur).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){F(this,ii).add(t)}getCurrentQuery(){return F(this,Pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,Dt).defaultQueryOptions(t),r=F(this,Dt).getQueryCache().build(F(this,Dt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ge(this,Oe,sl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,It)))}createResult(t,n){var N;const r=F(this,Pe),s=this.options,o=F(this,It),i=F(this,Ws),l=F(this,ri),c=t!==r?t.state:F(this,ra),{state:u}=t;let f={...u},d=!1,p;if(n._optimisticResults){const I=this.hasListeners(),j=!I&&C0(t,n),L=I&&R0(t,r,n,s);(j||L)&&(f={...f,...Nw(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:b}=f;p=f.data;let h=!1;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let I;o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(I=o.data,h=!0):I=typeof n.placeholderData=="function"?n.placeholderData((N=F(this,oi))==null?void 0:N.state.data,F(this,oi)):n.placeholderData,I!==void 0&&(b="success",p=Qf(o==null?void 0:o.data,I,n),d=!0)}if(n.select&&p!==void 0&&!h)if(o&&p===(i==null?void 0:i.data)&&n.select===F(this,sa))p=F(this,si);else try{re(this,sa,n.select),p=n.select(p),p=Qf(o==null?void 0:o.data,p,n),re(this,si,p),re(this,qr,null)}catch(I){re(this,qr,I)}F(this,qr)&&(m=F(this,qr),p=F(this,si),v=Date.now(),b="error");const y=f.fetchStatus==="fetching",g=b==="pending",w=b==="error",E=g&&y,C=p!==void 0,k={status:b,fetchStatus:f.fetchStatus,isPending:g,isSuccess:b==="success",isError:w,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!g,isLoadingError:w&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&C,isStale:tg(t,n),refetch:this.refetch,promise:F(this,ur),isEnabled:Gt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=k.data!==void 0,j=k.status==="error"&&!I,L=M=>{j?M.reject(k.error):I&&M.resolve(k.data)},A=()=>{const M=re(this,ur,k.promise=Xf());L(M)},P=F(this,ur);switch(P.status){case"pending":t.queryHash===r.queryHash&&L(P);break;case"fulfilled":(j||k.data!==P.value)&&A();break;case"rejected":(!j||k.error!==P.reason)&&A();break}}return k}updateResult(){const t=F(this,It),n=this.createResult(F(this,Pe),this.options);if(re(this,Ws,F(this,Pe).state),re(this,ri,this.options),F(this,Ws).data!==void 0&&re(this,oi,F(this,Pe)),kl(n,t))return;re(this,It,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!F(this,ii).size)return!0;const i=new Set(o??F(this,ii));return this.options.throwOnError&&i.add("error"),Object.keys(F(this,It)).some(l=>{const a=l;return F(this,It)[a]!==t[a]&&i.has(a)})};ge(this,Oe,Iw).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,Oe,nh).call(this)}},Dt=new WeakMap,Pe=new WeakMap,ra=new WeakMap,It=new WeakMap,Ws=new WeakMap,ri=new WeakMap,ur=new WeakMap,qr=new WeakMap,sa=new WeakMap,si=new WeakMap,oi=new WeakMap,Us=new WeakMap,Ks=new WeakMap,Qr=new WeakMap,ii=new WeakMap,Oe=new WeakSet,sl=function(t){ge(this,Oe,oh).call(this);let n=F(this,Pe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Et)),n},Jf=function(){ge(this,Oe,rh).call(this);const t=ss(this.options.staleTime,F(this,Pe));if(Cl.isServer()||F(this,It).isStale||!Yf(t))return;const r=Sw(F(this,It).dataUpdatedAt,t)+1;re(this,Us,As.setTimeout(()=>{F(this,It).isStale||this.updateResult()},r))},eh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Pe)):this.options.refetchInterval)??!1},th=function(t){ge(this,Oe,sh).call(this),re(this,Qr,t),!(Cl.isServer()||Gt(this.options.enabled,F(this,Pe))===!1||!Yf(F(this,Qr))||F(this,Qr)===0)&&re(this,Ks,As.setInterval(()=>{(this.options.refetchIntervalInBackground||Xp.isFocused())&&ge(this,Oe,sl).call(this)},F(this,Qr)))},nh=function(){ge(this,Oe,Jf).call(this),ge(this,Oe,th).call(this,ge(this,Oe,eh).call(this))},rh=function(){F(this,Us)!==void 0&&(As.clearTimeout(F(this,Us)),re(this,Us,void 0))},sh=function(){F(this,Ks)!==void 0&&(As.clearInterval(F(this,Ks)),re(this,Ks,void 0))},oh=function(){const t=F(this,Dt).getQueryCache().build(F(this,Dt),this.options);if(t===F(this,Pe))return;const n=F(this,Pe);re(this,Pe,t),re(this,ra,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Iw=function(t){Je.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(F(this,It))}),F(this,Dt).getQueryCache().notify({query:F(this,Pe),type:"observerResultsUpdated"})})},tw);function cP(e,t){return Gt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Gt(t.retryOnMount,e)===!1)}function C0(e,t){return cP(e,t)||e.state.data!==void 0&&ih(e,t,t.refetchOnMount)}function ih(e,t,n){if(Gt(t.enabled,e)!==!1&&ss(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&tg(e,t)}return!1}function R0(e,t,n,r){return(e!==t||Gt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&tg(e,n)}function tg(e,t){return Gt(t.enabled,e)!==!1&&e.isStaleByTime(ss(t.staleTime,e))}function uP(e,t){return!kl(e.getCurrentResult(),t)}var dP=class extends Uu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var m,v;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:o,isError:i,isRefetchError:l}=r,a=(v=(m=n.fetchMeta)==null?void 0:m.fetchMore)==null?void 0:v.direction,c=i&&a==="forward",u=s&&a==="forward",f=i&&a==="backward",d=s&&a==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:iP(t,n.data),hasPreviousPage:lP(t,n.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:d,isRefetchError:l&&!c&&!f,isRefetching:o&&!u&&!d}}},oa,Un,St,Ys,Kn,Fr,nw,fP=(nw=class extends Rw{constructor(t){super();ae(this,Kn);ae(this,oa);ae(this,Un);ae(this,St);ae(this,Ys);re(this,oa,t.client),this.mutationId=t.mutationId,re(this,St,t.mutationCache),re(this,Un,[]),this.state=t.state||Mw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,Un).includes(t)||(F(this,Un).push(t),this.clearGcTimeout(),F(this,St).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){re(this,Un,F(this,Un).filter(n=>n!==t)),this.scheduleGc(),F(this,St).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,Un).length||(this.state.status==="pending"?this.scheduleGc():F(this,St).remove(this))}continue(){var t;return((t=F(this,Ys))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,l,a,c,u,f,d,p,m,v,b,h,y,g,w,E,C,R;const n=()=>{ge(this,Kn,Fr).call(this,{type:"continue"})},r={client:F(this,oa),meta:this.options.meta,mutationKey:this.options.mutationKey};re(this,Ys,Cw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{ge(this,Kn,Fr).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{ge(this,Kn,Fr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,St).canRun(this)}));const s=this.state.status==="pending",o=!F(this,Ys).canStart();try{if(s)n();else{ge(this,Kn,Fr).call(this,{type:"pending",variables:t,isPaused:o}),F(this,St).config.onMutate&&await F(this,St).config.onMutate(t,this,r);const N=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t,r));N!==this.state.context&&ge(this,Kn,Fr).call(this,{type:"pending",context:N,variables:t,isPaused:o})}const k=await F(this,Ys).start();return await((c=(a=F(this,St).config).onSuccess)==null?void 0:c.call(a,k,t,this.state.context,this,r)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,k,t,this.state.context,r)),await((p=(d=F(this,St).config).onSettled)==null?void 0:p.call(d,k,null,this.state.variables,this.state.context,this,r)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,k,null,t,this.state.context,r)),ge(this,Kn,Fr).call(this,{type:"success",data:k}),k}catch(k){try{await((h=(b=F(this,St).config).onError)==null?void 0:h.call(b,k,t,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((g=(y=this.options).onError)==null?void 0:g.call(y,k,t,this.state.context,r))}catch(N){Promise.reject(N)}try{await((E=(w=F(this,St).config).onSettled)==null?void 0:E.call(w,void 0,k,this.state.variables,this.state.context,this,r))}catch(N){Promise.reject(N)}try{await((R=(C=this.options).onSettled)==null?void 0:R.call(C,void 0,k,t,this.state.context,r))}catch(N){Promise.reject(N)}throw ge(this,Kn,Fr).call(this,{type:"error",error:k}),k}finally{F(this,St).runNext(this)}}},oa=new WeakMap,Un=new WeakMap,St=new WeakMap,Ys=new WeakMap,Kn=new WeakSet,Fr=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),Je.batch(()=>{F(this,Un).forEach(r=>{r.onMutationUpdate(t)}),F(this,St).notify({mutation:this,type:"updated",action:t})})},nw);function Mw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dr,Cn,ia,rw,hP=(rw=class extends ho{constructor(t={}){super();ae(this,dr);ae(this,Cn);ae(this,ia);this.config=t,re(this,dr,new Set),re(this,Cn,new Map),re(this,ia,0)}build(t,n,r){const s=new fP({client:t,mutationCache:this,mutationId:++Da(this,ia)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){F(this,dr).add(t);const n=La(t);if(typeof n=="string"){const r=F(this,Cn).get(n);r?r.push(t):F(this,Cn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,dr).delete(t)){const n=La(t);if(typeof n=="string"){const r=F(this,Cn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&F(this,Cn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=La(t);if(typeof n=="string"){const r=F(this,Cn).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=La(t);if(typeof n=="string"){const s=(r=F(this,Cn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Je.batch(()=>{F(this,dr).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,dr).clear(),F(this,Cn).clear()})}getAll(){return Array.from(F(this,dr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>w0(n,r))}findAll(t={}){return this.getAll().filter(n=>w0(t,n))}notify(t){Je.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Je.batch(()=>Promise.all(t.map(n=>n.continue().catch(Et))))}},dr=new WeakMap,Cn=new WeakMap,ia=new WeakMap,rw);function La(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fr,Xr,Ft,hr,br,Ec,lh,sw,pP=(sw=class extends ho{constructor(n,r){super();ae(this,br);ae(this,fr);ae(this,Xr);ae(this,Ft);ae(this,hr);re(this,fr,n),this.setOptions(r),this.bindMethods(),ge(this,br,Ec).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=F(this,fr).defaultMutationOptions(n),kl(this.options,r)||F(this,fr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Ft),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Js(r.mutationKey)!==Js(this.options.mutationKey)?this.reset():((s=F(this,Ft))==null?void 0:s.state.status)==="pending"&&F(this,Ft).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,Ft))==null||n.removeObserver(this)}onMutationUpdate(n){ge(this,br,Ec).call(this),ge(this,br,lh).call(this,n)}getCurrentResult(){return F(this,Xr)}reset(){var n;(n=F(this,Ft))==null||n.removeObserver(this),re(this,Ft,void 0),ge(this,br,Ec).call(this),ge(this,br,lh).call(this)}mutate(n,r){var s;return re(this,hr,r),(s=F(this,Ft))==null||s.removeObserver(this),re(this,Ft,F(this,fr).getMutationCache().build(F(this,fr),this.options)),F(this,Ft).addObserver(this),F(this,Ft).execute(n)}},fr=new WeakMap,Xr=new WeakMap,Ft=new WeakMap,hr=new WeakMap,br=new WeakSet,Ec=function(){var r;const n=((r=F(this,Ft))==null?void 0:r.state)??Mw();re(this,Xr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},lh=function(n){Je.batch(()=>{var r,s,o,i,l,a,c,u;if(F(this,hr)&&this.hasListeners()){const f=F(this,Xr).variables,d=F(this,Xr).context,p={client:F(this,fr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=F(this,hr)).onSuccess)==null||s.call(r,n.data,f,d,p)}catch(m){Promise.reject(m)}try{(i=(o=F(this,hr)).onSettled)==null||i.call(o,n.data,null,f,d,p)}catch(m){Promise.reject(m)}}else if((n==null?void 0:n.type)==="error"){try{(a=(l=F(this,hr)).onError)==null||a.call(l,n.error,f,d,p)}catch(m){Promise.reject(m)}try{(u=(c=F(this,hr)).onSettled)==null||u.call(c,void 0,n.error,f,d,p)}catch(m){Promise.reject(m)}}}this.listeners.forEach(f=>{f(F(this,Xr))})})},sw);function P0(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function gP(e,t,n){const r=e.slice(0);return r[t]=n,r}var li,Lt,ai,qs,qt,Gr,la,aa,ca,ua,at,ah,ch,_w,uh,dh,fh,ow,mP=(ow=class extends ho{constructor(t,n,r){super();ae(this,at);ae(this,li);ae(this,Lt);ae(this,ai);ae(this,qs);ae(this,qt);ae(this,Gr);ae(this,la);ae(this,aa);ae(this,ca);ae(this,ua,[]);re(this,li,t),re(this,qs,r),re(this,ai,[]),re(this,qt,[]),re(this,Lt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&F(this,qt).forEach(t=>{t.subscribe(n=>{ge(this,at,dh).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,F(this,qt).forEach(t=>{t.destroy()})}setQueries(t,n){re(this,ai,t),re(this,qs,n),Je.batch(()=>{const r=F(this,qt),s=ge(this,at,uh).call(this,F(this,ai));s.forEach(f=>f.observer.setOptions(f.defaultedQueryOptions));const o=s.map(f=>f.observer),i=o.map(f=>f.getCurrentResult()),l=r.length!==o.length,a=o.some((f,d)=>f!==r[d]),c=l||a,u=c?!0:i.some((f,d)=>{const p=F(this,Lt)[d];return!p||!kl(f,p)});!c&&!u||(c&&(re(this,ua,s),re(this,qt,o)),re(this,Lt,i),this.hasListeners()&&(c&&(P0(r,o).forEach(f=>{f.destroy()}),P0(o,r).forEach(f=>{f.subscribe(d=>{ge(this,at,dh).call(this,f,d)})})),ge(this,at,fh).call(this)))})}getCurrentResult(){return F(this,Lt)}getQueries(){return F(this,qt).map(t=>t.getCurrentQuery())}getObservers(){return F(this,qt)}getOptimisticResult(t,n){const r=ge(this,at,uh).call(this,t),s=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions)),o=r.map(i=>i.defaultedQueryOptions.queryHash);return[s,i=>ge(this,at,ch).call(this,i??s,n,o),()=>ge(this,at,ah).call(this,s,r)]}},li=new WeakMap,Lt=new WeakMap,ai=new WeakMap,qs=new WeakMap,qt=new WeakMap,Gr=new WeakMap,la=new WeakMap,aa=new WeakMap,ca=new WeakMap,ua=new WeakMap,at=new WeakSet,ah=function(t,n){return n.map((r,s)=>{const o=t[s];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,i=>{n.forEach(l=>{l.observer.trackProp(i)})})})},ch=function(t,n,r){if(n){const s=F(this,ca),o=r!==void 0&&s!==void 0&&(s.length!==r.length||r.some((i,l)=>i!==s[l]));return(!F(this,Gr)||F(this,Lt)!==F(this,aa)||o||n!==F(this,la))&&(re(this,la,n),re(this,aa,F(this,Lt)),r!==void 0&&re(this,ca,r),re(this,Gr,Zp(F(this,Gr),n(t)))),F(this,Gr)}return t},_w=function(){var t;return((t=F(this,qs))==null?void 0:t.combine)!==void 0&&F(this,qt).some((n,r)=>{var s;return n.options.suspense&&((s=F(this,Lt)[r])==null?void 0:s.data)===void 0})},uh=function(t){const n=new Map;F(this,qt).forEach(s=>{const o=s.options.queryHash;if(!o)return;const i=n.get(o);i?i.push(s):n.set(o,[s])});const r=[];return t.forEach(s=>{var a;const o=F(this,li).defaultQueryOptions(s),l=((a=n.get(o.queryHash))==null?void 0:a.shift())??new Uu(F(this,li),o);r.push({defaultedQueryOptions:o,observer:l})}),r},dh=function(t,n){const r=F(this,qt).indexOf(t);r!==-1&&(re(this,Lt,gP(F(this,Lt),r,n)),ge(this,at,fh).call(this))},fh=function(){var t;if(this.hasListeners()){const n=ge(this,at,ah).call(this,F(this,Lt),F(this,ua)),r=ge(this,at,_w).call(this),s=F(this,Gr),o=r?s:ge(this,at,ch).call(this,n,(t=F(this,qs))==null?void 0:t.combine);(r||s!==o)&&Je.batch(()=>{this.listeners.forEach(i=>{i(F(this,Lt))})})}},ow),Yn,iw,yP=(iw=class extends ho{constructor(t={}){super();ae(this,Yn);this.config=t,re(this,Yn,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Gp(s,n);let i=this.get(o);return i||(i=new aP({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){F(this,Yn).has(t.queryHash)||(F(this,Yn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,Yn).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,Yn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Je.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,Yn).get(t)}getAll(){return[...F(this,Yn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>v0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>v0(t,r)):n}notify(t){Je.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Je.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Je.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yn=new WeakMap,iw),Ge,Zr,Jr,ci,ui,es,di,fi,lw,xP=(lw=class{constructor(e={}){ae(this,Ge);ae(this,Zr);ae(this,Jr);ae(this,ci);ae(this,ui);ae(this,es);ae(this,di);ae(this,fi);re(this,Ge,e.queryCache||new yP),re(this,Zr,e.mutationCache||new hP),re(this,Jr,e.defaultOptions||{}),re(this,ci,new Map),re(this,ui,new Map),re(this,es,0)}mount(){Da(this,es)._++,F(this,es)===1&&(re(this,di,Xp.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Ge).onFocus())})),re(this,fi,Uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Ge).onOnline())})))}unmount(){var e,t;Da(this,es)._--,F(this,es)===0&&((e=F(this,di))==null||e.call(this),re(this,di,void 0),(t=F(this,fi))==null||t.call(this),re(this,fi,void 0))}isFetching(e){return F(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Zr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,Ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,Ge).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ss(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,Ge).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=F(this,Ge).get(r.queryHash),o=s==null?void 0:s.state.data,i=QR(t,o);if(i!==void 0)return F(this,Ge).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Je.batch(()=>F(this,Ge).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,Ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,Ge);Je.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,Ge);return Je.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Je.batch(()=>F(this,Ge).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Et).catch(Et)}invalidateQueries(e,t={}){return Je.batch(()=>(F(this,Ge).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Je.batch(()=>F(this,Ge).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Et)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,Ge).build(this,t);return n.isStaleByTime(ss(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Uc.isOnline()?F(this,Zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,Ge)}getMutationCache(){return F(this,Zr)}getDefaultOptions(){return F(this,Jr)}setDefaultOptions(e){re(this,Jr,e)}setQueryDefaults(e,t){F(this,ci).set(Js(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,ci).values()],n={};return t.forEach(r=>{hi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,ui).set(Js(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,ui).values()],n={};return t.forEach(r=>{hi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Jr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Gp(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===Jp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Jr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,Ge).clear(),F(this,Zr).clear()}},Ge=new WeakMap,Zr=new WeakMap,Jr=new WeakMap,ci=new WeakMap,ui=new WeakMap,es=new WeakMap,di=new WeakMap,fi=new WeakMap,lw),Ow=S.createContext(void 0),Oi=e=>{const t=S.useContext(Ow);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},vP=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(Ow.Provider,{value:e,children:t})),Aw=S.createContext(!1),jw=()=>S.useContext(Aw);Aw.Provider;function wP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bP=S.createContext(wP()),zw=()=>S.useContext(bP),Dw=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?eg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Fw=e=>{S.useEffect(()=>{e.clearReset()},[e])},Lw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||eg(n,[e.error,r])),$w=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},SP=(e,t)=>e.isLoading&&e.isFetching&&!t,hh=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ph=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Hw({queries:e,...t},n){const r=Oi(),s=jw(),o=zw(),i=S.useMemo(()=>e.map(v=>{const b=r.defaultQueryOptions(v);return b._optimisticResults=s?"isRestoring":"optimistic",b}),[e,r,s]);i.forEach(v=>{$w(v);const b=r.getQueryCache().get(v.queryHash);Dw(v,o,b)}),Fw(o);const[l]=S.useState(()=>new mP(r,i,t)),[a,c,u]=l.getOptimisticResult(i,t.combine),f=!s&&t.subscribed!==!1;S.useSyncExternalStore(S.useCallback(v=>f?l.subscribe(Je.batchCalls(v)):Et,[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setQueries(i,t)},[i,t,l]);const p=a.some((v,b)=>hh(i[b],v))?a.flatMap((v,b)=>{const h=i[b];if(h&&hh(h,v)){const y=new Uu(r,h);return ph(h,y,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const m=a.find((v,b)=>{const h=i[b];return h&&Lw({result:v,errorResetBoundary:o,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(m!=null&&m.error)throw m.error;return c(u())}function Bw(e,t,n){var p,m,v,b;const r=jw(),s=zw(),o=Oi(),i=o.defaultQueryOptions(e);(m=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||m.call(p,i);const l=o.getQueryCache().get(i.queryHash),a=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":a?"optimistic":void 0,$w(i),Dw(i,s,l),Fw(s);const c=!o.getQueryCache().get(i.queryHash),[u]=S.useState(()=>new t(o,i)),f=u.getOptimisticResult(i),d=!r&&a;if(S.useSyncExternalStore(S.useCallback(h=>{const y=d?u.subscribe(Je.batchCalls(h)):Et;return u.updateResult(),y},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(i)},[i,u]),hh(i,f))throw ph(i,u,s);if(Lw({result:f,errorResetBoundary:s,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw f.error;if((b=(v=o.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||b.call(v,i,f),i.experimental_prefetchInRender&&!Cl.isServer()&&SP(f,r)){const h=c?ph(i,u,s):l==null?void 0:l.promise;h==null||h.catch(Et).finally(()=>{u.updateResult()})}return i.notifyOnChangeProps?f:u.trackResult(f)}function Gn(e,t){return Bw(e,Uu)}function To(e,t){const n=Oi(),[r]=S.useState(()=>new pP(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);const s=S.useSyncExternalStore(S.useCallback(i=>r.subscribe(Je.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=S.useCallback((i,l)=>{r.mutate(i,l).catch(Et)},[r]);if(s.error&&eg(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function EP(e,t){return Bw(e,dP)}var Vw={exports:{}},sn={},Ww={exports:{}},Uw={};/**
|
|
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(T,_){var O=T.length;T.push(_);e:for(;0<O;){var B=O-1>>>1,$=T[B];if(0<s($,_))T[B]=_,T[O]=$,O=B;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var _=T[0],O=T.pop();if(O!==_){T[0]=O;e:for(var B=0,$=T.length,V=$>>>1;B<V;){var Y=2*(B+1)-1,U=T[Y],K=Y+1,Q=T[K];if(0>s(U,O))K<$&&0>s(Q,U)?(T[B]=Q,T[K]=O,B=K):(T[B]=U,T[Y]=O,B=Y);else if(K<$&&0>s(Q,O))T[B]=Q,T[K]=O,B=K;else break e}}return _}function s(T,_){var O=T.sortIndex-_.sortIndex;return O!==0?O:T.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],c=[],u=1,f=null,d=3,p=!1,m=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,h=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 g(T){for(var _=n(c);_!==null;){if(_.callback===null)r(c);else if(_.startTime<=T)r(c),_.sortIndex=_.expirationTime,t(a,_);else break;_=n(c)}}function w(T){if(v=!1,g(T),!m)if(n(a)!==null)m=!0,z(E);else{var _=n(c);_!==null&&D(w,_.startTime-T)}}function E(T,_){m=!1,v&&(v=!1,h(k),k=-1),p=!0;var O=d;try{for(g(_),f=n(a);f!==null&&(!(f.expirationTime>_)||T&&!j());){var B=f.callback;if(typeof B=="function"){f.callback=null,d=f.priorityLevel;var $=B(f.expirationTime<=_);_=e.unstable_now(),typeof $=="function"?f.callback=$:f===n(a)&&r(a),g(_)}else r(a);f=n(a)}if(f!==null)var V=!0;else{var Y=n(c);Y!==null&&D(w,Y.startTime-_),V=!1}return V}finally{f=null,d=O,p=!1}}var C=!1,R=null,k=-1,N=5,I=-1;function j(){return!(e.unstable_now()-I<N)}function L(){if(R!==null){var T=e.unstable_now();I=T;var _=!0;try{_=R(!0,T)}finally{_?A():(C=!1,R=null)}}else C=!1}var A;if(typeof y=="function")A=function(){y(L)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,M=P.port2;P.port1.onmessage=L,A=function(){M.postMessage(null)}}else A=function(){b(L,0)};function z(T){R=T,C||(C=!0,A())}function D(T,_){k=b(function(){T(e.unstable_now())},_)}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(T){T.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,z(E))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(d){case 1:case 2:case 3:var _=3;break;default:_=d}var O=d;d=_;try{return T()}finally{d=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,_){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var O=d;d=T;try{return _()}finally{d=O}},e.unstable_scheduleCallback=function(T,_,O){var B=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?B+O:B):O=B,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=O+$,T={id:u++,callback:_,priorityLevel:T,startTime:O,expirationTime:$,sortIndex:-1},O>B?(T.sortIndex=O,t(c,T),n(a)===null&&T===n(c)&&(v?(h(k),k=-1):v=!0,D(w,O-B))):(T.sortIndex=$,t(a,T),m||p||(m=!0,z(E))),T},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(T){var _=d;return function(){var O=d;d=_;try{return T.apply(this,arguments)}finally{d=O}}}})(Uw);Ww.exports=Uw;var kP=Ww.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 CP=S,tn=kP;function ne(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 Kw=new Set,Rl={};function po(e,t){pi(e,t),pi(e+"Capture",t)}function pi(e,t){for(Rl[e]=t,e=0;e<t.length;e++)Kw.add(t[e])}var Sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gh=Object.prototype.hasOwnProperty,RP=/^[: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]*$/,T0={},N0={};function PP(e){return gh.call(N0,e)?!0:gh.call(T0,e)?!1:RP.test(e)?N0[e]=!0:(T0[e]=!0,!1)}function TP(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 NP(e,t,n,r){if(t===null||typeof t>"u"||TP(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 jt(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xt[e]=new jt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xt[t]=new jt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xt[e]=new jt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xt[e]=new jt(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){xt[e]=new jt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xt[e]=new jt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xt[e]=new jt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xt[e]=new jt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xt[e]=new jt(e,5,!1,e.toLowerCase(),null,!1,!1)});var ng=/[\-:]([a-z])/g;function rg(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(ng,rg);xt[t]=new jt(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(ng,rg);xt[t]=new jt(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(ng,rg);xt[t]=new jt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xt[e]=new jt(e,1,!1,e.toLowerCase(),null,!1,!1)});xt.xlinkHref=new jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xt[e]=new jt(e,1,!1,e.toLowerCase(),null,!0,!0)});function sg(e,t,n,r){var s=xt.hasOwnProperty(t)?xt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(NP(t,n,s,r)&&(n=null),r||s===null?PP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Tr=CP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$a=Symbol.for("react.element"),No=Symbol.for("react.portal"),Io=Symbol.for("react.fragment"),og=Symbol.for("react.strict_mode"),mh=Symbol.for("react.profiler"),Yw=Symbol.for("react.provider"),qw=Symbol.for("react.context"),ig=Symbol.for("react.forward_ref"),yh=Symbol.for("react.suspense"),xh=Symbol.for("react.suspense_list"),lg=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy"),Qw=Symbol.for("react.offscreen"),I0=Symbol.iterator;function Wi(e){return e===null||typeof e!="object"?null:(e=I0&&e[I0]||e["@@iterator"],typeof e=="function"?e:null)}var Qe=Object.assign,Kd;function ol(e){if(Kd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kd=t&&t[1]||""}return`
|
|
34
|
+
`+Kd+e}var Yd=!1;function qd(e,t){if(!e||Yd)return"";Yd=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
|
|
35
|
+
`),o=r.stack.split(`
|
|
36
|
+
`),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var a=`
|
|
37
|
+
`+s[i].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{Yd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ol(e):""}function IP(e){switch(e.tag){case 5:return ol(e.type);case 16:return ol("Lazy");case 13:return ol("Suspense");case 19:return ol("SuspenseList");case 0:case 2:case 15:return e=qd(e.type,!1),e;case 11:return e=qd(e.type.render,!1),e;case 1:return e=qd(e.type,!0),e;default:return""}}function vh(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 Io:return"Fragment";case No:return"Portal";case mh:return"Profiler";case og:return"StrictMode";case yh:return"Suspense";case xh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qw:return(e.displayName||"Context")+".Consumer";case Yw:return(e._context.displayName||"Context")+".Provider";case ig:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lg:return t=e.displayName||null,t!==null?t:vh(e.type)||"Memo";case Lr:t=e._payload,e=e._init;try{return vh(e(t))}catch{}}return null}function MP(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 vh(t);case 8:return t===og?"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 gs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _P(e){var t=Xw(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 s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ha(e){e._valueTracker||(e._valueTracker=_P(e))}function Gw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kc(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 wh(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function M0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gs(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 Zw(e,t){t=t.checked,t!=null&&sg(e,"checked",t,!1)}function bh(e,t){Zw(e,t);var n=gs(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")?Sh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Sh(e,t.type,gs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _0(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 Sh(e,t,n){(t!=="number"||Kc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var il=Array.isArray;function Bo(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gs(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Eh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function O0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ne(92));if(il(n)){if(1<n.length)throw Error(ne(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gs(n)}}function Jw(e,t){var n=gs(t.value),r=gs(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 A0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function eb(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 kh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?eb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ba,tb=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ba=Ba||document.createElement("div"),Ba.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ba.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dl={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},OP=["Webkit","ms","Moz","O"];Object.keys(dl).forEach(function(e){OP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dl[t]=dl[e]})});function nb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||dl.hasOwnProperty(e)&&dl[e]?(""+t).trim():t+"px"}function rb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=nb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var AP=Qe({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 Ch(e,t){if(t){if(AP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function Rh(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 Ph=null;function ag(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Th=null,Vo=null,Wo=null;function j0(e){if(e=pa(e)){if(typeof Th!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=Xu(t),Th(e.stateNode,e.type,t))}}function sb(e){Vo?Wo?Wo.push(e):Wo=[e]:Vo=e}function ob(){if(Vo){var e=Vo,t=Wo;if(Wo=Vo=null,j0(e),t)for(e=0;e<t.length;e++)j0(t[e])}}function ib(e,t){return e(t)}function lb(){}var Qd=!1;function ab(e,t,n){if(Qd)return e(t,n);Qd=!0;try{return ib(e,t,n)}finally{Qd=!1,(Vo!==null||Wo!==null)&&(lb(),ob())}}function Tl(e,t){var n=e.stateNode;if(n===null)return null;var r=Xu(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(ne(231,t,typeof n));return n}var Nh=!1;if(Sr)try{var Ui={};Object.defineProperty(Ui,"passive",{get:function(){Nh=!0}}),window.addEventListener("test",Ui,Ui),window.removeEventListener("test",Ui,Ui)}catch{Nh=!1}function jP(e,t,n,r,s,o,i,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var fl=!1,Yc=null,qc=!1,Ih=null,zP={onError:function(e){fl=!0,Yc=e}};function DP(e,t,n,r,s,o,i,l,a){fl=!1,Yc=null,jP.apply(zP,arguments)}function FP(e,t,n,r,s,o,i,l,a){if(DP.apply(this,arguments),fl){if(fl){var c=Yc;fl=!1,Yc=null}else throw Error(ne(198));qc||(qc=!0,Ih=c)}}function go(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 cb(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 z0(e){if(go(e)!==e)throw Error(ne(188))}function LP(e){var t=e.alternate;if(!t){if(t=go(e),t===null)throw Error(ne(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return z0(s),e;if(o===r)return z0(s),t;o=o.sibling}throw Error(ne(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)throw Error(ne(189))}}if(n.alternate!==r)throw Error(ne(190))}if(n.tag!==3)throw Error(ne(188));return n.stateNode.current===n?e:t}function ub(e){return e=LP(e),e!==null?db(e):null}function db(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=db(e);if(t!==null)return t;e=e.sibling}return null}var fb=tn.unstable_scheduleCallback,D0=tn.unstable_cancelCallback,$P=tn.unstable_shouldYield,HP=tn.unstable_requestPaint,nt=tn.unstable_now,BP=tn.unstable_getCurrentPriorityLevel,cg=tn.unstable_ImmediatePriority,hb=tn.unstable_UserBlockingPriority,Qc=tn.unstable_NormalPriority,VP=tn.unstable_LowPriority,pb=tn.unstable_IdlePriority,Ku=null,Zn=null;function WP(e){if(Zn&&typeof Zn.onCommitFiberRoot=="function")try{Zn.onCommitFiberRoot(Ku,e,void 0,(e.current.flags&128)===128)}catch{}}var _n=Math.clz32?Math.clz32:YP,UP=Math.log,KP=Math.LN2;function YP(e){return e>>>=0,e===0?32:31-(UP(e)/KP|0)|0}var Va=64,Wa=4194304;function ll(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 Xc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=ll(l):(o&=i,o!==0&&(r=ll(o)))}else i=n&~s,i!==0?r=ll(i):o!==0&&(r=ll(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&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-_n(t),s=1<<n,r|=e[n],t&=~s;return r}function qP(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 QP(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-_n(o),l=1<<i,a=s[i];a===-1?(!(l&n)||l&r)&&(s[i]=qP(l,t)):a<=t&&(e.expiredLanes|=l),o&=~l}}function Mh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gb(){var e=Va;return Va<<=1,!(Va&4194240)&&(Va=64),e}function Xd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_n(t),e[t]=n}function XP(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 s=31-_n(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function ug(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_n(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ze=0;function mb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var yb,dg,xb,vb,wb,_h=!1,Ua=[],os=null,is=null,ls=null,Nl=new Map,Il=new Map,Br=[],GP="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 F0(e,t){switch(e){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":Nl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(t.pointerId)}}function Ki(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=pa(t),t!==null&&dg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ZP(e,t,n,r,s){switch(t){case"focusin":return os=Ki(os,e,t,n,r,s),!0;case"dragenter":return is=Ki(is,e,t,n,r,s),!0;case"mouseover":return ls=Ki(ls,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return Nl.set(o,Ki(Nl.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,Il.set(o,Ki(Il.get(o)||null,e,t,n,r,s)),!0}return!1}function bb(e){var t=js(e.target);if(t!==null){var n=go(t);if(n!==null){if(t=n.tag,t===13){if(t=cb(n),t!==null){e.blockedOn=t,wb(e.priority,function(){xb(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 kc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Oh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ph=r,n.target.dispatchEvent(r),Ph=null}else return t=pa(n),t!==null&&dg(t),e.blockedOn=n,!1;t.shift()}return!0}function L0(e,t,n){kc(e)&&n.delete(t)}function JP(){_h=!1,os!==null&&kc(os)&&(os=null),is!==null&&kc(is)&&(is=null),ls!==null&&kc(ls)&&(ls=null),Nl.forEach(L0),Il.forEach(L0)}function Yi(e,t){e.blockedOn===t&&(e.blockedOn=null,_h||(_h=!0,tn.unstable_scheduleCallback(tn.unstable_NormalPriority,JP)))}function Ml(e){function t(s){return Yi(s,e)}if(0<Ua.length){Yi(Ua[0],e);for(var n=1;n<Ua.length;n++){var r=Ua[n];r.blockedOn===e&&(r.blockedOn=null)}}for(os!==null&&Yi(os,e),is!==null&&Yi(is,e),ls!==null&&Yi(ls,e),Nl.forEach(t),Il.forEach(t),n=0;n<Br.length;n++)r=Br[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Br.length&&(n=Br[0],n.blockedOn===null);)bb(n),n.blockedOn===null&&Br.shift()}var Uo=Tr.ReactCurrentBatchConfig,Gc=!0;function eT(e,t,n,r){var s=ze,o=Uo.transition;Uo.transition=null;try{ze=1,fg(e,t,n,r)}finally{ze=s,Uo.transition=o}}function tT(e,t,n,r){var s=ze,o=Uo.transition;Uo.transition=null;try{ze=4,fg(e,t,n,r)}finally{ze=s,Uo.transition=o}}function fg(e,t,n,r){if(Gc){var s=Oh(e,t,n,r);if(s===null)lf(e,t,r,Zc,n),F0(e,r);else if(ZP(s,e,t,n,r))r.stopPropagation();else if(F0(e,r),t&4&&-1<GP.indexOf(e)){for(;s!==null;){var o=pa(s);if(o!==null&&yb(o),o=Oh(e,t,n,r),o===null&&lf(e,t,r,Zc,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else lf(e,t,r,null,n)}}var Zc=null;function Oh(e,t,n,r){if(Zc=null,e=ag(r),e=js(e),e!==null)if(t=go(e),t===null)e=null;else if(n=t.tag,n===13){if(e=cb(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 Zc=e,null}function Sb(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(BP()){case cg:return 1;case hb:return 4;case Qc:case VP:return 16;case pb:return 536870912;default:return 16}default:return 16}}var ts=null,hg=null,Cc=null;function Eb(){if(Cc)return Cc;var e,t=hg,n=t.length,r,s="value"in ts?ts.value:ts.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return Cc=s.slice(e,1<r?1-r:void 0)}function Rc(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 Ka(){return!0}function $0(){return!1}function on(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ka:$0,this.isPropagationStopped=$0,this}return Qe(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=Ka)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ka)},persist:function(){},isPersistent:Ka}),t}var Ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pg=on(Ai),ha=Qe({},Ai,{view:0,detail:0}),nT=on(ha),Gd,Zd,qi,Yu=Qe({},ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gg,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!==qi&&(qi&&e.type==="mousemove"?(Gd=e.screenX-qi.screenX,Zd=e.screenY-qi.screenY):Zd=Gd=0,qi=e),Gd)},movementY:function(e){return"movementY"in e?e.movementY:Zd}}),H0=on(Yu),rT=Qe({},Yu,{dataTransfer:0}),sT=on(rT),oT=Qe({},ha,{relatedTarget:0}),Jd=on(oT),iT=Qe({},Ai,{animationName:0,elapsedTime:0,pseudoElement:0}),lT=on(iT),aT=Qe({},Ai,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cT=on(aT),uT=Qe({},Ai,{data:0}),B0=on(uT),dT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fT={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"},hT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hT[e])?!!t[e]:!1}function gg(){return pT}var gT=Qe({},ha,{key:function(e){if(e.key){var t=dT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gg,charCode:function(e){return e.type==="keypress"?Rc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mT=on(gT),yT=Qe({},Yu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),V0=on(yT),xT=Qe({},ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gg}),vT=on(xT),wT=Qe({},Ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),bT=on(wT),ST=Qe({},Yu,{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}),ET=on(ST),kT=[9,13,27,32],mg=Sr&&"CompositionEvent"in window,hl=null;Sr&&"documentMode"in document&&(hl=document.documentMode);var CT=Sr&&"TextEvent"in window&&!hl,kb=Sr&&(!mg||hl&&8<hl&&11>=hl),W0=" ",U0=!1;function Cb(e,t){switch(e){case"keyup":return kT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mo=!1;function RT(e,t){switch(e){case"compositionend":return Rb(t);case"keypress":return t.which!==32?null:(U0=!0,W0);case"textInput":return e=t.data,e===W0&&U0?null:e;default:return null}}function PT(e,t){if(Mo)return e==="compositionend"||!mg&&Cb(e,t)?(e=Eb(),Cc=hg=ts=null,Mo=!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 kb&&t.locale!=="ko"?null:t.data;default:return null}}var TT={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 K0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!TT[e.type]:t==="textarea"}function Pb(e,t,n,r){sb(r),t=Jc(t,"onChange"),0<t.length&&(n=new pg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var pl=null,_l=null;function NT(e){Fb(e,0)}function qu(e){var t=Ao(e);if(Gw(t))return e}function IT(e,t){if(e==="change")return t}var Tb=!1;if(Sr){var ef;if(Sr){var tf="oninput"in document;if(!tf){var Y0=document.createElement("div");Y0.setAttribute("oninput","return;"),tf=typeof Y0.oninput=="function"}ef=tf}else ef=!1;Tb=ef&&(!document.documentMode||9<document.documentMode)}function q0(){pl&&(pl.detachEvent("onpropertychange",Nb),_l=pl=null)}function Nb(e){if(e.propertyName==="value"&&qu(_l)){var t=[];Pb(t,_l,e,ag(e)),ab(NT,t)}}function MT(e,t,n){e==="focusin"?(q0(),pl=t,_l=n,pl.attachEvent("onpropertychange",Nb)):e==="focusout"&&q0()}function _T(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qu(_l)}function OT(e,t){if(e==="click")return qu(t)}function AT(e,t){if(e==="input"||e==="change")return qu(t)}function jT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:jT;function Ol(e,t){if(An(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 s=n[r];if(!gh.call(t,s)||!An(e[s],t[s]))return!1}return!0}function Q0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function X0(e,t){var n=Q0(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=Q0(n)}}function Ib(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ib(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mb(){for(var e=window,t=Kc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kc(e.document)}return t}function yg(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 zT(e){var t=Mb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ib(n.ownerDocument.documentElement,n)){if(r!==null&&yg(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 s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=X0(n,o);var i=X0(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 DT=Sr&&"documentMode"in document&&11>=document.documentMode,_o=null,Ah=null,gl=null,jh=!1;function G0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jh||_o==null||_o!==Kc(r)||(r=_o,"selectionStart"in r&&yg(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}),gl&&Ol(gl,r)||(gl=r,r=Jc(Ah,"onSelect"),0<r.length&&(t=new pg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_o)))}function Ya(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Oo={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},nf={},_b={};Sr&&(_b=document.createElement("div").style,"AnimationEvent"in window||(delete Oo.animationend.animation,delete Oo.animationiteration.animation,delete Oo.animationstart.animation),"TransitionEvent"in window||delete Oo.transitionend.transition);function Qu(e){if(nf[e])return nf[e];if(!Oo[e])return e;var t=Oo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _b)return nf[e]=t[n];return e}var Ob=Qu("animationend"),Ab=Qu("animationiteration"),jb=Qu("animationstart"),zb=Qu("transitionend"),Db=new Map,Z0="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 Es(e,t){Db.set(e,t),po(t,[e])}for(var rf=0;rf<Z0.length;rf++){var sf=Z0[rf],FT=sf.toLowerCase(),LT=sf[0].toUpperCase()+sf.slice(1);Es(FT,"on"+LT)}Es(Ob,"onAnimationEnd");Es(Ab,"onAnimationIteration");Es(jb,"onAnimationStart");Es("dblclick","onDoubleClick");Es("focusin","onFocus");Es("focusout","onBlur");Es(zb,"onTransitionEnd");pi("onMouseEnter",["mouseout","mouseover"]);pi("onMouseLeave",["mouseout","mouseover"]);pi("onPointerEnter",["pointerout","pointerover"]);pi("onPointerLeave",["pointerout","pointerover"]);po("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));po("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));po("onBeforeInput",["compositionend","keypress","textInput","paste"]);po("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));po("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));po("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var al="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(" "),$T=new Set("cancel close invalid load scroll toggle".split(" ").concat(al));function J0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,FP(r,t,void 0,e),e.currentTarget=null}function Fb(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==o&&s.isPropagationStopped())break e;J0(s,l,c),o=a}else for(i=0;i<r.length;i++){if(l=r[i],a=l.instance,c=l.currentTarget,l=l.listener,a!==o&&s.isPropagationStopped())break e;J0(s,l,c),o=a}}}if(qc)throw e=Ih,qc=!1,Ih=null,e}function Be(e,t){var n=t[$h];n===void 0&&(n=t[$h]=new Set);var r=e+"__bubble";n.has(r)||(Lb(t,e,2,!1),n.add(r))}function of(e,t,n){var r=0;t&&(r|=4),Lb(n,e,r,t)}var qa="_reactListening"+Math.random().toString(36).slice(2);function Al(e){if(!e[qa]){e[qa]=!0,Kw.forEach(function(n){n!=="selectionchange"&&($T.has(n)||of(n,!1,e),of(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qa]||(t[qa]=!0,of("selectionchange",!1,t))}}function Lb(e,t,n,r){switch(Sb(t)){case 1:var s=eT;break;case 4:s=tT;break;default:s=fg}n=s.bind(null,t,n,e),s=void 0,!Nh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function lf(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var a=i.tag;if((a===3||a===4)&&(a=i.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;i=i.return}for(;l!==null;){if(i=js(l),i===null)return;if(a=i.tag,a===5||a===6){r=o=i;continue e}l=l.parentNode}}r=r.return}ab(function(){var c=o,u=ag(n),f=[];e:{var d=Db.get(e);if(d!==void 0){var p=pg,m=e;switch(e){case"keypress":if(Rc(n)===0)break e;case"keydown":case"keyup":p=mT;break;case"focusin":m="focus",p=Jd;break;case"focusout":m="blur",p=Jd;break;case"beforeblur":case"afterblur":p=Jd;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":p=H0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=sT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=vT;break;case Ob:case Ab:case jb:p=lT;break;case zb:p=bT;break;case"scroll":p=nT;break;case"wheel":p=ET;break;case"copy":case"cut":case"paste":p=cT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=V0}var v=(t&4)!==0,b=!v&&e==="scroll",h=v?d!==null?d+"Capture":null:d;v=[];for(var y=c,g;y!==null;){g=y;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,h!==null&&(w=Tl(y,h),w!=null&&v.push(jl(y,w,g)))),b)break;y=y.return}0<v.length&&(d=new p(d,m,null,n,u),f.push({event:d,listeners:v}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",d&&n!==Ph&&(m=n.relatedTarget||n.fromElement)&&(js(m)||m[Er]))break e;if((p||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?js(m):null,m!==null&&(b=go(m),m!==b||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(v=H0,w="onMouseLeave",h="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=V0,w="onPointerLeave",h="onPointerEnter",y="pointer"),b=p==null?d:Ao(p),g=m==null?d:Ao(m),d=new v(w,y+"leave",p,n,u),d.target=b,d.relatedTarget=g,w=null,js(u)===c&&(v=new v(h,y+"enter",m,n,u),v.target=g,v.relatedTarget=b,w=v),b=w,p&&m)t:{for(v=p,h=m,y=0,g=v;g;g=Co(g))y++;for(g=0,w=h;w;w=Co(w))g++;for(;0<y-g;)v=Co(v),y--;for(;0<g-y;)h=Co(h),g--;for(;y--;){if(v===h||h!==null&&v===h.alternate)break t;v=Co(v),h=Co(h)}v=null}else v=null;p!==null&&ey(f,d,p,v,!1),m!==null&&b!==null&&ey(f,b,m,v,!0)}}e:{if(d=c?Ao(c):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var E=IT;else if(K0(d))if(Tb)E=AT;else{E=_T;var C=MT}else(p=d.nodeName)&&p.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(E=OT);if(E&&(E=E(e,c))){Pb(f,E,n,u);break e}C&&C(e,d,c),e==="focusout"&&(C=d._wrapperState)&&C.controlled&&d.type==="number"&&Sh(d,"number",d.value)}switch(C=c?Ao(c):window,e){case"focusin":(K0(C)||C.contentEditable==="true")&&(_o=C,Ah=c,gl=null);break;case"focusout":gl=Ah=_o=null;break;case"mousedown":jh=!0;break;case"contextmenu":case"mouseup":case"dragend":jh=!1,G0(f,n,u);break;case"selectionchange":if(DT)break;case"keydown":case"keyup":G0(f,n,u)}var R;if(mg)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Mo?Cb(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(kb&&n.locale!=="ko"&&(Mo||k!=="onCompositionStart"?k==="onCompositionEnd"&&Mo&&(R=Eb()):(ts=u,hg="value"in ts?ts.value:ts.textContent,Mo=!0)),C=Jc(c,k),0<C.length&&(k=new B0(k,e,null,n,u),f.push({event:k,listeners:C}),R?k.data=R:(R=Rb(n),R!==null&&(k.data=R)))),(R=CT?RT(e,n):PT(e,n))&&(c=Jc(c,"onBeforeInput"),0<c.length&&(u=new B0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=R))}Fb(f,t)})}function jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jc(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Tl(e,n),o!=null&&r.unshift(jl(e,o,s)),o=Tl(e,t),o!=null&&r.push(jl(e,o,s))),e=e.return}return r}function Co(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ey(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,s?(a=Tl(n,o),a!=null&&i.unshift(jl(n,a,l))):s||(a=Tl(n,o),a!=null&&i.push(jl(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var HT=/\r\n?/g,BT=/\u0000|\uFFFD/g;function ty(e){return(typeof e=="string"?e:""+e).replace(HT,`
|
|
38
|
+
`).replace(BT,"")}function Qa(e,t,n){if(t=ty(t),ty(e)!==t&&n)throw Error(ne(425))}function eu(){}var zh=null,Dh=null;function Fh(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 Lh=typeof setTimeout=="function"?setTimeout:void 0,VT=typeof clearTimeout=="function"?clearTimeout:void 0,ny=typeof Promise=="function"?Promise:void 0,WT=typeof queueMicrotask=="function"?queueMicrotask:typeof ny<"u"?function(e){return ny.resolve(null).then(e).catch(UT)}:Lh;function UT(e){setTimeout(function(){throw e})}function af(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Ml(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Ml(t)}function as(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 ry(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 ji=Math.random().toString(36).slice(2),Xn="__reactFiber$"+ji,zl="__reactProps$"+ji,Er="__reactContainer$"+ji,$h="__reactEvents$"+ji,KT="__reactListeners$"+ji,YT="__reactHandles$"+ji;function js(e){var t=e[Xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Er]||n[Xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ry(e);e!==null;){if(n=e[Xn])return n;e=ry(e)}return t}e=n,n=e.parentNode}return null}function pa(e){return e=e[Xn]||e[Er],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ao(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function Xu(e){return e[zl]||null}var Hh=[],jo=-1;function ks(e){return{current:e}}function Ve(e){0>jo||(e.current=Hh[jo],Hh[jo]=null,jo--)}function He(e,t){jo++,Hh[jo]=e.current,e.current=t}var ms={},Rt=ks(ms),Wt=ks(!1),eo=ms;function gi(e,t){var n=e.type.contextTypes;if(!n)return ms;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ut(e){return e=e.childContextTypes,e!=null}function tu(){Ve(Wt),Ve(Rt)}function sy(e,t,n){if(Rt.current!==ms)throw Error(ne(168));He(Rt,t),He(Wt,n)}function $b(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ne(108,MP(e)||"Unknown",s));return Qe({},n,r)}function nu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ms,eo=Rt.current,He(Rt,e),He(Wt,Wt.current),!0}function oy(e,t,n){var r=e.stateNode;if(!r)throw Error(ne(169));n?(e=$b(e,t,eo),r.__reactInternalMemoizedMergedChildContext=e,Ve(Wt),Ve(Rt),He(Rt,e)):Ve(Wt),He(Wt,n)}var cr=null,Gu=!1,cf=!1;function Hb(e){cr===null?cr=[e]:cr.push(e)}function qT(e){Gu=!0,Hb(e)}function Cs(){if(!cf&&cr!==null){cf=!0;var e=0,t=ze;try{var n=cr;for(ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}cr=null,Gu=!1}catch(s){throw cr!==null&&(cr=cr.slice(e+1)),fb(cg,Cs),s}finally{ze=t,cf=!1}}return null}var zo=[],Do=0,ru=null,su=0,dn=[],fn=0,to=null,pr=1,gr="";function Ms(e,t){zo[Do++]=su,zo[Do++]=ru,ru=e,su=t}function Bb(e,t,n){dn[fn++]=pr,dn[fn++]=gr,dn[fn++]=to,to=e;var r=pr;e=gr;var s=32-_n(r)-1;r&=~(1<<s),n+=1;var o=32-_n(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,pr=1<<32-_n(t)+s|n<<s|r,gr=o+e}else pr=1<<o|n<<s|r,gr=e}function xg(e){e.return!==null&&(Ms(e,1),Bb(e,1,0))}function vg(e){for(;e===ru;)ru=zo[--Do],zo[Do]=null,su=zo[--Do],zo[Do]=null;for(;e===to;)to=dn[--fn],dn[fn]=null,gr=dn[--fn],dn[fn]=null,pr=dn[--fn],dn[fn]=null}var en=null,Jt=null,Ke=!1,Tn=null;function Vb(e,t){var n=hn(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 iy(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,en=e,Jt=as(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,en=e,Jt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=to!==null?{id:pr,overflow:gr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=hn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,en=e,Jt=null,!0):!1;default:return!1}}function Bh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Vh(e){if(Ke){var t=Jt;if(t){var n=t;if(!iy(e,t)){if(Bh(e))throw Error(ne(418));t=as(n.nextSibling);var r=en;t&&iy(e,t)?Vb(r,n):(e.flags=e.flags&-4097|2,Ke=!1,en=e)}}else{if(Bh(e))throw Error(ne(418));e.flags=e.flags&-4097|2,Ke=!1,en=e}}}function ly(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;en=e}function Xa(e){if(e!==en)return!1;if(!Ke)return ly(e),Ke=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fh(e.type,e.memoizedProps)),t&&(t=Jt)){if(Bh(e))throw Wb(),Error(ne(418));for(;t;)Vb(e,t),t=as(t.nextSibling)}if(ly(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Jt=as(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Jt=null}}else Jt=en?as(e.stateNode.nextSibling):null;return!0}function Wb(){for(var e=Jt;e;)e=as(e.nextSibling)}function mi(){Jt=en=null,Ke=!1}function wg(e){Tn===null?Tn=[e]:Tn.push(e)}var QT=Tr.ReactCurrentBatchConfig;function Qi(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(ne(309));var r=n.stateNode}if(!r)throw Error(ne(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(ne(284));if(!n._owner)throw Error(ne(290,e))}return e}function Ga(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ay(e){var t=e._init;return t(e._payload)}function Ub(e){function t(h,y){if(e){var g=h.deletions;g===null?(h.deletions=[y],h.flags|=16):g.push(y)}}function n(h,y){if(!e)return null;for(;y!==null;)t(h,y),y=y.sibling;return null}function r(h,y){for(h=new Map;y!==null;)y.key!==null?h.set(y.key,y):h.set(y.index,y),y=y.sibling;return h}function s(h,y){return h=fs(h,y),h.index=0,h.sibling=null,h}function o(h,y,g){return h.index=g,e?(g=h.alternate,g!==null?(g=g.index,g<y?(h.flags|=2,y):g):(h.flags|=2,y)):(h.flags|=1048576,y)}function i(h){return e&&h.alternate===null&&(h.flags|=2),h}function l(h,y,g,w){return y===null||y.tag!==6?(y=mf(g,h.mode,w),y.return=h,y):(y=s(y,g),y.return=h,y)}function a(h,y,g,w){var E=g.type;return E===Io?u(h,y,g.props.children,w,g.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Lr&&ay(E)===y.type)?(w=s(y,g.props),w.ref=Qi(h,y,g),w.return=h,w):(w=Oc(g.type,g.key,g.props,null,h.mode,w),w.ref=Qi(h,y,g),w.return=h,w)}function c(h,y,g,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=yf(g,h.mode,w),y.return=h,y):(y=s(y,g.children||[]),y.return=h,y)}function u(h,y,g,w,E){return y===null||y.tag!==7?(y=Xs(g,h.mode,w,E),y.return=h,y):(y=s(y,g),y.return=h,y)}function f(h,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=mf(""+y,h.mode,g),y.return=h,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case $a:return g=Oc(y.type,y.key,y.props,null,h.mode,g),g.ref=Qi(h,null,y),g.return=h,g;case No:return y=yf(y,h.mode,g),y.return=h,y;case Lr:var w=y._init;return f(h,w(y._payload),g)}if(il(y)||Wi(y))return y=Xs(y,h.mode,g,null),y.return=h,y;Ga(h,y)}return null}function d(h,y,g,w){var E=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return E!==null?null:l(h,y,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case $a:return g.key===E?a(h,y,g,w):null;case No:return g.key===E?c(h,y,g,w):null;case Lr:return E=g._init,d(h,y,E(g._payload),w)}if(il(g)||Wi(g))return E!==null?null:u(h,y,g,w,null);Ga(h,g)}return null}function p(h,y,g,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return h=h.get(g)||null,l(y,h,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case $a:return h=h.get(w.key===null?g:w.key)||null,a(y,h,w,E);case No:return h=h.get(w.key===null?g:w.key)||null,c(y,h,w,E);case Lr:var C=w._init;return p(h,y,g,C(w._payload),E)}if(il(w)||Wi(w))return h=h.get(g)||null,u(y,h,w,E,null);Ga(y,w)}return null}function m(h,y,g,w){for(var E=null,C=null,R=y,k=y=0,N=null;R!==null&&k<g.length;k++){R.index>k?(N=R,R=null):N=R.sibling;var I=d(h,R,g[k],w);if(I===null){R===null&&(R=N);break}e&&R&&I.alternate===null&&t(h,R),y=o(I,y,k),C===null?E=I:C.sibling=I,C=I,R=N}if(k===g.length)return n(h,R),Ke&&Ms(h,k),E;if(R===null){for(;k<g.length;k++)R=f(h,g[k],w),R!==null&&(y=o(R,y,k),C===null?E=R:C.sibling=R,C=R);return Ke&&Ms(h,k),E}for(R=r(h,R);k<g.length;k++)N=p(R,h,k,g[k],w),N!==null&&(e&&N.alternate!==null&&R.delete(N.key===null?k:N.key),y=o(N,y,k),C===null?E=N:C.sibling=N,C=N);return e&&R.forEach(function(j){return t(h,j)}),Ke&&Ms(h,k),E}function v(h,y,g,w){var E=Wi(g);if(typeof E!="function")throw Error(ne(150));if(g=E.call(g),g==null)throw Error(ne(151));for(var C=E=null,R=y,k=y=0,N=null,I=g.next();R!==null&&!I.done;k++,I=g.next()){R.index>k?(N=R,R=null):N=R.sibling;var j=d(h,R,I.value,w);if(j===null){R===null&&(R=N);break}e&&R&&j.alternate===null&&t(h,R),y=o(j,y,k),C===null?E=j:C.sibling=j,C=j,R=N}if(I.done)return n(h,R),Ke&&Ms(h,k),E;if(R===null){for(;!I.done;k++,I=g.next())I=f(h,I.value,w),I!==null&&(y=o(I,y,k),C===null?E=I:C.sibling=I,C=I);return Ke&&Ms(h,k),E}for(R=r(h,R);!I.done;k++,I=g.next())I=p(R,h,k,I.value,w),I!==null&&(e&&I.alternate!==null&&R.delete(I.key===null?k:I.key),y=o(I,y,k),C===null?E=I:C.sibling=I,C=I);return e&&R.forEach(function(L){return t(h,L)}),Ke&&Ms(h,k),E}function b(h,y,g,w){if(typeof g=="object"&&g!==null&&g.type===Io&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case $a:e:{for(var E=g.key,C=y;C!==null;){if(C.key===E){if(E=g.type,E===Io){if(C.tag===7){n(h,C.sibling),y=s(C,g.props.children),y.return=h,h=y;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Lr&&ay(E)===C.type){n(h,C.sibling),y=s(C,g.props),y.ref=Qi(h,C,g),y.return=h,h=y;break e}n(h,C);break}else t(h,C);C=C.sibling}g.type===Io?(y=Xs(g.props.children,h.mode,w,g.key),y.return=h,h=y):(w=Oc(g.type,g.key,g.props,null,h.mode,w),w.ref=Qi(h,y,g),w.return=h,h=w)}return i(h);case No:e:{for(C=g.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(h,y.sibling),y=s(y,g.children||[]),y.return=h,h=y;break e}else{n(h,y);break}else t(h,y);y=y.sibling}y=yf(g,h.mode,w),y.return=h,h=y}return i(h);case Lr:return C=g._init,b(h,y,C(g._payload),w)}if(il(g))return m(h,y,g,w);if(Wi(g))return v(h,y,g,w);Ga(h,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(h,y.sibling),y=s(y,g),y.return=h,h=y):(n(h,y),y=mf(g,h.mode,w),y.return=h,h=y),i(h)):n(h,y)}return b}var yi=Ub(!0),Kb=Ub(!1),ou=ks(null),iu=null,Fo=null,bg=null;function Sg(){bg=Fo=iu=null}function Eg(e){var t=ou.current;Ve(ou),e._currentValue=t}function Wh(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 Ko(e,t){iu=e,bg=Fo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Bt=!0),e.firstContext=null)}function yn(e){var t=e._currentValue;if(bg!==e)if(e={context:e,memoizedValue:t,next:null},Fo===null){if(iu===null)throw Error(ne(308));Fo=e,iu.dependencies={lanes:0,firstContext:e}}else Fo=Fo.next=e;return t}var zs=null;function kg(e){zs===null?zs=[e]:zs.push(e)}function Yb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,kg(t)):(n.next=s.next,s.next=n),t.interleaved=n,kr(e,r)}function kr(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 $r=!1;function Cg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qb(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 yr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function cs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Te&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,kr(e,n)}return s=r.interleaved,s===null?(t.next=t,kg(r)):(t.next=s.next,s.next=t),r.interleaved=t,kr(e,n)}function Pc(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,ug(e,n)}}function cy(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 lu(e,t,n,r){var s=e.updateQueue;$r=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var a=l,c=a.next;a.next=null,i===null?o=c:i.next=c,i=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==i&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var f=s.baseState;i=0,u=c=a=null,l=o;do{var d=l.lane,p=l.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,v=l;switch(d=t,p=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){f=m.call(p,f,d);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,d=typeof m=="function"?m.call(p,f,d):m,d==null)break e;f=Qe({},f,d);break e;case 2:$r=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=s.effects,d===null?s.effects=[l]:d.push(l))}else p={eventTime:p,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=p,a=f):u=u.next=p,i|=d;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;d=l,l=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(u===null&&(a=f),s.baseState=a,s.firstBaseUpdate=c,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);ro|=i,e.lanes=i,e.memoizedState=f}}function uy(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ne(191,s));s.call(r)}}}var ga={},Jn=ks(ga),Dl=ks(ga),Fl=ks(ga);function Ds(e){if(e===ga)throw Error(ne(174));return e}function Rg(e,t){switch(He(Fl,t),He(Dl,e),He(Jn,ga),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kh(t,e)}Ve(Jn),He(Jn,t)}function xi(){Ve(Jn),Ve(Dl),Ve(Fl)}function Qb(e){Ds(Fl.current);var t=Ds(Jn.current),n=kh(t,e.type);t!==n&&(He(Dl,e),He(Jn,n))}function Pg(e){Dl.current===e&&(Ve(Jn),Ve(Dl))}var Ye=ks(0);function au(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 uf=[];function Tg(){for(var e=0;e<uf.length;e++)uf[e]._workInProgressVersionPrimary=null;uf.length=0}var Tc=Tr.ReactCurrentDispatcher,df=Tr.ReactCurrentBatchConfig,no=0,qe=null,it=null,ut=null,cu=!1,ml=!1,Ll=0,XT=0;function wt(){throw Error(ne(321))}function Ng(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!An(e[n],t[n]))return!1;return!0}function Ig(e,t,n,r,s,o){if(no=o,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Tc.current=e===null||e.memoizedState===null?eN:tN,e=n(r,s),ml){o=0;do{if(ml=!1,Ll=0,25<=o)throw Error(ne(301));o+=1,ut=it=null,t.updateQueue=null,Tc.current=nN,e=n(r,s)}while(ml)}if(Tc.current=uu,t=it!==null&&it.next!==null,no=0,ut=it=qe=null,cu=!1,t)throw Error(ne(300));return e}function Mg(){var e=Ll!==0;return Ll=0,e}function Wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?qe.memoizedState=ut=e:ut=ut.next=e,ut}function xn(){if(it===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=ut===null?qe.memoizedState:ut.next;if(t!==null)ut=t,it=e;else{if(e===null)throw Error(ne(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},ut===null?qe.memoizedState=ut=e:ut=ut.next=e}return ut}function $l(e,t){return typeof t=="function"?t(e):t}function ff(e){var t=xn(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=it,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,a=null,c=o;do{var u=c.lane;if((no&u)===u)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=f,i=r):a=a.next=f,qe.lanes|=u,ro|=u}c=c.next}while(c!==null&&c!==o);a===null?i=r:a.next=l,An(r,t.memoizedState)||(Bt=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,qe.lanes|=o,ro|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function hf(e){var t=xn(),n=t.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);An(o,t.memoizedState)||(Bt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Xb(){}function Gb(e,t){var n=qe,r=xn(),s=t(),o=!An(r.memoizedState,s);if(o&&(r.memoizedState=s,Bt=!0),r=r.queue,_g(e1.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ut!==null&&ut.memoizedState.tag&1){if(n.flags|=2048,Hl(9,Jb.bind(null,n,r,s,t),void 0,null),dt===null)throw Error(ne(349));no&30||Zb(n,t,s)}return s}function Zb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jb(e,t,n,r){t.value=n,t.getSnapshot=r,t1(t)&&n1(e)}function e1(e,t,n){return n(function(){t1(t)&&n1(e)})}function t1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!An(e,n)}catch{return!0}}function n1(e){var t=kr(e,1);t!==null&&On(t,e,1,-1)}function dy(e){var t=Wn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:e},t.queue=e,e=e.dispatch=JT.bind(null,qe,e),[t.memoizedState,e]}function Hl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=qe.updateQueue,t===null?(t={lastEffect:null,stores:null},qe.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 r1(){return xn().memoizedState}function Nc(e,t,n,r){var s=Wn();qe.flags|=e,s.memoizedState=Hl(1|t,n,void 0,r===void 0?null:r)}function Zu(e,t,n,r){var s=xn();r=r===void 0?null:r;var o=void 0;if(it!==null){var i=it.memoizedState;if(o=i.destroy,r!==null&&Ng(r,i.deps)){s.memoizedState=Hl(t,n,o,r);return}}qe.flags|=e,s.memoizedState=Hl(1|t,n,o,r)}function fy(e,t){return Nc(8390656,8,e,t)}function _g(e,t){return Zu(2048,8,e,t)}function s1(e,t){return Zu(4,2,e,t)}function o1(e,t){return Zu(4,4,e,t)}function i1(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 l1(e,t,n){return n=n!=null?n.concat([e]):null,Zu(4,4,i1.bind(null,t,e),n)}function Og(){}function a1(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ng(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function c1(e,t){var n=xn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ng(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function u1(e,t,n){return no&21?(An(n,t)||(n=gb(),qe.lanes|=n,ro|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bt=!0),e.memoizedState=n)}function GT(e,t){var n=ze;ze=n!==0&&4>n?n:4,e(!0);var r=df.transition;df.transition={};try{e(!1),t()}finally{ze=n,df.transition=r}}function d1(){return xn().memoizedState}function ZT(e,t,n){var r=ds(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},f1(e))h1(t,n);else if(n=Yb(e,t,n,r),n!==null){var s=Ot();On(n,e,r,s),p1(n,t,r)}}function JT(e,t,n){var r=ds(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(f1(e))h1(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,An(l,i)){var a=t.interleaved;a===null?(s.next=s,kg(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=Yb(e,t,s,r),n!==null&&(s=Ot(),On(n,e,r,s),p1(n,t,r))}}function f1(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function h1(e,t){ml=cu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function p1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ug(e,n)}}var uu={readContext:yn,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useInsertionEffect:wt,useLayoutEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useMutableSource:wt,useSyncExternalStore:wt,useId:wt,unstable_isNewReconciler:!1},eN={readContext:yn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:yn,useEffect:fy,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Nc(4194308,4,i1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Nc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nc(4,2,e,t)},useMemo:function(e,t){var n=Wn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wn();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=ZT.bind(null,qe,e),[r.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:dy,useDebugValue:Og,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=dy(!1),t=e[0];return e=GT.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qe,s=Wn();if(Ke){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=t(),dt===null)throw Error(ne(349));no&30||Zb(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,fy(e1.bind(null,r,o,e),[e]),r.flags|=2048,Hl(9,Jb.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Wn(),t=dt.identifierPrefix;if(Ke){var n=gr,r=pr;n=(r&~(1<<32-_n(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ll++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=XT++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tN={readContext:yn,useCallback:a1,useContext:yn,useEffect:_g,useImperativeHandle:l1,useInsertionEffect:s1,useLayoutEffect:o1,useMemo:c1,useReducer:ff,useRef:r1,useState:function(){return ff($l)},useDebugValue:Og,useDeferredValue:function(e){var t=xn();return u1(t,it.memoizedState,e)},useTransition:function(){var e=ff($l)[0],t=xn().memoizedState;return[e,t]},useMutableSource:Xb,useSyncExternalStore:Gb,useId:d1,unstable_isNewReconciler:!1},nN={readContext:yn,useCallback:a1,useContext:yn,useEffect:_g,useImperativeHandle:l1,useInsertionEffect:s1,useLayoutEffect:o1,useMemo:c1,useReducer:hf,useRef:r1,useState:function(){return hf($l)},useDebugValue:Og,useDeferredValue:function(e){var t=xn();return it===null?t.memoizedState=e:u1(t,it.memoizedState,e)},useTransition:function(){var e=hf($l)[0],t=xn().memoizedState;return[e,t]},useMutableSource:Xb,useSyncExternalStore:Gb,useId:d1,unstable_isNewReconciler:!1};function kn(e,t){if(e&&e.defaultProps){t=Qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Uh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ju={isMounted:function(e){return(e=e._reactInternals)?go(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ot(),s=ds(e),o=yr(r,s);o.payload=t,n!=null&&(o.callback=n),t=cs(e,o,s),t!==null&&(On(t,e,s,r),Pc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ot(),s=ds(e),o=yr(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=cs(e,o,s),t!==null&&(On(t,e,s,r),Pc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ot(),r=ds(e),s=yr(n,r);s.tag=2,t!=null&&(s.callback=t),t=cs(e,s,r),t!==null&&(On(t,e,r,n),Pc(t,e,r))}};function hy(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!Ol(n,r)||!Ol(s,o):!0}function g1(e,t,n){var r=!1,s=ms,o=t.contextType;return typeof o=="object"&&o!==null?o=yn(o):(s=Ut(t)?eo:Rt.current,r=t.contextTypes,o=(r=r!=null)?gi(e,s):ms),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ju,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function py(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&&Ju.enqueueReplaceState(t,t.state,null)}function Kh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Cg(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=yn(o):(o=Ut(t)?eo:Rt.current,s.context=gi(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Uh(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ju.enqueueReplaceState(s,s.state,null),lu(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function vi(e,t){try{var n="",r=t;do n+=IP(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
39
|
+
Error generating stack: `+o.message+`
|
|
40
|
+
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function pf(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Yh(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var rN=typeof WeakMap=="function"?WeakMap:Map;function m1(e,t,n){n=yr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fu||(fu=!0,rp=r),Yh(e,t)},n}function y1(e,t,n){n=yr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Yh(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Yh(e,t),typeof r!="function"&&(us===null?us=new Set([this]):us.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function gy(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rN;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=yN.bind(null,e,t,n),t.then(e,e))}function my(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 yy(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=yr(-1,1),t.tag=2,cs(n,t,1))),n.lanes|=1),e)}var sN=Tr.ReactCurrentOwner,Bt=!1;function Mt(e,t,n,r){t.child=e===null?Kb(t,null,n,r):yi(t,e.child,n,r)}function xy(e,t,n,r,s){n=n.render;var o=t.ref;return Ko(t,s),r=Ig(e,t,n,r,o,s),n=Mg(),e!==null&&!Bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Cr(e,t,s)):(Ke&&n&&xg(t),t.flags|=1,Mt(e,t,r,s),t.child)}function vy(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Hg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,x1(e,t,o,r,s)):(e=Oc(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ol,n(i,r)&&e.ref===t.ref)return Cr(e,t,s)}return t.flags|=1,e=fs(o,r),e.ref=t.ref,e.return=t,t.child=e}function x1(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(Ol(o,r)&&e.ref===t.ref)if(Bt=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Bt=!0);else return t.lanes=e.lanes,Cr(e,t,s)}return qh(e,t,n,r,s)}function v1(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},He($o,Qt),Qt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,He($o,Qt),Qt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,He($o,Qt),Qt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,He($o,Qt),Qt|=r;return Mt(e,t,s,n),t.child}function w1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qh(e,t,n,r,s){var o=Ut(n)?eo:Rt.current;return o=gi(t,o),Ko(t,s),n=Ig(e,t,n,r,o,s),r=Mg(),e!==null&&!Bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Cr(e,t,s)):(Ke&&r&&xg(t),t.flags|=1,Mt(e,t,n,s),t.child)}function wy(e,t,n,r,s){if(Ut(n)){var o=!0;nu(t)}else o=!1;if(Ko(t,s),t.stateNode===null)Ic(e,t),g1(t,n,r),Kh(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var a=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=yn(c):(c=Ut(n)?eo:Rt.current,c=gi(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&py(t,i,r,c),$r=!1;var d=t.memoizedState;i.state=d,lu(t,r,i,s),a=t.memoizedState,l!==r||d!==a||Wt.current||$r?(typeof u=="function"&&(Uh(t,n,u,r),a=t.memoizedState),(l=$r||hy(t,n,l,r,d,a,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),i.props=r,i.state=a,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,qb(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:kn(t.type,l),i.props=c,f=t.pendingProps,d=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=yn(a):(a=Ut(n)?eo:Rt.current,a=gi(t,a));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||d!==a)&&py(t,i,r,a),$r=!1,d=t.memoizedState,i.state=d,lu(t,r,i,s);var m=t.memoizedState;l!==f||d!==m||Wt.current||$r?(typeof p=="function"&&(Uh(t,n,p,r),m=t.memoizedState),(c=$r||hy(t,n,c,r,d,m,a)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,m,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,m,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),i.props=r,i.state=m,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Qh(e,t,n,r,o,s)}function Qh(e,t,n,r,s,o){w1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&oy(t,n,!1),Cr(e,t,o);r=t.stateNode,sN.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=yi(t,e.child,null,o),t.child=yi(t,null,l,o)):Mt(e,t,l,o),t.memoizedState=r.state,s&&oy(t,n,!0),t.child}function b1(e){var t=e.stateNode;t.pendingContext?sy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sy(e,t.context,!1),Rg(e,t.containerInfo)}function by(e,t,n,r,s){return mi(),wg(s),t.flags|=256,Mt(e,t,n,r),t.child}var Xh={dehydrated:null,treeContext:null,retryLane:0};function Gh(e){return{baseLanes:e,cachePool:null,transitions:null}}function S1(e,t,n){var r=t.pendingProps,s=Ye.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),He(Ye,s&1),e===null)return Vh(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):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=nd(i,r,0,null),e=Xs(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Gh(n),t.memoizedState=Xh,e):Ag(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return oN(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=fs(s,a),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=fs(l,o):(o=Xs(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?Gh(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=Xh,r}return o=e.child,e=o.sibling,r=fs(o,{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 Ag(e,t){return t=nd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Za(e,t,n,r){return r!==null&&wg(r),yi(t,e.child,null,n),e=Ag(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oN(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=pf(Error(ne(422))),Za(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=nd({mode:"visible",children:r.children},s,0,null),o=Xs(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&yi(t,e.child,null,i),t.child.memoizedState=Gh(i),t.memoizedState=Xh,o);if(!(t.mode&1))return Za(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(ne(419)),r=pf(o,r,void 0),Za(e,t,i,r)}if(l=(i&e.childLanes)!==0,Bt||l){if(r=dt,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,kr(e,s),On(r,e,s,-1))}return $g(),r=pf(Error(ne(421))),Za(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=xN.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Jt=as(s.nextSibling),en=t,Ke=!0,Tn=null,e!==null&&(dn[fn++]=pr,dn[fn++]=gr,dn[fn++]=to,pr=e.id,gr=e.overflow,to=t),t=Ag(t,r.children),t.flags|=4096,t)}function Sy(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wh(e.return,t,n)}function gf(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function E1(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Mt(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&&Sy(e,n,t);else if(e.tag===19)Sy(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(He(Ye,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&au(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),gf(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&au(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}gf(t,!0,n,null,o);break;case"together":gf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ic(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Cr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ro|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,n=fs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function iN(e,t,n){switch(t.tag){case 3:b1(t),mi();break;case 5:Qb(t);break;case 1:Ut(t.type)&&nu(t);break;case 4:Rg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;He(ou,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(He(Ye,Ye.current&1),t.flags|=128,null):n&t.child.childLanes?S1(e,t,n):(He(Ye,Ye.current&1),e=Cr(e,t,n),e!==null?e.sibling:null);He(Ye,Ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return E1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),He(Ye,Ye.current),r)break;return null;case 22:case 23:return t.lanes=0,v1(e,t,n)}return Cr(e,t,n)}var k1,Zh,C1,R1;k1=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}};Zh=function(){};C1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ds(Jn.current);var o=null;switch(n){case"input":s=wh(e,s),r=wh(e,r),o=[];break;case"select":s=Qe({},s,{value:void 0}),r=Qe({},r,{value:void 0}),o=[];break;case"textarea":s=Eh(e,s),r=Eh(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=eu)}Ch(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Rl.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var a=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||a&&a.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in a)a.hasOwnProperty(i)&&l[i]!==a[i]&&(n||(n={}),n[i]=a[i])}else n||(o||(o=[]),o.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Rl.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&Be("scroll",e),o||l===a||(o=[])):(o=o||[]).push(c,a))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};R1=function(e,t,n,r){n!==r&&(t.flags|=4)};function Xi(e,t){if(!Ke)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 bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function lN(e,t,n){var r=t.pendingProps;switch(vg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return Ut(t.type)&&tu(),bt(t),null;case 3:return r=t.stateNode,xi(),Ve(Wt),Ve(Rt),Tg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Xa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tn!==null&&(ip(Tn),Tn=null))),Zh(e,t),bt(t),null;case 5:Pg(t);var s=Ds(Fl.current);if(n=t.type,e!==null&&t.stateNode!=null)C1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ne(166));return bt(t),null}if(e=Ds(Jn.current),Xa(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Xn]=t,r[zl]=o,e=(t.mode&1)!==0,n){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(s=0;s<al.length;s++)Be(al[s],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":M0(r,o),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Be("invalid",r);break;case"textarea":O0(r,o),Be("invalid",r)}Ch(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Qa(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Qa(r.textContent,l,e),s=["children",""+l]):Rl.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&Be("scroll",r)}switch(n){case"input":Ha(r),_0(r,o,!0);break;case"textarea":Ha(r),A0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=eu)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=eb(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Xn]=t,e[zl]=r,k1(e,t,!1,!1),t.stateNode=e;e:{switch(i=Rh(n,r),n){case"dialog":Be("cancel",e),Be("close",e),s=r;break;case"iframe":case"object":case"embed":Be("load",e),s=r;break;case"video":case"audio":for(s=0;s<al.length;s++)Be(al[s],e);s=r;break;case"source":Be("error",e),s=r;break;case"img":case"image":case"link":Be("error",e),Be("load",e),s=r;break;case"details":Be("toggle",e),s=r;break;case"input":M0(e,r),s=wh(e,r),Be("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Qe({},r,{value:void 0}),Be("invalid",e);break;case"textarea":O0(e,r),s=Eh(e,r),Be("invalid",e);break;default:s=r}Ch(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?rb(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&tb(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Pl(e,a):typeof a=="number"&&Pl(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Rl.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Be("scroll",e):a!=null&&sg(e,o,a,i))}switch(n){case"input":Ha(e),_0(e,r,!1);break;case"textarea":Ha(e),A0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gs(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Bo(e,!!r.multiple,o,!1):r.defaultValue!=null&&Bo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=eu)}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 bt(t),null;case 6:if(e&&t.stateNode!=null)R1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ne(166));if(n=Ds(Fl.current),Ds(Jn.current),Xa(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xn]=t,(o=r.nodeValue!==n)&&(e=en,e!==null))switch(e.tag){case 3:Qa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Qa(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xn]=t,t.stateNode=r}return bt(t),null;case 13:if(Ve(Ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ke&&Jt!==null&&t.mode&1&&!(t.flags&128))Wb(),mi(),t.flags|=98560,o=!1;else if(o=Xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ne(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ne(317));o[Xn]=t}else mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bt(t),o=!1}else Tn!==null&&(ip(Tn),Tn=null),o=!0;if(!o)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?lt===0&&(lt=3):$g())),t.updateQueue!==null&&(t.flags|=4),bt(t),null);case 4:return xi(),Zh(e,t),e===null&&Al(t.stateNode.containerInfo),bt(t),null;case 10:return Eg(t.type._context),bt(t),null;case 17:return Ut(t.type)&&tu(),bt(t),null;case 19:if(Ve(Ye),o=t.memoizedState,o===null)return bt(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Xi(o,!1);else{if(lt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=au(e),i!==null){for(t.flags|=128,Xi(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return He(Ye,Ye.current&1|2),t.child}e=e.sibling}o.tail!==null&&nt()>wi&&(t.flags|=128,r=!0,Xi(o,!1),t.lanes=4194304)}else{if(!r)if(e=au(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Ke)return bt(t),null}else 2*nt()-o.renderingStartTime>wi&&n!==1073741824&&(t.flags|=128,r=!0,Xi(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=nt(),t.sibling=null,n=Ye.current,He(Ye,r?n&1|2:n&1),t):(bt(t),null);case 22:case 23:return Lg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qt&1073741824&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function aN(e,t){switch(vg(t),t.tag){case 1:return Ut(t.type)&&tu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xi(),Ve(Wt),Ve(Rt),Tg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pg(t),null;case 13:if(Ve(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ye),null;case 4:return xi(),null;case 10:return Eg(t.type._context),null;case 22:case 23:return Lg(),null;case 24:return null;default:return null}}var Ja=!1,kt=!1,cN=typeof WeakSet=="function"?WeakSet:Set,de=null;function Lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ze(e,t,r)}else n.current=null}function Jh(e,t,n){try{n()}catch(r){Ze(e,t,r)}}var Ey=!1;function uN(e,t){if(zh=Gc,e=Mb(),yg(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 s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(l=i+s),f!==o||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++c===s&&(l=i),d===o&&++u===r&&(a=i),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dh={focusedElem:e,selectionRange:n},Gc=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,b=m.memoizedState,h=t.stateNode,y=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:kn(t.type,v),b);h.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(w){Ze(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return m=Ey,Ey=!1,m}function yl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Jh(t,n,o)}s=s.next}while(s!==r)}}function ed(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 ep(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 P1(e){var t=e.alternate;t!==null&&(e.alternate=null,P1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[zl],delete t[$h],delete t[KT],delete t[YT])),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 T1(e){return e.tag===5||e.tag===3||e.tag===4}function ky(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||T1(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 tp(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=eu));else if(r!==4&&(e=e.child,e!==null))for(tp(e,t,n),e=e.sibling;e!==null;)tp(e,t,n),e=e.sibling}function np(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(np(e,t,n),e=e.sibling;e!==null;)np(e,t,n),e=e.sibling}var pt=null,Rn=!1;function Or(e,t,n){for(n=n.child;n!==null;)N1(e,t,n),n=n.sibling}function N1(e,t,n){if(Zn&&typeof Zn.onCommitFiberUnmount=="function")try{Zn.onCommitFiberUnmount(Ku,n)}catch{}switch(n.tag){case 5:kt||Lo(n,t);case 6:var r=pt,s=Rn;pt=null,Or(e,t,n),pt=r,Rn=s,pt!==null&&(Rn?(e=pt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pt.removeChild(n.stateNode));break;case 18:pt!==null&&(Rn?(e=pt,n=n.stateNode,e.nodeType===8?af(e.parentNode,n):e.nodeType===1&&af(e,n),Ml(e)):af(pt,n.stateNode));break;case 4:r=pt,s=Rn,pt=n.stateNode.containerInfo,Rn=!0,Or(e,t,n),pt=r,Rn=s;break;case 0:case 11:case 14:case 15:if(!kt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Jh(n,t,i),s=s.next}while(s!==r)}Or(e,t,n);break;case 1:if(!kt&&(Lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ze(n,t,l)}Or(e,t,n);break;case 21:Or(e,t,n);break;case 22:n.mode&1?(kt=(r=kt)||n.memoizedState!==null,Or(e,t,n),kt=r):Or(e,t,n);break;default:Or(e,t,n)}}function Cy(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cN),t.forEach(function(r){var s=vN.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function En(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:pt=l.stateNode,Rn=!1;break e;case 3:pt=l.stateNode.containerInfo,Rn=!0;break e;case 4:pt=l.stateNode.containerInfo,Rn=!0;break e}l=l.return}if(pt===null)throw Error(ne(160));N1(o,i,s),pt=null,Rn=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(c){Ze(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)I1(t,e),t=t.sibling}function I1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(En(t,e),Hn(e),r&4){try{yl(3,e,e.return),ed(3,e)}catch(v){Ze(e,e.return,v)}try{yl(5,e,e.return)}catch(v){Ze(e,e.return,v)}}break;case 1:En(t,e),Hn(e),r&512&&n!==null&&Lo(n,n.return);break;case 5:if(En(t,e),Hn(e),r&512&&n!==null&&Lo(n,n.return),e.flags&32){var s=e.stateNode;try{Pl(s,"")}catch(v){Ze(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Zw(s,o),Rh(l,i);var c=Rh(l,o);for(i=0;i<a.length;i+=2){var u=a[i],f=a[i+1];u==="style"?rb(s,f):u==="dangerouslySetInnerHTML"?tb(s,f):u==="children"?Pl(s,f):sg(s,u,f,c)}switch(l){case"input":bh(s,o);break;case"textarea":Jw(s,o);break;case"select":var d=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var p=o.value;p!=null?Bo(s,!!o.multiple,p,!1):d!==!!o.multiple&&(o.defaultValue!=null?Bo(s,!!o.multiple,o.defaultValue,!0):Bo(s,!!o.multiple,o.multiple?[]:"",!1))}s[zl]=o}catch(v){Ze(e,e.return,v)}}break;case 6:if(En(t,e),Hn(e),r&4){if(e.stateNode===null)throw Error(ne(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(v){Ze(e,e.return,v)}}break;case 3:if(En(t,e),Hn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ml(t.containerInfo)}catch(v){Ze(e,e.return,v)}break;case 4:En(t,e),Hn(e);break;case 13:En(t,e),Hn(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Dg=nt())),r&4&&Cy(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(kt=(c=kt)||u,En(t,e),kt=c):En(t,e),Hn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(de=e,u=e.child;u!==null;){for(f=de=u;de!==null;){switch(d=de,p=d.child,d.tag){case 0:case 11:case 14:case 15:yl(4,d,d.return);break;case 1:Lo(d,d.return);var m=d.stateNode;if(typeof m.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){Ze(r,n,v)}}break;case 5:Lo(d,d.return);break;case 22:if(d.memoizedState!==null){Py(f);continue}}p!==null?(p.return=d,de=p):Py(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=f.stateNode,a=f.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=nb("display",i))}catch(v){Ze(e,e.return,v)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){Ze(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:En(t,e),Hn(e),r&4&&Cy(e);break;case 21:break;default:En(t,e),Hn(e)}}function Hn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(T1(n)){var r=n;break e}n=n.return}throw Error(ne(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Pl(s,""),r.flags&=-33);var o=ky(e);np(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=ky(e);tp(e,l,i);break;default:throw Error(ne(161))}}catch(a){Ze(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dN(e,t,n){de=e,M1(e)}function M1(e,t,n){for(var r=(e.mode&1)!==0;de!==null;){var s=de,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||Ja;if(!i){var l=s.alternate,a=l!==null&&l.memoizedState!==null||kt;l=Ja;var c=kt;if(Ja=i,(kt=a)&&!c)for(de=s;de!==null;)i=de,a=i.child,i.tag===22&&i.memoizedState!==null?Ty(s):a!==null?(a.return=i,de=a):Ty(s);for(;o!==null;)de=o,M1(o),o=o.sibling;de=s,Ja=l,kt=c}Ry(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,de=o):Ry(e)}}function Ry(e){for(;de!==null;){var t=de;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:kt||ed(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!kt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:kn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&uy(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}uy(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Ml(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}kt||t.flags&512&&ep(t)}catch(d){Ze(t,t.return,d)}}if(t===e){de=null;break}if(n=t.sibling,n!==null){n.return=t.return,de=n;break}de=t.return}}function Py(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var n=t.sibling;if(n!==null){n.return=t.return,de=n;break}de=t.return}}function Ty(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ed(4,t)}catch(a){Ze(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(a){Ze(t,s,a)}}var o=t.return;try{ep(t)}catch(a){Ze(t,o,a)}break;case 5:var i=t.return;try{ep(t)}catch(a){Ze(t,i,a)}}}catch(a){Ze(t,t.return,a)}if(t===e){de=null;break}var l=t.sibling;if(l!==null){l.return=t.return,de=l;break}de=t.return}}var fN=Math.ceil,du=Tr.ReactCurrentDispatcher,jg=Tr.ReactCurrentOwner,gn=Tr.ReactCurrentBatchConfig,Te=0,dt=null,rt=null,yt=0,Qt=0,$o=ks(0),lt=0,Bl=null,ro=0,td=0,zg=0,xl=null,Ht=null,Dg=0,wi=1/0,ar=null,fu=!1,rp=null,us=null,ec=!1,ns=null,hu=0,vl=0,sp=null,Mc=-1,_c=0;function Ot(){return Te&6?nt():Mc!==-1?Mc:Mc=nt()}function ds(e){return e.mode&1?Te&2&&yt!==0?yt&-yt:QT.transition!==null?(_c===0&&(_c=gb()),_c):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Sb(e.type)),e):1}function On(e,t,n,r){if(50<vl)throw vl=0,sp=null,Error(ne(185));fa(e,n,r),(!(Te&2)||e!==dt)&&(e===dt&&(!(Te&2)&&(td|=n),lt===4&&Vr(e,yt)),Kt(e,r),n===1&&Te===0&&!(t.mode&1)&&(wi=nt()+500,Gu&&Cs()))}function Kt(e,t){var n=e.callbackNode;QP(e,t);var r=Xc(e,e===dt?yt:0);if(r===0)n!==null&&D0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&D0(n),t===1)e.tag===0?qT(Ny.bind(null,e)):Hb(Ny.bind(null,e)),WT(function(){!(Te&6)&&Cs()}),n=null;else{switch(mb(r)){case 1:n=cg;break;case 4:n=hb;break;case 16:n=Qc;break;case 536870912:n=pb;break;default:n=Qc}n=L1(n,_1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _1(e,t){if(Mc=-1,_c=0,Te&6)throw Error(ne(327));var n=e.callbackNode;if(Yo()&&e.callbackNode!==n)return null;var r=Xc(e,e===dt?yt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=pu(e,r);else{t=r;var s=Te;Te|=2;var o=A1();(dt!==e||yt!==t)&&(ar=null,wi=nt()+500,Qs(e,t));do try{gN();break}catch(l){O1(e,l)}while(!0);Sg(),du.current=o,Te=s,rt!==null?t=0:(dt=null,yt=0,t=lt)}if(t!==0){if(t===2&&(s=Mh(e),s!==0&&(r=s,t=op(e,s))),t===1)throw n=Bl,Qs(e,0),Vr(e,r),Kt(e,nt()),n;if(t===6)Vr(e,r);else{if(s=e.current.alternate,!(r&30)&&!hN(s)&&(t=pu(e,r),t===2&&(o=Mh(e),o!==0&&(r=o,t=op(e,o))),t===1))throw n=Bl,Qs(e,0),Vr(e,r),Kt(e,nt()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(ne(345));case 2:_s(e,Ht,ar);break;case 3:if(Vr(e,r),(r&130023424)===r&&(t=Dg+500-nt(),10<t)){if(Xc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Ot(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Lh(_s.bind(null,e,Ht,ar),t);break}_s(e,Ht,ar);break;case 4:if(Vr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-_n(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fN(r/1960))-r,10<r){e.timeoutHandle=Lh(_s.bind(null,e,Ht,ar),r);break}_s(e,Ht,ar);break;case 5:_s(e,Ht,ar);break;default:throw Error(ne(329))}}}return Kt(e,nt()),e.callbackNode===n?_1.bind(null,e):null}function op(e,t){var n=xl;return e.current.memoizedState.isDehydrated&&(Qs(e,t).flags|=256),e=pu(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&ip(t)),e}function ip(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function hN(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 s=n[r],o=s.getSnapshot;s=s.value;try{if(!An(o(),s))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 Vr(e,t){for(t&=~zg,t&=~td,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_n(t),r=1<<n;e[n]=-1,t&=~r}}function Ny(e){if(Te&6)throw Error(ne(327));Yo();var t=Xc(e,0);if(!(t&1))return Kt(e,nt()),null;var n=pu(e,t);if(e.tag!==0&&n===2){var r=Mh(e);r!==0&&(t=r,n=op(e,r))}if(n===1)throw n=Bl,Qs(e,0),Vr(e,t),Kt(e,nt()),n;if(n===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_s(e,Ht,ar),Kt(e,nt()),null}function Fg(e,t){var n=Te;Te|=1;try{return e(t)}finally{Te=n,Te===0&&(wi=nt()+500,Gu&&Cs())}}function so(e){ns!==null&&ns.tag===0&&!(Te&6)&&Yo();var t=Te;Te|=1;var n=gn.transition,r=ze;try{if(gn.transition=null,ze=1,e)return e()}finally{ze=r,gn.transition=n,Te=t,!(Te&6)&&Cs()}}function Lg(){Qt=$o.current,Ve($o)}function Qs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,VT(n)),rt!==null)for(n=rt.return;n!==null;){var r=n;switch(vg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&tu();break;case 3:xi(),Ve(Wt),Ve(Rt),Tg();break;case 5:Pg(r);break;case 4:xi();break;case 13:Ve(Ye);break;case 19:Ve(Ye);break;case 10:Eg(r.type._context);break;case 22:case 23:Lg()}n=n.return}if(dt=e,rt=e=fs(e.current,null),yt=Qt=t,lt=0,Bl=null,zg=td=ro=0,Ht=xl=null,zs!==null){for(t=0;t<zs.length;t++)if(n=zs[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}zs=null}return e}function O1(e,t){do{var n=rt;try{if(Sg(),Tc.current=uu,cu){for(var r=qe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}cu=!1}if(no=0,ut=it=qe=null,ml=!1,Ll=0,jg.current=null,n===null||n.return===null){lt=1,Bl=t,rt=null;break}e:{var o=e,i=n.return,l=n,a=t;if(t=yt,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=my(i);if(p!==null){p.flags&=-257,yy(p,i,l,o,t),p.mode&1&&gy(o,c,t),t=p,a=c;var m=t.updateQueue;if(m===null){var v=new Set;v.add(a),t.updateQueue=v}else m.add(a);break e}else{if(!(t&1)){gy(o,c,t),$g();break e}a=Error(ne(426))}}else if(Ke&&l.mode&1){var b=my(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),yy(b,i,l,o,t),wg(vi(a,l));break e}}o=a=vi(a,l),lt!==4&&(lt=2),xl===null?xl=[o]:xl.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var h=m1(o,a,t);cy(o,h);break e;case 1:l=a;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(us===null||!us.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=y1(o,l,t);cy(o,w);break e}}o=o.return}while(o!==null)}z1(n)}catch(E){t=E,rt===n&&n!==null&&(rt=n=n.return);continue}break}while(!0)}function A1(){var e=du.current;return du.current=uu,e===null?uu:e}function $g(){(lt===0||lt===3||lt===2)&&(lt=4),dt===null||!(ro&268435455)&&!(td&268435455)||Vr(dt,yt)}function pu(e,t){var n=Te;Te|=2;var r=A1();(dt!==e||yt!==t)&&(ar=null,Qs(e,t));do try{pN();break}catch(s){O1(e,s)}while(!0);if(Sg(),Te=n,du.current=r,rt!==null)throw Error(ne(261));return dt=null,yt=0,lt}function pN(){for(;rt!==null;)j1(rt)}function gN(){for(;rt!==null&&!$P();)j1(rt)}function j1(e){var t=F1(e.alternate,e,Qt);e.memoizedProps=e.pendingProps,t===null?z1(e):rt=t,jg.current=null}function z1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=aN(n,t),n!==null){n.flags&=32767,rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{lt=6,rt=null;return}}else if(n=lN(n,t,Qt),n!==null){rt=n;return}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);lt===0&&(lt=5)}function _s(e,t,n){var r=ze,s=gn.transition;try{gn.transition=null,ze=1,mN(e,t,n,r)}finally{gn.transition=s,ze=r}return null}function mN(e,t,n,r){do Yo();while(ns!==null);if(Te&6)throw Error(ne(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ne(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(XP(e,o),e===dt&&(rt=dt=null,yt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ec||(ec=!0,L1(Qc,function(){return Yo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=gn.transition,gn.transition=null;var i=ze;ze=1;var l=Te;Te|=4,jg.current=null,uN(e,n),I1(n,e),zT(Dh),Gc=!!zh,Dh=zh=null,e.current=n,dN(n),HP(),Te=l,ze=i,gn.transition=o}else e.current=n;if(ec&&(ec=!1,ns=e,hu=s),o=e.pendingLanes,o===0&&(us=null),WP(n.stateNode),Kt(e,nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(fu)throw fu=!1,e=rp,rp=null,e;return hu&1&&e.tag!==0&&Yo(),o=e.pendingLanes,o&1?e===sp?vl++:(vl=0,sp=e):vl=0,Cs(),null}function Yo(){if(ns!==null){var e=mb(hu),t=gn.transition,n=ze;try{if(gn.transition=null,ze=16>e?16:e,ns===null)var r=!1;else{if(e=ns,ns=null,hu=0,Te&6)throw Error(ne(331));var s=Te;for(Te|=4,de=e.current;de!==null;){var o=de,i=o.child;if(de.flags&16){var l=o.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(de=c;de!==null;){var u=de;switch(u.tag){case 0:case 11:case 15:yl(8,u,o)}var f=u.child;if(f!==null)f.return=u,de=f;else for(;de!==null;){u=de;var d=u.sibling,p=u.return;if(P1(u),u===c){de=null;break}if(d!==null){d.return=p,de=d;break}de=p}}}var m=o.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}de=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,de=i;else e:for(;de!==null;){if(o=de,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yl(9,o,o.return)}var h=o.sibling;if(h!==null){h.return=o.return,de=h;break e}de=o.return}}var y=e.current;for(de=y;de!==null;){i=de;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,de=g;else e:for(i=y;de!==null;){if(l=de,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ed(9,l)}}catch(E){Ze(l,l.return,E)}if(l===i){de=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,de=w;break e}de=l.return}}if(Te=s,Cs(),Zn&&typeof Zn.onPostCommitFiberRoot=="function")try{Zn.onPostCommitFiberRoot(Ku,e)}catch{}r=!0}return r}finally{ze=n,gn.transition=t}}return!1}function Iy(e,t,n){t=vi(n,t),t=m1(e,t,1),e=cs(e,t,1),t=Ot(),e!==null&&(fa(e,1,t),Kt(e,t))}function Ze(e,t,n){if(e.tag===3)Iy(e,e,n);else for(;t!==null;){if(t.tag===3){Iy(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(us===null||!us.has(r))){e=vi(n,e),e=y1(t,e,1),t=cs(t,e,1),e=Ot(),t!==null&&(fa(t,1,e),Kt(t,e));break}}t=t.return}}function yN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ot(),e.pingedLanes|=e.suspendedLanes&n,dt===e&&(yt&n)===n&&(lt===4||lt===3&&(yt&130023424)===yt&&500>nt()-Dg?Qs(e,0):zg|=n),Kt(e,t)}function D1(e,t){t===0&&(e.mode&1?(t=Wa,Wa<<=1,!(Wa&130023424)&&(Wa=4194304)):t=1);var n=Ot();e=kr(e,t),e!==null&&(fa(e,t,n),Kt(e,n))}function xN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),D1(e,n)}function vN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(t),D1(e,n)}var F1;F1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wt.current)Bt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Bt=!1,iN(e,t,n);Bt=!!(e.flags&131072)}else Bt=!1,Ke&&t.flags&1048576&&Bb(t,su,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ic(e,t),e=t.pendingProps;var s=gi(t,Rt.current);Ko(t,n),s=Ig(null,t,r,e,s,n);var o=Mg();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ut(r)?(o=!0,nu(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Cg(t),s.updater=Ju,t.stateNode=s,s._reactInternals=t,Kh(t,r,e,n),t=Qh(null,t,r,!0,o,n)):(t.tag=0,Ke&&o&&xg(t),Mt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ic(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=bN(r),e=kn(r,e),s){case 0:t=qh(null,t,r,e,n);break e;case 1:t=wy(null,t,r,e,n);break e;case 11:t=xy(null,t,r,e,n);break e;case 14:t=vy(null,t,r,kn(r.type,e),n);break e}throw Error(ne(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:kn(r,s),qh(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:kn(r,s),wy(e,t,r,s,n);case 3:e:{if(b1(t),e===null)throw Error(ne(387));r=t.pendingProps,o=t.memoizedState,s=o.element,qb(e,t),lu(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=vi(Error(ne(423)),t),t=by(e,t,r,n,s);break e}else if(r!==s){s=vi(Error(ne(424)),t),t=by(e,t,r,n,s);break e}else for(Jt=as(t.stateNode.containerInfo.firstChild),en=t,Ke=!0,Tn=null,n=Kb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mi(),r===s){t=Cr(e,t,n);break e}Mt(e,t,r,n)}t=t.child}return t;case 5:return Qb(t),e===null&&Vh(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,Fh(r,s)?i=null:o!==null&&Fh(r,o)&&(t.flags|=32),w1(e,t),Mt(e,t,i,n),t.child;case 6:return e===null&&Vh(t),null;case 13:return S1(e,t,n);case 4:return Rg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yi(t,null,r,n):Mt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:kn(r,s),xy(e,t,r,s,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,He(ou,r._currentValue),r._currentValue=i,o!==null)if(An(o.value,i)){if(o.children===s.children&&!Wt.current){t=Cr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=yr(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Wh(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(ne(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Wh(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Mt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Ko(t,n),s=yn(s),r=r(s),t.flags|=1,Mt(e,t,r,n),t.child;case 14:return r=t.type,s=kn(r,t.pendingProps),s=kn(r.type,s),vy(e,t,r,s,n);case 15:return x1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:kn(r,s),Ic(e,t),t.tag=1,Ut(r)?(e=!0,nu(t)):e=!1,Ko(t,n),g1(t,r,s),Kh(t,r,s,n),Qh(null,t,r,!0,e,n);case 19:return E1(e,t,n);case 22:return v1(e,t,n)}throw Error(ne(156,t.tag))};function L1(e,t){return fb(e,t)}function wN(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 hn(e,t,n,r){return new wN(e,t,n,r)}function Hg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bN(e){if(typeof e=="function")return Hg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ig)return 11;if(e===lg)return 14}return 2}function fs(e,t){var n=e.alternate;return n===null?(n=hn(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 Oc(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Hg(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Io:return Xs(n.children,s,o,t);case og:i=8,s|=8;break;case mh:return e=hn(12,n,t,s|2),e.elementType=mh,e.lanes=o,e;case yh:return e=hn(13,n,t,s),e.elementType=yh,e.lanes=o,e;case xh:return e=hn(19,n,t,s),e.elementType=xh,e.lanes=o,e;case Qw:return nd(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yw:i=10;break e;case qw:i=9;break e;case ig:i=11;break e;case lg:i=14;break e;case Lr:i=16,r=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=hn(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function Xs(e,t,n,r){return e=hn(7,e,r,t),e.lanes=n,e}function nd(e,t,n,r){return e=hn(22,e,r,t),e.elementType=Qw,e.lanes=n,e.stateNode={isHidden:!1},e}function mf(e,t,n){return e=hn(6,e,null,t),e.lanes=n,e}function yf(e,t,n){return t=hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function SN(e,t,n,r,s){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=Xd(0),this.expirationTimes=Xd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Bg(e,t,n,r,s,o,i,l,a){return e=new SN(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=hn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cg(o),e}function EN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:No,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $1(e){if(!e)return ms;e=e._reactInternals;e:{if(go(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ut(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var n=e.type;if(Ut(n))return $b(e,n,t)}return t}function H1(e,t,n,r,s,o,i,l,a){return e=Bg(n,r,!0,e,s,o,i,l,a),e.context=$1(null),n=e.current,r=Ot(),s=ds(n),o=yr(r,s),o.callback=t??null,cs(n,o,s),e.current.lanes=s,fa(e,s,r),Kt(e,r),e}function rd(e,t,n,r){var s=t.current,o=Ot(),i=ds(s);return n=$1(n),t.context===null?t.context=n:t.pendingContext=n,t=yr(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=cs(s,t,i),e!==null&&(On(e,s,i,o),Pc(e,s,i)),i}function gu(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 My(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vg(e,t){My(e,t),(e=e.alternate)&&My(e,t)}function kN(){return null}var B1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wg(e){this._internalRoot=e}sd.prototype.render=Wg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));rd(e,t,null,null)};sd.prototype.unmount=Wg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;so(function(){rd(null,e,null,null)}),t[Er]=null}};function sd(e){this._internalRoot=e}sd.prototype.unstable_scheduleHydration=function(e){if(e){var t=vb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Br.length&&t!==0&&t<Br[n].priority;n++);Br.splice(n,0,e),n===0&&bb(e)}};function Ug(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function od(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _y(){}function CN(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=gu(i);o.call(c)}}var i=H1(t,r,e,0,null,!1,!1,"",_y);return e._reactRootContainer=i,e[Er]=i.current,Al(e.nodeType===8?e.parentNode:e),so(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=gu(a);l.call(c)}}var a=Bg(e,0,!1,null,null,!1,!1,"",_y);return e._reactRootContainer=a,e[Er]=a.current,Al(e.nodeType===8?e.parentNode:e),so(function(){rd(t,a,n,r)}),a}function id(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var a=gu(i);l.call(a)}}rd(t,i,e,s)}else i=CN(n,t,e,s,r);return gu(i)}yb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ll(t.pendingLanes);n!==0&&(ug(t,n|1),Kt(t,nt()),!(Te&6)&&(wi=nt()+500,Cs()))}break;case 13:so(function(){var r=kr(e,1);if(r!==null){var s=Ot();On(r,e,1,s)}}),Vg(e,1)}};dg=function(e){if(e.tag===13){var t=kr(e,134217728);if(t!==null){var n=Ot();On(t,e,134217728,n)}Vg(e,134217728)}};xb=function(e){if(e.tag===13){var t=ds(e),n=kr(e,t);if(n!==null){var r=Ot();On(n,e,t,r)}Vg(e,t)}};vb=function(){return ze};wb=function(e,t){var n=ze;try{return ze=e,t()}finally{ze=n}};Th=function(e,t,n){switch(t){case"input":if(bh(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 s=Xu(r);if(!s)throw Error(ne(90));Gw(r),bh(r,s)}}}break;case"textarea":Jw(e,n);break;case"select":t=n.value,t!=null&&Bo(e,!!n.multiple,t,!1)}};ib=Fg;lb=so;var RN={usingClientEntryPoint:!1,Events:[pa,Ao,Xu,sb,ob,Fg]},Gi={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PN={bundleType:Gi.bundleType,version:Gi.version,rendererPackageName:Gi.rendererPackageName,rendererConfig:Gi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ub(e),e===null?null:e.stateNode},findFiberByHostInstance:Gi.findFiberByHostInstance||kN,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 tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{Ku=tc.inject(PN),Zn=tc}catch{}}sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RN;sn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ug(t))throw Error(ne(200));return EN(e,t,null,n)};sn.createRoot=function(e,t){if(!Ug(e))throw Error(ne(299));var n=!1,r="",s=B1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Bg(e,1,!1,null,null,n,!1,r,s),e[Er]=t.current,Al(e.nodeType===8?e.parentNode:e),new Wg(t)};sn.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(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=ub(t),e=e===null?null:e.stateNode,e};sn.flushSync=function(e){return so(e)};sn.hydrate=function(e,t,n){if(!od(t))throw Error(ne(200));return id(null,e,t,!0,n)};sn.hydrateRoot=function(e,t,n){if(!Ug(e))throw Error(ne(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=B1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=H1(t,null,e,1,n??null,s,!1,o,i),e[Er]=t.current,Al(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new sd(t)};sn.render=function(e,t,n){if(!od(t))throw Error(ne(200));return id(null,e,t,!1,n)};sn.unmountComponentAtNode=function(e){if(!od(e))throw Error(ne(40));return e._reactRootContainer?(so(function(){id(null,null,e,!1,function(){e._reactRootContainer=null,e[Er]=null})}),!0):!1};sn.unstable_batchedUpdates=Fg;sn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!od(n))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return id(e,t,n,!1,r)};sn.version="18.3.1-next-f1338f8080-20240426";function V1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V1)}catch(e){console.error(e)}}V1(),Vw.exports=sn;var vn=Vw.exports,W1,Oy=vn;W1=Oy.createRoot,Oy.hydrateRoot;function TN(e,t,n){const r=new Array(e);return new Proxy(r,{get(s,o,i){if(typeof o=="string"){const l=o.charCodeAt(0);if(l>=48&&l<=57){const a=+o;if(Number.isInteger(a)&&a>=0&&a<e){let c=s[a];if(!c){const u=t[a*2];c=s[a]={index:a,key:n(a),start:u,size:t[a*2+1],end:u+t[a*2+1],lane:0}}return c}}if(o==="length")return e}return Reflect.get(s,o,i)}})}function Ro(e,t,n){let r=n.initialDeps??[],s,o=!0;function i(){const l=e();return(l.length!==r.length||l.some((c,u)=>r[u]!==c))&&(r=l,s=t(...l),n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(s),o=!1),s}return i.updateDeps=l=>{r=l},i}function Ay(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const NN=(e,t)=>Math.abs(e-t)<1.01,IN=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}};let Zi;const xf=()=>{if(Zi!==void 0)return Zi;if(typeof navigator>"u")return Zi=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Zi=!0;const e=navigator.maxTouchPoints;return Zi=navigator.platform==="MacIntel"&&e!==void 0&&e>0},jy=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},MN=e=>e,_N=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,s=new Array(r);for(let o=0;o<r;o++)s[o]=t+o;return s},ON=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:l,height:a}=i;t({width:Math.round(l),height:Math.round(a)})};if(s(jy(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const l=()=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(jy(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},mu={passive:!0},AN=typeof window>"u"?!0:"onscrollend"in window,jN=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e.options.useScrollendEvent&&AN;let i=0;const l=o?null:IN(s,()=>t(i,!1),e.options.isScrollingResetDelay),a=f=>()=>{i=n(r),l==null||l(),t(i,f)},c=a(!0),u=a(!1);return r.addEventListener("scroll",c,mu),o&&r.addEventListener("scrollend",u,mu),()=>{r.removeEventListener("scroll",c),o&&r.removeEventListener("scrollend",u)}},zN=(e,t)=>jN(e,t,n=>{const{horizontal:r,isRtl:s}=e.options;return r?n.scrollLeft*(s&&-1||1):n.scrollTop}),DN=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),s=n.options.getItemKey(r);return n.itemSizeCache.get(s)??n.options.estimateSize(r)}if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),s=n.options.getItemKey(r),o=n.itemSizeCache.get(s);if(o!==void 0)return o}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},FN=(e,{adjustments:t=0,behavior:n},r)=>{var s,o;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},LN=FN;class $N{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,s;return((s=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:s.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{const l=o.target,a=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);for(const[c,u]of this.elementsCache)if(u===l){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(a)&&this.resizeItem(a,this.options.measureElement(l,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{var r,s;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:MN,rangeExtractor:_N,onChange:()=>{},measureElement:DN,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const d in n){const p=n[d];p!==void 0&&(o[d]=p)}const i=this.options;let l=null,a=null,c=!1;if(i!==void 0&&i.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const d=i.count,p=o.count,m=this.getMeasurements(),v=d>0?((r=m[0])==null?void 0:r.key)??i.getItemKey(0):null,b=d>0?((s=m[d-1])==null?void 0:s.key)??i.getItemKey(d-1):null;if(p!==d||d>0&&p>0&&(o.getItemKey(0)!==v||o.getItemKey(p-1)!==b)){c=!0;const g=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??m[0]:null;g&&(l=[g.key,this.getScrollOffset()-g.start]);const w=o.followOnAppend===!0?"auto":o.followOnAppend||null;w&&p>d&&this.isAtEnd(i.scrollEndThreshold)&&(d===0||o.getItemKey(p-1)!==b)&&(a=w)}}this.options=o,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,f=0;if(l&&this.scrollOffset!==null){const[d,p]=l,m=this.getMeasurements(),{count:v,getItemKey:b}=this.options;let h=0;for(;h<v&&b(h)!==d;)h++;if(h<v){const y=m[h];if(y){const g=Math.max(0,y.start+p);g!==this.scrollOffset&&(f=g-this.scrollOffset,this.scrollOffset=g,u=!0)}}}(u||a)&&(this.pendingScrollAnchor=[u?l[0]:null,u?l[1]:0,a,f])},this.notify=n=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=Ro(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{if(i&&this._intendedScrollOffset===null&&o===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const l=this.getScrollOffset();this.scrollDirection=i?l===o?this.scrollDirection:l<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const o=this.scrollElement,i=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},l=()=>{this._iosTouching=!1,!(!xf()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",i,mu),o.addEventListener("touchend",l,mu),this.unsubs.push(()=>{o.removeEventListener("touchstart",i),o.removeEventListener("touchend",l),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[o,i,l,a]=s;o!==null&&!l&&(xf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?a!==0&&(this._iosDeferredAdjustment+=a):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),l&&this.scrollToEnd({behavior:l})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ro(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,s,o,i,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c}),{key:!1}),this.getMeasurements=Ro(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:l,laneAssignmentMode:a,gap:c},u)=>{const f=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const h of this.laneAssignments.keys())h>=n&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),l===1){const h=n*2;let y=this._flatMeasurements;if(!y||y.length<h){const E=new Float64Array(h);y&&d>0&&E.set(y.subarray(0,d*2)),y=E,this._flatMeasurements=y}let g;if(d===0)g=r+s;else{const E=d-1;g=y[E*2]+y[E*2+1]+c}for(let E=d;E<n;E++){const C=o(E),R=f.get(C),k=typeof R=="number"?R:this.options.estimateSize(E);y[E*2]=g,y[E*2+1]=k,g+=k+c}const w=TN(n,y,o);return this.measurementsCache=w,w}const p=this.measurementsCache.slice(0,d),m=new Array(l).fill(void 0),v=new Float64Array(l);let b=0;for(let h=0;h<d;h++){const y=p[h];y&&(m[y.lane]===void 0&&b++,m[y.lane]=h,v[y.lane]=y.end)}for(let h=d;h<n;h++){const y=o(h),g=this.laneAssignments.get(h);let w,E;const C=a==="estimate"||f.has(y);if(g!==void 0&&this.options.lanes>1){w=g;const I=m[w],j=I!==void 0?p[I]:void 0;E=j?j.end+c:r+s}else if(b===l){let I=0,j=v[0],L=m[0];for(let A=1;A<l;A++){const P=v[A];(P<j||P===j&&m[A]<L)&&(I=A,j=P,L=m[A])}w=I,E=j+c,C&&this.laneAssignments.set(h,w)}else w=h%this.options.lanes,E=r+s,C&&this.laneAssignments.set(h,w);const R=f.get(y),k=typeof R=="number"?R:this.options.estimateSize(h),N=E+k;p[h]={index:h,start:E,size:k,end:N,key:y,lane:w},m[w]===void 0&&b++,m[w]=h,v[w]=N}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ro(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,o)=>n.length===0||r===0?(this.range=null,null):(this.range=BN(n,r,s,o,o===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ro(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,o,i)=>o===null||i===null?[]:n({startIndex:o,endIndex:i,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(s!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,s-o),l=Math.min(this.options.count-1,s+o);return n>=i&&n<=l}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,l)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(l))});return}const r=this.indexFromElement(n),s=this.options.getItemKey(r),o=this.elementsCache.get(s);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(s,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var s,o;if(n<0||n>=this.options.count)return;let i,l,a;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)a=this.options.getItemKey(n),l=c[n*2],i=c[n*2+1];else{const d=this.measurementsCache[n];if(!d)return;a=d.key,l=d.start,i=d.size}const u=this.itemSizeCache.get(a)??i,f=r-u;if(f!==0){const d=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=d?this.getTotalSize():0,m=this.getScrollOffset()+this.scrollAdjustments,b=!this.itemSizeCache.has(a)?l<m:l+u<=m&&this.scrollDirection!=="backward",h=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:a,start:l,size:i,end:l+i,lane:0},f,this):b);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(a,r),this.itemSizeCacheVersion++;let y=!1;d?y=this.applyScrollAdjustment(this.getTotalSize()-p):h&&(y=this.applyScrollAdjustment(f)),this.notify(y)}},this.getVirtualItems=Ro(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let o=0,i=n.length;o<i;o++){const l=n[o],a=r[l];s.push(a)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const s=this._flatMeasurements,o=this.options.lanes===1&&s!=null,i=U1(0,r.length-1,o?l=>s[l*2]:l=>Ay(r[l]).start,n);return Ay(r[i])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+o?"end":"start"),r==="center"?n+=(s-o)/2:r==="end"&&(n-=o);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.getSize(),o=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=o+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const l=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0;const o=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:s,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:s="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[i,l]=o,a=this.now();this.scrollState={index:n,align:l,behavior:s,startedAt:a,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const s=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const o=r.length-1,i=this._flatMeasurements;i!=null?s=i[o*2]+i[o*2+1]:s=((n=r[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(l=>l===null);){const l=r[i];o[l.lane]===null&&(o[l.lane]=l.end),i--}s=Math.max(...o.filter(l=>l!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const s of r)s&&this.itemSizeCache.has(s.key)&&n.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:xf()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=r?r[0]:this.scrollState.lastTargetOffset,o=1,i=s!==this.scrollState.lastTargetOffset;if(!i&&NN(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,i){const l=this.getSize()||600,a=Math.abs(s-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&a>l;this.scrollState.lastTargetOffset=s,c||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const U1=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,o=n(s);if(o<r)e=s+1;else if(o>r)t=s-1;else return s}return e>0?e-1:0};function HN(e,t,n){let r=0;for(;r<=t;){const s=(r+t)/2|0,o=e[s*2];if(o<n)r=s+1;else if(o>n)t=s-1;else return s}return r>0?r-1:0}function BN(e,t,n,r,s){const o=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:o};if(r===1&&s!==null){const c=HN(s,o,n);let u=c;const f=n+t;for(;u<o&&s[u*2]+s[u*2+1]<f;)u++;return{startIndex:c,endIndex:u}}let l=U1(0,o,c=>e[c].start,n),a=l;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const c=Array(r).fill(0);for(;a<o&&c.some(f=>f<n+t);){const f=e[a];c[f.lane]=f.end,a++}const u=Array(r).fill(n+t);for(;l>=0&&u.some(f=>f>=n);){const f=e[l];u[f.lane]=f.start,l--}l=Math.max(0,l-l%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:l,endIndex:a}}const vf=typeof document<"u"?S.useLayoutEffect:S.useEffect;function VN({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const s=S.useReducer(u=>u+1,0)[1],o=S.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});o.current.enabled=t,o.current.mode=n;const i=u=>{const f=o.current;if(!f.enabled||!f.container)return;const d=u.getTotalSize();if(d!==f.lastSize){f.lastSize=d;const p=u.options.horizontal?"width":"height";f.container.style[p]=`${d}px`}},l=u=>{const f=o.current;if(!f.enabled||!f.container)return;i(u);const d=!!u.options.horizontal,p=f.mode==="transform",m=d?"left":"top",v=u.options.scrollMargin,b=u.getVirtualItems();for(const h of b){const y=h.start-v,g=u.elementsCache.get(h.key);g&&f.lastPositions.get(g)!==y&&(f.lastPositions.set(g,y),p?g.style.transform=d?`translate3d(${y}px, 0, 0)`:`translate3d(0, ${y}px, 0)`:g.style[m]=`${y}px`)}},a={...r,onChange:(u,f)=>{var d;const p=o.current;let m=!0;if(p.enabled){l(u);const v=u.range,b=p.prevRange;m=!b||b.isScrolling!==u.isScrolling||b.startIndex!==(v==null?void 0:v.startIndex)||b.endIndex!==(v==null?void 0:v.endIndex),m&&(p.prevRange=v?{startIndex:v.startIndex,endIndex:v.endIndex,isScrolling:u.isScrolling}:null)}m&&(e&&f?vn.flushSync(s):s()),(d=r.onChange)==null||d.call(r,u,f)}},[c]=S.useState(()=>{const u=new $N(a);return Object.assign(u,{containerRef:f=>{const d=o.current;if(d.container=f,d.lastSize=null,f&&d.enabled){const p=u.getTotalSize();d.lastSize=p;const m=u.options.horizontal?"width":"height";f.style[m]=`${p}px`}}})});return c.setOptions(a),vf(()=>c._didMount(),[]),vf(()=>(i(c),c._willUpdate())),vf(()=>{l(c)}),c}function WN(e){return VN({observeElementRect:ON,observeElementOffset:zN,scrollToFn:LN,...e})}function UN(e){if(typeof e=="object"&&e!==null&&"durationMs"in e){const t=e.durationMs;if(typeof t=="number")return t}}function Kg(e){const t=new Map,n=[];for(const s of e){const o=s.subId??s.name??s.process;if(o===void 0){n.push(s);continue}const i=t.get(o),l=i??{id:o,name:s.name??o,phases:[],logs:[]};i||t.set(o,l),s.name!==void 0&&(l.name=s.name),s.group!==void 0&&(l.group=s.group),s.status!==void 0?(l.terminal=s,l.status=s.status):s.phase!==void 0?l.phases.push(s):l.logs.push(s)}return{subs:[...t.values()].map(s=>{var u;const o=[...s.phases,...s.logs],i=[...o,...s.terminal?[s.terminal]:[]].map(f=>f.at),l=i.length?i.reduce((f,d)=>d<f?d:f,Number.POSITIVE_INFINITY):void 0,c=UN((u=s.terminal)==null?void 0:u.data)??(s.terminal&&l!==void 0&&o.length>0?s.terminal.at-l:void 0);return{...s,startedAt:l,durationMs:c}}),stepLogs:n}}const K1={kind:"all"},ld="unknown";function zi(e){const t=e==null?void 0:e.trim();return t||void 0}function KN(e){return zi(e)===void 0}function ma(e){const t=zi(e);if(t===void 0)return ld;const n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)||t}function YN(e,t){return e.kind!==t.kind?!1:e.kind==="origin"&&t.kind==="origin"?e.origin===t.origin:!0}function Y1(e){return e.kind==="origin"?`origin:${e.origin}`:e.kind}function qN(e,t){if(t.kind==="all")return!0;const n=zi(e.origin);return t.kind==="unknown"?n===void 0:n===t.origin}function QN(e,t){return t.kind==="all"?[...e]:e.filter(n=>qN(n,t))}const Yg="Runs with no recorded origin: started before origins were stamped, or registered through a path whose declaring package could not be resolved. Not attributed to any library.";function XN(e){const t=new Map;let n=0;for(const s of e){const o=zi(s.origin);if(o===void 0){n+=1;continue}t.set(o,(t.get(o)??0)+1)}const r=[{filter:K1,label:"all",title:"Every origin, including runs that have none",count:e.length}];for(const s of[...t.keys()].sort())r.push({filter:{kind:"origin",origin:s},label:ma(s),title:s,count:t.get(s)??0});return n>0&&r.push({filter:{kind:"unknown"},label:ld,title:Yg,count:n}),r}function GN(e){return e.reduce((t,n)=>t+(KN(n.origin)?1:0),0)}function ZN(e){return e.anyFilter?e.origin.kind==="unknown"?{message:e.unknownCount>0?"No unclassified runs match the other filters.":"Every run here has a recorded origin — none are unclassified."}:e.origin.kind==="origin"&&e.unknownCount>0?{message:`No runs from ${ma(e.origin.origin)} match these filters.`,unclassified:e.unknownCount}:{message:"No runs match these filters."}:{message:"No runs yet."}}const zy="compensate:";function JN(e){return e.startsWith(zy)?e.slice(zy.length):e}function eI(e){const t=[],n=[];for(const r of e)r.seq<0?n.push(r):t.push(r);return n.sort((r,s)=>s.seq-r.seq),{body:t,compensations:n}}function tI(e){let t=0,n=0,r=0;for(const s of e)s.status==="completed"?t++:s.status==="failed"?n++:r++;return{total:e.length,done:t,failed:n,pending:r}}const nI=10*60*1e3;function rI(e,t){if(e.kind!=="remote"||e.status!=="pending")return!1;const n=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return t-n>nI}const sI=new Set(["running","suspended","cancelling"]);function lp(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function wf(e,t){const n=lp(e),r=t.filter(i=>lp(i.group)===n),s=r.some(i=>i.depth>0),o=r.some(i=>i.liveWorkers.length>0);return s&&!o}function oI(e){return e.startsWith("wh:")?`webhook ${e}`:e.startsWith("child:")?`child ${e.slice(6)}`:`signal ${e}`}function iI(e,t){var s;const n=(s=e.tags)==null?void 0:s.find(o=>o.startsWith("singleton:"));return n?t.filter(o=>{var i;return sI.has(o.status)&&((i=o.tags)==null?void 0:i.includes(n))}).sort((o,i)=>o.createdAt.localeCompare(i.createdAt)||o.id.localeCompare(i.id))[0]:void 0}function lI(e){return`${e.on} ${e.name}`}function qg(e,t){var s;if(e.status!=="suspended")return e.status==="pending"&&wf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:e.status==="blocked"?{status:"no-worker",detail:e.workflow}:{status:e.status};const n=iI(e,t.runs);if(n&&n.id!==e.id)return{status:"queued",detail:`behind leader ${n.id.slice(0,8)}`};const r=(s=t.timeline)==null?void 0:s.find(o=>o.status==="pending"||o.status==="running");return r?r.kind==="signal"?{status:"awaiting",detail:oI(r.name)}:r.kind==="sleep"?{status:"sleeping"}:r.workerGroup&&wf(r.workerGroup,t.health)?{status:"no-worker",detail:lp(r.workerGroup)}:{status:"running"}:e.waiting?{status:"awaiting",detail:lI(e.waiting)}:wf(e.workflow,t.health)?{status:"no-worker",detail:e.workflow}:{status:"running"}}function aI(e,t){return e.status!=="suspended"?e.status:t!=null&&t.some(n=>n.status==="pending"||n.status==="running")?"running":e.wakeAt!=null?"sleeping":t?"awaiting":"running"}function q1(){return typeof window<"u"&&typeof window.__DURABLE_BASE__=="string"?window.__DURABLE_BASE__:"/durable"}function Q1(){return typeof window<"u"&&typeof window.__DURABLE_API__=="string"?window.__DURABLE_API__:`${q1()}/api`}async function cI(e){try{const t=await e.json();if(typeof t!="object"||t===null||!("auth"in t))return;const n=t.auth;if(typeof n!="object"||n===null||!("modes"in n))return;const r=n.modes;return Array.isArray(r)?r.filter(s=>typeof s=="string"):void 0}catch{return}}function uI(e){if(typeof window>"u")return;const t=q1();if(e!=null&&e.includes("login")){const n=encodeURIComponent(window.location.pathname+window.location.search);window.location.href=`${t}/login?returnTo=${n}`;return}window.location.href=t}async function Bn(e,t){const n=await fetch(Q1()+e,t);if(n.status===401)throw uI(await cI(n)),new Error("Session expired; redirecting to sign-in.");if(!n.ok)throw new Error(`${n.status} ${n.statusText}`);return await n.json()}const tt={async runs(e,t,n,r){const{runs:s}=await tt.runsPage(e,t,n,r);return s},async runsPage(e,t,n,r,s){const o=new URLSearchParams;e&&o.set("status",e),t&&o.set("tag",t);for(const a of n??[])o.append("attr",a);r!=null&&r.namespace&&o.set("namespace",r.namespace),r!=null&&r.origin&&o.set("origin",r.origin),(s==null?void 0:s.limit)!==void 0&&o.set("limit",String(s.limit)),(s==null?void 0:s.offset)!==void 0&&o.set("offset",String(s.offset));const i=o.toString(),l=await Bn(i?`/runs?${i}`:"/runs");return{runs:l.runs,page:l.page}},run(e){return Bn(`/runs/${encodeURIComponent(e)}`)},workers(){return Bn("/workers")},topology(){return Bn("/topology")},async retry(e){return(await Bn(`/runs/${encodeURIComponent(e)}/retry`,{method:"POST"})).result},async retryWithInput(e,t){return(await Bn(`/runs/${encodeURIComponent(e)}/retry-with-input`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:t})})).result},bulk(e,t){const n=new URLSearchParams;t.compensate&&n.set("compensate","true"),t.status&&n.set("status",t.status),t.tag&&n.set("tag",t.tag);for(const s of t.attr??[])n.append("attr",s);t.namespace&&n.set("namespace",t.namespace),t.origin&&n.set("origin",t.origin);const r=n.toString();return Bn(`/bulk/${e}${r?`?${r}`:""}`,{method:"POST"})},async cancel(e,t){const n=t!=null&&t.compensate?"?compensate=true":"";return(await Bn(`/runs/${encodeURIComponent(e)}/cancel${n}`,{method:"POST"})).result},async continue(e){return(await Bn(`/runs/${encodeURIComponent(e)}/continue`,{method:"POST"})).result},async redispatch(e){return(await Bn(`/runs/${encodeURIComponent(e)}/redispatch`,{method:"POST"})).result},streamRun(e,t){const n=new EventSource(`${Q1()}/runs/${encodeURIComponent(e)}/stream`);return n.onmessage=r=>{try{t(JSON.parse(r.data))}catch{}},()=>n.close()}};function yu(e){const t=e.lastIndexOf("@");return t===-1?"default":e.slice(t+1)}function ap(e){const t=e.lastIndexOf("@");return t===-1?e:e.slice(0,t)}function dI(e){const t=new Map;for(const r of e){const s=yu(r.group),o=t.get(s);o?o.push(r):t.set(s,[r])}return[...t.entries()].map(([r,s])=>{const o=new Set;let i=0,l=0;for(const a of s){i+=a.depth,a.depth>0&&a.liveWorkers.length===0&&(l+=1);for(const c of a.liveWorkers)o.add(c.instanceId)}return{partition:r,workerCount:o.size,handlerCount:s.length,totalDepth:i,starvedCount:l}}).sort((r,s)=>r.partition==="default"?-1:s.partition==="default"?1:r.partition.localeCompare(s.partition))}function fI(e,t){if(!e)return t;const n=new Map(e.timeline.map(r=>[r.seq,r]));return{...t,timeline:t.timeline.map(r=>{var o,i;if((r.status==="pending"||r.status==="running")&&(((o=r.events)==null?void 0:o.length)??0)===0){const l=(i=n.get(r.seq))==null?void 0:i.events;if(l!=null&&l.length)return{...r,events:l}}return r})}}function hI(e){var n,r;const t=new Map;for(const s of e)for(const o of s.liveWorkers){const i=ap(o.group),l=t.get(o.instanceId);if(l===void 0){t.set(o.instanceId,{instanceId:o.instanceId,partition:yu(o.group),runtime:(n=o.status)==null?void 0:n.runtime,handlers:new Set([i]),status:o.status,lastBeatAt:o.lastBeatAt});continue}l.handlers.add(i),o.lastBeatAt>=l.lastBeatAt&&(l.lastBeatAt=o.lastBeatAt,l.partition=yu(o.group),l.runtime=(r=o.status)==null?void 0:r.runtime,l.status=o.status)}return[...t.values()].map(s=>({instanceId:s.instanceId,partition:s.partition,runtime:s.runtime,handlers:[...s.handlers].sort((o,i)=>o.localeCompare(i)),status:s.status,lastBeatAt:s.lastBeatAt})).sort((s,o)=>s.partition!==o.partition?s.partition==="default"?-1:o.partition==="default"?1:s.partition.localeCompare(o.partition):s.instanceId.localeCompare(o.instanceId))}function pI(e){const t=new Set,n=new Set,r=new Set;for(const o of e){for(const i of o.liveWorkers)t.add(i.instanceId);o.kind==="workflow"?n.add(ap(o.group)):o.kind==="step"&&r.add(ap(o.group))}const s=e.filter(o=>o.depth>0&&o.liveWorkers.length===0).sort((o,i)=>i.depth-o.depth);return{queueCount:e.length,workflowCount:n.size,stepCount:r.size,workerCount:t.size,starved:s,allDraining:s.length===0}}function X1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=X1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function G1(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=X1(e))&&(r&&(r+=" "),r+=t);return r}const Dy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fy=G1,Z1=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Fy(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],f=o==null?void 0:o[c];if(u===null)return null;const d=Dy(u)||Dy(f);return s[c][d]}),l=n&&Object.entries(n).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:d,...p}=u;return Object.entries(p).every(m=>{let[v,b]=m;return Array.isArray(b)?b.includes({...o,...l}[v]):{...o,...l}[v]===b})?[...c,f,d]:c},[]);return Fy(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},gI=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mI=(e,t)=>({classGroupId:e,validator:t}),J1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),xu="-",Ly=[],yI="arbitrary..",xI=e=>{const t=wI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return vI(i);const l=i.split(xu),a=l[0]===""&&l.length>1?1:0;return eS(l,a,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const a=r[i],c=n[i];return a?c?gI(c,a):a:c||Ly}return n[i]||Ly}}},eS=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const c=eS(e,t+1,o);if(c)return c}const i=n.validators;if(i===null)return;const l=t===0?e.join(xu):e.slice(t).join(xu),a=i.length;for(let c=0;c<a;c++){const u=i[c];if(u.validator(l))return u.classGroupId}},vI=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?yI+r:void 0})(),wI=e=>{const{theme:t,classGroups:n}=e;return bI(n,t)},bI=(e,t)=>{const n=J1();for(const r in e){const s=e[r];Qg(s,n,r,t)}return n},Qg=(e,t,n,r)=>{const s=e.length;for(let o=0;o<s;o++){const i=e[o];SI(i,t,n,r)}},SI=(e,t,n,r)=>{if(typeof e=="string"){EI(e,t,n);return}if(typeof e=="function"){kI(e,t,n,r);return}CI(e,t,n,r)},EI=(e,t,n)=>{const r=e===""?t:tS(t,e);r.classGroupId=n},kI=(e,t,n,r)=>{if(RI(e)){Qg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mI(n,e))},CI=(e,t,n,r)=>{const s=Object.entries(e),o=s.length;for(let i=0;i<o;i++){const[l,a]=s[i];Qg(a,tS(t,l),n,r)}},tS=(e,t)=>{let n=e;const r=t.split(xu),s=r.length;for(let o=0;o<s;o++){const i=r[o];let l=n.nextPart.get(i);l||(l=J1(),n.nextPart.set(i,l)),n=l}return n},RI=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,PI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=r[o])!==void 0)return s(o,i),i},set(o,i){o in n?n[o]=i:s(o,i)}}},cp="!",$y=":",TI=[],Hy=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),NI=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const o=[];let i=0,l=0,a=0,c;const u=s.length;for(let v=0;v<u;v++){const b=s[v];if(i===0&&l===0){if(b===$y){o.push(s.slice(a,v)),a=v+1;continue}if(b==="/"){c=v;continue}}b==="["?i++:b==="]"?i--:b==="("?l++:b===")"&&l--}const f=o.length===0?s:s.slice(a);let d=f,p=!1;f.endsWith(cp)?(d=f.slice(0,-1),p=!0):f.startsWith(cp)&&(d=f.slice(1),p=!0);const m=c&&c>a?c-a:void 0;return Hy(o,p,d,m)};if(t){const s=t+$y,o=r;r=i=>i.startsWith(s)?o(i.slice(s.length)):Hy(TI,!1,i,void 0,!0)}if(n){const s=r;r=o=>n({className:o,parseClassName:s})}return r},II=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let o=0;o<n.length;o++){const i=n[o],l=i[0]==="[",a=t.has(i);l||a?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},MI=e=>({cache:PI(e.cacheSize),parseClassName:NI(e),sortModifiers:II(e),postfixLookupClassGroupIds:_I(e),...xI(e)}),_I=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},OI=/\s+/,AI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o,postfixLookupClassGroupIds:i}=t,l=[],a=e.trim().split(OI);let c="";for(let u=a.length-1;u>=0;u-=1){const f=a[u],{isExternal:d,modifiers:p,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:b}=n(f);if(d){c=f+(c.length>0?" "+c:c);continue}let h=!!b,y;if(h){const R=v.substring(0,b);y=r(R);const k=y&&i[y]?r(v):void 0;k&&k!==y&&(y=k,h=!1)}else y=r(v);if(!y){if(!h){c=f+(c.length>0?" "+c:c);continue}if(y=r(v),!y){c=f+(c.length>0?" "+c:c);continue}h=!1}const g=p.length===0?"":p.length===1?p[0]:o(p).join(":"),w=m?g+cp:g,E=w+y;if(l.indexOf(E)>-1)continue;l.push(E);const C=s(y,h);for(let R=0;R<C.length;++R){const k=C[R];l.push(w+k)}c=f+(c.length>0?" "+c:c)}return c},jI=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=nS(n))&&(s&&(s+=" "),s+=r);return s},nS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=nS(e[r]))&&(n&&(n+=" "),n+=t);return n},zI=(e,...t)=>{let n,r,s,o;const i=a=>{const c=t.reduce((u,f)=>f(u),e());return n=MI(c),r=n.cache.get,s=n.cache.set,o=l,l(a)},l=a=>{const c=r(a);if(c)return c;const u=AI(a,n);return s(a,u),u};return o=i,(...a)=>o(jI(...a))},DI=[],ot=e=>{const t=n=>n[e]||DI;return t.isThemeGetter=!0,t},rS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,FI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,LI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$I=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,HI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,BI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ar=e=>FI.test(e),we=e=>!!e&&!Number.isNaN(Number(e)),Vn=e=>!!e&&Number.isInteger(Number(e)),bf=e=>e.endsWith("%")&&we(e.slice(0,-1)),sr=e=>LI.test(e),oS=()=>!0,WI=e=>$I.test(e)&&!HI.test(e),Xg=()=>!1,UI=e=>BI.test(e),KI=e=>VI.test(e),YI=e=>!ce(e)&&!ue(e),qI=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),QI=e=>Rs(e,aS,Xg),ce=e=>rS.test(e),Ns=e=>Rs(e,cS,WI),By=e=>Rs(e,rM,we),XI=e=>Rs(e,dS,oS),GI=e=>Rs(e,uS,Xg),Vy=e=>Rs(e,iS,Xg),ZI=e=>Rs(e,lS,KI),nc=e=>Rs(e,fS,UI),ue=e=>sS.test(e),Ji=e=>mo(e,cS),JI=e=>mo(e,uS),Wy=e=>mo(e,iS),eM=e=>mo(e,aS),tM=e=>mo(e,lS),rc=e=>mo(e,fS,!0),nM=e=>mo(e,dS,!0),Rs=(e,t,n)=>{const r=rS.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},mo=(e,t,n=!1)=>{const r=sS.exec(e);return r?r[1]?t(r[1]):n:!1},iS=e=>e==="position"||e==="percentage",lS=e=>e==="image"||e==="url",aS=e=>e==="length"||e==="size"||e==="bg-size",cS=e=>e==="length",rM=e=>e==="number",uS=e=>e==="family-name",dS=e=>e==="number"||e==="weight",fS=e=>e==="shadow",sM=()=>{const e=ot("color"),t=ot("font"),n=ot("text"),r=ot("font-weight"),s=ot("tracking"),o=ot("leading"),i=ot("breakpoint"),l=ot("container"),a=ot("spacing"),c=ot("radius"),u=ot("shadow"),f=ot("inset-shadow"),d=ot("text-shadow"),p=ot("drop-shadow"),m=ot("blur"),v=ot("perspective"),b=ot("aspect"),h=ot("ease"),y=ot("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...w(),ue,ce],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],k=()=>[ue,ce,a],N=()=>[Ar,"full","auto",...k()],I=()=>[Vn,"none","subgrid",ue,ce],j=()=>["auto",{span:["full",Vn,ue,ce]},Vn,ue,ce],L=()=>[Vn,"auto",ue,ce],A=()=>["auto","min","max","fr",ue,ce],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],M=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...k()],D=()=>[Ar,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],T=()=>[Ar,"screen","full","dvw","lvw","svw","min","max","fit",...k()],_=()=>[Ar,"screen","full","lh","dvh","lvh","svh","min","max","fit",...k()],O=()=>[e,ue,ce],B=()=>[...w(),Wy,Vy,{position:[ue,ce]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",eM,QI,{size:[ue,ce]}],Y=()=>[bf,Ji,Ns],U=()=>["","none","full",c,ue,ce],K=()=>["",we,Ji,Ns],Q=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[we,bf,Wy,Vy],G=()=>["","none",m,ue,ce],J=()=>["none",we,ue,ce],X=()=>["none",we,ue,ce],q=()=>[we,ue,ce],te=()=>[Ar,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sr],breakpoint:[sr],color:[oS],container:[sr],"drop-shadow":[sr],ease:["in","out","in-out"],font:[YI],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sr],shadow:[sr],spacing:["px",we],text:[sr],"text-shadow":[sr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ar,ce,ue,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ue,ce]}],"container-named":[qI],columns:[{columns:[we,ce,ue,l]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Vn,"auto",ue,ce]}],basis:[{basis:[Ar,"full","auto",l,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[we,Ar,"auto","initial","none",ce]}],grow:[{grow:["",we,ue,ce]}],shrink:[{shrink:["",we,ue,ce]}],order:[{order:[Vn,"first","last","none",ue,ce]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...M(),"normal"]}],"justify-self":[{"justify-self":["auto",...M()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...M(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...M(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...M(),"baseline"]}],"place-self":[{"place-self":["auto",...M()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pbs:[{pbs:k()}],pbe:[{pbe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",..._()]}],"min-block-size":[{"min-block":["auto",..._()]}],"max-block-size":[{"max-block":["none",..._()]}],w:[{w:[l,"screen",...D()]}],"min-w":[{"min-w":[l,"screen","none",...D()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",n,Ji,Ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,nM,XI]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bf,ce]}],"font-family":[{font:[JI,GI,t]}],"font-features":[{"font-features":[ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ue,ce]}],"line-clamp":[{"line-clamp":[we,"none",ue,By]}],leading:[{leading:[o,...k()]}],"list-image":[{"list-image":["none",ue,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[we,"from-font","auto",ue,Ns]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[we,"auto",ue,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"tab-size":[{tab:[Vn,ue,ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Vn,ue,ce],radial:["",ue,ce],conic:[Vn,ue,ce]},tM,ZI]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[we,ue,ce]}],"outline-w":[{outline:["",we,Ji,Ns]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,rc,nc]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",f,rc,nc]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[we,Ns]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",d,rc,nc]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[we,ue,ce]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[we]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[ue,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[we]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,ce]}],filter:[{filter:["","none",ue,ce]}],blur:[{blur:G()}],brightness:[{brightness:[we,ue,ce]}],contrast:[{contrast:[we,ue,ce]}],"drop-shadow":[{"drop-shadow":["","none",p,rc,nc]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",we,ue,ce]}],"hue-rotate":[{"hue-rotate":[we,ue,ce]}],invert:[{invert:["",we,ue,ce]}],saturate:[{saturate:[we,ue,ce]}],sepia:[{sepia:["",we,ue,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,ce]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[we,ue,ce]}],"backdrop-contrast":[{"backdrop-contrast":[we,ue,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",we,ue,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[we,ue,ce]}],"backdrop-invert":[{"backdrop-invert":["",we,ue,ce]}],"backdrop-opacity":[{"backdrop-opacity":[we,ue,ce]}],"backdrop-saturate":[{"backdrop-saturate":[we,ue,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",we,ue,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[we,"initial",ue,ce]}],ease:[{ease:["linear","initial",h,ue,ce]}],delay:[{delay:[we,ue,ce]}],animate:[{animate:["none",y,ue,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,ue,ce]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:J()}],"rotate-x":[{"rotate-x":J()}],"rotate-y":[{"rotate-y":J()}],"rotate-z":[{"rotate-z":J()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:q()}],"skew-x":[{"skew-x":q()}],"skew-y":[{"skew-y":q()}],transform:[{transform:[ue,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],zoom:[{zoom:[Vn,ue,ce]}],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mbs":[{"scroll-mbs":k()}],"scroll-mbe":[{"scroll-mbe":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pbs":[{"scroll-pbs":k()}],"scroll-pbe":[{"scroll-pbe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue,ce]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[we,Ji,Ns,By]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},oM=zI(sM);function ft(...e){return oM(G1(e))}const iM=Z1("inline-flex items-center justify-center gap-1.5 rounded-md border font-medium transition-colors disabled:pointer-events-none disabled:opacity-30 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",{variants:{variant:{outline:"border-line text-zinc-300 hover:bg-zinc-800 hover:text-zinc-100",ghost:"border-transparent text-zinc-500 hover:text-zinc-200",quiet:"border-line text-zinc-500 hover:text-zinc-200",brand:"border-brand/30 bg-brand/10 text-brand hover:bg-brand/20",warn:"border-warn/40 bg-warn/10 text-warn hover:bg-warn/20",info:"border-sky-500/30 bg-sky-500/10 text-sky-300 hover:bg-sky-500/20",alt:"border-indigo-500/30 bg-indigo-500/10 text-indigo-300 hover:bg-indigo-500/20",danger:"border-rose-500/30 bg-rose-500/10 text-rose-300 hover:bg-rose-500/20",chip:"border-line bg-zinc-800/40 text-zinc-400 hover:border-zinc-500"},size:{sm:"px-3 py-1.5 text-xs uppercase tracking-wide",xs:"px-1.5 py-0.5 text-[10px]",chip:"px-2.5 py-1 text-xs",icon:"h-7 w-7 shrink-0 p-0"}},defaultVariants:{variant:"outline",size:"sm"}}),Ue=S.forwardRef(({className:e,variant:t,size:n,type:r,...s},o)=>x.jsx("button",{ref:o,type:r??"button",className:ft(iM({variant:t,size:n}),e),...s}));Ue.displayName="Button";function lM({runs:e,value:t,onChange:n}){const r=XN(e);return r.length<=1?null:x.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-line px-2 py-1.5",children:[x.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.18em] text-zinc-600",children:"origin"}),r.map(s=>{const o=YN(t,s.filter);return x.jsxs(Ue,{variant:"ghost",size:"chip","aria-pressed":o,title:s.title,onClick:()=>n(s.filter),className:ft("mono max-w-full gap-1 rounded-md",s.filter.kind==="unknown"&&"italic text-zinc-500",o&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[x.jsx("span",{className:"truncate",children:s.label}),x.jsx("span",{className:"tnum shrink-0 text-zinc-600",children:s.count})]},Y1(s.filter))})]})}function aM(e){if(e.length===0)return"";let t=e[0]??"";for(const n of e.slice(1)){let r=0;for(;r<t.length&&r<n.length&&t[r]===n[r];)r+=1;t=t.slice(0,r)}return t.replace(/[\s._:-]+$/,"")}function cM(e){const t=aM(e.map(n=>n.name));return`${t.length>=2?t:"parallel"} ×${e.length}`}function hS(e){var r;const t=[];let n=0;for(;n<e.length;){const s=e[n];if(s===void 0){n+=1;continue}const o=s.parallelGroup;if(o===void 0||o===""){t.push({kind:"single",step:s}),n+=1;continue}const i=[];let l=n;for(;l<e.length&&((r=e[l])==null?void 0:r.parallelGroup)===o;){const a=e[l];a!==void 0&&i.push(a),l+=1}i.length<=1?t.push({kind:"single",step:i[0]??s}):t.push({kind:"fan",group:o,steps:i,label:cM(i)}),n=l}return t}function oo(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)}const zn={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round"};function pS(e){return x.jsxs("svg",{...zn,...e,"aria-hidden":"true",children:[x.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.5"}),x.jsx("path",{d:"M9 3v2M15 3v2M9 19v2M15 19v2M3 9h2M3 15h2M19 9h2M19 15h2"})]})}function uM(e){return x.jsxs("svg",{...zn,...e,"aria-hidden":"true",children:[x.jsx("circle",{cx:"12",cy:"12",r:"9"}),x.jsx("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]})}function dM(e){return x.jsxs("svg",{...zn,...e,"aria-hidden":"true",children:[x.jsx("circle",{cx:"12",cy:"13",r:"8"}),x.jsx("path",{d:"M12 13V9M9 2h6"})]})}function fM(e){return x.jsxs("svg",{...zn,...e,"aria-hidden":"true",children:[x.jsx("circle",{cx:"12",cy:"12",r:"2"}),x.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 gS(e){return x.jsx("svg",{...zn,...e,"aria-hidden":"true",children:x.jsx("path",{d:"m4 12 5 5L20 6"})})}function Di(e){return x.jsx("svg",{...zn,...e,"aria-hidden":"true",children:x.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function hM(e){return x.jsxs("svg",{...zn,...e,"aria-hidden":"true",children:[x.jsx("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),x.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h8"})]})}function Sf(e){return x.jsx("svg",{...zn,...e,"aria-hidden":"true",children:x.jsx("path",{d:"M21 12a9 9 0 1 1-2.6-6.3M21 4v5h-5"})})}function Gg(e){return x.jsx("svg",{...zn,...e,"aria-hidden":"true",children:x.jsx("path",{d:"M13 2 4 14h7l-1 8 9-12h-7l1-8z"})})}function pM(e){return x.jsx("svg",{...zn,...e,"aria-hidden":"true",children:x.jsx("path",{d:"M6 4l14 8-14 8z"})})}function Zg(e){return x.jsxs("svg",{...zn,...e,"aria-hidden":"true",children:[x.jsx("circle",{cx:"6",cy:"5",r:"2"}),x.jsx("path",{d:"M6 7v6a4 4 0 004 4h4"}),x.jsx("circle",{cx:"18",cy:"17",r:"2"})]})}const gM={local:pS,remote:uM,sleep:dM,signal:fM,child:Zg};function Jg(e){return gM[e]??pS}const up={local:"In-process step",remote:"Remote worker step",sleep:"Durable timer",signal:"External signal",child:"Child workflow — click to open its run"},mM=9e4;function yM(e,t,n){var o;const r=((t==null?void 0:t.liveWorkers)??[]).filter(i=>n-i.lastBeatAt<=mM).sort((i,l)=>l.lastBeatAt-i.lastBeatAt)[0];if(r)return{kind:"working",instanceId:r.instanceId,beatAgoS:Math.max(0,Math.round((n-r.lastBeatAt)/1e3)),inFlight:(o=r.status)==null?void 0:o.inFlight};const s=e.enqueuedAt?new Date(e.enqueuedAt).getTime():new Date(e.startedAt).getTime();return{kind:"lost",minutes:Math.round((n-s)/6e4)}}function xM(e){const t=S.useMemo(()=>{const s=new Set;for(const o of e){const i=oo(o);i!==void 0&&s.add(i)}return[...s].sort()},[e]),n=Hw({queries:t.map(s=>({queryKey:["run",s],queryFn:()=>tt.run(s)}))}),r={};return t.forEach((s,o)=>{var l;const i=(l=n[o])==null?void 0:l.data;i&&(r[s]=i)}),r}function vM(e,t,n){if(t){const i=new Date(t.run.createdAt).getTime(),a=t.run.status==="running"||t.run.status==="suspended"?n:new Date(t.run.updatedAt).getTime();return[i,Math.max(a,i)]}const{subs:r}=Kg(e.events??[]),s=r.map(i=>i.startedAt).filter(i=>i!==void 0),o=r.map(i=>{var l;return((l=i.terminal)==null?void 0:l.at)??i.startedAt}).filter(i=>i!==void 0);return s.length>0&&o.length>0?[Math.min(...s),Math.max(...o)]:[new Date(e.startedAt).getTime(),new Date(e.finishedAt).getTime()]}function dp(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}const wM={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"},bM={ok:"bg-emerald-400",failed:"bg-red-400",skipped:"bg-amber-400"};function mS({row:e,run:t,childRuns:n,depth:r,selectedKey:s,onSelect:o,onOpenRun:i,onToggleChild:l,expanded:a,collapsedSubs:c,toggleSubs:u}){var j;const{step:f,left:d,width:p,ms:m,subRows:v}=e,b=f.status==="failed",h=oo(f),y=!!h,g=y?Zg:Jg(f.kind),w=s===`${f.runId}#${f.seq}`,E=y&&h!==void 0&&a.has(h),C=v.length>0&&!y,R=c.has(f.seq),k=rI(f,Date.now()),{data:N}=Gn({queryKey:["workers"],queryFn:()=>tt.workers(),refetchInterval:1e4,enabled:k}),I=k?yM(f,N==null?void 0:N.find(L=>L.group===f.workerGroup),Date.now()):void 0;return x.jsxs("div",{children:[x.jsxs("button",{type:"button",onClick:()=>o(f,t),title:y?"Child workflow — click for its detail (↗ opens 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 ${w?"bg-zinc-800/60":"hover:bg-zinc-900/60"}`,children:[x.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[y&&h!==void 0&&x.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),l(h)},className:"shrink-0 text-indigo-400 hover:text-indigo-200 transition-colors",title:E?"Collapse child run":"Expand child run inline",children:x.jsx("span",{className:"inline-block transition-transform",style:{transform:E?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),C&&x.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),u(f.seq)},className:"shrink-0 text-zinc-500 transition-colors hover:text-zinc-300",title:R?`Show ${v.length} sub-process(es)`:"Hide sub-processes",children:x.jsx("span",{className:"inline-block transition-transform",style:{transform:R?"rotate(0deg)":"rotate(90deg)"},children:"▸"})}),x.jsx("span",{className:b?"text-red-400":y?"text-indigo-300":"text-emerald-400",children:x.jsx(g,{width:12,height:12})}),x.jsx("span",{className:"truncate text-[12px] text-zinc-300",children:h!==void 0?((j=n[h])==null?void 0:j.run.workflow)??"child workflow":f.name}),y&&h!==void 0&&x.jsx("button",{type:"button",onClick:L=>{L.stopPropagation(),i(h)},title:"Open the child run",className:"shrink-0 text-indigo-300 transition-colors hover:text-indigo-100",children:"↗"})]}),x.jsxs("span",{className:"relative h-5",children:[x.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),x.jsx("span",{className:`absolute top-1/2 flex h-3.5 -translate-y-1/2 items-center rounded-[3px] transition-all duration-500 ease-out ${b?"bg-red-500/35 ring-1 ring-red-500/50":w?"bg-emerald-400/45 ring-1 ring-emerald-400/60":"bg-emerald-500/30 ring-1 ring-emerald-500/40"}`,style:{left:`${d}%`,width:`${p}%`}}),x.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(${d+p}%, calc(100% - 44px))`},children:dp(m)})]})]}),(I==null?void 0:I.kind)==="working"&&x.jsxs("div",{className:"mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] text-emerald-500/80",title:"A live worker holds this dispatch — its heartbeat is fresh. Long steps are expected to sit here; only re-dispatch if the heartbeat goes stale.",children:[x.jsx("span",{"aria-hidden":!0,children:"⚙"}),"being worked by ",I.instanceId," — heartbeat ",I.beatAgoS,"s ago",I.inFlight!==void 0?` · ${I.inFlight} in flight`:""]}),(I==null?void 0:I.kind)==="lost"&&x.jsxs("div",{className:"mono ml-[18px] mb-1 flex items-center gap-1 text-[10px] s-stale",title:"No live worker heartbeat on this step's group — reconcile-wake can't recover a stuck `pending` step; re-dispatch it from the run actions above",children:[x.jsx("span",{"aria-hidden":!0,children:"⚠"}),"awaiting worker result — dispatched ",I.minutes,"m ago, no live worker (possibly lost)"]}),v.length>0&&!R&&x.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 space-y-0.5 border-l border-line-soft pl-2",children:v.map(L=>x.jsxs("div",{className:"grid grid-cols-[130px_1fr] items-center gap-3 px-2",title:`${L.name} — ${L.status}`,children:[x.jsxs("span",{className:"flex items-center gap-1.5 truncate",children:[x.jsx("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${bM[L.status]}`}),x.jsx("span",{className:"truncate text-[10px] text-zinc-400",children:L.name})]}),x.jsxs("span",{className:"relative h-3",children:[x.jsx("span",{className:"absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-line-soft"}),x.jsx("span",{className:`absolute top-1/2 h-2 -translate-y-1/2 rounded-[2px] transition-all duration-500 ease-out ${wM[L.status]}`,style:{left:`${L.left}%`,width:`${L.width}%`}}),x.jsx("span",{className:"mono tnum absolute top-1/2 -translate-y-1/2 whitespace-nowrap pl-1 text-[9px] text-zinc-600",style:{left:`min(${L.left+L.width}%, calc(100% - 38px))`},children:dp(L.ms)})]})]},L.key))}),y&&h!==void 0&&E&&x.jsx("div",{className:"ml-[18px] mt-0.5 mb-1 border-l border-line-soft pl-2",children:x.jsx(EM,{id:h,depth:r+1,selectedKey:s,onSelect:o,onOpenRun:i,expanded:a,onToggleChild:l})})]})}function SM({label:e,fanFailed:t,memberRows:n,rowProps:r}){return x.jsxs("div",{className:"rounded-md bg-zinc-900/30 ring-1 ring-line-soft",children:[x.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[x.jsx("span",{className:"text-[11px] text-indigo-300/80",title:"parallel fan-out (ctx.gather / ctx.all)",children:"⑃"}),x.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.15em] text-zinc-500",children:"parallel"}),x.jsx("span",{className:`text-[11px] ${t?"text-red-400":"text-zinc-300"}`,children:e})]}),x.jsx("div",{className:"ml-[10px] border-l border-line-soft pl-1",children:n.map(s=>x.jsx(mS,{row:s,...r},s.step.seq))})]})}function em({run:e,timeline:t,depth:n,selectedKey:r,onSelect:s,onOpenRun:o,expanded:i,onToggleChild:l}){const a=xM(t),{span:c,rows:u}=S.useMemo(()=>{const h=e.status==="running"||e.status==="suspended",y=Date.now(),g=t.map(k=>{const N=oo(k),I=N!==void 0?a[N]:void 0,[j,L]=vM(k,I,y);return{step:k,childId:N,childRun:I,barStart:j,barEnd:L}}),w=Math.min(new Date(e.createdAt).getTime(),...g.map(k=>k.barStart)),E=Math.max(...g.map(k=>k.barEnd),h?y:w+1),C=Math.max(E-w,1),R=g.map(({step:k,childId:N,childRun:I,barStart:j,barEnd:L})=>{const{subs:A}=Kg(k.events??[]),P=A.map(M=>{var T;const z=M.startedAt??j,D=((T=M.terminal)==null?void 0:T.at)??z;return{key:M.id,name:M.name,status:M.status??"ok",left:(z-w)/C*100,width:Math.max((D-z)/C*100,.8),ms:M.durationMs??Math.max(D-z,0)}});return{step:k,childId:N,childRun:I,left:(j-w)/C*100,width:Math.max((L-j)/C*100,.8),ms:L-j,subRows:P}});return{span:C,rows:R}},[e,t,a]),f=S.useMemo(()=>hS(t),[t]),d=S.useMemo(()=>{const h=new Map;for(const y of u)h.set(y.step.seq,y);return h},[u]),[p,m]=S.useState(new Set),b={run:e,childRuns:a,depth:n,selectedKey:r,onSelect:s,onOpenRun:o,onToggleChild:l,expanded:i,collapsedSubs:p,toggleSubs:h=>m(y=>{const g=new Set(y);return g.has(h)?g.delete(h):g.add(h),g})};return x.jsx(x.Fragment,{children:f.map(h=>{if(h.kind==="single"){const g=d.get(h.step.seq);return g?x.jsx(mS,{row:g,...b},g.step.seq):null}const y=h.steps.map(g=>d.get(g.seq)).filter(g=>g!==void 0);return x.jsx(SM,{label:h.label,fanFailed:h.steps.some(g=>g.status==="failed"),memberRows:y,rowProps:b},`fan:${h.group}`)})})}function EM({id:e,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const{data:l}=Gn({queryKey:["run",e],queryFn:()=>tt.run(e)});return t>6?null:l?x.jsxs("div",{className:"my-1 rounded-md border border-line bg-black/15",children:[x.jsxs("div",{className:"mono flex items-center gap-2 px-2 py-1 text-[10px] text-zinc-500",children:[x.jsxs("span",{className:"text-indigo-300",children:["⌁ ",l.run.workflow]}),x.jsx("span",{className:"tnum text-zinc-600",children:e.slice(0,8)}),x.jsx("span",{className:`s-${l.run.status} uppercase`,children:l.run.status}),x.jsx("button",{type:"button",onClick:()=>s(e),className:"ml-auto rounded border border-line px-1.5 text-zinc-400 hover:text-zinc-200",children:"open ↗"})]}),x.jsx(em,{run:l.run,timeline:l.timeline,depth:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i})]}):x.jsx("div",{className:"mono px-2 py-1 text-[10px] text-zinc-600",children:"loading child run…"})}function kM({run:e,timeline:t,selectedKey:n,onSelect:r,onOpenRun:s,expanded:o,onToggleChild:i}){const l=S.useMemo(()=>{const u=t.map(v=>new Date(v.startedAt).getTime()),f=t.map(v=>new Date(v.finishedAt).getTime()),d=Math.min(new Date(e.createdAt).getTime(),...u),p=e.status==="running"||e.status==="suspended",m=Math.max(...f,p?Date.now():d+1);return Math.max(m-d,1)},[e,t]),a=o??new Set,c=i??(()=>{});return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 pt-3",children:[x.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.2em] text-zinc-500",children:"spans"}),x.jsxs("span",{className:"mono tnum text-[10px] text-zinc-600",children:["total ",dp(l)]})]}),x.jsx("div",{className:"min-h-0 flex-1 space-y-1 overflow-auto px-3 pb-3",children:x.jsx(em,{run:e,timeline:t,depth:0,selectedKey:n,onSelect:r,onOpenRun:s,expanded:a,onToggleChild:c})})]})}function vu(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`}function Uy(e,t){return vu(new Date(t).getTime()-new Date(e).getTime())}function Ky(e){return tm(new Date(e).getTime())}function tm(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}const yS={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"},CM={debug:"text-zinc-500",info:"text-zinc-300",warn:"text-amber-300",error:"text-red-300"},RM=["ok","failed","skipped"];function xS({e}){return x.jsxs("div",{className:"flex gap-2 py-0.5",children:[x.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:tm(e.at)}),x.jsx("span",{className:`shrink-0 uppercase ${CM[e.level]}`,children:e.level}),x.jsx("span",{className:"min-w-0 break-words text-zinc-300",children:e.message})]})}function Yy({sub:e,showGroup:t=!0}){var l,a;const n=((l=e.terminal)==null?void 0:l.message)!==void 0&&e.terminal.message!==e.name,r=e.phases.length>0||e.logs.length>0||n,[s,o]=S.useState(e.status==="failed"),i=e.status?yS[e.status]:"border-amber-500/25 bg-amber-500/10 text-amber-300";return x.jsxs("li",{className:`rounded-md border ${i}`,children:[x.jsxs("button",{type:"button",disabled:!r,onClick:()=>o(c=>!c),className:"flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[11.5px] disabled:cursor-default","aria-expanded":r?s:void 0,children:[x.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r&&x.jsx("span",{className:`text-[9px] text-zinc-500 transition-transform duration-150 ${s?"":"-rotate-90"}`,children:"▼"}),x.jsx("span",{className:"mono truncate text-zinc-200",children:e.name}),t&&e.group&&x.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-wider text-zinc-500",children:e.group})]}),x.jsxs("span",{className:"mono flex shrink-0 items-center gap-2 text-[10px] uppercase tracking-wider",children:[e.durationMs!==void 0&&x.jsx("span",{className:"tnum text-zinc-400",children:vu(e.durationMs)}),x.jsx("span",{children:e.status??"running"})]})]}),s&&x.jsxs("div",{className:"border-t border-line/60 px-2.5 py-2",children:[e.phases.length>0&&x.jsx("ul",{className:"mono mb-2 flex flex-col gap-0.5 text-[10.5px]",children:e.phases.map((c,u)=>x.jsxs("li",{className:"flex gap-2",children:[x.jsx("span",{className:"shrink-0 text-zinc-600 tnum",children:tm(c.at)}),x.jsx("span",{className:"text-zinc-400",children:c.phase}),e.startedAt!==void 0&&x.jsxs("span",{className:"text-zinc-600 tnum",children:["+",vu(c.at-e.startedAt)]})]},`${c.at}-${c.phase}-${u}`))}),((a=e.terminal)==null?void 0:a.message)&&e.terminal.message!==e.name&&x.jsx("div",{className:`mono mb-2 rounded border p-2 text-[11px] ${e.status==="failed"?"border-red-500/25 bg-red-500/10 text-red-200":"border-line bg-black/20 text-zinc-300"}`,children:e.terminal.message}),e.logs.length>0&&x.jsx("div",{className:"mono flex flex-col gap-0.5 text-[11px]",children:e.logs.map((c,u)=>x.jsx(xS,{e:c},`${c.at}-${u}`))})]})]})}function PM({events:e}){const{subs:t,stepLogs:n}=Kg(e),r=RM.map(o=>[o,t.filter(i=>i.status===o).length]).filter(([,o])=>o>0),s=t.some(o=>o.group);return x.jsxs(x.Fragment,{children:[t.length>0&&x.jsxs("section",{className:"rise",children:[x.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[x.jsxs("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["sub-processes · ",t.length]}),x.jsx("span",{className:"mono flex gap-2 text-[10px] uppercase tracking-wider",children:r.map(([o,i])=>x.jsxs("span",{className:yS[o].split(" ").pop(),children:[i," ",o]},o))})]}),s?Object.entries(t.reduce((o,i)=>{const l=i.group??"—";return o[l]===void 0&&(o[l]=[]),o[l].push(i),o},{})).sort(([o],[i])=>o==="—"?1:i==="—"?-1:o.localeCompare(i)).map(([o,i])=>x.jsxs("div",{className:"mb-2",children:[x.jsx("div",{className:"mono mb-1 text-[10px] uppercase tracking-wider text-zinc-500",children:o}),x.jsx("ul",{className:"flex flex-col gap-1",children:i.map(l=>x.jsx(Yy,{sub:l,showGroup:!1},l.id))})]},o)):x.jsx("ul",{className:"flex flex-col gap-1",children:t.map(o=>x.jsx(Yy,{sub:o},o.id))})]}),n.length>0&&x.jsxs("section",{className:"rise",children:[x.jsxs("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:["logs · ",n.length]}),x.jsx("div",{className:"mono max-h-64 overflow-auto rounded-lg border border-line bg-black/40 p-2.5 text-[11px] leading-relaxed",children:n.map((o,i)=>x.jsx(xS,{e:o},`${o.at}-${i}`))})]})]})}function TM({value:e}){const[t,n]=S.useState(!1);return x.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded border border-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?x.jsx(gS,{width:11,height:11}):x.jsx(hM,{width:11,height:11}),t?"copied":"copy"]})}function wu({label:e,value:t}){const n=typeof t=="string"?t:JSON.stringify(t,null,2);return x.jsxs("section",{className:"rise",children:[x.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[x.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:e}),x.jsx(TM,{value:n})]}),x.jsx("pre",{className:"mono max-h-64 overflow-auto rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300",children:n})]})}function jr({k:e,v:t,mono:n=!0}){return x.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[x.jsx("span",{className:"mono shrink-0 text-[10px] uppercase tracking-[0.16em] text-zinc-600",children:e}),x.jsx("span",{className:`truncate text-right text-[12px] text-zinc-200 ${n?"mono tnum":""}`,children:t})]})}function NM({id:e,onOpenRun:t}){const{data:n}=Gn({queryKey:["run",e],queryFn:()=>tt.run(e)}),[r,s]=S.useState(new Set),o=i=>s(l=>{const a=new Set(l);return a.has(i)?a.delete(i):a.add(i),a});return n?n.timeline.length===0?x.jsxs("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:["no steps recorded yet — child ",n.run.status]}):x.jsx("div",{className:"mt-2 max-h-80 space-y-1 overflow-auto rounded-md border border-line bg-black/20 p-1.5",children:x.jsx(em,{run:n.run,timeline:n.timeline,depth:0,onSelect:()=>{},onOpenRun:t??(()=>{}),expanded:r,onToggleChild:o})}):x.jsx("div",{className:"mono px-2 py-2 text-[10px] text-zinc-600",children:"loading child run…"})}function IM({step:e,run:t,onClose:n,onOpenRun:r}){const s=oo(e),[o,i]=S.useState(!1),l=e.status==="failed",a=e.status==="pending"||e.status==="running",c=Jg(e.kind),u=Uy(t.createdAt,e.startedAt),f=e.enqueuedAt?new Date(e.startedAt).getTime()-new Date(e.enqueuedAt).getTime():0;return x.jsxs("aside",{className:"absolute inset-y-0 right-0 z-20 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise",children:[x.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:`grid h-6 w-6 shrink-0 place-items-center rounded-md ${l?"bg-red-500/15 text-red-300":a?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:x.jsx(c,{width:13,height:13})}),x.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.name})]}),x.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:[e.status," · ",up[e.kind]??e.kind]})]}),x.jsx("button",{type:"button",onClick:n,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:x.jsx(Di,{})})]}),x.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[x.jsxs("div",{className:"rounded-lg border border-line bg-black/20 px-3.5 py-1",children:[x.jsx(jr,{k:"seq",v:`#${e.seq}`}),f>=1&&x.jsx(jr,{k:"queued",v:x.jsx("span",{className:"text-sky-300",children:vu(f)})}),x.jsx(jr,{k:"duration",v:a?x.jsx("span",{className:"text-amber-300",children:"running…"}):Uy(e.startedAt,e.finishedAt)}),x.jsx(jr,{k:"attempts",v:x.jsxs("span",{className:e.attempts>1?"text-amber-300":"",children:[e.attempts>1&&x.jsx(Gg,{width:11,height:11,className:"mr-1 inline"}),e.attempts]})}),e.workerGroup&&x.jsx(jr,{k:"worker",v:`@${e.workerGroup}`}),x.jsx(jr,{k:"started",v:Ky(e.startedAt)}),!a&&x.jsx(jr,{k:"finished",v:Ky(e.finishedAt)}),x.jsx(jr,{k:"offset",v:`+${u}`})]}),l&&e.error&&x.jsxs("section",{className:"rise",children:[x.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),x.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&&x.jsx(PM,{events:e.events}),s&&x.jsxs("section",{className:"rise",children:[x.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[x.jsx("span",{className:"mono text-[10px] uppercase tracking-[0.18em] text-zinc-500",children:"child run"}),r&&x.jsx("button",{type:"button",onClick:()=>r(s),className:"mono rounded border border-line px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-zinc-500 transition-colors hover:text-zinc-200",children:"open ↗"})]}),x.jsxs("button",{type:"button",onClick:()=>i(d=>!d),className:"flex w-full items-center gap-2 rounded-md border border-indigo-500/30 bg-indigo-500/10 px-2.5 py-1.5 text-left transition-colors hover:bg-indigo-500/20",title:o?"Collapse child run":"Expand child run inline",children:[x.jsx("span",{className:"inline-block text-[9px] text-indigo-300 transition-transform",style:{transform:o?"rotate(90deg)":"rotate(0deg)"},children:"▸"}),x.jsx("span",{className:"mono truncate text-[11px] text-indigo-300",children:s})]}),o&&x.jsx(NM,{id:s,onOpenRun:r})]}),e.input!==void 0&&x.jsx(wu,{label:"input",value:e.input}),e.output!==void 0&&x.jsx(wu,{label:"output",value:e.output})]})]})}function MM({run:e,onClose:t}){const n=e.input===void 0&&e.output===void 0&&!e.error;return x.jsxs("aside",{className:"absolute inset-y-0 right-0 z-30 flex w-[380px] max-w-[90%] flex-col border-l border-line bg-panel/95 shadow-2xl backdrop-blur-md rise",children:[x.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx("h3",{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:e.workflow}),x.jsxs("div",{className:`mono mt-1 text-[11px] uppercase tracking-wider s-${e.status}`,children:["run · ",e.status]})]}),x.jsx("button",{type:"button",onClick:t,className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-line text-zinc-500 transition-colors hover:text-zinc-200","aria-label":"Close",children:x.jsx(Di,{})})]}),x.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto px-5 py-4",children:[e.error&&x.jsxs("section",{className:"rise",children:[x.jsx("div",{className:"mono mb-1.5 text-[10px] uppercase tracking-[0.18em] text-red-400/80",children:"error"}),x.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&&x.jsx(wu,{label:"input",value:e.input}),e.output!==void 0&&x.jsx(wu,{label:"output",value:e.output}),n&&x.jsx("div",{className:"text-sm text-zinc-600",children:"No input/output recorded."})]})]})}function st(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=st(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var _M={value:()=>{}};function ad(){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 Ac(n)}function Ac(e){this._=e}function OM(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ac.prototype=ad.prototype={constructor:Ac,on:function(e,t){var n=this._,r=OM(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=AM(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=qy(n[s],e.name,t);else if(t==null)for(s in n)n[s]=qy(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ac(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[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],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function AM(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function qy(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=_M,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var fp="http://www.w3.org/1999/xhtml";const Qy={svg:"http://www.w3.org/2000/svg",xhtml:fp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cd(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Qy.hasOwnProperty(t)?{space:Qy[t],local:e}:e}function jM(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fp&&t.documentElement.namespaceURI===fp?t.createElement(e):t.createElementNS(n,e)}}function zM(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vS(e){var t=cd(e);return(t.local?zM:jM)(t)}function DM(){}function nm(e){return e==null?DM:function(){return this.querySelector(e)}}function FM(e){typeof e!="function"&&(e=nm(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=new Array(i),a,c,u=0;u<i;++u)(a=o[u])&&(c=e.call(a,a.__data__,u,o))&&("__data__"in a&&(c.__data__=a.__data__),l[u]=c);return new nn(r,this._parents)}function LM(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $M(){return[]}function wS(e){return e==null?$M:function(){return this.querySelectorAll(e)}}function HM(e){return function(){return LM(e.apply(this,arguments))}}function BM(e){typeof e=="function"?e=HM(e):e=wS(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&(r.push(e.call(a,a.__data__,c,i)),s.push(a));return new nn(r,s)}function bS(e){return function(){return this.matches(e)}}function SS(e){return function(t){return t.matches(e)}}var VM=Array.prototype.find;function WM(e){return function(){return VM.call(this.children,e)}}function UM(){return this.firstElementChild}function KM(e){return this.select(e==null?UM:WM(typeof e=="function"?e:SS(e)))}var YM=Array.prototype.filter;function qM(){return Array.from(this.children)}function QM(e){return function(){return YM.call(this.children,e)}}function XM(e){return this.selectAll(e==null?qM:QM(typeof e=="function"?e:SS(e)))}function GM(e){typeof e!="function"&&(e=bS(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new nn(r,this._parents)}function ES(e){return new Array(e.length)}function ZM(){return new nn(this._enter||this._groups.map(ES),this._parents)}function bu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bu.prototype={constructor:bu,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 JM(e){return function(){return e}}function e_(e,t,n,r,s,o){for(var i=0,l,a=t.length,c=o.length;i<c;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new bu(e,o[i]);for(;i<a;++i)(l=t[i])&&(s[i]=l)}function t_(e,t,n,r,s,o,i){var l,a,c=new Map,u=t.length,f=o.length,d=new Array(u),p;for(l=0;l<u;++l)(a=t[l])&&(d[l]=p=i.call(a,a.__data__,l,t)+"",c.has(p)?s[l]=a:c.set(p,a));for(l=0;l<f;++l)p=i.call(e,o[l],l,o)+"",(a=c.get(p))?(r[l]=a,a.__data__=o[l],c.delete(p)):n[l]=new bu(e,o[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(d[l])===a&&(s[l]=a)}function n_(e){return e.__data__}function r_(e,t){if(!arguments.length)return Array.from(this,n_);var n=t?t_:e_,r=this._parents,s=this._groups;typeof e!="function"&&(e=JM(e));for(var o=s.length,i=new Array(o),l=new Array(o),a=new Array(o),c=0;c<o;++c){var u=r[c],f=s[c],d=f.length,p=s_(e.call(u,u&&u.__data__,c,r)),m=p.length,v=l[c]=new Array(m),b=i[c]=new Array(m),h=a[c]=new Array(d);n(u,f,v,b,h,p,t);for(var y=0,g=0,w,E;y<m;++y)if(w=v[y]){for(y>=g&&(g=y+1);!(E=b[g])&&++g<m;);w._next=E||null}}return i=new nn(i,r),i._enter=l,i._exit=a,i}function s_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function o_(){return new nn(this._exit||this._groups.map(ES),this._parents)}function i_(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function l_(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),a=0;a<i;++a)for(var c=n[a],u=r[a],f=c.length,d=l[a]=new Array(f),p,m=0;m<f;++m)(p=c[m]||u[m])&&(d[m]=p);for(;a<s;++a)l[a]=n[a];return new nn(l,this._parents)}function a_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function c_(e){e||(e=u_);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,a=s[o]=new Array(l),c,u=0;u<l;++u)(c=i[u])&&(a[u]=c);a.sort(t)}return new nn(s,this._parents).order()}function u_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function d_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function f_(){return Array.from(this)}function h_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function p_(){let e=0;for(const t of this)++e;return e}function g_(){return!this.node()}function m_(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function y_(e){return function(){this.removeAttribute(e)}}function x_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function v_(e,t){return function(){this.setAttribute(e,t)}}function w_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function b_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function S_(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 E_(e,t){var n=cd(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?x_:y_:typeof t=="function"?n.local?S_:b_:n.local?w_:v_)(n,t))}function kS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function k_(e){return function(){this.style.removeProperty(e)}}function C_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function R_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function P_(e,t,n){return arguments.length>1?this.each((t==null?k_:typeof t=="function"?R_:C_)(e,t,n??"")):bi(this.node(),e)}function bi(e,t){return e.style.getPropertyValue(t)||kS(e).getComputedStyle(e,null).getPropertyValue(t)}function T_(e){return function(){delete this[e]}}function N_(e,t){return function(){this[e]=t}}function I_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function M_(e,t){return arguments.length>1?this.each((t==null?T_:typeof t=="function"?I_:N_)(e,t)):this.node()[e]}function CS(e){return e.trim().split(/^|\s+/)}function rm(e){return e.classList||new RS(e)}function RS(e){this._node=e,this._names=CS(e.getAttribute("class")||"")}RS.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 PS(e,t){for(var n=rm(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function TS(e,t){for(var n=rm(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function __(e){return function(){PS(this,e)}}function O_(e){return function(){TS(this,e)}}function A_(e,t){return function(){(t.apply(this,arguments)?PS:TS)(this,e)}}function j_(e,t){var n=CS(e+"");if(arguments.length<2){for(var r=rm(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?A_:t?__:O_)(n,t))}function z_(){this.textContent=""}function D_(e){return function(){this.textContent=e}}function F_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function L_(e){return arguments.length?this.each(e==null?z_:(typeof e=="function"?F_:D_)(e)):this.node().textContent}function $_(){this.innerHTML=""}function H_(e){return function(){this.innerHTML=e}}function B_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function V_(e){return arguments.length?this.each(e==null?$_:(typeof e=="function"?B_:H_)(e)):this.node().innerHTML}function W_(){this.nextSibling&&this.parentNode.appendChild(this)}function U_(){return this.each(W_)}function K_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y_(){return this.each(K_)}function q_(e){var t=typeof e=="function"?e:vS(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Q_(){return null}function X_(e,t){var n=typeof e=="function"?e:vS(e),r=t==null?Q_:typeof t=="function"?t:nm(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function G_(){var e=this.parentNode;e&&e.removeChild(this)}function Z_(){return this.each(G_)}function J_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eO(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tO(e){return this.select(e?eO:J_)}function nO(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rO(e){return function(t){e.call(this,t,this.__data__)}}function sO(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 oO(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function iO(e,t,n){return function(){var r=this.__on,s,o=rO(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function lO(e,t,n){var r=sO(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,c=l.length,u;a<c;++a)for(s=0,u=l[a];s<o;++s)if((i=r[s]).type===u.type&&i.name===u.name)return u.value}return}for(l=t?iO:oO,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function NS(e,t,n){var r=kS(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function aO(e,t){return function(){return NS(this,e,t)}}function cO(e,t){return function(){return NS(this,e,t.apply(this,arguments))}}function uO(e,t){return this.each((typeof t=="function"?cO:aO)(e,t))}function*dO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var IS=[null];function nn(e,t){this._groups=e,this._parents=t}function ya(){return new nn([[document.documentElement]],IS)}function fO(){return this}nn.prototype=ya.prototype={constructor:nn,select:FM,selectAll:BM,selectChild:KM,selectChildren:XM,filter:GM,data:r_,enter:ZM,exit:o_,join:i_,merge:l_,selection:fO,order:a_,sort:c_,call:d_,nodes:f_,node:h_,size:p_,empty:g_,each:m_,attr:E_,style:P_,property:M_,classed:j_,text:L_,html:V_,raise:U_,lower:Y_,append:q_,insert:X_,remove:Z_,clone:tO,datum:nO,on:lO,dispatch:uO,[Symbol.iterator]:dO};function Zt(e){return typeof e=="string"?new nn([[document.querySelector(e)]],[document.documentElement]):new nn([[e]],IS)}function hO(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Pn(e,t){if(e=hO(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 s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const pO={passive:!1},Vl={capture:!0,passive:!1};function Ef(e){e.stopImmediatePropagation()}function qo(e){e.preventDefault(),e.stopImmediatePropagation()}function MS(e){var t=e.document.documentElement,n=Zt(e).on("dragstart.drag",qo,Vl);"onselectstart"in t?n.on("selectstart.drag",qo,Vl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function _S(e,t){var n=e.document.documentElement,r=Zt(e).on("dragstart.drag",null);t&&(r.on("click.drag",qo,Vl),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 sc=e=>()=>e;function hp(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:a,dy:c,dispatch:u}){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:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}hp.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function gO(e){return!e.ctrlKey&&!e.button}function mO(){return this.parentNode}function yO(e,t){return t??{x:e.x,y:e.y}}function xO(){return navigator.maxTouchPoints||"ontouchstart"in this}function OS(){var e=gO,t=mO,n=yO,r=xO,s={},o=ad("start","drag","end"),i=0,l,a,c,u,f=0;function d(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",h,pO).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,E){if(!(u||!e.call(this,w,E))){var C=g(this,t.call(this,w,E),w,E,"mouse");C&&(Zt(w.view).on("mousemove.drag",m,Vl).on("mouseup.drag",v,Vl),MS(w.view),Ef(w),c=!1,l=w.clientX,a=w.clientY,C("start",w))}}function m(w){if(qo(w),!c){var E=w.clientX-l,C=w.clientY-a;c=E*E+C*C>f}s.mouse("drag",w)}function v(w){Zt(w.view).on("mousemove.drag mouseup.drag",null),_S(w.view,c),qo(w),s.mouse("end",w)}function b(w,E){if(e.call(this,w,E)){var C=w.changedTouches,R=t.call(this,w,E),k=C.length,N,I;for(N=0;N<k;++N)(I=g(this,R,w,E,C[N].identifier,C[N]))&&(Ef(w),I("start",w,C[N]))}}function h(w){var E=w.changedTouches,C=E.length,R,k;for(R=0;R<C;++R)(k=s[E[R].identifier])&&(qo(w),k("drag",w,E[R]))}function y(w){var E=w.changedTouches,C=E.length,R,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),R=0;R<C;++R)(k=s[E[R].identifier])&&(Ef(w),k("end",w,E[R]))}function g(w,E,C,R,k,N){var I=o.copy(),j=Pn(N||C,E),L,A,P;if((P=n.call(w,new hp("beforestart",{sourceEvent:C,target:d,identifier:k,active:i,x:j[0],y:j[1],dx:0,dy:0,dispatch:I}),R))!=null)return L=P.x-j[0]||0,A=P.y-j[1]||0,function M(z,D,T){var _=j,O;switch(z){case"start":s[k]=M,O=i++;break;case"end":delete s[k],--i;case"drag":j=Pn(T||D,E),O=i;break}I.call(z,w,new hp(z,{sourceEvent:D,subject:P,target:d,identifier:k,active:O,x:j[0]+L,y:j[1]+A,dx:j[0]-_[0],dy:j[1]-_[1],dispatch:I}),R)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:sc(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:sc(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:sc(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:sc(!!w),d):r},d.on=function(){var w=o.on.apply(o,arguments);return w===o?d:w},d.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,d):Math.sqrt(f)},d}function sm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function AS(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xa(){}var Wl=.7,Su=1/Wl,Qo="\\s*([+-]?\\d+)\\s*",Ul="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vO=/^#([0-9a-f]{3,8})$/,wO=new RegExp(`^rgb\\(${Qo},${Qo},${Qo}\\)$`),bO=new RegExp(`^rgb\\(${er},${er},${er}\\)$`),SO=new RegExp(`^rgba\\(${Qo},${Qo},${Qo},${Ul}\\)$`),EO=new RegExp(`^rgba\\(${er},${er},${er},${Ul}\\)$`),kO=new RegExp(`^hsl\\(${Ul},${er},${er}\\)$`),CO=new RegExp(`^hsla\\(${Ul},${er},${er},${Ul}\\)$`),Xy={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};sm(xa,io,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gy,formatHex:Gy,formatHex8:RO,formatHsl:PO,formatRgb:Zy,toString:Zy});function Gy(){return this.rgb().formatHex()}function RO(){return this.rgb().formatHex8()}function PO(){return jS(this).formatHsl()}function Zy(){return this.rgb().formatRgb()}function io(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=vO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Jy(t):n===3?new Vt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?oc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?oc(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=wO.exec(e))?new Vt(t[1],t[2],t[3],1):(t=bO.exec(e))?new Vt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=SO.exec(e))?oc(t[1],t[2],t[3],t[4]):(t=EO.exec(e))?oc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kO.exec(e))?nx(t[1],t[2]/100,t[3]/100,1):(t=CO.exec(e))?nx(t[1],t[2]/100,t[3]/100,t[4]):Xy.hasOwnProperty(e)?Jy(Xy[e]):e==="transparent"?new Vt(NaN,NaN,NaN,0):null}function Jy(e){return new Vt(e>>16&255,e>>8&255,e&255,1)}function oc(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vt(e,t,n,r)}function TO(e){return e instanceof xa||(e=io(e)),e?(e=e.rgb(),new Vt(e.r,e.g,e.b,e.opacity)):new Vt}function pp(e,t,n,r){return arguments.length===1?TO(e):new Vt(e,t,n,r??1)}function Vt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sm(Vt,pp,AS(xa,{brighter(e){return e=e==null?Su:Math.pow(Su,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wl:Math.pow(Wl,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vt(Gs(this.r),Gs(this.g),Gs(this.b),Eu(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:ex,formatHex:ex,formatHex8:NO,formatRgb:tx,toString:tx}));function ex(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}`}function NO(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}${Fs((isNaN(this.opacity)?1:this.opacity)*255)}`}function tx(){const e=Eu(this.opacity);return`${e===1?"rgb(":"rgba("}${Gs(this.r)}, ${Gs(this.g)}, ${Gs(this.b)}${e===1?")":`, ${e})`}`}function Eu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fs(e){return e=Gs(e),(e<16?"0":"")+e.toString(16)}function nx(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Nn(e,t,n,r)}function jS(e){if(e instanceof Nn)return new Nn(e.h,e.s,e.l,e.opacity);if(e instanceof xa||(e=io(e)),!e)return new Nn;if(e instanceof Nn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,l=o-s,a=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=a<.5?o+s:2-o-s,i*=60):l=a>0&&a<1?0:i,new Nn(i,l,a,e.opacity)}function IO(e,t,n,r){return arguments.length===1?jS(e):new Nn(e,t,n,r??1)}function Nn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sm(Nn,IO,AS(xa,{brighter(e){return e=e==null?Su:Math.pow(Su,e),new Nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wl:Math.pow(Wl,e),new Nn(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,s=2*n-r;return new Vt(kf(e>=240?e-240:e+120,s,r),kf(e,s,r),kf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Nn(rx(this.h),ic(this.s),ic(this.l),Eu(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=Eu(this.opacity);return`${e===1?"hsl(":"hsla("}${rx(this.h)}, ${ic(this.s)*100}%, ${ic(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rx(e){return e=(e||0)%360,e<0?e+360:e}function ic(e){return Math.max(0,Math.min(1,e||0))}function kf(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 om=e=>()=>e;function MO(e,t){return function(n){return e+n*t}}function _O(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 OO(e){return(e=+e)==1?zS:function(t,n){return n-t?_O(t,n,e):om(isNaN(t)?n:t)}}function zS(e,t){var n=t-e;return n?MO(e,n):om(isNaN(e)?t:e)}const ku=function e(t){var n=OO(t);function r(s,o){var i=n((s=pp(s)).r,(o=pp(o)).r),l=n(s.g,o.g),a=n(s.b,o.b),c=zS(s.opacity,o.opacity);return function(u){return s.r=i(u),s.g=l(u),s.b=a(u),s.opacity=c(u),s+""}}return r.gamma=e,r}(1);function AO(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function jO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function zO(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=wl(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(l){for(i=0;i<r;++i)o[i]=s[i](l);return o}}function DO(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function FO(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=wl(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var gp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cf=new RegExp(gp.source,"g");function LO(e){return function(){return e}}function $O(e){return function(t){return e(t)+""}}function DS(e,t){var n=gp.lastIndex=Cf.lastIndex=0,r,s,o,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=gp.exec(e))&&(s=Cf.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,a.push({i,x:qn(r,s)})),n=Cf.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?a[0]?$O(a[0].x):LO(t):(t=a.length,function(c){for(var u=0,f;u<t;++u)l[(f=a[u]).i]=f.x(c);return l.join("")})}function wl(e,t){var n=typeof t,r;return t==null||n==="boolean"?om(t):(n==="number"?qn:n==="string"?(r=io(t))?(t=r,ku):DS:t instanceof io?ku:t instanceof Date?DO:jO(t)?AO:Array.isArray(t)?zO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?FO:qn)(e,t)}var sx=180/Math.PI,mp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function FS(e,t,n,r,s,o){var i,l,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*sx,skewX:Math.atan(a)*sx,scaleX:i,scaleY:l}}var lc;function HO(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mp:FS(t.a,t.b,t.c,t.d,t.e,t.f)}function BO(e){return e==null||(lc||(lc=document.createElementNS("http://www.w3.org/2000/svg","g")),lc.setAttribute("transform",e),!(e=lc.transform.baseVal.consolidate()))?mp:(e=e.matrix,FS(e.a,e.b,e.c,e.d,e.e,e.f))}function LS(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,u,f,d,p,m){if(c!==f||u!==d){var v=p.push("translate(",null,t,null,n);m.push({i:v-4,x:qn(c,f)},{i:v-2,x:qn(u,d)})}else(f||d)&&p.push("translate("+f+t+d+n)}function i(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(s(f)+"rotate(",null,r)-2,x:qn(c,u)})):u&&f.push(s(f)+"rotate("+u+r)}function l(c,u,f,d){c!==u?d.push({i:f.push(s(f)+"skewX(",null,r)-2,x:qn(c,u)}):u&&f.push(s(f)+"skewX("+u+r)}function a(c,u,f,d,p,m){if(c!==f||u!==d){var v=p.push(s(p)+"scale(",null,",",null,")");m.push({i:v-4,x:qn(c,f)},{i:v-2,x:qn(u,d)})}else(f!==1||d!==1)&&p.push(s(p)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),i(c.rotate,u.rotate,f,d),l(c.skewX,u.skewX,f,d),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(p){for(var m=-1,v=d.length,b;++m<v;)f[(b=d[m]).i]=b.x(p);return f.join("")}}}var VO=LS(HO,"px, ","px)","deg)"),WO=LS(BO,", ",")",")"),UO=1e-12;function ox(e){return((e=Math.exp(e))+1/e)/2}function KO(e){return((e=Math.exp(e))-1/e)/2}function YO(e){return((e=Math.exp(2*e))-1)/(e+1)}const jc=function e(t,n,r){function s(o,i){var l=o[0],a=o[1],c=o[2],u=i[0],f=i[1],d=i[2],p=u-l,m=f-a,v=p*p+m*m,b,h;if(v<UO)h=Math.log(d/c)/t,b=function(R){return[l+R*p,a+R*m,c*Math.exp(t*R*h)]};else{var y=Math.sqrt(v),g=(d*d-c*c+r*v)/(2*c*n*y),w=(d*d-c*c-r*v)/(2*d*n*y),E=Math.log(Math.sqrt(g*g+1)-g),C=Math.log(Math.sqrt(w*w+1)-w);h=(C-E)/t,b=function(R){var k=R*h,N=ox(E),I=c/(n*y)*(N*YO(t*k+E)-KO(E));return[l+I*p,a+I*m,c*N/ox(t*k+E)]}}return b.duration=h*1e3*t/Math.SQRT2,b}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,a=l*l;return e(i,l,a)},s}(Math.SQRT2,2,4);var Si=0,cl=0,el=0,$S=1e3,Cu,ul,Ru=0,lo=0,ud=0,Kl=typeof performance=="object"&&performance.now?performance:Date,HS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function im(){return lo||(HS(qO),lo=Kl.now()+ud)}function qO(){lo=0}function Pu(){this._call=this._time=this._next=null}Pu.prototype=BS.prototype={constructor:Pu,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?im():+n)+(t==null?0:+t),!this._next&&ul!==this&&(ul?ul._next=this:Cu=this,ul=this),this._call=e,this._time=n,yp()},stop:function(){this._call&&(this._call=null,this._time=1/0,yp())}};function BS(e,t,n){var r=new Pu;return r.restart(e,t,n),r}function QO(){im(),++Si;for(var e=Cu,t;e;)(t=lo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Si}function ix(){lo=(Ru=Kl.now())+ud,Si=cl=0;try{QO()}finally{Si=0,GO(),lo=0}}function XO(){var e=Kl.now(),t=e-Ru;t>$S&&(ud-=t,Ru=e)}function GO(){for(var e,t=Cu,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:Cu=n);ul=e,yp(r)}function yp(e){if(!Si){cl&&(cl=clearTimeout(cl));var t=e-lo;t>24?(e<1/0&&(cl=setTimeout(ix,e-Kl.now()-ud)),el&&(el=clearInterval(el))):(el||(Ru=Kl.now(),el=setInterval(XO,$S)),Si=1,HS(ix))}}function lx(e,t,n){var r=new Pu;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var ZO=ad("start","end","cancel","interrupt"),JO=[],VS=0,ax=1,xp=2,zc=3,cx=4,vp=5,Dc=6;function dd(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;e2(e,n,{name:t,index:r,group:s,on:ZO,tween:JO,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:VS})}function lm(e,t){var n=Dn(e,t);if(n.state>VS)throw new Error("too late; already scheduled");return n}function nr(e,t){var n=Dn(e,t);if(n.state>zc)throw new Error("too late; already running");return n}function Dn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function e2(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=BS(o,0,n.time);function o(c){n.state=ax,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,f,d,p;if(n.state!==ax)return a();for(u in r)if(p=r[u],p.name===n.name){if(p.state===zc)return lx(i);p.state===cx?(p.state=Dc,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[u]):+u<t&&(p.state=Dc,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[u])}if(lx(function(){n.state===zc&&(n.state=cx,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=xp,n.on.call("start",e,e.__data__,n.index,n.group),n.state===xp){for(n.state=zc,s=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(p=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(s[++f]=p);s.length=f+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=vp,1),f=-1,d=s.length;++f<d;)s[f].call(e,u);n.state===vp&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Dc,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Fc(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>xp&&r.state<vp,r.state=Dc,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function t2(e){return this.each(function(){Fc(this,e)})}function n2(e,t){var n,r;return function(){var s=nr(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function r2(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=nr(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},a=0,c=s.length;a<c;++a)if(s[a].name===t){s[a]=l;break}a===c&&s.push(l)}o.tween=s}}function s2(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Dn(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?n2:r2)(n,e,t))}function am(e,t,n){var r=e._id;return e.each(function(){var s=nr(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Dn(s,r).value[t]}}function WS(e,t){var n;return(typeof t=="number"?qn:t instanceof io?ku:(n=io(t))?(t=n,ku):DS)(e,t)}function o2(e){return function(){this.removeAttribute(e)}}function i2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function l2(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function a2(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function c2(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function u2(e,t,n){var r,s,o;return function(){var i,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=l+"",i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l)))}}function d2(e,t){var n=cd(e),r=n==="transform"?WO:WS;return this.attrTween(e,typeof t=="function"?(n.local?u2:c2)(n,r,am(this,"attr."+e,t)):t==null?(n.local?i2:o2)(n):(n.local?a2:l2)(n,r,t))}function f2(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function h2(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function p2(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&h2(e,o)),n}return s._value=t,s}function g2(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&f2(e,o)),n}return s._value=t,s}function m2(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=cd(e);return this.tween(n,(r.local?p2:g2)(r,t))}function y2(e,t){return function(){lm(this,e).delay=+t.apply(this,arguments)}}function x2(e,t){return t=+t,function(){lm(this,e).delay=t}}function v2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?y2:x2)(t,e)):Dn(this.node(),t).delay}function w2(e,t){return function(){nr(this,e).duration=+t.apply(this,arguments)}}function b2(e,t){return t=+t,function(){nr(this,e).duration=t}}function S2(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?w2:b2)(t,e)):Dn(this.node(),t).duration}function E2(e,t){if(typeof t!="function")throw new Error;return function(){nr(this,e).ease=t}}function k2(e){var t=this._id;return arguments.length?this.each(E2(t,e)):Dn(this.node(),t).ease}function C2(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nr(this,e).ease=n}}function R2(e){if(typeof e!="function")throw new Error;return this.each(C2(this._id,e))}function P2(e){typeof e!="function"&&(e=bS(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],a,c=0;c<i;++c)(a=o[c])&&e.call(a,a.__data__,c,o)&&l.push(a);return new Rr(r,this._parents,this._name,this._id)}function T2(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var a=t[l],c=n[l],u=a.length,f=i[l]=new Array(u),d,p=0;p<u;++p)(d=a[p]||c[p])&&(f[p]=d);for(;l<r;++l)i[l]=t[l];return new Rr(i,this._parents,this._name,this._id)}function N2(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 I2(e,t,n){var r,s,o=N2(t)?lm:nr;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function M2(e,t){var n=this._id;return arguments.length<2?Dn(this.node(),n).on.on(e):this.each(I2(n,e,t))}function _2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function O2(){return this.on("end.remove",_2(this._id))}function A2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nm(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],a=l.length,c=o[i]=new Array(a),u,f,d=0;d<a;++d)(u=l[d])&&(f=e.call(u,u.__data__,d,l))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,dd(c[d],t,n,d,c,Dn(u,n)));return new Rr(o,this._parents,t,n)}function j2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wS(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var a=r[l],c=a.length,u,f=0;f<c;++f)if(u=a[f]){for(var d=e.call(u,u.__data__,f,a),p,m=Dn(u,n),v=0,b=d.length;v<b;++v)(p=d[v])&&dd(p,t,n,v,d,m);o.push(d),i.push(u)}return new Rr(o,i,t,n)}var z2=ya.prototype.constructor;function D2(){return new z2(this._groups,this._parents)}function F2(e,t){var n,r,s;return function(){var o=bi(this,e),i=(this.style.removeProperty(e),bi(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function US(e){return function(){this.style.removeProperty(e)}}function L2(e,t,n){var r,s=n+"",o;return function(){var i=bi(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function $2(e,t,n){var r,s,o;return function(){var i=bi(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),bi(this,e))),i===a?null:i===r&&a===s?o:(s=a,o=t(r=i,l))}}function H2(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var a=nr(this,e),c=a.on,u=a.value[o]==null?l||(l=US(t)):void 0;(c!==n||s!==u)&&(r=(n=c).copy()).on(i,s=u),a.on=r}}function B2(e,t,n){var r=(e+="")=="transform"?VO:WS;return t==null?this.styleTween(e,F2(e,r)).on("end.style."+e,US(e)):typeof t=="function"?this.styleTween(e,$2(e,r,am(this,"style."+e,t))).each(H2(this._id,e)):this.styleTween(e,L2(e,r,t),n).on("end.style."+e,null)}function V2(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function W2(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&V2(e,i,n)),r}return o._value=t,o}function U2(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,W2(e,t,n??""))}function K2(e){return function(){this.textContent=e}}function Y2(e){return function(){var t=e(this);this.textContent=t??""}}function q2(e){return this.tween("text",typeof e=="function"?Y2(am(this,"text",e)):K2(e==null?"":e+""))}function Q2(e){return function(t){this.textContent=e.call(this,t)}}function X2(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&Q2(s)),t}return r._value=e,r}function G2(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,X2(e))}function Z2(){for(var e=this._name,t=this._id,n=KS(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)if(a=i[c]){var u=Dn(a,t);dd(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Rr(r,this._parents,e,n)}function J2(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},a={value:function(){--s===0&&o()}};n.each(function(){var c=nr(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),c.on=t}),s===0&&o()})}var eA=0;function Rr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function KS(){return++eA}var or=ya.prototype;Rr.prototype={constructor:Rr,select:A2,selectAll:j2,selectChild:or.selectChild,selectChildren:or.selectChildren,filter:P2,merge:T2,selection:D2,transition:Z2,call:or.call,nodes:or.nodes,node:or.node,size:or.size,empty:or.empty,each:or.each,on:M2,attr:d2,attrTween:m2,style:B2,styleTween:U2,text:q2,textTween:G2,remove:O2,tween:s2,delay:v2,duration:S2,ease:k2,easeVarying:R2,end:J2,[Symbol.iterator]:or[Symbol.iterator]};function tA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nA={time:null,delay:0,duration:250,ease:tA};function rA(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 sA(e){var t,n;e instanceof Rr?(t=e._id,e=e._name):(t=KS(),(n=nA).time=im(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,a,c=0;c<l;++c)(a=i[c])&&dd(a,e,t,c,i,n||rA(a,t));return new Rr(r,this._parents,e,t)}ya.prototype.interrupt=t2;ya.prototype.transition=sA;const ac=e=>()=>e;function oA(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){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:s}})}function mr(e,t,n){this.k=e,this.x=t,this.y=n}mr.prototype={constructor:mr,scale:function(e){return e===1?this:new mr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new mr(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 fd=new mr(1,0,0);YS.prototype=mr.prototype;function YS(e){for(;!e.__zoom;)if(!(e=e.parentNode))return fd;return e.__zoom}function Rf(e){e.stopImmediatePropagation()}function tl(e){e.preventDefault(),e.stopImmediatePropagation()}function iA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lA(){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 ux(){return this.__zoom||fd}function aA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cA(){return navigator.maxTouchPoints||"ontouchstart"in this}function uA(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function qS(){var e=iA,t=lA,n=uA,r=aA,s=cA,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=jc,c=ad("start","zoom","end"),u,f,d,p=500,m=150,v=0,b=10;function h(P){P.property("__zoom",ux).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",j).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(P,M,z,D){var T=P.selection?P.selection():P;T.property("__zoom",ux),P!==T?E(P,M,z,D):T.interrupt().each(function(){C(this,arguments).event(D).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},h.scaleBy=function(P,M,z,D){h.scaleTo(P,function(){var T=this.__zoom.k,_=typeof M=="function"?M.apply(this,arguments):M;return T*_},z,D)},h.scaleTo=function(P,M,z,D){h.transform(P,function(){var T=t.apply(this,arguments),_=this.__zoom,O=z==null?w(T):typeof z=="function"?z.apply(this,arguments):z,B=_.invert(O),$=typeof M=="function"?M.apply(this,arguments):M;return n(g(y(_,$),O,B),T,i)},z,D)},h.translateBy=function(P,M,z,D){h.transform(P,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),i)},null,D)},h.translateTo=function(P,M,z,D,T){h.transform(P,function(){var _=t.apply(this,arguments),O=this.__zoom,B=D==null?w(_):typeof D=="function"?D.apply(this,arguments):D;return n(fd.translate(B[0],B[1]).scale(O.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof z=="function"?-z.apply(this,arguments):-z),_,i)},D,T)};function y(P,M){return M=Math.max(o[0],Math.min(o[1],M)),M===P.k?P:new mr(M,P.x,P.y)}function g(P,M,z){var D=M[0]-z[0]*P.k,T=M[1]-z[1]*P.k;return D===P.x&&T===P.y?P:new mr(P.k,D,T)}function w(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function E(P,M,z,D){P.on("start.zoom",function(){C(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(D).end()}).tween("zoom",function(){var T=this,_=arguments,O=C(T,_).event(D),B=t.apply(T,_),$=z==null?w(B):typeof z=="function"?z.apply(T,_):z,V=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Y=T.__zoom,U=typeof M=="function"?M.apply(T,_):M,K=a(Y.invert($).concat(V/Y.k),U.invert($).concat(V/U.k));return function(Q){if(Q===1)Q=U;else{var H=K(Q),W=V/H[2];Q=new mr(W,$[0]-H[0]*W,$[1]-H[1]*W)}O.zoom(null,Q)}})}function C(P,M,z){return!z&&P.__zooming||new R(P,M)}function R(P,M){this.that=P,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,M),this.taps=0}R.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,M){return this.mouse&&P!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var M=Zt(this.that).datum();c.call(P,this.that,new oA(P,{sourceEvent:this.sourceEvent,target:h,transform:this.that.__zoom,dispatch:c}),M)}};function k(P,...M){if(!e.apply(this,arguments))return;var z=C(this,M).event(P),D=this.__zoom,T=Math.max(o[0],Math.min(o[1],D.k*Math.pow(2,r.apply(this,arguments)))),_=Pn(P);if(z.wheel)(z.mouse[0][0]!==_[0]||z.mouse[0][1]!==_[1])&&(z.mouse[1]=D.invert(z.mouse[0]=_)),clearTimeout(z.wheel);else{if(D.k===T)return;z.mouse=[_,D.invert(_)],Fc(this),z.start()}tl(P),z.wheel=setTimeout(O,m),z.zoom("mouse",n(g(y(D,T),z.mouse[0],z.mouse[1]),z.extent,i));function O(){z.wheel=null,z.end()}}function N(P,...M){if(d||!e.apply(this,arguments))return;var z=P.currentTarget,D=C(this,M,!0).event(P),T=Zt(P.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",V,!0),_=Pn(P,z),O=P.clientX,B=P.clientY;MS(P.view),Rf(P),D.mouse=[_,this.__zoom.invert(_)],Fc(this),D.start();function $(Y){if(tl(Y),!D.moved){var U=Y.clientX-O,K=Y.clientY-B;D.moved=U*U+K*K>v}D.event(Y).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=Pn(Y,z),D.mouse[1]),D.extent,i))}function V(Y){T.on("mousemove.zoom mouseup.zoom",null),_S(Y.view,D.moved),tl(Y),D.event(Y).end()}}function I(P,...M){if(e.apply(this,arguments)){var z=this.__zoom,D=Pn(P.changedTouches?P.changedTouches[0]:P,this),T=z.invert(D),_=z.k*(P.shiftKey?.5:2),O=n(g(y(z,_),D,T),t.apply(this,M),i);tl(P),l>0?Zt(this).transition().duration(l).call(E,O,D,P):Zt(this).call(h.transform,O,D,P)}}function j(P,...M){if(e.apply(this,arguments)){var z=P.touches,D=z.length,T=C(this,M,P.changedTouches.length===D).event(P),_,O,B,$;for(Rf(P),O=0;O<D;++O)B=z[O],$=Pn(B,this),$=[$,this.__zoom.invert($),B.identifier],T.touch0?!T.touch1&&T.touch0[2]!==$[2]&&(T.touch1=$,T.taps=0):(T.touch0=$,_=!0,T.taps=1+!!u);u&&(u=clearTimeout(u)),_&&(T.taps<2&&(f=$[0],u=setTimeout(function(){u=null},p)),Fc(this),T.start())}}function L(P,...M){if(this.__zooming){var z=C(this,M).event(P),D=P.changedTouches,T=D.length,_,O,B,$;for(tl(P),_=0;_<T;++_)O=D[_],B=Pn(O,this),z.touch0&&z.touch0[2]===O.identifier?z.touch0[0]=B:z.touch1&&z.touch1[2]===O.identifier&&(z.touch1[0]=B);if(O=z.that.__zoom,z.touch1){var V=z.touch0[0],Y=z.touch0[1],U=z.touch1[0],K=z.touch1[1],Q=(Q=U[0]-V[0])*Q+(Q=U[1]-V[1])*Q,H=(H=K[0]-Y[0])*H+(H=K[1]-Y[1])*H;O=y(O,Math.sqrt(Q/H)),B=[(V[0]+U[0])/2,(V[1]+U[1])/2],$=[(Y[0]+K[0])/2,(Y[1]+K[1])/2]}else if(z.touch0)B=z.touch0[0],$=z.touch0[1];else return;z.zoom("touch",n(g(O,B,$),z.extent,i))}}function A(P,...M){if(this.__zooming){var z=C(this,M).event(P),D=P.changedTouches,T=D.length,_,O;for(Rf(P),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),_=0;_<T;++_)O=D[_],z.touch0&&z.touch0[2]===O.identifier?delete z.touch0:z.touch1&&z.touch1[2]===O.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(O=Pn(O,this),Math.hypot(f[0]-O[0],f[1]-O[1])<b)){var B=Zt(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return h.wheelDelta=function(P){return arguments.length?(r=typeof P=="function"?P:ac(+P),h):r},h.filter=function(P){return arguments.length?(e=typeof P=="function"?P:ac(!!P),h):e},h.touchable=function(P){return arguments.length?(s=typeof P=="function"?P:ac(!!P),h):s},h.extent=function(P){return arguments.length?(t=typeof P=="function"?P:ac([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),h):t},h.scaleExtent=function(P){return arguments.length?(o[0]=+P[0],o[1]=+P[1],h):[o[0],o[1]]},h.translateExtent=function(P){return arguments.length?(i[0][0]=+P[0][0],i[1][0]=+P[1][0],i[0][1]=+P[0][1],i[1][1]=+P[1][1],h):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},h.constrain=function(P){return arguments.length?(n=P,h):n},h.duration=function(P){return arguments.length?(l=+P,h):l},h.interpolate=function(P){return arguments.length?(a=P,h):a},h.on=function(){var P=c.on.apply(c,arguments);return P===c?h:P},h.clickDistance=function(P){return arguments.length?(v=(P=+P)*P,h):Math.sqrt(v)},h.tapDistance=function(P){return arguments.length?(b=+P,h):b},h}const jn={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.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 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.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Yl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],QS=["Enter"," ","Escape"],XS={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ei;(function(e){e.Strict="strict",e.Loose="loose"})(Ei||(Ei={}));var Zs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zs||(Zs={}));var ql;(function(e){e.Partial="partial",e.Full="full"})(ql||(ql={}));const GS={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Wr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Wr||(Wr={}));var Tu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tu||(Tu={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const dx={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function ZS(e){return e===null?null:e?"valid":"invalid"}const JS=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,dA=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),cm=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),va=(e,t=[0,0])=>{const{width:n,height:r}=Fn(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},fA=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((s,o)=>{const i=typeof o=="string";let l=!t.nodeLookup&&!i?o:void 0;return t.nodeLookup&&(l=i?t.nodeLookup.get(o):cm(o)?o:t.nodeLookup.get(o.id)),l?(n=!0,hd(s,Nu(l,t.nodeOrigin))):s},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?pd(r):{x:0,y:0,width:0,height:0}},wa=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=hd(n,Nu(s)),r=!0)}),r?pd(n):{x:0,y:0,width:0,height:0}},um=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l=(t.x-n)/s,a=(t.y-r)/s,c=t.width/s,u=t.height/s,f=[];for(const d of e.values()){const{measured:p,selectable:m=!0,hidden:v=!1}=d;if(i&&!m||v)continue;const b=p.width??d.width??d.initialWidth??0,h=p.height??d.height??d.initialHeight??0,{x:y,y:g}=d.internals.positionAbsolute,w=rE(l,a,c,u,y,g,b,h),E=b*h,C=o&&w>0;(!d.internals.handleBounds||C||w>=E||d.dragging)&&f.push(d)}return f},hA=(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 pA(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{let o;if(t!=null&&t.includeHiddenNodes){const{width:i,height:l}=Fn(s);o=i>0&&l>0}else o=!!(s.measured.width&&s.measured.height&&!s.hidden);o&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function gA({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return!0;const l=pA(e,i),a=wa(l),c=fm(a,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),!0}function eE({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:a,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let f=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",jn.error005());else{const{width:p,height:m}=Fn(l);p&&m&&(f=[[a,c],[a+p,c+m]])}else l&&co(i.extent)&&(f=[[i.extent[0][0]+a,i.extent[0][1]+c],[i.extent[1][0]+a,i.extent[1][1]+c]]);const d=co(f)?ao(t,f,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",jn.error015())),{position:{x:d.x-a+(i.measured.width??0)*u[0],y:d.y-c+(i.measured.height??0)*u[1]},positionAbsolute:d}}async function mA({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(d=>d.id)),i=[];for(const d of n){if(d.deletable===!1)continue;const p=o.has(d.id),m=!p&&d.parentId&&i.find(v=>v.id===d.parentId);(p||m)&&i.push(d)}const l=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),u=hA(i,a);for(const d of a)l.has(d.id)&&!u.find(m=>m.id===d.id)&&u.push(d);if(!s)return{edges:u,nodes:i};const f=await s({nodes:i,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:i}:{edges:[],nodes:[]}:f}const ki=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ao=(e={x:0,y:0},t,n)=>({x:ki(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ki(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function tE(e,t,n){const{width:r,height:s}=Fn(n),{x:o,y:i}=n.internals.positionAbsolute;return ao(e,[[o,i],[o+r,i+s]],t)}const fx=(e,t,n)=>e<t?ki(Math.abs(e-t),1,t)/t:e>n?-ki(Math.abs(e-n),1,t)/t:0,dm=(e,t,n=15,r=40)=>{const s=fx(e.x,r,t.width-r)*n,o=fx(e.y,r,t.height-r)*n;return[s,o]},hd=(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)}),wp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),pd=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ql=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=cm(e)?e.internals.positionAbsolute:va(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Nu=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=cm(e)?e.internals.positionAbsolute:va(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},nE=(e,t)=>pd(hd(wp(e),wp(t))),rE=(e,t,n,r,s,o,i,l)=>{const a=Math.max(0,Math.min(e+n,s+i)-Math.max(e,s)),c=Math.max(0,Math.min(t+r,o+l)-Math.max(t,o));return Math.ceil(a*c)},Iu=(e,t)=>rE(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),hx=e=>In(e.width)&&In(e.height)&&In(e.x)&&In(e.y),In=e=>!isNaN(e)&&isFinite(e),sE=(e,t)=>(n,r)=>{},ba=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Sa=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?ba(l,i):l},Ci=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Po(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yA(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Po(e,n),s=Po(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Po(e.top??e.y??0,n),s=Po(e.bottom??e.y??0,n),o=Po(e.left??e.x??0,t),i=Po(e.right??e.x??0,t);return{top:r,right:i,bottom:s,left:o,x:o+i,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function xA(e,t,n,r,s,o){const{x:i,y:l}=Ci(e,[t,n,r]),{x:a,y:c}=Ci({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=s-a,f=o-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(u),bottom:Math.floor(f)}}const fm=(e,t,n,r,s,o)=>{const i=yA(o,t,n),l=(t-i.x)/e.width,a=(n-i.y)/e.height,c=Math.min(l,a),u=ki(c,r,s),f=e.x+e.width/2,d=e.y+e.height/2,p=t/2-f*u,m=n/2-d*u,v=xA(e,p,m,u,t,n),b={left:Math.min(v.left-i.left,0),top:Math.min(v.top-i.top,0),right:Math.min(v.right-i.right,0),bottom:Math.min(v.bottom-i.bottom,0)};return{x:p-b.left+b.right,y:m-b.top+b.bottom,zoom:u}},Xl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function co(e){return e!=null&&e!=="parent"}function Fn(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 oE(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 iE(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function px(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function vA(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function wA(e){return{...XS,...e||{}}}function bl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Mn(e),l=Sa({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:a,y:c}=n?ba(l,t):l;return{xSnapped:a,ySnapped:c,...l}}const hm=e=>({width:e.offsetWidth,height:e.offsetHeight}),lE=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},bA=["INPUT","SELECT","TEXTAREA"];function aE(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:bA.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const cE=e=>"clientX"in e,Mn=(e,t)=>{var o,i;const n=cE(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},gx=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...hm(i)}})};function uE({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const a=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,u=Math.abs(a-e),f=Math.abs(c-t);return[a,c,u,f]}function cc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function mx({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case he.Left:return[t-cc(t-r,o),n];case he.Right:return[t+cc(r-t,o),n];case he.Top:return[t,n-cc(n-s,o)];case he.Bottom:return[t,n+cc(s-n,o)]}}function dE({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,curvature:i=.25}){const[l,a]=mx({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,u]=mx({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[f,d,p,m]=uE({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${a} ${c},${u} ${r},${s}`,f,d,p,m]}function fE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function SA({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const i=s&&n?r+1e3:r,l=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+l}function EA({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=hd(Nu(e),Nu(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Iu(i,pd(o))>0}const kA=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,CA=(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)),RA=(e,t,n={})=>{var o;if(!e.source||!e.target)return(o=n.onError)==null||o.call(n,"006",jn.error006()),t;const r=n.getEdgeId||kA;let s;return JS(e)?s={...e}:s={...e,id:r(e)},CA(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function hE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=fE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const yx={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},PA=({source:e,sourcePosition:t=he.Bottom,target:n})=>t===he.Left||t===he.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},xx=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function TA({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:s,offset:o,stepPosition:i}){const l=yx[t],a=yx[r],c={x:e.x+l.x*o,y:e.y+l.y*o},u={x:n.x+a.x*o,y:n.y+a.y*o},f=PA({source:c,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",p=f[d];let m=[],v,b;const h={x:0,y:0},y={x:0,y:0},[,,g,w]=fE({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*a[d]===-1){d==="x"?(v=s.x??c.x+(u.x-c.x)*i,b=s.y??(c.y+u.y)/2):(v=s.x??(c.x+u.x)/2,b=s.y??c.y+(u.y-c.y)*i);const k=[{x:v,y:c.y},{x:v,y:u.y}],N=[{x:c.x,y:b},{x:u.x,y:b}];l[d]===p?m=d==="x"?k:N:m=d==="x"?N:k}else{const k=[{x:c.x,y:u.y}],N=[{x:u.x,y:c.y}];if(d==="x"?m=l.x===p?N:k:m=l.y===p?k:N,t===r){const P=Math.abs(e[d]-n[d]);if(P<=o){const M=Math.min(o-1,o-P);l[d]===p?h[d]=(c[d]>e[d]?-1:1)*M:y[d]=(u[d]>n[d]?-1:1)*M}}if(t!==r){const P=d==="x"?"y":"x",M=l[d]===a[P],z=c[P]>u[P],D=c[P]<u[P];(l[d]===1&&(!M&&z||M&&D)||l[d]!==1&&(!M&&D||M&&z))&&(m=d==="x"?k:N)}const I={x:c.x+h.x,y:c.y+h.y},j={x:u.x+y.x,y:u.y+y.y},L=Math.max(Math.abs(I.x-m[0].x),Math.abs(j.x-m[0].x)),A=Math.max(Math.abs(I.y-m[0].y),Math.abs(j.y-m[0].y));L>=A?(v=(I.x+j.x)/2,b=m[0].y):(v=m[0].x,b=(I.y+j.y)/2)}const E={x:c.x+h.x,y:c.y+h.y},C={x:u.x+y.x,y:u.y+y.y};return[[e,...E.x!==m[0].x||E.y!==m[0].y?[E]:[],...m,...C.x!==m[m.length-1].x||C.y!==m[m.length-1].y?[C]:[],n],v,b,g,w]}function NA(e,t,n,r){const s=Math.min(xx(e,t)/2,xx(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*u}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${o},${i+s*a}Q ${o},${i} ${o+s*l},${i}`}function bp({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20,stepPosition:u=.5}){const[f,d,p,m,v]=TA({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:a},offset:c,stepPosition:u});let b=`M${f[0].x} ${f[0].y}`;for(let h=1;h<f.length-1;h++)b+=NA(f[h-1],f[h],f[h+1],i);return b+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[b,d,p,m,v]}function vx(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function IA(e){var f;const{sourceNode:t,targetNode:n}=e;if(!vx(t)||!vx(n))return null;const r=t.internals.handleBounds||wx(t.handles),s=n.internals.handleBounds||wx(n.handles),o=bx((r==null?void 0:r.source)??[],e.sourceHandle),i=bx(e.connectionMode===Ei.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(f=e.onError)==null||f.call(e,"008",jn.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||he.Bottom,a=(i==null?void 0:i.position)||he.Top,c=uo(t,o,l),u=uo(n,i,a);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:a}}function wx(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 uo(e,t,n=he.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??Fn(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case he.Top:return{x:s+i/2,y:o};case he.Right:return{x:s+i,y:o+l/2};case he.Bottom:return{x:s+i/2,y:o+l};case he.Left:return{x:s,y:o+l/2}}}function bx(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Sp(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function MA(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(a=>{if(a&&typeof a=="object"){const c=Sp(a,t);o.has(c)||(i.push({id:c,color:a.color||n,...a}),o.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const pE=1e3,_A=10,pm={nodeOrigin:[0,0],nodeExtent:Yl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},OA={...pm,checkEquality:!0};function gm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function AA(e,t,n){const r=gm(pm,n);for(const s of e.values())if(s.parentId)ym(s,e,t,r);else{const o=va(s,r.nodeOrigin),i=co(s.extent)?s.extent:r.nodeExtent,l=ao(o,i,Fn(s));s.internals.positionAbsolute=l}}function jA(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function mm(e){return e==="manual"}function Ep(e,t,n,r={}){var u,f;const s=gm(OA,r),o={i:0},i=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!mm(s.zIndexMode)?pE:0;let a=e.length>0,c=!1;t.clear(),n.clear();for(const d of e){let p=i.get(d.id);if(s.checkEquality&&d===(p==null?void 0:p.internals.userNode))t.set(d.id,p);else{const m=va(d,s.nodeOrigin),v=co(d.extent)?d.extent:s.nodeExtent,b=ao(m,v,Fn(d));p={...s.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:b,handleBounds:jA(d,p),z:gE(d,l,s.zIndexMode),userNode:d}},t.set(d.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(a=!1),d.parentId&&ym(p,t,n,r,o),c||(c=d.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:c}}function zA(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 ym(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l,zIndexMode:a}=gm(pm,r),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}zA(e,n),s&&!u.parentId&&u.internals.rootParentIndex===void 0&&a==="auto"&&(u.internals.rootParentIndex=++s.i,u.internals.z=u.internals.z+s.i*_A),s&&u.internals.rootParentIndex!==void 0&&(s.i=u.internals.rootParentIndex);const f=o&&!mm(a)?pE:0,{x:d,y:p,z:m}=DA(e,u,i,l,f,a),{positionAbsolute:v}=e.internals,b=d!==v.x||p!==v.y;(b||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:d,y:p}:v,z:m}})}function gE(e,t,n){const r=In(e.zIndex)?e.zIndex:0;return mm(n)?r:r+(e.selected?t:0)}function DA(e,t,n,r,s,o){const{x:i,y:l}=t.internals.positionAbsolute,a=Fn(e),c=va(e,n),u=co(e.extent)?ao(c,e.extent,a):c;let f=ao({x:i+u.x,y:l+u.y},r,a);e.extent==="parent"&&(f=tE(f,a,t));const d=gE(e,s,o),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=d?p+1:d}}function xm(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??Ql(a),u=nE(c,l.rect);o.set(l.parentId,{expandedRect:u,parent:a})}return o.size>0&&o.forEach(({expandedRect:l,parent:a},c)=>{var g;const u=a.internals.positionAbsolute,f=Fn(a),d=a.origin??r,p=l.x<u.x?Math.round(Math.abs(u.x-l.x)):0,m=l.y<u.y?Math.round(Math.abs(u.y-l.y)):0,v=Math.max(f.width,Math.round(l.width)),b=Math.max(f.height,Math.round(l.height)),h=(v-f.width)*d[0],y=(b-f.height)*d[1];(p>0||m>0||h||y)&&(s.push({id:c,type:"position",position:{x:a.position.x-p+h,y:a.position.y-m+y}}),(g=n.get(c))==null||g.forEach(w=>{e.some(E=>E.id===w.id)||s.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+m}})})),(f.width<l.width||f.height<l.height||p||m)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?d[0]*p-h:0),height:b+(m?d[1]*m-y:0)}})}),s}function FA(e,t,n,r,s,o,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],u=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const p of e.values()){const m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),a=!0;continue}const v=hm(p.nodeElement),b=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!m.internals.handleBounds||p.force))){const y=p.nodeElement.getBoundingClientRect(),g=co(m.extent)?m.extent:o;let{positionAbsolute:w}=m.internals;if(m.parentId&&m.extent==="parent"){const C=t.get(m.parentId);C&&(w=tE(w,v,C))}else g&&(w=ao(w,g,v));const E={...m,measured:v,internals:{...m.internals,positionAbsolute:w,handleBounds:{source:gx("source",p.nodeElement,y,f,m.id),target:gx("target",p.nodeElement,y,f,m.id)}}};t.set(m.id,E),m.parentId&&ym(E,t,n,{nodeOrigin:s,zIndexMode:i}),a=!0,b&&(c.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&d.push({id:m.id,parentId:m.parentId,rect:Ql(E,s)}))}}if(d.length>0){const p=xm(d,t,n,s);c.push(...p)}return{changes:c,updatedInternals:a}}async function LA({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return!1;const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r);return!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2])}function Sx(e,t,n,r,s,o){let i=s;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${s}-${e}`;const a=r.get(i)||new Map;if(r.set(i,a.set(n,t)),o){i=`${s}-${e}-${o}`;const c=r.get(i)||new Map;r.set(i,c.set(n,t))}}function mE(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,a={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},c=`${s}-${i}--${o}-${l}`,u=`${o}-${l}--${s}-${i}`;Sx("source",a,u,e,s,i),Sx("target",a,c,e,o,l),t.set(r.id,r)}}function yE(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:yE(n,t):!1}function Ex(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function $A(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!yE(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,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 s}function Pf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,a;const s=[];for(const[c,u]of t){const f=(i=n.get(c))==null?void 0:i.internals.userNode;f&&s.push({...f,position:u.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((a=t.get(e))==null?void 0:a.position)||o.position,dragging:r}:s[0],s]}function HA({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},i=ba(o,t);return{x:i.x-o.x,y:i.y-o.y}}function BA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,a=!1,c={x:0,y:0},u=null,f=!1,d=null,p=!1,m=!1,v=null;function b({noDragClassName:y,handleSelector:g,domNode:w,isSelectable:E,nodeId:C,nodeClickDistance:R=0}){d=Zt(w);function k({x:L,y:A}){const{nodeLookup:P,nodeExtent:M,snapGrid:z,snapToGrid:D,nodeOrigin:T,onNodeDrag:_,onSelectionDrag:O,onError:B,updateNodePositions:$}=t();o={x:L,y:A};let V=!1;const Y=l.size>1,U=Y&&M?wp(wa(l)):null,K=Y&&D?HA({dragItems:l,snapGrid:z,x:L,y:A}):null;for(const[Q,H]of l){if(!P.has(Q))continue;let W={x:L-H.distance.x,y:A-H.distance.y};D&&(W=K?{x:Math.round(W.x+K.x),y:Math.round(W.y+K.y)}:ba(W,z));let G=null;if(Y&&M&&!H.extent&&U){const{positionAbsolute:q}=H.internals,te=q.x-U.x+M[0][0],le=q.x+H.measured.width-U.x2+M[1][0],Z=q.y-U.y+M[0][1],ee=q.y+H.measured.height-U.y2+M[1][1];G=[[te,Z],[le,ee]]}const{position:J,positionAbsolute:X}=eE({nodeId:Q,nextPosition:W,nodeLookup:P,nodeExtent:G||M,nodeOrigin:T,onError:B});V=V||H.position.x!==J.x||H.position.y!==J.y,H.position=J,H.internals.positionAbsolute=X}if(m=m||V,!!V&&($(l,!0),v&&(r||_||!C&&O))){const[Q,H]=Pf({nodeId:C,dragItems:l,nodeLookup:P});r==null||r(v,l,Q,H),_==null||_(v,Q,H),C||O==null||O(v,H)}}async function N(){if(!u)return;const{transform:L,panBy:A,autoPanSpeed:P,autoPanOnNodeDrag:M}=t();if(!M){a=!1,cancelAnimationFrame(i);return}const[z,D]=dm(c,u,P);(z!==0||D!==0)&&(o.x=(o.x??0)-z/L[2],o.y=(o.y??0)-D/L[2],await A({x:z,y:D})&&k(o)),i=requestAnimationFrame(N)}function I(L){var Y;const{nodeLookup:A,multiSelectionActive:P,nodesDraggable:M,transform:z,snapGrid:D,snapToGrid:T,selectNodesOnDrag:_,onNodeDragStart:O,onSelectionDragStart:B,unselectNodesAndEdges:$}=t();f=!0,(!_||!E)&&!P&&C&&((Y=A.get(C))!=null&&Y.selected||$()),E&&_&&C&&(e==null||e(C));const V=bl(L.sourceEvent,{transform:z,snapGrid:D,snapToGrid:T,containerBounds:u});if(o=V,l=$A(A,M,V,C),l.size>0&&(n||O||!C&&B)){const[U,K]=Pf({nodeId:C,dragItems:l,nodeLookup:A});n==null||n(L.sourceEvent,l,U,K),O==null||O(L.sourceEvent,U,K),C||B==null||B(L.sourceEvent,K)}}const j=OS().clickDistance(R).on("start",L=>{const{domNode:A,nodeDragThreshold:P,transform:M,snapGrid:z,snapToGrid:D}=t();u=(A==null?void 0:A.getBoundingClientRect())||null,p=!1,m=!1,v=L.sourceEvent,P===0&&I(L),o=bl(L.sourceEvent,{transform:M,snapGrid:z,snapToGrid:D,containerBounds:u}),c=Mn(L.sourceEvent,u)}).on("drag",L=>{const{autoPanOnNodeDrag:A,transform:P,snapGrid:M,snapToGrid:z,nodeDragThreshold:D,nodeLookup:T}=t(),_=bl(L.sourceEvent,{transform:P,snapGrid:M,snapToGrid:z,containerBounds:u});if(v=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||C&&!T.has(C))&&(p=!0),!p){if(!a&&A&&f&&(a=!0,N()),!f){const O=Mn(L.sourceEvent,u),B=O.x-c.x,$=O.y-c.y;Math.sqrt(B*B+$*$)>D&&I(L)}(o.x!==_.xSnapped||o.y!==_.ySnapped)&&l&&f&&(c=Mn(L.sourceEvent,u),k(_))}}).on("end",L=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,f=!1,cancelAnimationFrame(i),l.size>0){const{nodeLookup:A,updateNodePositions:P,onNodeDragStop:M,onSelectionDragStop:z}=t();if(m&&(P(l,!1),m=!1),s||M||!C&&z){const[D,T]=Pf({nodeId:C,dragItems:l,nodeLookup:A,dragging:!1});s==null||s(L.sourceEvent,l,D,T),M==null||M(L.sourceEvent,D,T),C||z==null||z(L.sourceEvent,T)}}}).filter(L=>{const A=L.target;return!L.button&&(!y||!Ex(A,`.${y}`,w))&&(!g||Ex(A,g,w))});d.call(j)}function h(){d==null||d.on(".drag",null)}return{update:b,destroy:h}}function VA(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Iu(s,Ql(o))>0&&r.push(o);return r}const WA=250;function UA(e,t,n,r){var l,a;let s=[],o=1/0;const i=VA(e,n,t+WA);for(const c of i){const u=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((a=c.internals.handleBounds)==null?void 0:a.target)??[]];for(const f of u){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:p}=uo(c,f,f.position,!0),m=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(p-e.y,2));m>t||(m<o?(s=[{...f,x:d,y:p}],o=m):m===o&&s.push({...f,x:d,y:p}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(u=>u.type===c)??s[0]}return s[0]}function xE(e,t,n,r,s,o=!1){var c,u,f;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((u=i.internals.handleBounds)==null?void 0:u.source)??[],...((f=i.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return a&&o?{...a,...uo(i,a,a.position,!0)}:a}function vE(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function KA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const wE=()=>!0;function YA(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:a,lib:c,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:p,onConnectStart:m,onConnect:v,onConnectEnd:b,isValidConnection:h=wE,onReconnectEnd:y,updateConnection:g,getTransform:w,getFromHandle:E,autoPanSpeed:C,dragThreshold:R=1,handleDomNode:k}){const N=lE(e.target);let I=0,j;const{x:L,y:A}=Mn(e),P=vE(o,k),M=l==null?void 0:l.getBoundingClientRect();let z=!1;if(!M||!P)return;const D=xE(s,P,r,a,t);if(!D)return;let T=Mn(e,M),_=!1,O=null,B=!1,$=null;function V(){if(!u||!M)return;const[J,X]=dm(T,M,C);d({x:J,y:X}),I=requestAnimationFrame(V)}const Y={...D,nodeId:s,type:P,position:D.position},U=a.get(s);let Q={inProgress:!0,isValid:null,from:uo(U,Y,he.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:U,to:T,toHandle:null,toPosition:dx[Y.position],toNode:null,pointer:T};function H(){z=!0,g(Q),m==null||m(e,{nodeId:s,handleId:r,handleType:P})}R===0&&H();function W(J){if(!z){const{x:ee,y:fe}=Mn(J),oe=ee-L,xe=fe-A;if(!(oe*oe+xe*xe>R*R))return;H()}if(!E()||!Y){G(J);return}const X=w();T=Mn(J,M),j=UA(Sa(T,X,!1,[1,1]),n,a,Y),_||(V(),_=!0);const q=bE(J,{handle:j,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:h,doc:N,lib:c,flowId:f,nodeLookup:a});$=q.handleDomNode,O=q.connection,B=KA(!!j,q.isValid);const te=a.get(s),le=te?uo(te,Y,he.Left,!0):Q.from,Z={...Q,from:le,isValid:B,to:q.toHandle&&B?Ci({x:q.toHandle.x,y:q.toHandle.y},X):T,toHandle:q.toHandle,toPosition:B&&q.toHandle?q.toHandle.position:dx[Y.position],toNode:q.toHandle?a.get(q.toHandle.nodeId):null,pointer:T};g(Z),Q=Z}function G(J){if(!("touches"in J&&J.touches.length>0)){if(z){(j||$)&&O&&B&&(v==null||v(O));const{inProgress:X,...q}=Q,te={...q,toPosition:Q.toHandle?Q.toPosition:null};b==null||b(J,te),o&&(y==null||y(J,te))}p(),cancelAnimationFrame(I),_=!1,B=!1,O=null,$=null,N.removeEventListener("mousemove",W),N.removeEventListener("mouseup",G),N.removeEventListener("touchmove",W),N.removeEventListener("touchend",G)}}N.addEventListener("mousemove",W),N.addEventListener("mouseup",G),N.addEventListener("touchmove",W),N.addEventListener("touchend",G)}function bE(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:a,isValidConnection:c=wE,nodeLookup:u}){const f=o==="target",d=t?i.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=Mn(e),v=i.elementFromPoint(p,m),b=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:d,h={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=vE(void 0,b),g=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),E=b.classList.contains("connectable"),C=b.classList.contains("connectableend");if(!g||!y)return h;const R={source:f?g:r,sourceHandle:f?w:s,target:f?r:g,targetHandle:f?s:w};h.connection=R;const N=E&&C&&(n===Ei.Strict?f&&y==="source"||!f&&y==="target":g!==r||w!==s);h.isValid=N&&c(R),h.toHandle=xE(g,y,w,u,n,!0)}return h}const kp={onPointerDown:YA,isValid:bE};function qA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Zt(e);function o({translateExtent:l,width:a,height:c,zoomStep:u=1,pannable:f=!0,zoomable:d=!0,inversePan:p=!1}){const m=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const w=n(),E=g.sourceEvent.ctrlKey&&Xl()?10:1,C=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*u,R=w[2]*Math.pow(2,C*E);t.scaleTo(R)};let v=[0,0];const b=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},h=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const E=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],C=[E[0]-v[0],E[1]-v[1]];v=E;const R=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),k={x:w[0]-C[0]*R,y:w[1]-C[1]*R},N=[[0,0],[a,c]];t.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},N,l)},y=qS().on("start",b).on("zoom",f?h:null).on("zoom.wheel",d?m:null);s.call(y,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:Pn}}const gd=e=>({x:e.x,y:e.y,zoom:e.k}),Tf=({x:e,y:t,zoom:n})=>fd.translate(e,t).scale(n),Hr=(e,t)=>e.target.closest(`.${t}`),SE=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),QA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Nf=(e,t=0,n=QA,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},EE=e=>{const t=e.ctrlKey&&Xl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function XA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:c}){return u=>{if(Hr(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&i){const b=Pn(u),h=EE(u),y=f*Math.pow(2,h);r.scaleTo(n,y,b,u);return}const d=u.deltaMode===1?20:1;let p=s===Zs.Vertical?0:u.deltaX*d,m=s===Zs.Horizontal?0:u.deltaY*d;!Xl()&&u.shiftKey&&s!==Zs.Vertical&&(p=u.deltaY*d,m=0),r.translateBy(n,-(p/f)*o,-(m/f)*o,{internal:!0});const v=gd(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(u,v):(e.isPanScrolling=!0,l==null||l(u,v)),e.panScrollTimeout=setTimeout(()=>{c==null||c(u,v),e.isPanScrolling=!1},150)}}function GA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=Hr(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function ZA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=gd(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function JA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&SE(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,gd(o.transform)))}}function ej({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&SE(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const a=gd(i.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,a)},n?150:0)}}}function tj({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:a,noPanClassName:c,lib:u,connectionInProgress:f}){return d=>{var h;const p=t||n,m=r&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Hr(d,`${u}-flow__node`)||Hr(d,`${u}-flow__edge`)||Hr(d,`${u}-flow__selection`)||Hr(d,`${u}-flow__nodesselection`)))return!0;if(!s&&!p&&!o&&!i&&!r||l||f&&!v||Hr(d,a)&&v||Hr(d,c)&&(!v||o&&v&&!t)||!r&&d.ctrlKey&&v)return!1;if(!r&&d.type==="touchstart"&&((h=d.touches)==null?void 0:h.length)>1)return d.preventDefault(),!1;if(!p&&!o&&!m&&v||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const b=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v||e)&&b}}function nj({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:a}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect();let f=[[0,0],[u.width,u.height]];const d=typeof ResizeObserver<"u"?new ResizeObserver(A=>{const P=A[0];P&&(f=[[0,0],[P.contentRect.width,P.contentRect.height]])}):null;d==null||d.observe(e);const p=qS().extent(()=>f).scaleExtent([t,n]).translateExtent(r),m=Zt(e).call(p);w({x:s.x,y:s.y,zoom:ki(s.zoom,t,n)},[[0,0],[u.width,u.height]],r);const v=m.on("wheel.zoom"),b=m.on("dblclick.zoom");p.wheelDelta(EE);async function h(A,P){return m?new Promise(M=>{p==null||p.interpolate((P==null?void 0:P.interpolate)==="linear"?wl:jc).transform(Nf(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>M(!0)),A)}):!1}function y({noWheelClassName:A,noPanClassName:P,onPaneContextMenu:M,userSelectionActive:z,panOnScroll:D,panOnDrag:T,panOnScrollMode:_,panOnScrollSpeed:O,preventScrolling:B,zoomOnPinch:$,zoomOnScroll:V,zoomOnDoubleClick:Y,panActivationKeyPressed:U=!1,zoomActivationKeyPressed:K,lib:Q,onTransformChange:H,connectionInProgress:W,paneClickDistance:G,selectionOnDrag:J}){z&&!c.isZoomingOrPanning&&g();const X=D&&!K&&!z;p.clickDistance(J?1/0:!In(G)||G<0?0:G);const q=X?XA({zoomPanValues:c,noWheelClassName:A,d3Selection:m,d3Zoom:p,panOnScrollMode:_,panOnScrollSpeed:O,zoomOnPinch:$,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:l}):GA({noWheelClassName:A,preventScrolling:B,d3ZoomHandler:v});m.on("wheel.zoom",q,{passive:!1});const te=ZA({zoomPanValues:c,onDraggingChange:a,onPanZoomStart:i});p.on("start",te);const le=JA({zoomPanValues:c,panOnDrag:T,onPaneContextMenu:!!M,onPanZoom:o,onTransformChange:H});p.on("zoom",le);const Z=ej({zoomPanValues:c,panOnDrag:T,panOnScroll:D,onPaneContextMenu:M,onPanZoomEnd:l,onDraggingChange:a});p.on("end",Z);const ee=tj({panActivationKeyPressed:U,zoomActivationKeyPressed:K,panOnDrag:T,zoomOnScroll:V,panOnScroll:D,zoomOnDoubleClick:Y,zoomOnPinch:$,userSelectionActive:z,noPanClassName:P,noWheelClassName:A,lib:Q,connectionInProgress:W});p.filter(ee),Y?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}function g(){p.on("zoom",null)}async function w(A,P,M){const z=Tf(A),D=p==null?void 0:p.constrain()(z,P,M);return D&&await h(D),D}async function E(A,P){const M=Tf(A);return await h(M,P),M}function C(A){if(m){const P=Tf(A),M=m.property("__zoom");(M.k!==A.zoom||M.x!==A.x||M.y!==A.y)&&(p==null||p.transform(m,P,null,{sync:!0}))}}function R(){const A=m?YS(m.node()):{x:0,y:0,k:1};return{x:A.x,y:A.y,zoom:A.k}}async function k(A,P){return m?new Promise(M=>{p==null||p.interpolate((P==null?void 0:P.interpolate)==="linear"?wl:jc).scaleTo(Nf(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>M(!0)),A)}):!1}async function N(A,P){return m?new Promise(M=>{p==null||p.interpolate((P==null?void 0:P.interpolate)==="linear"?wl:jc).scaleBy(Nf(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>M(!0)),A)}):!1}function I(A){p==null||p.scaleExtent(A)}function j(A){p==null||p.translateExtent(A)}function L(A){const P=!In(A)||A<0?0:A;p==null||p.clickDistance(P)}return{update:y,destroy:g,setViewport:E,setViewportConstrained:w,getViewport:R,scaleTo:k,scaleBy:N,setScaleExtent:I,setTranslateExtent:j,syncViewport:C,setClickDistance:L}}var Ri;(function(e){e.Line="line",e.Handle="handle"})(Ri||(Ri={}));function rj({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,a=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(a[0]=a[0]*-1),l&&o&&(a[1]=a[1]*-1),a}function kx(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function zr(e,t){return Math.max(0,t-e)}function Dr(e,t){return Math.max(0,e-t)}function uc(e,t,n){return Math.max(0,t-e,e-n)}function Cx(e,t){return e?!t:t}function sj(e,t,n,r,s,o,i,l){let{affectsX:a,affectsY:c}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:v,maxWidth:b,minHeight:h,maxHeight:y}=r,{x:g,y:w,width:E,height:C,aspectRatio:R}=e;let k=Math.floor(u?p-e.pointerX:0),N=Math.floor(f?m-e.pointerY:0);const I=E+(a?-k:k),j=C+(c?-N:N),L=-o[0]*E,A=-o[1]*C;let P=uc(I,v,b),M=uc(j,h,y);if(i){let T=0,_=0;a&&k<0?T=zr(g+k+L,i[0][0]):!a&&k>0&&(T=Dr(g+I+L,i[1][0])),c&&N<0?_=zr(w+N+A,i[0][1]):!c&&N>0&&(_=Dr(w+j+A,i[1][1])),P=Math.max(P,T),M=Math.max(M,_)}if(l){let T=0,_=0;a&&k>0?T=Dr(g+k,l[0][0]):!a&&k<0&&(T=zr(g+I,l[1][0])),c&&N>0?_=Dr(w+N,l[0][1]):!c&&N<0&&(_=zr(w+j,l[1][1])),P=Math.max(P,T),M=Math.max(M,_)}if(s){if(u){const T=uc(I/R,h,y)*R;if(P=Math.max(P,T),i){let _=0;!a&&!c||a&&!c&&d?_=Dr(w+A+I/R,i[1][1])*R:_=zr(w+A+(a?k:-k)/R,i[0][1])*R,P=Math.max(P,_)}if(l){let _=0;!a&&!c||a&&!c&&d?_=zr(w+I/R,l[1][1])*R:_=Dr(w+(a?k:-k)/R,l[0][1])*R,P=Math.max(P,_)}}if(f){const T=uc(j*R,v,b)/R;if(M=Math.max(M,T),i){let _=0;!a&&!c||c&&!a&&d?_=Dr(g+j*R+L,i[1][0])/R:_=zr(g+(c?N:-N)*R+L,i[0][0])/R,M=Math.max(M,_)}if(l){let _=0;!a&&!c||c&&!a&&d?_=zr(g+j*R,l[1][0])/R:_=Dr(g+(c?N:-N)*R,l[0][0])/R,M=Math.max(M,_)}}}N=N+(N<0?M:-M),k=k+(k<0?P:-P),s&&(d?I>j*R?N=(Cx(a,c)?-k:k)/R:k=(Cx(a,c)?-N:N)*R:u?(N=k/R,c=a):(k=N*R,a=c));const z=a?g+k:g,D=c?w+N:w;return{width:E+(a?-k:k),height:C+(c?-N:N),x:o[0]*k*(a?-1:1)+z,y:o[1]*N*(c?-1:1)+D}}const kE={width:0,height:0,x:0,y:0},oj={...kE,pointerX:0,pointerY:0,aspectRatio:1};function ij(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,a=n[1]*i;return[[r-l,s-a],[r+o-l,s+i-a]]}function lj({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=Zt(e);let i={controlDirection:kx("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:u,keepAspectRatio:f,resizeDirection:d,onResizeStart:p,onResize:m,onResizeEnd:v,shouldResize:b}){let h={...kE},y={...oj};i={boundaries:u,resizeDirection:d,keepAspectRatio:f,controlDirection:kx(c)};let g,w=null,E=[],C,R,k,N=!1;const I=OS().on("start",j=>{const{nodeLookup:L,transform:A,snapGrid:P,snapToGrid:M,nodeOrigin:z,paneDomNode:D}=n();if(g=L.get(t),!g)return;w=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:T,ySnapped:_}=bl(j.sourceEvent,{transform:A,snapGrid:P,snapToGrid:M,containerBounds:w});h={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},y={...h,pointerX:T,pointerY:_,aspectRatio:h.width/h.height},C=void 0,R=co(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(C=L.get(g.parentId)),C&&g.extent==="parent"&&(R=[[0,0],[C.measured.width,C.measured.height]]),E=[],k=void 0;for(const[O,B]of L)if(B.parentId===t&&(E.push({id:O,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const $=ij(B,g,B.origin??z);k?k=[[Math.min($[0][0],k[0][0]),Math.min($[0][1],k[0][1])],[Math.max($[1][0],k[1][0]),Math.max($[1][1],k[1][1])]]:k=$}p==null||p(j,{...h})}).on("drag",j=>{const{transform:L,snapGrid:A,snapToGrid:P,nodeOrigin:M}=n(),z=bl(j.sourceEvent,{transform:L,snapGrid:A,snapToGrid:P,containerBounds:w}),D=[];if(!g)return;const{x:T,y:_,width:O,height:B}=h,$={},V=g.origin??M,{width:Y,height:U,x:K,y:Q}=sj(y,i.controlDirection,z,i.boundaries,i.keepAspectRatio,V,R,k),H=Y!==O,W=U!==B,G=K!==T&&H,J=Q!==_&&W;if(!G&&!J&&!H&&!W)return;if((G||J||V[0]===1||V[1]===1)&&($.x=G?K:h.x,$.y=J?Q:h.y,h.x=$.x,h.y=$.y,E.length>0)){const le=K-T,Z=Q-_;for(const ee of E)ee.position={x:ee.position.x-le+V[0]*(Y-O),y:ee.position.y-Z+V[1]*(U-B)},D.push(ee)}if((H||W)&&($.width=H&&(!i.resizeDirection||i.resizeDirection==="horizontal")?Y:h.width,$.height=W&&(!i.resizeDirection||i.resizeDirection==="vertical")?U:h.height,h.width=$.width,h.height=$.height),C&&g.expandParent){const le=V[0]*($.width??0);$.x&&$.x<le&&(h.x=le,y.x=y.x-($.x-le));const Z=V[1]*($.height??0);$.y&&$.y<Z&&(h.y=Z,y.y=y.y-($.y-Z))}const X=rj({width:h.width,prevWidth:O,height:h.height,prevHeight:B,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),q={...h,direction:X};(b==null?void 0:b(j,q))!==!1&&(N=!0,m==null||m(j,q),r($,D))}).on("end",j=>{N&&(v==null||v(j,{...h}),s==null||s({...h}),N=!1)});o.call(I)}function a(){o.on(".drag",null)}return{update:l,destroy:a}}var CE={exports:{}},RE={},PE={exports:{}},TE={};/**
|
|
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 Pi=S;function aj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cj=typeof Object.is=="function"?Object.is:aj,uj=Pi.useState,dj=Pi.useEffect,fj=Pi.useLayoutEffect,hj=Pi.useDebugValue;function pj(e,t){var n=t(),r=uj({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return fj(function(){s.value=n,s.getSnapshot=t,If(s)&&o({inst:s})},[e,n,t]),dj(function(){return If(s)&&o({inst:s}),e(function(){If(s)&&o({inst:s})})},[e]),hj(n),n}function If(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cj(e,n)}catch{return!0}}function gj(e,t){return t()}var mj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gj:pj;TE.useSyncExternalStore=Pi.useSyncExternalStore!==void 0?Pi.useSyncExternalStore:mj;PE.exports=TE;var md=PE.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 yd=S,yj=md;function xj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vj=typeof Object.is=="function"?Object.is:xj,wj=yj.useSyncExternalStore,bj=yd.useRef,Sj=yd.useEffect,Ej=yd.useMemo,kj=yd.useDebugValue;RE.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=bj(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=Ej(function(){function a(p){if(!c){if(c=!0,u=p,p=r(p),s!==void 0&&i.hasValue){var m=i.value;if(s(m,p))return f=m}return f=p}if(m=f,vj(u,p))return m;var v=r(p);return s!==void 0&&s(m,v)?(u=p,m):(u=p,f=v)}var c=!1,u,f,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,s]);var l=wj(e,o[0],o[1]);return Sj(function(){i.hasValue=!0,i.value=l},[l]),kj(l),l};CE.exports=RE;var NE=CE.exports;const Cj=cw(NE),Rj={},Rx=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(m=>m(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Rj?"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()}},c=t=e(r,s,a);return a},Pj=e=>e?Rx(e):Rx,{useDebugValue:Tj}=ww,{useSyncExternalStoreWithSelector:Nj}=Cj,Ij=e=>e;function IE(e,t=Ij,n){const r=Nj(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Tj(r),r}const Px=(e,t)=>{const n=Pj(e),r=(s,o=t)=>IE(n,s,o);return Object.assign(r,n),r},Mj=(e,t)=>e?Px(e,t):Px;function Xe(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,s]of e)if(!Object.is(s,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 xd=S.createContext(null),_j=xd.Provider,ME=jn.error001("react");function Ne(e,t){const n=S.useContext(xd);if(n===null)throw new Error(ME);return IE(n,e,t)}function We(){const e=S.useContext(xd);if(e===null)throw new Error(ME);return S.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Tx={display:"none"},Oj={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},_E="react-flow__node-desc",OE="react-flow__edge-desc",Aj="react-flow__aria-live",jj=e=>e.ariaLiveMessage,zj=e=>e.ariaLabelConfig;function Dj({rfId:e}){const t=Ne(jj);return x.jsx("div",{id:`${Aj}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Oj,children:t})}function Fj({rfId:e,disableKeyboardA11y:t}){const n=Ne(zj);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${_E}-${e}`,style:Tx,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${OE}-${e}`,style:Tx,children:n["edge.a11yDescription.default"]}),!t&&x.jsx(Dj,{rfId:e})]})}const vd=S.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return x.jsx("div",{className:st(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});vd.displayName="Panel";const Nx="https://reactflow.dev?utm_source=attribution";function Lj({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:x.jsx(vd,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Nx}`,children:x.jsx("a",{href:Nx,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $j=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}},dc=e=>e.id;function Hj(e,t){return Xe(e.selectedNodes.map(dc),t.selectedNodes.map(dc))&&Xe(e.selectedEdges.map(dc),t.selectedEdges.map(dc))}function Bj({onSelectionChange:e}){const t=We(),{selectedNodes:n,selectedEdges:r}=Ne($j,Hj);return S.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const Vj=e=>!!e.onSelectionChangeHandlers;function Wj({onSelectionChange:e}){const t=Ne(Vj);return e||t?x.jsx(Bj,{onSelectionChange:e}):null}const AE=[0,0],Uj={x:0,y:0,zoom:1},Kj=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Ix=[...Kj,"rfId"],Yj=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}),Mx={translateExtent:Yl,nodeOrigin:AE,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function qj(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:a}=Ne(Yj,Xe),c=We();S.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{u.current=Mx,l()}),[]);const u=S.useRef(Mx);return S.useEffect(()=>{for(const f of Ix){const d=e[f],p=u.current[f];d!==p&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?r(d):f==="maxZoom"?s(d):f==="translateExtent"?o(d):f==="nodeExtent"?i(d):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:wA(d)}):f==="fitView"?c.setState({fitViewQueued:d}):f==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[f]:d})))}u.current=e},Ix.map(f=>e[f])),null}function _x(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Qj(e){var r;const[t,n]=S.useState(e==="system"?null:e);return S.useEffect(()=>{if(e!=="system"){n(e);return}const s=_x(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=_x())!=null&&r.matches?"dark":"light"}const Ox=typeof document<"u"?document:null;function Gl(e=null,t={target:Ox,actInsideInputWithModifier:!0}){const[n,r]=S.useState(!1),s=S.useRef(!1),o=S.useRef(new Set([])),[i,l]=S.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),u=c.reduce((f,d)=>f.concat(...d),[]);return[c,u]}return[[],[]]},[e]);return S.useEffect(()=>{const a=(t==null?void 0:t.target)??Ox,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const u=p=>{var b,h;if(s.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!s.current||s.current&&!c)&&aE(p))return!1;const v=jx(p.code,l);if(o.current.add(p[v]),Ax(i,o.current,!1)){const y=((h=(b=p.composedPath)==null?void 0:b.call(p))==null?void 0:h[0])||p.target,g=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(s.current||!g)&&p.preventDefault(),r(!0)}},f=p=>{const m=jx(p.code,l);Ax(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(p[m]),p.key==="Meta"&&o.current.clear(),s.current=!1},d=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",u),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",u),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Ax(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function jx(e,t){return t.includes(e)?"code":"key"}const Xj=()=>{const e=We();return S.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),a=fm(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:l,y:a}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-a},u=n.snapGrid??s,f=n.snapToGrid??o;return Sa(c,r,f,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Ci(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function jE(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const a of i)Gj(a,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function Gj(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={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Zj(e,t){return jE(e,t)}function Jj(e,t){return jE(e,t)}function Os(e,t){return{id:e,type:"select",selected:t}}function Ho(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(Os(o.id,i)))}return r}function zx({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),a=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Dx(e){return{id:e.id,type:"remove"}}const ez=sE();function tz(e,t,n={}){return RA(e,t,{...n,onError:n.onError??ez})}const Fx=e=>dA(e),nz=e=>JS(e);function zE(e){return S.forwardRef(e)}const DE=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Lx(e){const[t,n]=S.useState(BigInt(0)),[r]=S.useState(()=>rz(()=>n(s=>s+BigInt(1))));return DE(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function rz(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const FE=S.createContext(null);function sz({children:e}){const t=We(),n=S.useCallback(l=>{const{nodes:a=[],setNodes:c,hasDefaultNodes:u,onNodesChange:f,nodeLookup:d,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let v=a;for(const h of l)v=typeof h=="function"?h(v):h;let b=zx({items:v,lookup:d});for(const h of m.values())b=h(b);u&&c(v),b.length>0?f==null||f(b):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:h,nodes:y,setNodes:g}=t.getState();h&&g(y)})},[]),r=Lx(n),s=S.useCallback(l=>{const{edges:a=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:d}=t.getState();let p=a;for(const m of l)p=typeof m=="function"?m(p):m;u?c(p):f&&f(zx({items:p,lookup:d}))},[]),o=Lx(s),i=S.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return x.jsx(FE.Provider,{value:i,children:e})}function oz(){const e=S.useContext(FE);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const iz=e=>!!e.panZoom;function vm(){const e=Xj(),t=We(),n=oz(),r=Ne(iz),s=S.useMemo(()=>{const o=f=>t.getState().nodeLookup.get(f),i=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},a=f=>{var h,y;const{nodeLookup:d,nodeOrigin:p}=t.getState(),m=Fx(f)?f:d.get(f.id),v=m.parentId?iE(m.position,m.measured,m.parentId,d,p):m.position,b={...m,position:v,width:((h=m.measured)==null?void 0:h.width)??m.width,height:((y=m.measured)==null?void 0:y.height)??m.height};return Ql(b)},c=(f,d,p={replace:!1})=>{i(m=>m.map(v=>{if(v.id===f){const b=typeof d=="function"?d(v):d;return p.replace&&Fx(b)?b:{...v,...b}}return v}))},u=(f,d,p={replace:!1})=>{l(m=>m.map(v=>{if(v.id===f){const b=typeof d=="function"?d(v):d;return p.replace&&nz(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=o(f))==null?void 0:d.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:i,setEdges:l,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:p}=t.getState(),[m,v,b]=p;return{nodes:f.map(h=>({...h})),edges:d.map(h=>({...h})),viewport:{x:m,y:v,zoom:b}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:p,edges:m,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:h,triggerEdgeChanges:y,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:E,edges:C}=await mA({nodesToRemove:f,edgesToRemove:d,nodes:p,edges:m,onBeforeDelete:w}),R=C.length>0,k=E.length>0;if(R){const N=C.map(Dx);b==null||b(C),y(N)}if(k){const N=E.map(Dx);v==null||v(E),h(N)}return(k||R)&&(g==null||g({nodes:E,edges:C})),{deletedNodes:E,deletedEdges:C}},getIntersectingNodes:(f,d=!0,p)=>{const m=hx(f),v=m?f:a(f),b=p!==void 0;return v?(p||t.getState().nodes).filter(h=>{const y=t.getState().nodeLookup.get(h.id);if(y&&!m&&(h.id===f.id||!y.internals.positionAbsolute))return!1;const g=Ql(b?h:y),w=Iu(g,v);return d&&w>0||w>=g.width*g.height||w>=v.width*v.height}):[]},isNodeIntersecting:(f,d,p=!0)=>{const v=hx(f)?f:a(f);if(!v)return!1;const b=Iu(v,d);return p&&b>0||b>=d.width*d.height||b>=v.width*v.height},updateNode:c,updateNodeData:(f,d,p={replace:!1})=>{c(f,m=>{const v=typeof d=="function"?d(m):d;return p.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},p)},updateEdge:u,updateEdgeData:(f,d,p={replace:!1})=>{u(f,m=>{const v=typeof d=="function"?d(m):d;return p.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},p)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:p}=t.getState();return fA(f,{nodeLookup:d,nodeOrigin:p})},getHandleConnections:({type:f,id:d,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${d?`-${d}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:d,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const d=t.getState().fitViewResolver??vA();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(p=>[...p]),d.promise}}},[]);return S.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const $x=e=>e.selected,lz=typeof window<"u"?window:void 0;function az({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=We(),{deleteElements:r}=vm(),s=Gl(e,{actInsideInputWithModifier:!1}),o=Gl(t,{target:lz});S.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter($x),edges:i.filter($x)}),n.setState({nodesSelectionActive:!1})}},[s]),S.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function cz(e){const t=We();S.useEffect(()=>{const n=()=>{var s,o,i,l;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=hm(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",jn.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 wd={position:"absolute",width:"100%",height:"100%",top:0,left:0},uz=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function dz({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:s,panOnScrollSpeed:o=.5,panOnScrollMode:i=Zs.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:u,minZoom:f,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:m=!0,children:v,noWheelClassName:b,noPanClassName:h,onViewportChange:y,isControlledViewport:g,paneClickDistance:w,selectionOnDrag:E}){const C=We(),R=S.useRef(null),{userSelectionActive:k,lib:N,connectionInProgress:I}=Ne(uz,Xe),j=Gl(p),L=S.useRef();cz(R);const A=S.useCallback(P=>{y==null||y({x:P[0],y:P[1],zoom:P[2]}),g||C.setState({transform:P})},[y,g]);return S.useEffect(()=>{if(R.current){L.current=nj({domNode:R.current,minZoom:f,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:D=>C.setState(T=>T.paneDragging===D?T:{paneDragging:D}),onPanZoomStart:(D,T)=>{const{onViewportChangeStart:_,onMoveStart:O}=C.getState();O==null||O(D,T),_==null||_(T)},onPanZoom:(D,T)=>{const{onViewportChange:_,onMove:O}=C.getState();O==null||O(D,T),_==null||_(T)},onPanZoomEnd:(D,T)=>{const{onViewportChangeEnd:_,onMoveEnd:O}=C.getState();O==null||O(D,T),_==null||_(T)}});const{x:P,y:M,zoom:z}=L.current.getViewport();return C.setState({panZoom:L.current,transform:[P,M,z],domNode:R.current.closest(".react-flow")}),()=>{var D;(D=L.current)==null||D.destroy()}}},[]),S.useEffect(()=>{var P;(P=L.current)==null||P.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:s,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:j,preventScrolling:m,noPanClassName:h,userSelectionActive:k,noWheelClassName:b,lib:N,onTransformChange:A,connectionInProgress:I,selectionOnDrag:E,paneClickDistance:w})},[e,t,n,r,s,o,i,l,a,j,m,h,k,b,N,A,I,E,w]),x.jsx("div",{className:"react-flow__renderer",ref:R,style:wd,children:v})}const fz=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function hz(){const{userSelectionActive:e,userSelectionRect:t}=Ne(fz,Xe);return e&&t?x.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 Mf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},pz=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function gz({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ql.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:a,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:p,onPaneMouseLeave:m,children:v}){const b=S.useRef(0),h=We(),{userSelectionActive:y,elementsSelectable:g,dragging:w,panBy:E,autoPanSpeed:C}=Ne(pz,Xe),R=g&&(e||y),k=S.useRef(null),N=S.useRef(),I=S.useRef(new Set),j=S.useRef(new Set),L=S.useRef(!1),A=S.useRef(!1),P=S.useRef({x:0,y:0}),M=S.useRef(!1),z=H=>{if(A.current||L.current||h.getState().connection.inProgress){A.current=!1,L.current=!1;return}c==null||c(H),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},D=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}u==null||u(H)},T=f?H=>f(H):void 0,_=H=>{A.current&&(H.stopPropagation(),A.current=!1)},O=H=>{var ee,fe;if(H.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:W,transform:G}=h.getState();if(N.current=W==null?void 0:W.getBoundingClientRect(),!N.current)return;const J=H.target===k.current;if(!J&&!!H.target.closest(".nokey")||!e||!(i&&J||t)||H.button!==0||!H.isPrimary)return;(fe=(ee=H.target)==null?void 0:ee.setPointerCapture)==null||fe.call(ee,H.pointerId),A.current=!1;const{x:te,y:le}=Mn(H.nativeEvent,N.current),Z=Sa({x:te,y:le},G);h.setState({userSelectionRect:{width:0,height:0,startX:Z.x,startY:Z.y,x:te,y:le}}),J||(H.stopPropagation(),H.preventDefault())};function B(H,W){const{userSelectionRect:G}=h.getState();if(!G)return;const{transform:J,nodeLookup:X,edgeLookup:q,connectionLookup:te,triggerNodeChanges:le,triggerEdgeChanges:Z,defaultEdgeOptions:ee}=h.getState(),fe={x:G.startX,y:G.startY},{x:oe,y:xe}=Ci(fe,J),Re={startX:fe.x,startY:fe.y,x:H<oe?H:oe,y:W<xe?W:xe,width:Math.abs(H-oe),height:Math.abs(W-xe)},Se=I.current,Ae=j.current;I.current=new Set(um(X,Re,J,n===ql.Partial,!0).map(ie=>ie.id)),j.current=new Set;const se=(ee==null?void 0:ee.selectable)??!0;for(const ie of I.current){const _e=te.get(ie);if(_e)for(const{edgeId:ve}of _e.values()){const De=q.get(ve);De&&(De.selectable??se)&&j.current.add(ve)}}if(!px(Se,I.current)){const ie=Ho(X,I.current,!0);le(ie)}if(!px(Ae,j.current)){const ie=Ho(q,j.current);Z(ie)}h.setState({userSelectionRect:Re,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!s||!N.current)return;const[H,W]=dm(P.current,N.current,C);E({x:H,y:W}).then(G=>{if(!A.current||!G){b.current=requestAnimationFrame($);return}const{x:J,y:X}=P.current;B(J,X),b.current=requestAnimationFrame($)})}const V=()=>{cancelAnimationFrame(b.current),b.current=0,M.current=!1};S.useEffect(()=>()=>V(),[]);const Y=H=>{const{userSelectionRect:W,transform:G,resetSelectedElements:J}=h.getState();if(!N.current||!W)return;const{x:X,y:q}=Mn(H.nativeEvent,N.current);P.current={x:X,y:q};const te=Ci({x:W.startX,y:W.startY},G);if(!A.current){const le=t?0:o;if(Math.hypot(X-te.x,q-te.y)<=le)return;J(),l==null||l(H)}A.current=!0,M.current||($(),M.current=!0),B(X,q)},U=H=>{var W,G;if(!R){H.target===k.current&&h.getState().connection.inProgress&&(L.current=!0);return}H.button===0&&((G=(W=H.target)==null?void 0:W.releasePointerCapture)==null||G.call(W,H.pointerId),!y&&H.target===k.current&&h.getState().userSelectionRect&&(z==null||z(H)),h.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(a==null||a(H),h.setState({nodesSelectionActive:I.current.size>0})),V())},K=H=>{var W,G;(G=(W=H.target)==null?void 0:W.releasePointerCapture)==null||G.call(W,H.pointerId),V()},Q=r===!0||Array.isArray(r)&&r.includes(0);return x.jsxs("div",{className:st(["react-flow__pane",{draggable:Q,dragging:w,selection:e}]),onClick:R?void 0:Mf(z,k),onContextMenu:Mf(D,k),onWheel:Mf(T,k),onPointerEnter:R?void 0:d,onPointerMove:R?Y:p,onPointerUp:U,onPointerCancel:R?K:void 0,onPointerDownCapture:R?O:void 0,onClickCapture:R?_:void 0,onPointerLeave:m,ref:k,style:wd,children:[v,x.jsx(hz,{})]})}function Cp({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:a}=t.getState(),c=l.get(e);if(!c){a==null||a("012",jn.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):s([e])}function LE({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=We(),[a,c]=S.useState(!1),u=S.useRef();return S.useEffect(()=>{if(!t)return u.current=BA({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{Cp({id:f,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{var f;(f=u.current)==null||f.destroy(),u.current=void 0}},[t,l,e]),S.useEffect(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i})},[n,r,t,o,e,s,i]),a}const mz=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function $E(){const e=We();return S.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:a,nodeLookup:c,nodeOrigin:u}=e.getState(),f=new Map,d=mz(i),p=s?o[0]:5,m=s?o[1]:5,v=n.direction.x*p*n.factor,b=n.direction.y*m*n.factor;for(const[,h]of c){if(!d(h))continue;let y={x:h.internals.positionAbsolute.x+v,y:h.internals.positionAbsolute.y+b};s&&(y=ba(y,o));const{position:g,positionAbsolute:w}=eE({nodeId:h.id,nextPosition:y,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:l});h.position=g,h.internals.positionAbsolute=w,f.set(h.id,h)}a(f)},[])}const wm=S.createContext(null),yz=wm.Provider;wm.Consumer;const HE=()=>S.useContext(wm),xz=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),BE=S.createContext(null);function vz({children:e}){const t=Ne(xz,Xe);return x.jsx(BE.Provider,{value:t,children:e})}function wz(){const e=S.useContext(BE);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const bz={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Sz=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:a,isValid:c}=i;if(!l&&!s)return bz;const u=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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:u,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===Ei.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:u&&c}};function Ez({type:e="source",position:t=he.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:u,onTouchStart:f,...d},p){var M,z;const m=i||null,v=e==="target",b=We(),h=HE(),{connectOnClick:y,noPanClassName:g,rfId:w}=wz(),{connectingFrom:E,connectingTo:C,clickConnecting:R,isPossibleEndHandle:k,connectionInProcess:N,clickConnectionInProcess:I,valid:j}=Ne(Sz(h,m,e),Xe);h||(z=(M=b.getState()).onError)==null||z.call(M,"010",jn.error010());const L=D=>{const{defaultEdgeOptions:T,onConnect:_,hasDefaultEdges:O}=b.getState(),B={...T,...D};if(O){const{edges:$,setEdges:V,onError:Y}=b.getState();V(tz(B,$,{onError:Y}))}_==null||_(B),l==null||l(B)},A=D=>{if(!h)return;const T=cE(D.nativeEvent);if(s&&(T&&D.button===0||!T)){const _=b.getState();kp.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:_.autoPanOnConnect,connectionMode:_.connectionMode,connectionRadius:_.connectionRadius,domNode:_.domNode,nodeLookup:_.nodeLookup,lib:_.lib,isTarget:v,handleId:m,nodeId:h,flowId:_.rfId,panBy:_.panBy,cancelConnection:_.cancelConnection,onConnectStart:_.onConnectStart,onConnectEnd:(...O)=>{var B,$;return($=(B=b.getState()).onConnectEnd)==null?void 0:$.call(B,...O)},updateConnection:_.updateConnection,onConnect:L,isValidConnection:n||((...O)=>{var B,$;return(($=(B=b.getState()).isValidConnection)==null?void 0:$.call(B,...O))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:_.autoPanSpeed,dragThreshold:_.connectionDragThreshold})}T?u==null||u(D):f==null||f(D)},P=D=>{const{onClickConnectStart:T,onClickConnectEnd:_,connectionClickStartHandle:O,connectionMode:B,isValidConnection:$,lib:V,rfId:Y,nodeLookup:U,connection:K}=b.getState();if(!h||!O&&!s)return;if(!O){T==null||T(D.nativeEvent,{nodeId:h,handleId:m,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:h,type:e,id:m}});return}const Q=lE(D.target),H=n||$,{connection:W,isValid:G}=kp.isValid(D.nativeEvent,{handle:{nodeId:h,id:m,type:e},connectionMode:B,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:H,flowId:Y,doc:Q,lib:V,nodeLookup:U});G&&W&&L(W);const J=structuredClone(K);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,_==null||_(D,J),b.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":m,"data-nodeid":h,"data-handlepos":t,"data-id":`${w}-${h}-${m}-${e}`,className:st(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!v,target:v,connectable:r,connectablestart:s,connectableend:o,clickconnecting:R,connectingfrom:E,connectingto:C,valid:j,connectionindicator:r&&(!N||k)&&(N||I?o:s)}]),onMouseDown:A,onTouchStart:A,onClick:y?P:void 0,ref:p,...d,children:a})}const ys=S.memo(zE(Ez));function kz({data:e,isConnectable:t,sourcePosition:n=he.Bottom}){return x.jsxs(x.Fragment,{children:[e==null?void 0:e.label,x.jsx(ys,{type:"source",position:n,isConnectable:t})]})}function Cz({data:e,isConnectable:t,targetPosition:n=he.Top,sourcePosition:r=he.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(ys,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,x.jsx(ys,{type:"source",position:r,isConnectable:t})]})}function Rz(){return null}function Pz({data:e,isConnectable:t,targetPosition:n=he.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(ys,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Mu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Hx={input:kz,default:Cz,output:Pz,group:Rz};function Tz(e){var t,n,r,s;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??((s=e.style)==null?void 0:s.height)}}const Nz=e=>{const{width:t,height:n,x:r,y:s}=wa(e.nodeLookup,{filter:o=>!!o.selected});return{width:In(t)?t:null,height:In(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function Iz({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=We(),{width:s,height:o,transformString:i,userSelectionActive:l}=Ne(Nz,Xe),a=$E(),c=S.useRef(null);S.useEffect(()=>{var p;n||(p=c.current)==null||p.focus({preventScroll:!0})},[n]);const u=!l&&s!==null&&o!==null;if(LE({nodeRef:c,disabled:!u}),!u)return null;const f=e?p=>{const m=r.getState().nodes.filter(v=>v.selected);e(p,m)}:void 0,d=p=>{Object.prototype.hasOwnProperty.call(Mu,p.key)&&(p.preventDefault(),a({direction:Mu[p.key],factor:p.shiftKey?4:1}))};return x.jsx("div",{className:st(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:x.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const Bx=typeof window<"u"?window:void 0,Mz=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function VE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:c,selectionOnDrag:u,selectionMode:f,onSelectionStart:d,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:h,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:C,zoomOnDoubleClick:R,panOnDrag:k,autoPanOnSelection:N,defaultViewport:I,translateExtent:j,minZoom:L,maxZoom:A,preventScrolling:P,onSelectionContextMenu:M,noWheelClassName:z,noPanClassName:D,disableKeyboardA11y:T,onViewportChange:_,isControlledViewport:O}){const{nodesSelectionActive:B,userSelectionActive:$}=Ne(Mz,Xe),V=Gl(c,{target:Bx}),Y=Gl(v,{target:Bx}),U=Y||k,K=Y||w,Q=u&&U!==!0,H=V||$||Q;return az({deleteKeyCode:a,multiSelectionKeyCode:m}),x.jsx(dz,{onPaneContextMenu:o,elementsSelectable:h,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:K,panActivationKeyPressed:Y,panOnScrollSpeed:E,panOnScrollMode:C,zoomOnDoubleClick:R,panOnDrag:!V&&U,defaultViewport:I,translateExtent:j,minZoom:L,maxZoom:A,zoomActivationKeyCode:b,preventScrolling:P,noWheelClassName:z,noPanClassName:D,onViewportChange:_,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:Q,children:x.jsxs(gz,{onSelectionStart:d,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:U,autoPanOnSelection:N,isSelecting:!!H,selectionMode:f,selectionKeyPressed:V,paneClickDistance:l,selectionOnDrag:Q,children:[e,B&&x.jsx(Iz,{onSelectionContextMenu:M,noPanClassName:D,disableKeyboardA11y:T})]})})}VE.displayName="FlowRenderer";const _z=S.memo(VE),Oz=e=>t=>e?um(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 Az(e){return Ne(S.useCallback(Oz(e),[e]),Xe)}const jz=e=>e.updateNodeInternals;function zz(){const e=Ne(jz),[t]=S.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return S.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Dz({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=We(),o=S.useRef(null),i=S.useRef(null),l=S.useRef(e.sourcePosition),a=S.useRef(e.targetPosition),c=S.useRef(t),u=n&&!!e.internals.handleBounds;return S.useEffect(()=>{o.current&&!e.hidden&&(!u||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[u,e.hidden]),S.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),S.useEffect(()=>{if(o.current){const f=c.current!==t,d=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(f||d||p)&&(c.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function Fz({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:a,nodesConnectable:c,nodesFocusable:u,resizeObserver:f,noDragClassName:d,noPanClassName:p,disableKeyboardA11y:m,rfId:v,nodeTypes:b,nodeClickDistance:h,onError:y}){const{node:g,internals:w,isParent:E}=Ne(H=>{const W=H.nodeLookup.get(e),G=H.parentLookup.has(e);return{node:W,internals:W.internals,isParent:G}},Xe);let C=g.type||"default",R=(b==null?void 0:b[C])||Hx[C];R===void 0&&(y==null||y("003",jn.error003(C)),C="default",R=(b==null?void 0:b.default)||Hx.default);const k=!!(g.draggable||l&&typeof g.draggable>"u"),N=!!(g.selectable||a&&typeof g.selectable>"u"),I=!!(g.connectable||c&&typeof g.connectable>"u"),j=!!(g.focusable||u&&typeof g.focusable>"u"),L=We(),A=oE(g),P=Dz({node:g,nodeType:C,hasDimensions:A,resizeObserver:f}),M=LE({nodeRef:P,disabled:g.hidden||!k,noDragClassName:d,handleSelector:g.dragHandle,nodeId:e,isSelectable:N,nodeClickDistance:h}),z=$E();if(g.hidden)return null;const D=Fn(g),T=Tz(g),_=N||k||t||n||r||s,O=n?H=>n(H,{...w.userNode}):void 0,B=r?H=>r(H,{...w.userNode}):void 0,$=s?H=>s(H,{...w.userNode}):void 0,V=o?H=>o(H,{...w.userNode}):void 0,Y=i?H=>i(H,{...w.userNode}):void 0,U=H=>{const{selectNodesOnDrag:W,nodeDragThreshold:G}=L.getState();N&&(!W||!k||G>0)&&Cp({id:e,store:L,nodeRef:P}),t&&t(H,{...w.userNode})},K=H=>{if(!(aE(H.nativeEvent)||m)){if(QS.includes(H.key)&&N){const W=H.key==="Escape";Cp({id:e,store:L,unselect:W,nodeRef:P})}else if(k&&g.selected&&Object.prototype.hasOwnProperty.call(Mu,H.key)){H.preventDefault();const{ariaLabelConfig:W}=L.getState();L.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),z({direction:Mu[H.key],factor:H.shiftKey?4:1})}}},Q=()=>{var te;if(m||!((te=P.current)!=null&&te.matches(":focus-visible")))return;const{transform:H,width:W,height:G,autoPanOnNodeFocus:J,setCenter:X}=L.getState();if(!J)return;um(new Map([[e,g]]),{x:0,y:0,width:W,height:G},H,!0).length>0||X(g.position.x+D.width/2,g.position.y+D.height/2,{zoom:H[2]})};return x.jsx("div",{className:st(["react-flow__node",`react-flow__node-${C}`,{[p]:k},g.className,{selected:g.selected,selectable:N,parent:E,draggable:k,dragging:M}]),ref:P,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:_?"all":"none",visibility:A?"visible":"hidden",...g.style,...T},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:B,onMouseLeave:$,onContextMenu:V,onClick:U,onDoubleClick:Y,onKeyDown:j?K:void 0,tabIndex:j?0:void 0,onFocus:j?Q:void 0,role:g.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${_E}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:x.jsx(yz,{value:e,children:x.jsx(R,{id:e,data:g.data,type:C,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:g.selected??!1,selectable:N,draggable:k,deletable:g.deletable??!0,isConnectable:I,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:M,dragHandle:g.dragHandle,zIndex:w.z,parentId:g.parentId,...D})})})}var Lz=S.memo(Fz);const $z=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function WE(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:s}=Ne($z,Xe),o=Az(e.onlyRenderVisibleElements),i=zz();return x.jsx("div",{className:"react-flow__nodes",style:wd,children:o.map(l=>x.jsx(Lz,{id:l,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:i,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},l))})}WE.displayName="NodeRenderer";const Hz=S.memo(WE);function Bz(e){return Ne(S.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&EA({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Xe)}const Vz=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return x.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Wz=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return x.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Vx={[Tu.Arrow]:Vz,[Tu.ArrowClosed]:Wz};function Uz(e){const t=We();return S.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Vx,e)?Vx[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",jn.error009(e)),null)},[e])}const Kz=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const a=Uz(t);return a?x.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:x.jsx(a,{color:n,strokeWidth:i})}):null},UE=({defaultColor:e,rfId:t})=>{const n=Ne(o=>o.edges),r=Ne(o=>o.defaultEdgeOptions),s=S.useMemo(()=>MA(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:s.map(o=>x.jsx(Kz,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};UE.displayName="MarkerDefinitions";var Yz=S.memo(UE);function KE({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...u}){const[f,d]=S.useState({x:1,y:0,width:0,height:0}),p=st(["react-flow__edge-textwrapper",c]),m=S.useRef(null);return S.useEffect(()=>{if(m.current){const v=m.current.getBBox();d({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?x.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...u,children:[s&&x.jsx("rect",{width:f.width+2*i[0],x:-i[0],y:-i[1],height:f.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),x.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),a]}):null}KE.displayName="EdgeText";const qz=S.memo(KE);function bd({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:c=20,...u}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...u,d:e,fill:"none",className:st(["react-flow__edge-path",u.className])}),c?x.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&In(t)&&In(n)?x.jsx(qz,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Wx({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===he.Left||e===he.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function YE({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:s,targetPosition:o=he.Top}){const[i,l]=Wx({pos:n,x1:e,y1:t,x2:r,y2:s}),[a,c]=Wx({pos:o,x1:r,y1:s,x2:e,y2:t}),[u,f,d,p]=uE({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:a,targetControlY:c});return[`M${e},${t} C${i},${l} ${a},${c} ${r},${s}`,u,f,d,p]}function qE(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,interactionWidth:h})=>{const[y,g,w]=YE({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),E=e.isInternal?void 0:t;return x.jsx(bd,{id:E,path:y,labelX:g,labelY:w,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,interactionWidth:h})})}const Qz=qE({isInternal:!1}),QE=qE({isInternal:!0});Qz.displayName="SimpleBezierEdge";QE.displayName="SimpleBezierEdgeInternal";function XE(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,sourcePosition:p=he.Bottom,targetPosition:m=he.Top,markerEnd:v,markerStart:b,pathOptions:h,interactionWidth:y})=>{const[g,w,E]=bp({sourceX:n,sourceY:r,sourcePosition:p,targetX:s,targetY:o,targetPosition:m,borderRadius:h==null?void 0:h.borderRadius,offset:h==null?void 0:h.offset,stepPosition:h==null?void 0:h.stepPosition}),C=e.isInternal?void 0:t;return x.jsx(bd,{id:C,path:g,labelX:w,labelY:E,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:v,markerStart:b,interactionWidth:y})})}const GE=XE({isInternal:!1}),ZE=XE({isInternal:!0});GE.displayName="SmoothStepEdge";ZE.displayName="SmoothStepEdgeInternal";function JE(e){return S.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return x.jsx(GE,{...n,id:r,pathOptions:S.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Xz=JE({isInternal:!1}),ek=JE({isInternal:!0});Xz.displayName="StepEdge";ek.displayName="StepEdgeInternal";function tk(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:m,interactionWidth:v})=>{const[b,h,y]=hE({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return x.jsx(bd,{id:g,path:b,labelX:h,labelY:y,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:m,interactionWidth:v})})}const Gz=tk({isInternal:!1}),nk=tk({isInternal:!0});Gz.displayName="StraightEdge";nk.displayName="StraightEdgeInternal";function rk(e){return S.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=he.Bottom,targetPosition:l=he.Top,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,pathOptions:h,interactionWidth:y})=>{const[g,w,E]=dE({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:h==null?void 0:h.curvature}),C=e.isInternal?void 0:t;return x.jsx(bd,{id:C,path:g,labelX:w,labelY:E,label:a,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:b,interactionWidth:y})})}const Zz=rk({isInternal:!1}),sk=rk({isInternal:!0});Zz.displayName="BezierEdge";sk.displayName="BezierEdgeInternal";const Ux={default:sk,straight:nk,step:ek,smoothstep:ZE,simplebezier:QE},Kx={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Jz=(e,t,n)=>n===he.Left?e-t:n===he.Right?e+t:e,eD=(e,t,n)=>n===he.Top?e-t:n===he.Bottom?e+t:e,Yx="react-flow__edgeupdater";function qx({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return x.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:st([Yx,`${Yx}-${l}`]),cx:Jz(t,r,e),cy:eD(n,r,e),r,stroke:"transparent",fill:"transparent"})}function tD({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:a,onReconnect:c,onReconnectStart:u,onReconnectEnd:f,setReconnecting:d,setUpdateHover:p}){const m=We(),v=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:C,domNode:R,connectionMode:k,connectionRadius:N,lib:I,onConnectStart:j,cancelConnection:L,nodeLookup:A,rfId:P,panBy:M,updateConnection:z}=m.getState(),D=E.type==="target",T=(B,$)=>{d(!1),f==null||f(B,n,E.type,$)},_=B=>c==null?void 0:c(n,B),O=(B,$)=>{d(!0),u==null||u(w,n,E.type),j==null||j(B,$)};kp.onPointerDown(w.nativeEvent,{autoPanOnConnect:C,connectionMode:k,connectionRadius:N,domNode:R,handleId:E.id,nodeId:E.nodeId,nodeLookup:A,isTarget:D,edgeUpdaterType:E.type,lib:I,flowId:P,cancelConnection:L,panBy:M,isValidConnection:(...B)=>{var $,V;return((V=($=m.getState()).isValidConnection)==null?void 0:V.call($,...B))??!0},onConnect:_,onConnectStart:O,onConnectEnd:(...B)=>{var $,V;return(V=($=m.getState()).onConnectEnd)==null?void 0:V.call($,...B)},onReconnectEnd:T,updateConnection:z,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},b=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),h=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>p(!0),g=()=>p(!1);return x.jsxs(x.Fragment,{children:[(e===!0||e==="source")&&x.jsx(qx,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:b,onMouseEnter:y,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&x.jsx(qx,{position:a,centerX:o,centerY:i,radius:t,onMouseDown:h,onMouseEnter:y,onMouseOut:g,type:"target"})]})}function nD({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:p,rfId:m,edgeTypes:v,noPanClassName:b,onError:h,disableKeyboardA11y:y}){let g=Ne(X=>X.edgeLookup.get(e));const w=Ne(X=>X.defaultEdgeOptions);g=w?{...w,...g}:g;let E=g.type||"default",C=(v==null?void 0:v[E])||Ux[E];C===void 0&&(h==null||h("011",jn.error011(E)),E="default",C=(v==null?void 0:v.default)||Ux.default);const R=!!(g.focusable||t&&typeof g.focusable>"u"),k=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),N=!!(g.selectable||r&&typeof g.selectable>"u"),I=S.useRef(null),[j,L]=S.useState(!1),[A,P]=S.useState(!1),M=We(),{zIndex:z=g.zIndex,sourceX:D,sourceY:T,targetX:_,targetY:O,sourcePosition:B,targetPosition:$}=Ne(S.useCallback(X=>{const q=X.nodeLookup.get(g.source),te=X.nodeLookup.get(g.target);if(!q||!te)return Kx;const le=IA({id:e,sourceNode:q,targetNode:te,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:X.connectionMode,onError:h}),Z=SA({selected:g.selected,zIndex:g.zIndex,sourceNode:q,targetNode:te,elevateOnSelect:X.elevateEdgesOnSelect,zIndexMode:X.zIndexMode});return{...le||Kx,zIndex:Z}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex,h]),Xe),V=S.useMemo(()=>g.markerStart?`url('#${Sp(g.markerStart,m)}')`:void 0,[g.markerStart,m]),Y=S.useMemo(()=>g.markerEnd?`url('#${Sp(g.markerEnd,m)}')`:void 0,[g.markerEnd,m]);if(g.hidden||D===null||T===null||_===null||O===null)return null;const U=X=>{var Z;const{addSelectedEdges:q,unselectNodesAndEdges:te,multiSelectionActive:le}=M.getState();N&&(M.setState({nodesSelectionActive:!1}),g.selected&&le?(te({nodes:[],edges:[g]}),(Z=I.current)==null||Z.blur()):q([e])),s&&s(X,g)},K=o?X=>{o(X,{...g})}:void 0,Q=i?X=>{i(X,{...g})}:void 0,H=l?X=>{l(X,{...g})}:void 0,W=a?X=>{a(X,{...g})}:void 0,G=c?X=>{c(X,{...g})}:void 0,J=X=>{var q;if(!y&&QS.includes(X.key)&&N){const{unselectNodesAndEdges:te,addSelectedEdges:le}=M.getState();X.key==="Escape"?((q=I.current)==null||q.blur(),te({edges:[g]})):le([e])}};return x.jsx("svg",{style:{zIndex:z},children:x.jsxs("g",{className:st(["react-flow__edge",`react-flow__edge-${E}`,g.className,b,{selected:g.selected,animated:g.animated,inactive:!N&&!s,updating:j,selectable:N}]),onClick:U,onDoubleClick:K,onContextMenu:Q,onMouseEnter:H,onMouseMove:W,onMouseLeave:G,onKeyDown:R?J:void 0,tabIndex:R?0:void 0,role:g.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":R?`${OE}-${m}`:void 0,ref:I,...g.domAttributes,children:[!A&&x.jsx(C,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:N,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:D,sourceY:T,targetX:_,targetY:O,sourcePosition:B,targetPosition:$,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:V,markerEnd:Y,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),k&&x.jsx(tD,{edge:g,isReconnectable:k,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:p,sourceX:D,sourceY:T,targetX:_,targetY:O,sourcePosition:B,targetPosition:$,setUpdateHover:L,setReconnecting:P})]})})}var rD=S.memo(nD);const sD=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ok({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:h,elementsSelectable:y,onError:g}=Ne(sD,Xe),w=Bz(t);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(Yz,{defaultColor:e,rfId:n}),w.map(E=>x.jsx(rD,{id:E,edgesFocusable:b,edgesReconnectable:h,elementsSelectable:y,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:a,onMouseLeave:c,onClick:u,reconnectRadius:f,onDoubleClick:d,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:v},E))]})}ok.displayName="EdgeRenderer";const oD=S.memo(ok),Qx=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function iD({children:e}){const t=We(),n=S.useRef(null),[r]=S.useState(()=>t.getState().transform);return DE(()=>{let s=null;const o=()=>{const i=t.getState().transform;s&&i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||(s=i,n.current&&(n.current.style.transform=Qx(i)))};return o(),t.subscribe(o)},[t]),x.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Qx(r)},children:e})}function lD(e){const t=vm(),n=S.useRef(!1);S.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const aD=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function cD(e){const t=Ne(aD),n=We();return S.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uD(e){return e.connection.inProgress?{...e.connection,to:Sa(e.connection.to,e.transform)}:{...e.connection}}function dD(e){return uD}function fD(e){const t=dD();return Ne(t,Xe)}const hD=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pD({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:a}=Ne(hD,Xe);return!(o&&s&&a)?null:x.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:st(["react-flow__connection",ZS(l)]),children:x.jsx(ik,{style:t,type:n,CustomComponent:r,isValid:l})})})}const ik=({style:e,type:t=Wr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:a,to:c,toNode:u,toHandle:f,toPosition:d,pointer:p}=fD();if(!s)return;if(n)return x.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:a,toPosition:d,connectionStatus:ZS(r),toNode:u,toHandle:f,pointer:p});let m="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case Wr.Bezier:[m]=dE(v);break;case Wr.SimpleBezier:[m]=YE(v);break;case Wr.Step:[m]=bp({...v,borderRadius:0});break;case Wr.SmoothStep:[m]=bp(v);break;default:[m]=hE(v)}return x.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};ik.displayName="ConnectionLine";const gD={};function Xx(e=gD){S.useRef(e),We(),S.useEffect(()=>{},[e])}function mD(){We(),S.useRef(!1),S.useEffect(()=>{},[])}function lk({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:h,selectionKeyCode:y,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:C,zoomActivationKeyCode:R,deleteKeyCode:k,onlyRenderVisibleElements:N,elementsSelectable:I,defaultViewport:j,translateExtent:L,minZoom:A,maxZoom:P,preventScrolling:M,defaultMarkerColor:z,zoomOnScroll:D,zoomOnPinch:T,panOnScroll:_,panOnScrollSpeed:O,panOnScrollMode:B,zoomOnDoubleClick:$,panOnDrag:V,autoPanOnSelection:Y,onPaneClick:U,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:H,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:J,nodeClickDistance:X,onEdgeContextMenu:q,onEdgeMouseEnter:te,onEdgeMouseMove:le,onEdgeMouseLeave:Z,reconnectRadius:ee,onReconnect:fe,onReconnectStart:oe,onReconnectEnd:xe,noDragClassName:Re,noWheelClassName:Se,noPanClassName:Ae,disableKeyboardA11y:se,nodeExtent:ie,rfId:_e,viewport:ve,onViewportChange:De,nodesDraggable:Le}){return Xx(e),Xx(t),mD(),lD(n),cD(ve),x.jsx(_z,{onPaneClick:U,onPaneMouseEnter:K,onPaneMouseMove:Q,onPaneMouseLeave:H,onPaneContextMenu:G,onPaneScroll:W,paneClickDistance:J,deleteKeyCode:k,selectionKeyCode:y,selectionOnDrag:g,selectionMode:w,onSelectionStart:d,onSelectionEnd:p,multiSelectionKeyCode:E,panActivationKeyCode:C,zoomActivationKeyCode:R,elementsSelectable:I,zoomOnScroll:D,zoomOnPinch:T,zoomOnDoubleClick:$,panOnScroll:_,panOnScrollSpeed:O,panOnScrollMode:B,panOnDrag:V,autoPanOnSelection:Y,defaultViewport:j,translateExtent:L,minZoom:A,maxZoom:P,onSelectionContextMenu:f,preventScrolling:M,noDragClassName:Re,noWheelClassName:Se,noPanClassName:Ae,disableKeyboardA11y:se,onViewportChange:De,isControlledViewport:!!ve,children:x.jsxs(iD,{children:[x.jsx(oD,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:fe,onReconnectStart:oe,onReconnectEnd:xe,onlyRenderVisibleElements:N,onEdgeContextMenu:q,onEdgeMouseEnter:te,onEdgeMouseMove:le,onEdgeMouseLeave:Z,reconnectRadius:ee,defaultMarkerColor:z,noPanClassName:Ae,disableKeyboardA11y:se,rfId:_e}),x.jsx(pD,{style:v,type:m,component:b,containerStyle:h}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(Hz,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:X,onlyRenderVisibleElements:N,noPanClassName:Ae,noDragClassName:Re,disableKeyboardA11y:se,nodeExtent:ie,rfId:_e,nodesDraggable:Le}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}lk.displayName="GraphView";const yD=S.memo(lk),xD=sE(),Gx=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:a=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:f,zIndexMode:d="basic"}={})=>{const p=new Map,m=new Map,v=new Map,b=new Map,h=r??t??[],y=n??e??[],g=u??[0,0],w=f??Yl;mE(v,b,h);const{nodesInitialized:E}=Ep(y,p,m,{nodeOrigin:g,nodeExtent:w,zIndexMode:d});let C=[0,0,1];if(i&&s&&o){const R=wa(p,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:k,y:N,zoom:I}=fm(R,s,o,a,c,(l==null?void 0:l.padding)??.1);C=[k,N,I]}return{rfId:"1",width:s??0,height:o??0,transform:C,nodes:y,nodesInitialized:E,nodeLookup:p,parentLookup:m,edges:h,edgeLookup:b,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:c,translateExtent:Yl,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ei.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...GS},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:xD,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:XS,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},vD=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:a,maxZoom:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d})=>Mj((p,m)=>{async function v(){const{nodeLookup:b,panZoom:h,fitViewOptions:y,fitViewResolver:g,width:w,height:E,minZoom:C,maxZoom:R}=m();h&&(await gA({nodes:b,width:w,height:E,panZoom:h,minZoom:C,maxZoom:R},y),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...Gx({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:a,maxZoom:c,nodeOrigin:u,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:b=>{const{nodeLookup:h,parentLookup:y,nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:E,fitViewQueued:C,zIndexMode:R,nodesSelectionActive:k}=m(),{nodesInitialized:N,hasSelectedNodes:I}=Ep(b,h,y,{nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:R}),j=k&&I;C&&N?(v(),p({nodes:b,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:j})):p({nodes:b,nodesInitialized:N,nodesSelectionActive:j})},setEdges:b=>{const{connectionLookup:h,edgeLookup:y}=m();mE(h,y,b),p({edges:b})},setDefaultNodesAndEdges:(b,h)=>{if(b){const{setNodes:y}=m();y(b),p({hasDefaultNodes:!0})}if(h){const{setEdges:y}=m();y(h),p({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:h,nodeLookup:y,parentLookup:g,domNode:w,nodeOrigin:E,nodeExtent:C,debug:R,fitViewQueued:k,zIndexMode:N}=m(),{changes:I,updatedInternals:j}=FA(b,y,g,w,E,C,N);j&&(AA(y,g,{nodeOrigin:E,nodeExtent:C,zIndexMode:N}),k?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(R&&console.log("React Flow: trigger node changes",I),h==null||h(I)))},updateNodePositions:(b,h=!1)=>{const y=[];let g=[];const{nodeLookup:w,triggerNodeChanges:E,connection:C,updateConnection:R,onNodesChangeMiddlewareMap:k}=m();for(const[N,I]of b){const j=w.get(N),L=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(I!=null&&I.position)),A={id:N,type:"position",position:L?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:h};if(j&&C.inProgress&&C.fromNode.id===j.id){const P=uo(j,C.fromHandle,he.Left,!0);R({...C,from:P})}L&&j.parentId&&y.push({id:N,parentId:j.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),g.push(A)}if(y.length>0){const{parentLookup:N,nodeOrigin:I}=m(),j=xm(y,w,N,I);g.push(...j)}for(const N of k.values())g=N(g);E(g)},triggerNodeChanges:b=>{const{onNodesChange:h,setNodes:y,nodes:g,hasDefaultNodes:w,debug:E}=m();if(b!=null&&b.length){if(w){const C=Zj(b,g);y(C)}E&&console.log("React Flow: trigger node changes",b),h==null||h(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:h,setEdges:y,edges:g,hasDefaultEdges:w,debug:E}=m();if(b!=null&&b.length){if(w){const C=Jj(b,g);y(C)}E&&console.log("React Flow: trigger edge changes",b),h==null||h(b)}},addSelectedNodes:b=>{const{multiSelectionActive:h,edgeLookup:y,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:E}=m();if(h){const C=b.map(R=>Os(R,!0));w(C);return}w(Ho(g,new Set([...b]),!0)),E(Ho(y))},addSelectedEdges:b=>{const{multiSelectionActive:h,edgeLookup:y,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:E}=m();if(h){const C=b.map(R=>Os(R,!0));E(C);return}E(Ho(y,new Set([...b]))),w(Ho(g,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:h}={})=>{const{edges:y,nodes:g,nodeLookup:w,triggerNodeChanges:E,triggerEdgeChanges:C}=m(),R=b||g,k=h||y,N=[];for(const j of R){if(!j.selected)continue;const L=w.get(j.id);L&&(L.selected=!1),N.push(Os(j.id,!1))}const I=[];for(const j of k)j.selected&&I.push(Os(j.id,!1));E(N),C(I)},setMinZoom:b=>{const{panZoom:h,maxZoom:y}=m();h==null||h.setScaleExtent([b,y]),p({minZoom:b})},setMaxZoom:b=>{const{panZoom:h,minZoom:y}=m();h==null||h.setScaleExtent([y,b]),p({maxZoom:b})},setTranslateExtent:b=>{var h;(h=m().panZoom)==null||h.setTranslateExtent(b),p({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:h,triggerNodeChanges:y,triggerEdgeChanges:g,elementsSelectable:w}=m();if(!w)return;const E=h.reduce((R,k)=>k.selected?[...R,Os(k.id,!1)]:R,[]),C=b.reduce((R,k)=>k.selected?[...R,Os(k.id,!1)]:R,[]);y(E),g(C)},setNodeExtent:b=>{const{nodes:h,nodeLookup:y,parentLookup:g,nodeOrigin:w,elevateNodesOnSelect:E,nodeExtent:C,zIndexMode:R}=m();b[0][0]===C[0][0]&&b[0][1]===C[0][1]&&b[1][0]===C[1][0]&&b[1][1]===C[1][1]||(Ep(h,y,g,{nodeOrigin:w,nodeExtent:b,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:R}),p({nodeExtent:b}))},panBy:b=>{const{transform:h,width:y,height:g,panZoom:w,translateExtent:E}=m();return LA({delta:b,panZoom:w,transform:h,translateExtent:E,width:y,height:g})},setCenter:async(b,h,y)=>{const{width:g,height:w,maxZoom:E,panZoom:C}=m();if(!C)return!1;const R=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:E;return await C.setViewport({x:g/2-b*R,y:w/2-h*R,zoom:R},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),!0},cancelConnection:()=>{p({connection:{...GS}})},updateConnection:b=>{p({connection:b})},reset:()=>p({...Gx()})}},Object.is);function wD({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:a,fitView:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d,children:p}){const[m]=S.useState(()=>vD({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:a,nodeOrigin:u,nodeExtent:f,zIndexMode:d}));return x.jsx(_j,{value:m,children:x.jsx(sz,{children:x.jsx(vz,{children:p})})})}function bD({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:p}){return S.useContext(xd)?x.jsx(x.Fragment,{children:e}):x.jsx(wD,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:a,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:p,children:e})}const SD={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ED({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:h,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:C,onNodeDragStart:R,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:I,onEdgesDelete:j,onDelete:L,onSelectionChange:A,onSelectionDragStart:P,onSelectionDrag:M,onSelectionDragStop:z,onSelectionContextMenu:D,onSelectionStart:T,onSelectionEnd:_,onBeforeDelete:O,connectionMode:B,connectionLineType:$=Wr.Bezier,connectionLineStyle:V,connectionLineComponent:Y,connectionLineContainerStyle:U,deleteKeyCode:K="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:H=!1,selectionMode:W=ql.Full,panActivationKeyCode:G="Space",multiSelectionKeyCode:J=Xl()?"Meta":"Control",zoomActivationKeyCode:X=Xl()?"Meta":"Control",snapToGrid:q,snapGrid:te,onlyRenderVisibleElements:le=!1,selectNodesOnDrag:Z,nodesDraggable:ee,autoPanOnNodeFocus:fe,nodesConnectable:oe,nodesFocusable:xe,nodeOrigin:Re=AE,edgesFocusable:Se,edgesReconnectable:Ae,elementsSelectable:se=!0,defaultViewport:ie=Uj,minZoom:_e=.5,maxZoom:ve=2,translateExtent:De=Yl,preventScrolling:Le=!0,nodeExtent:Pt,defaultMarkerColor:Tt="#b1b1b7",zoomOnScroll:Ir=!0,zoomOnPinch:rr=!0,panOnScroll:vo=!1,panOnScrollSpeed:Mr=.5,panOnScrollMode:Ln=Zs.Free,zoomOnDoubleClick:wo=!0,panOnDrag:bo=!0,onPaneClick:So,onPaneMouseEnter:Eo,onPaneMouseMove:Pa,onPaneMouseLeave:Ta,onPaneScroll:Na,onPaneContextMenu:Ce,paneClickDistance:ht=1,nodeClickDistance:ln=0,children:Nt,onReconnect:Sn,onReconnectStart:an,onReconnectEnd:Ts,onEdgeContextMenu:ko,onEdgeDoubleClick:$n,onEdgeMouseEnter:$i,onEdgeMouseMove:Hi,onEdgeMouseLeave:Bi,reconnectRadius:Ld=10,onNodesChange:Vi,onEdgesChange:Ia,noDragClassName:$d="nodrag",noWheelClassName:Hd="nowheel",noPanClassName:_r="nopan",fitView:Ma,fitViewOptions:_a,connectOnClick:Bd,attributionPosition:Oa,proOptions:Aa,defaultEdgeOptions:ja,elevateNodesOnSelect:XC=!0,elevateEdgesOnSelect:GC=!1,disableKeyboardA11y:d0=!1,autoPanOnConnect:ZC,autoPanOnNodeDrag:JC,autoPanOnSelection:eR=!0,autoPanSpeed:tR,connectionRadius:nR,isValidConnection:rR,onError:sR,style:oR,id:f0,nodeDragThreshold:iR,connectionDragThreshold:lR,viewport:aR,onViewportChange:cR,width:uR,height:dR,colorMode:fR="light",debug:hR,onScroll:za,ariaLabelConfig:pR,zIndexMode:h0="basic",...gR},mR){const Vd=f0||"1",yR=Qj(fR),xR=S.useCallback(p0=>{p0.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),za==null||za(p0)},[za]);return x.jsx("div",{"data-testid":"rf__wrapper",...gR,onScroll:xR,style:{...oR,...SD},ref:mR,className:st(["react-flow",s,yR]),id:f0,role:"application",children:x.jsxs(bD,{nodes:e,edges:t,width:uR,height:dR,fitView:Ma,fitViewOptions:_a,minZoom:_e,maxZoom:ve,nodeOrigin:Re,nodeExtent:Pt,zIndexMode:h0,children:[x.jsx(qj,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:h,nodesDraggable:ee,autoPanOnNodeFocus:fe,nodesConnectable:oe,nodesFocusable:xe,edgesFocusable:Se,edgesReconnectable:Ae,elementsSelectable:se,elevateNodesOnSelect:XC,elevateEdgesOnSelect:GC,minZoom:_e,maxZoom:ve,nodeExtent:Pt,onNodesChange:Vi,onEdgesChange:Ia,snapToGrid:q,snapGrid:te,connectionMode:B,translateExtent:De,connectOnClick:Bd,defaultEdgeOptions:ja,fitView:Ma,fitViewOptions:_a,onNodesDelete:I,onEdgesDelete:j,onDelete:L,onNodeDragStart:R,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:M,onSelectionDragStart:P,onSelectionDragStop:z,onMove:u,onMoveStart:f,onMoveEnd:d,noPanClassName:_r,nodeOrigin:Re,rfId:Vd,autoPanOnConnect:ZC,autoPanOnNodeDrag:JC,autoPanSpeed:tR,onError:sR,connectionRadius:nR,isValidConnection:rR,selectNodesOnDrag:Z,nodeDragThreshold:iR,connectionDragThreshold:lR,onBeforeDelete:O,debug:hR,ariaLabelConfig:pR,zIndexMode:h0}),x.jsx(yD,{onInit:c,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:C,nodeTypes:o,edgeTypes:i,connectionLineType:$,connectionLineStyle:V,connectionLineComponent:Y,connectionLineContainerStyle:U,selectionKeyCode:Q,selectionOnDrag:H,selectionMode:W,deleteKeyCode:K,multiSelectionKeyCode:J,panActivationKeyCode:G,zoomActivationKeyCode:X,onlyRenderVisibleElements:le,defaultViewport:ie,translateExtent:De,minZoom:_e,maxZoom:ve,preventScrolling:Le,zoomOnScroll:Ir,zoomOnPinch:rr,zoomOnDoubleClick:wo,panOnScroll:vo,panOnScrollSpeed:Mr,panOnScrollMode:Ln,panOnDrag:bo,autoPanOnSelection:eR,onPaneClick:So,onPaneMouseEnter:Eo,onPaneMouseMove:Pa,onPaneMouseLeave:Ta,onPaneScroll:Na,onPaneContextMenu:Ce,paneClickDistance:ht,nodeClickDistance:ln,onSelectionContextMenu:D,onSelectionStart:T,onSelectionEnd:_,onReconnect:Sn,onReconnectStart:an,onReconnectEnd:Ts,onEdgeContextMenu:ko,onEdgeDoubleClick:$n,onEdgeMouseEnter:$i,onEdgeMouseMove:Hi,onEdgeMouseLeave:Bi,reconnectRadius:Ld,defaultMarkerColor:Tt,noDragClassName:$d,noWheelClassName:Hd,noPanClassName:_r,rfId:Vd,disableKeyboardA11y:d0,nodeExtent:Pt,viewport:aR,onViewportChange:cR,nodesDraggable:ee}),x.jsx(Wj,{onSelectionChange:A}),Nt,x.jsx(Lj,{proOptions:Aa,position:Oa}),x.jsx(Fj,{rfId:Vd,disableKeyboardA11y:d0})]})})}var kD=zE(ED);function CD({dimensions:e,lineWidth:t,variant:n,className:r}){return x.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:st(["react-flow__background-pattern",n,r])})}function RD({radius:e,className:t}){return x.jsx("circle",{cx:e,cy:e,r:e,className:st(["react-flow__background-pattern","dots",t])})}var xr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(xr||(xr={}));const PD={[xr.Dots]:1,[xr.Lines]:1,[xr.Cross]:6},TD=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ak({id:e,variant:t=xr.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:a,className:c,patternClassName:u}){const f=S.useRef(null),{transform:d,patternId:p}=Ne(TD,Xe),m=r||PD[t],v=t===xr.Dots,b=t===xr.Cross,h=Array.isArray(n)?n:[n,n],y=[h[0]*d[2]||1,h[1]*d[2]||1],g=m*d[2],w=Array.isArray(o)?o:[o,o],E=b?[g,g]:y,C=[w[0]*d[2]+E[0]/2,w[1]*d[2]+E[1]/2],R=`${p}${e||""}`;return x.jsxs("svg",{className:st(["react-flow__background",c]),style:{...a,...wd,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:f,"data-testid":"rf__background",children:[x.jsx("pattern",{id:R,x:d[0]%y[0],y:d[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:v?x.jsx(RD,{radius:g/2,className:u}):x.jsx(CD,{dimensions:E,lineWidth:s,variant:t,className:u})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}ak.displayName="Background";const ND=S.memo(ak);function ID(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function MD(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function _D(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.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 OD(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 AD(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.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 fc({children:e,className:t,...n}){return x.jsx("button",{type:"button",className:st(["react-flow__controls-button",t]),...n,children:e})}const jD=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ck({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:u,position:f="bottom-left",orientation:d="vertical","aria-label":p}){const m=We(),{isInteractive:v,minZoomReached:b,maxZoomReached:h,ariaLabelConfig:y}=Ne(jD,Xe),{zoomIn:g,zoomOut:w,fitView:E}=vm(),C=()=>{g(),o==null||o()},R=()=>{w(),i==null||i()},k=()=>{E(s),l==null||l()},N=()=>{m.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},I=d==="horizontal"?"horizontal":"vertical";return x.jsxs(vd,{className:st(["react-flow__controls",I,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&x.jsxs(x.Fragment,{children:[x.jsx(fc,{onClick:C,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:h,children:x.jsx(ID,{})}),x.jsx(fc,{onClick:R,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:b,children:x.jsx(MD,{})})]}),n&&x.jsx(fc,{className:"react-flow__controls-fitview",onClick:k,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:x.jsx(_D,{})}),r&&x.jsx(fc,{className:"react-flow__controls-interactive",onClick:N,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:v?x.jsx(AD,{}):x.jsx(OD,{})}),u]})}ck.displayName="Controls";const zD=S.memo(ck);function DD({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:a,className:c,borderRadius:u,shapeRendering:f,selected:d,onClick:p}){const{background:m,backgroundColor:v}=o||{},b=i||m||v;return x.jsx("rect",{className:st(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:u,ry:u,width:r,height:s,style:{fill:b,stroke:l,strokeWidth:a},shapeRendering:f,onClick:p?h=>p(h,e):void 0})}const FD=S.memo(DD),LD=e=>e.nodes.map(t=>t.id),_f=e=>e instanceof Function?e:()=>e;function $D({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=FD,onClick:i}){const l=Ne(LD,Xe),a=_f(t),c=_f(e),u=_f(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:l.map(d=>x.jsx(BD,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:f},d))})}function HD({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:a}){const{node:c,x:u,y:f,width:d,height:p}=Ne(m=>{const v=m.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const b=v.internals.userNode,{x:h,y}=v.internals.positionAbsolute,{width:g,height:w}=Fn(b);return{node:b,x:h,y,width:g,height:w}},Xe);return!c||c.hidden||!oE(c)?null:x.jsx(l,{x:u,y:f,width:d,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:s,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:a,id:c.id})}const BD=S.memo(HD);var VD=S.memo($D);const WD=200,UD=150,KD=e=>!e.hidden,YD=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?nE(wa(e.nodeLookup,{filter:KD}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Zx=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,qD=(e,t)=>Zx(e.viewBB,t.viewBB)&&Zx(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,QD="react-flow__minimap-desc";function uk({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:a,maskColor:c,maskStrokeColor:u,maskStrokeWidth:f,position:d="bottom-right",onClick:p,onNodeClick:m,pannable:v=!1,zoomable:b=!1,ariaLabel:h,inversePan:y,zoomStep:g=1,offsetScale:w=5}){const E=We(),C=S.useRef(null),{boundingRect:R,viewBB:k,rfId:N,panZoom:I,translateExtent:j,flowWidth:L,flowHeight:A,ariaLabelConfig:P}=Ne(YD,qD),M=(e==null?void 0:e.width)??WD,z=(e==null?void 0:e.height)??UD,D=R.width/M,T=R.height/z,_=Math.max(D,T),O=_*M,B=_*z,$=w*_,V=R.x-(O-R.width)/2-$,Y=R.y-(B-R.height)/2-$,U=O+$*2,K=B+$*2,Q=`${QD}-${N}`,H=S.useRef(0),W=S.useRef();H.current=_,S.useEffect(()=>{if(C.current&&I)return W.current=qA({domNode:C.current,panZoom:I,getTransform:()=>E.getState().transform,getViewScale:()=>H.current}),()=>{var q;(q=W.current)==null||q.destroy()}},[I]),S.useEffect(()=>{var q;(q=W.current)==null||q.update({translateExtent:j,width:L,height:A,inversePan:y,pannable:v,zoomStep:g,zoomable:b})},[v,b,y,g,j,L,A]);const G=p?q=>{var Z;const[te,le]=((Z=W.current)==null?void 0:Z.pointer(q))||[0,0];p(q,{x:te,y:le})}:void 0,J=m?S.useCallback((q,te)=>{const le=E.getState().nodeLookup.get(te).internals.userNode;m(q,le)},[]):void 0,X=h??P["minimap.ariaLabel"];return x.jsx(vd,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*_: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 i=="number"?i:void 0},className:st(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:M,height:z,viewBox:`${V} ${Y} ${U} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:C,onClick:G,children:[X&&x.jsx("title",{id:Q,children:X}),x.jsx(VD,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-$},${Y-$}h${U+$*2}v${K+$*2}h${-U-$*2}z
|
|
62
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}uk.displayName="MiniMap";S.memo(uk);const XD=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,GD={[Ri.Line]:"right",[Ri.Handle]:"bottom-right"};function ZD({nodeId:e,position:t,variant:n=Ri.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:l=10,minHeight:a=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:p=!0,shouldResize:m,onResizeStart:v,onResize:b,onResizeEnd:h}){const y=HE(),g=typeof e=="string"?e:y,w=We(),E=S.useRef(null),C=n===Ri.Handle,R=Ne(S.useCallback(XD(C&&p),[C,p]),Xe),k=S.useRef(null),N=t??GD[n];S.useEffect(()=>{if(!(!E.current||!g))return k.current||(k.current=lj({domNode:E.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:j,transform:L,snapGrid:A,snapToGrid:P,nodeOrigin:M,domNode:z}=w.getState();return{nodeLookup:j,transform:L,snapGrid:A,snapToGrid:P,nodeOrigin:M,paneDomNode:z}},onChange:(j,L)=>{const{triggerNodeChanges:A,nodeLookup:P,parentLookup:M,nodeOrigin:z}=w.getState(),D=[],T={x:j.x,y:j.y},_=P.get(g);if(_&&_.expandParent&&_.parentId){const O=_.origin??z,B=j.width??_.measured.width??0,$=j.height??_.measured.height??0,V={id:_.id,parentId:_.parentId,rect:{width:B,height:$,...iE({x:j.x??_.position.x,y:j.y??_.position.y},{width:B,height:$},_.parentId,P,O)}},Y=xm([V],P,M,z);D.push(...Y),T.x=j.x?Math.max(O[0]*B,j.x):void 0,T.y=j.y?Math.max(O[1]*$,j.y):void 0}if(T.x!==void 0&&T.y!==void 0){const O={id:g,type:"position",position:{...T}};D.push(O)}if(j.width!==void 0&&j.height!==void 0){const B={id:g,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};D.push(B)}for(const O of L){const B={...O,type:"position"};D.push(B)}A(D)},onEnd:({width:j,height:L})=>{const A={id:g,type:"dimensions",resizing:!1,dimensions:{width:j,height:L}};w.getState().triggerNodeChanges([A])}})),k.current.update({controlPosition:N,boundaries:{minWidth:l,minHeight:a,maxWidth:c,maxHeight:u},keepAspectRatio:f,resizeDirection:d,onResizeStart:v,onResize:b,onResizeEnd:h,shouldResize:m}),()=>{var j;(j=k.current)==null||j.destroy()}},[N,l,a,c,u,f,v,b,h,m]);const I=N.split("-");return x.jsx("div",{className:st(["react-flow__resize-control","nodrag",...I,n,r]),ref:E,style:{...s,scale:R,...i&&{[C?"backgroundColor":"borderColor"]:i}},children:o})}S.memo(ZD);const JD=new Set;function e5(e){return e.startsWith("signal:child:")}function t5(e){const t=Oi(),n=(()=>{const o=new Set(e),i=[...e];for(;i.length>0;){const l=i.shift();if(l===void 0)continue;const a=t.getQueryData(["run",l]);if(a!==void 0)for(const c of a.timeline){const u=oo(c);u!==void 0&&!o.has(u)&&(o.add(u),i.push(u))}}return[...o].sort()})(),r=Hw({queries:n.map(o=>({queryKey:["run",o],queryFn:()=>tt.run(o)}))}),s={};return n.forEach((o,i)=>{var a;const l=(a=r[i])==null?void 0:a.data;l&&(s[o]=l)}),s}function n5({data:e}){const t=e.status==="failed",n=e.status==="pending"||e.status==="running",r=!!e.childRunId,s=!!e.collapsed,o=r&&!s,i=o?Zg:Jg(e.kind),l=t?{rail:"bg-red-400",badge:"bg-red-500/15 text-red-300",pill:"bg-red-500/20 text-red-300"}:n?{rail:"bg-live",badge:"bg-live/15 text-live",pill:"bg-live/20 text-live"}:{rail:"bg-emerald-400",badge:"bg-emerald-500/15 text-emerald-300",pill:"bg-emerald-500/20 text-emerald-300"};return x.jsxs("div",{title:o?up.child:up[e.kind]??e.kind,className:`group relative w-[208px] cursor-pointer overflow-hidden rounded-xl border bg-panel/95 shadow-lg backdrop-blur transition-all duration-150 hover:-translate-y-0.5 ${e.selected?"border-brand/60 ring-2 ring-brand/30":t?"border-red-500/40 hover:border-red-400/60":o?"border-indigo-500/40 hover:border-indigo-400/60":"border-line hover:border-zinc-600"}`,children:[x.jsx("span",{className:`absolute inset-y-0 left-0 w-[3px] ${l.rail} ${n?"animate-pulse":""}`}),x.jsx(ys,{type:"target",position:he.Left,className:"!border-0 !bg-zinc-600"}),x.jsxs("div",{className:"py-2.5 pl-3.5 pr-3",children:[x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx("span",{className:`grid h-5 w-5 shrink-0 place-items-center rounded ${l.badge}`,children:x.jsx(i,{width:12,height:12})}),x.jsx("span",{className:"truncate text-[13px] font-medium text-zinc-100",children:e.name}),x.jsx("span",{className:`ml-auto grid h-4 w-4 shrink-0 place-items-center rounded-full ${l.pill} ${n?"animate-pulse":""}`,children:t?x.jsx(Di,{width:9,height:9}):n?x.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}):x.jsx(gS,{width:9,height:9})})]}),x.jsxs("div",{className:"mono mt-1.5 flex items-center gap-1.5 text-[10px] text-zinc-500",children:[r?x.jsxs("span",{className:"flex items-center gap-1",children:[!s&&x.jsx("button",{type:"button",onClick:a=>{var c;a.stopPropagation(),e.childRunId&&((c=e.onToggleChild)==null||c.call(e,e.childRunId))},title:e.childExpanded?"Collapse child flow":"Expand child flow inline",className:"grid h-4 w-4 place-items-center rounded border border-indigo-500/30 bg-indigo-500/10 text-indigo-300 transition-colors hover:border-indigo-400/60 hover:bg-indigo-500/20 hover:text-indigo-200",children:x.jsx("span",{className:"inline-block text-[9px] transition-transform",style:{transform:e.childExpanded?"rotate(90deg)":"rotate(0deg)"},children:"▸"})}),x.jsx("button",{type:"button",onClick:a=>{var c;a.stopPropagation(),e.childRunId&&((c=e.onOpenRun)==null||c.call(e,e.childRunId))},title:"Open the child run",className:"rounded border border-indigo-500/30 bg-indigo-500/10 px-1 text-indigo-300 transition-colors hover:border-indigo-400/60 hover:bg-indigo-500/20 hover:text-indigo-200",children:"child ↗"})]}):x.jsx("span",{className:"rounded border border-line px-1 text-zinc-400",children:e.kind}),e.attempts>1&&x.jsxs("span",{className:"flex items-center gap-0.5 text-amber-300",children:[x.jsx(Gg,{width:9,height:9}),e.attempts]}),e.workerGroup&&x.jsxs("span",{className:"truncate",children:["@",e.workerGroup]}),x.jsxs("span",{className:"tnum ml-auto text-zinc-400",children:["#",e.seq,e.duration&&x.jsxs("span",{className:"text-zinc-600",children:[" · ",e.duration]})]})]}),e.subs&&x.jsxs("div",{className:"mono mt-1.5 flex items-center gap-2 border-t border-line pt-1.5 text-[10px]",children:[e.subs.ok>0&&x.jsxs("span",{className:"text-emerald-300",children:[e.subs.ok," ok"]}),e.subs.failed>0&&x.jsxs("span",{className:"text-red-300",children:[e.subs.failed," failed"]}),e.subs.skipped>0&&x.jsxs("span",{className:"text-amber-300",children:[e.subs.skipped," skipped"]})]})]}),x.jsx(ys,{type:"source",position:he.Right,className:"!border-0 !bg-zinc-600"})]})}function r5({data:e}){const t=e.status==="running"||e.status==="awaiting";return x.jsxs("div",{className:`s-${e.status} flex items-center gap-2 rounded-full border border-current/30 bg-panel px-3.5 py-1.5`,children:[x.jsx(ys,{type:"target",position:he.Left,className:"!border-0 !bg-zinc-600"}),x.jsx("span",{className:`dot ${t?"pulse":""}`}),x.jsx("span",{className:"mono text-[11px] uppercase tracking-wider",children:e.label}),x.jsx(ys,{type:"source",position:he.Right,className:"!border-0 !bg-zinc-600"})]})}const s5={step:n5,terminal:r5};function o5(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 i5({run:e,timeline:t,endStatus:n,selectedKey:r,onSelect:s,onOpenRun:o,fmtDuration:i,expanded:l,onToggleChild:a}){const c=l??JD,u=S.useMemo(()=>{const v=new Set(c);for(const b of t){const h=oo(b);h!==void 0&&v.add(h)}return v},[c,t]),f=t5(u),{nodes:d,edges:p}=(()=>{const y=[],g=[],w=e.status==="running"||e.status==="suspended",E=(A,P,M)=>({id:`${A}->${P}`,source:A,target:P,style:{stroke:M?"#f87171":"var(--line)",strokeWidth:1.5}}),C=(A,P)=>({id:`${A}=>${P}`,source:A,target:P,style:{stroke:"#818cf8",strokeWidth:1.5,strokeDasharray:"4 3"}});function R(A,P,M,z,D,T){const _=`${D}s${A.seq}`,O=oo(A),B=O!==void 0?f[O]:void 0,$=B!==void 0&&B.timeline.length===1&&B.timeline[0]?{step:B.timeline[0],run:B.run}:void 0,V=$!==void 0,Y=!V&&O!==void 0&&c.has(O),U=$?$.step:A,K=$?$.run:T,Q=$?$.step.name:O!==void 0?(B==null?void 0:B.run.workflow)??"child workflow":A.name,H=U.status==="failed";y.push({id:_,type:"step",draggable:!1,position:{x:P,y:M},data:{seq:U.seq,name:Q,kind:U.kind,status:U.status,workerGroup:U.workerGroup,attempts:U.attempts,duration:i(U.startedAt,U.finishedAt),subs:o5(U),selected:r===`${U.runId}#${U.seq}`,childRunId:O,onOpenRun:o,childExpanded:Y,onToggleChild:a,collapsed:V,depth:z,step:U,laneRun:K}});const W=Y?B:void 0;if(W){const G=k(W.timeline,z+1,P+248,M+150,`${O}:`,W.run);for(const X of G.firstIds)g.push(C(_,X));const J=e5(A.name)&&G.connectors.length>0?G.connectors:[{id:_,failed:H}];return{id:_,exits:J,nextX:Math.max(P+248,G.nextX),bottomY:Math.max(M,G.bottomY)}}return{id:_,exits:[{id:_,failed:H}],nextX:P+248,bottomY:M}}function k(A,P,M,z,D,T){let _=M;const O=[];let B=[],$=z;for(const V of hS(A)){const Y=V.kind==="single"?[V.step]:V.steps,U=O.length===0,K=[];let Q=z,H=_;for(const W of Y){const G=R(W,_,Q,P,D,T);U&&O.push(G.id);for(const J of B)g.push(E(J.id,G.id,J.failed));K.push(...G.exits),H=Math.max(H,G.nextX),Q=G.bottomY+96}B=K,_=H,$=Math.max($,Q-96)}return{firstIds:O,connectors:B,nextX:_,bottomY:$}}const N=248;y.push({id:"start",type:"terminal",position:{x:0,y:0},draggable:!1,data:{status:"running",label:e.workflow}});const I=k(t,0,N,0,"",e);for(const A of I.firstIds)g.push({id:`start->${A}`,source:"start",target:A});const j=n??aI(e,t);y.push({id:"end",type:"terminal",position:{x:Math.max(I.nextX,N),y:0},draggable:!1,data:{status:j,label:j}});const L=I.connectors.length>0?I.connectors:[{id:"start",failed:!1}];for(const A of L)g.push({id:`${A.id}->end`,source:A.id,target:"end",animated:w,style:{stroke:w?"var(--live)":"var(--line)",strokeWidth:w?2:1.5}});return{nodes:y,edges:g}})(),m=S.useCallback((v,b)=>{if(b.type!=="step")return;const h=b.data;h.step&&h.laneRun&&s(h.step,h.laneRun)},[s]);return x.jsxs(kD,{nodes:d,edges:p,nodeTypes:s5,onNodeClick:m,fitView:!0,fitViewOptions:{padding:.3,maxZoom:1.1},proOptions:{hideAttribution:!0},nodesConnectable:!1,nodesDraggable:!1,panOnScroll:!0,minZoom:.3,children:[x.jsx(ND,{variant:xr.Dots,gap:22,size:1,color:"#1c1c22"}),x.jsx(zD,{showInteractive:!1,position:"bottom-right"})]})}function Lc(e){const t=e.lastIndexOf("~retry~");return t===-1?void 0:e.slice(0,t)}function Of(e){const n=(Lc(e)??e).match(/^(.*)\.child\.\d+$/);return(n==null?void 0:n[1])||void 0}const dk=Z1("inline-flex items-center gap-1.5 rounded border px-1.5 text-[10px] leading-relaxed",{variants:{variant:{outline:"border-line bg-zinc-800/40 text-zinc-400",tenant:"border-sky-500/30 bg-sky-500/10 text-sky-300",origin:"border-teal-500/30 bg-teal-500/10 text-teal-300","origin-unknown":"border-line bg-zinc-800/40 italic text-zinc-500",attr:"border-indigo-500/30 bg-indigo-500/10 text-indigo-300",danger:"border-rose-500/40 bg-rose-500/10 text-rose-300",warn:"border-warn/40 bg-warn/10 text-warn",status:"border-transparent px-0 uppercase tracking-wider"}},defaultVariants:{variant:"outline"}}),$t=S.forwardRef(({className:e,variant:t,...n},r)=>x.jsx("span",{ref:r,className:ft(dk({variant:t}),e),...n}));$t.displayName="Badge";function l5(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(i=>o.searchParams.append("args[]",i)),`${t} error #${r}; visit ${o} for the full message.`}}const Yt=l5("https://base-ui.com/production-error","Base UI"),fk=S.createContext(void 0);function yo(e){const t=S.useContext(fk);if(!e&&t===void 0)throw new Error(Yt(27));return t}const Jx={};function wn(e,t){const n=S.useRef(Jx);return n.current===Jx&&(n.current=e(t)),n}function Ti(e,t,n,r){const s=wn(hk).current;return c5(s,e,t,n,r)&&pk(s,[e,t,n,r]),s.callback}function a5(e){const t=wn(hk).current;return u5(t,e)&&pk(t,e),t.callback}function hk(){return{callback:null,cleanup:null,refs:[]}}function c5(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function u5(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function pk(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=o(n);typeof i=="function"&&(r[s]=i);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const i=r[s];typeof i=="function"?i():o(null);break}case"object":{o.current=null;break}}}}}}}const d5=parseInt(S.version,10);function bm(e){return d5>=e}function ev(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(bm(19)?n==null?void 0:n.ref:t.ref)??null}function Rp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function Sm(){}const _u=Object.freeze([]),mt=Object.freeze({});function f5(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function h5(e,t){return typeof e=="function"?e(t):e}function p5(e,t){return typeof e=="function"?e(t):e}const Em={};function Sd(e,t,n,r,s){if(!n&&!r&&!e)return Ou(t);let o=Ou(e);return t&&(o=$c(o,t)),n&&(o=$c(o,n)),r&&(o=$c(o,r)),o}function g5(e){if(e.length===0)return Em;if(e.length===1)return Ou(e[0]);let t=Ou(e[0]);for(let n=1;n<e.length;n+=1)t=$c(t,e[n]);return t}function Ou(e){return km(e)?{...mk(e,Em)}:m5(e)}function $c(e,t){return km(t)?mk(t,e):y5(e,t)}function m5(e){const t={...e};for(const n in t){const r=t[n];gk(n,r)&&(t[n]=yk(r))}return t}function y5(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Rp(e.style,r);break}case"className":{e[n]=xk(e.className,r);break}default:gk(n,r)?e[n]=x5(e[n],r):e[n]=r}}return e}function gk(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function km(e){return typeof e=="function"}function mk(e,t){return km(e)?e(t):e??Em}function x5(e,t){return t?e?(...n)=>{const r=n[0];if(vk(r)){const o=r;Au(o);const i=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),i}const s=t(...n);return e==null||e(...n),s}:yk(t):e}function yk(e){return e&&((...t)=>{const n=t[0];return vk(n)&&Au(n),e(...t)})}function Au(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function xk(e,t){return t?e?t+" "+e:t:e}function vk(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function zt(e,t,n={}){const r=t.render,s=v5(t,n);if(n.enabled===!1)return null;const o=n.state??mt;return S5(e,r,s,o)}function v5(e,t={}){const{className:n,style:r,render:s}=e,{state:o=mt,ref:i,props:l,stateAttributesMapping:a,enabled:c=!0}=t,u=c?h5(n,o):void 0,f=c?p5(r,o):void 0,d=c?f5(o,a):mt,p=c&&l?w5(l):void 0,m=c?Rp(d,p)??{}:mt;return typeof document<"u"&&(c?Array.isArray(i)?m.ref=a5([m.ref,ev(s),...i]):m.ref=Ti(m.ref,ev(s),i):Ti(null,null)),c?(u!==void 0&&(m.className=xk(m.className,u)),f!==void 0&&(m.style=Rp(m.style,f)),m):mt}function w5(e){return Array.isArray(e)?g5(e):Sd(void 0,e)}const b5=Symbol.for("react.lazy");function S5(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Sd(n,t.props);s.ref=n.ref;let o=t;return(o==null?void 0:o.$$typeof)===b5&&(o=S.Children.toArray(t)[0]),S.cloneElement(o,s)}if(e&&typeof e=="string")return E5(e,n);throw new Error(Yt(8))}function E5(e,t){return e==="button"?S.createElement("button",{type:"button",...t,key:t.key}):e==="img"?S.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}let tv=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const k5={"data-starting-style":""},C5={"data-ending-style":""},Cm={transitionStatus(e){return e==="starting"?k5:e==="ending"?C5:null}};(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=tv.startingStyle]="startingStyle",e[e.endingStyle=tv.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const R5={"data-popup-open":""},P5={"data-popup-open":"","data-pressed":""},T5={"data-open":""},N5={"data-closed":""},I5={"data-anchor-hidden":""},wk={open(e){return e?R5:null}},M5={open(e){return e?P5:null}},Rm={open(e){return e?T5:N5},anchorHidden(e){return e?I5:null}},Pm={...Rm,...Cm},_5=S.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:i=!1,...l}=t,a=yo(),c=a.useState("open"),u=a.useState("nested"),f=a.useState("mounted"),d=a.useState("transitionStatus");return zt("div",t,{state:{open:c,transitionStatus:d},ref:[a.context.backdropRef,n],stateAttributesMapping:Pm,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:i||!u})});function Ed(){return typeof window<"u"}function vt(e){return Tm(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Nr(e){var t;return(t=(Tm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tm(e){return Ed()?e instanceof Node||e instanceof et(e).Node:!1}function Ee(e){return Ed()?e instanceof Element||e instanceof et(e).Element:!1}function $e(e){return Ed()?e instanceof HTMLElement||e instanceof et(e).HTMLElement:!1}function Ni(e){return!Ed()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof et(e).ShadowRoot}function Ea(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function O5(e){return/^(table|td|th)$/.test(vt(e))}function kd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const A5=/transform|translate|scale|rotate|perspective|filter/,j5=/paint|layout|strict|content/,Is=e=>!!e&&e!=="none";let Af;function Nm(e){const t=Ee(e)?rn(e):e;return Is(t.transform)||Is(t.translate)||Is(t.scale)||Is(t.rotate)||Is(t.perspective)||!Im()&&(Is(t.backdropFilter)||Is(t.filter))||A5.test(t.willChange||"")||j5.test(t.contain||"")}function z5(e){let t=xs(e);for(;$e(t)&&!hs(t);){if(Nm(t))return t;if(kd(t))return null;t=xs(t)}return null}function Im(){return Af==null&&(Af=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Af}function hs(e){return/^(html|body|#document)$/.test(vt(e))}function rn(e){return et(e).getComputedStyle(e)}function Cd(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xs(e){if(vt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ni(e)&&e.host||Nr(e);return Ni(t)?t.host:t}function bk(e){const t=xs(e);return hs(t)?(e.ownerDocument||e).body:$e(t)&&Ea(t)?t:bk(t)}function Zl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=bk(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=et(s);if(o){const l=Pp(i);return t.concat(i,i.visualViewport||[],Ea(s)?s:[],l&&n?Zl(l):[])}else return t.concat(s,Zl(s,[],n))}function Pp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mm={...DR},jf=Mm.useInsertionEffect,D5=jf&&jf!==Mm.useLayoutEffect?jf:e=>e();function me(e){const t=wn(F5).current;return t.next=e,D5(t.effect),t.trampoline}function F5(){const e={next:void 0,callback:L5,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function L5(){}const $5=()=>{},pe=typeof document<"u"?S.useLayoutEffect:$5,Sk=S.createContext(void 0);function _m(e=!1){const t=S.useContext(Sk);if(t===void 0&&!e)throw new Error(Yt(16));return t}function H5(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,i=r&&t!==!1,l=r&&t===!1;return{props:S.useMemo(()=>{const c={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=s,!o&&n&&(c.tabIndex=t?s:-1)),(o&&(t||i)||!o&&n)&&(c["aria-disabled"]=n),o&&(!t||l)&&(c.disabled=n),c},[r,n,t,i,l,o,s])}}function je(e){return(e==null?void 0:e.ownerDocument)||document}function zf(e,t,{detail:n=0}={}){e.dispatchEvent(new(et(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Om(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,i=S.useRef(null),l=_m(!0),a=o??l!==void 0,{props:c}=H5({focusableWhenDisabled:n,disabled:t,composite:a,tabIndex:r,isNativeButton:s}),u=S.useCallback(()=>{const p=i.current;Df(p)&&a&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,a]);pe(u,[u]);const f=S.useCallback((p={})=>{const{onClick:m,onMouseDown:v,onKeyUp:b,onKeyDown:h,onPointerDown:y,...g}=p;return Sd({onClick(w){if(t){w.preventDefault();return}m==null||m(w)},onMouseDown(w){t||v==null||v(w)},onKeyDown(w){if(t||(Au(w),h==null||h(w),w.baseUIHandlerPrevented))return;const E=w.target===w.currentTarget,C=w.currentTarget,R=Df(C),k=!s&&B5(C),N=E&&(s?R:!k),I=w.key==="Enter",j=w.key===" ",L=C.getAttribute("role"),A=(L==null?void 0:L.startsWith("menuitem"))||L==="option"||L==="gridcell";if(E&&a&&j){if(w.defaultPrevented&&A)return;w.preventDefault(),(!s||R)&&(w.preventBaseUIHandler(),zf(C,w));return}if(!N||s||!j&&!I){E&&k&&j&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),I&&(w.preventBaseUIHandler(),zf(C,w)))},onKeyUp(w){if(!t){if(Au(w),b==null||b(w),w.target===w.currentTarget&&s&&a&&Df(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!s&&!a&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),zf(w.currentTarget,w))}},onPointerDown(w){if(t){w.preventDefault();return}y==null||y(w)}},s?{type:"button"}:{role:"button"},c,g)},[t,c,a,s]),d=me(p=>{i.current=p,u()});return{getButtonProps:f,buttonRef:d}}function Df(e){return $e(e)&&e.tagName==="BUTTON"}function B5(e){return $e(e)&&e.tagName==="A"&&!!e.href}const Rd="none",vs="trigger-press",gt="trigger-hover",Hc="trigger-focus",Ek="outside-press",kk="close-press",Jl="focus-out",Pd="escape-key",Ck="disabled",nv="missing",rv="initial",Am="imperative-action";function Me(e,t,n,r){let s=!1,o=!1;const i=r??mt;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...i}}const V5=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,...a}=t,c=yo(),u=c.useState("open"),{getButtonProps:f,buttonRef:d}=Om({disabled:i,native:l}),p={disabled:i};function m(v){u&&c.setOpen(!1,Me(kk,v.nativeEvent))}return zt("button",t,{state:p,ref:[n,d],props:[{onClick:m},a,f]})});let sv=0;function W5(e,t="mui"){const[n,r]=S.useState(e),s=e||n;return S.useEffect(()=>{n==null&&(sv+=1,r(`${t}-${sv}`))},[n,t]),s}const ov=Mm.useId;function Td(e,t){if(ov!==void 0){const n=ov();return e??(t?`${t}-${n}`:n)}return W5(e,t)}function Fi(e){return Td(e,"base-ui")}const U5=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=yo(),c=Fi(i);return a.useSyncedValueWithCleanup("descriptionElementId",c),zt("p",t,{ref:n,props:[{id:c},l]})});function jm(e){S.useEffect(e,_u)}const nl=0;class bn{constructor(){Ie(this,"currentId",nl);Ie(this,"clear",()=>{this.currentId!==nl&&(clearTimeout(this.currentId),this.currentId=nl)});Ie(this,"disposeEffect",()=>this.clear)}static create(){return new bn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=nl,n()},t)}isStarted(){return this.currentId!==nl}}function Pr(){const e=wn(bn.create).current;return jm(e.disposeEffect),e}function K5(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Y5,platform:q5,maxTouchPoints:Q5}=K5(),Nd=Y5.toLowerCase(),ea=q5.toLowerCase(),Id=/^i(os$|p)/.test(ea)||ea==="macintel"&&Q5>1,iv="android",Tp=ea===iv||Nd.includes(iv),Rk=!Id&&ea.startsWith("mac");ea.startsWith("win");const X5=Rk||Id;var aw;const xo=typeof CSS<"u"&&!!((aw=CSS.supports)!=null&&aw.call(CSS,"-webkit-backdrop-filter:none"));!xo&&Nd.includes("firefox");!xo&&Nd.includes("chrom");const G5=X5,Pk=/jsdom|happydom/.test(Nd);function Z5(e){e.preventDefault(),e.stopPropagation()}function J5(e){return"nativeEvent"in e}function eF(e){return e.pointerType===""&&e.isTrusted?!0:Tp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Tk(e){return Pk?!1:!Tp&&e.width===0&&e.height===0||Tp&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ps(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function tF(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Np="data-base-ui-focusable",Nk="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function un(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function ye(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Ni(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ct(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ju(e,t){if(!Ee(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(ye(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Ff(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function nF(e){return e.matches("html,body")}function Md(e){return $e(e)&&e.matches(Nk)}function rF(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Nk}`))!=null}function lv(e){return e?e.getAttribute("role")==="combobox"&&Md(e):!1}function sF(e){if(!e||Pk)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function av(e){return e?e.hasAttribute(Np)?e:e.querySelector(`[${Np}]`)||e:null}function oF(e,t){return t!=null&&!ps(t)?0:typeof e=="function"?e():e}function ws(e,t,n){const r=oF(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function cv(e){return typeof e=="function"?e():e}function Ik(e,t){return t||e==="click"||e==="mousedown"}function iF(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const Mk=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new bn,currentIdRef:{current:null},currentContextRef:{current:null}});function lF(e,t){e.current=t.current}function aF(e){const{children:t,delay:n,timeoutMs:r=0}=e,s=S.useRef(n),o=S.useRef(n),i=S.useRef(null),l=S.useRef(null),a=Pr();return pe(()=>{if(o.current=n,!i.current){s.current=n;return}s.current={open:ws(s.current,"open"),close:ws(n,"close")}},[n,i,s,o]),x.jsx(Mk.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:o,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:a}),[r,a]),children:t})}function cF(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=S.useContext(Mk),{currentIdRef:i,delayRef:l,timeoutMs:a,initialDelayRef:c,currentContextRef:u,hasProvider:f,timeout:d}=o,[p,m]=S.useState(!1),v=S.useRef(n);return pe(()=>{v.current=n},[n]),pe(()=>{function b(){var h;(h=u.current)==null||h.setIsInstantPhase(!1),i.current=null,u.current=null,l.current=c.current,d.clear()}if(i.current&&!n&&i.current===s){if(m(!1),a){const h=s;return d.start(a,()=>{r.select("open")||i.current&&i.current!==h||b()}),()=>{(v.current||i.current!==h)&&d.clear()}}b()}},[n,s,i,l,a,c,u,d,r]),pe(()=>{if(!n)return;const b=u.current,h=i.current;d.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:m},i.current=s,l.current={open:0,close:ws(c.current,"close")},h!==null&&h!==s?(m(!0),b==null||b.setIsInstantPhase(!0),b==null||b.onOpenChange(!1,Me(Rd))):(m(!1),b==null||b.setIsInstantPhase(!1))},[n,s,r,i,l,c,u,d]),pe(()=>()=>{if(i.current===s){if(u.current=null,!v.current)return;i.current=null,lF(l,c),d.clear()}},[u,i,l,s,c,d]),S.useMemo(()=>({hasProvider:f,delayRef:l,isInstantPhase:p}),[f,l,p])}function be(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function tr(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function _t(e){const t=wn(uF,e).current;return t.next=e,pe(t.effect),t}function uF(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const hc=null;class dF{constructor(){Ie(this,"callbacks",[]);Ie(this,"callbacksCount",0);Ie(this,"nextId",1);Ie(this,"startId",1);Ie(this,"isScheduled",!1);Ie(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let pc=new dF;class Qn{constructor(){Ie(this,"currentId",hc);Ie(this,"cancel",()=>{this.currentId!==hc&&(pc.cancel(this.currentId),this.currentId=hc)});Ie(this,"disposeEffect",()=>this.cancel)}static create(){return new Qn}static request(t){return pc.request(t)}static cancel(t){return pc.cancel(t)}request(t){this.cancel(),this.currentId=pc.request(()=>{this.currentId=hc,t()})}}function zm(){const e=wn(Qn.create).current;return jm(e.disposeEffect),e}const fF={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},hF={...fF,position:"fixed",top:0,left:0},Ii=S.forwardRef(function(t,n){const[r,s]=S.useState();pe(()=>{G5&&xo&&s("button")},[]);const o={tabIndex:0,role:r};return x.jsx("span",{...t,ref:n,style:hF,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),Mi=Math.min,vr=Math.max,zu=Math.round,gc=Math.floor,wr=e=>({x:e,y:e}),pF={left:"right",right:"left",bottom:"top",top:"bottom"};function _k(e,t,n){return vr(e,Mi(t,n))}function bs(e,t){return typeof e=="function"?e(t):e}function mn(e){return e.split("-")[0]}function Ps(e){return e.split("-")[1]}function Dm(e){return e==="x"?"y":"x"}function Fm(e){return e==="y"?"height":"width"}function pn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Lm(e){return Dm(pn(e))}function gF(e,t,n){n===void 0&&(n=!1);const r=Ps(e),s=Lm(e),o=Fm(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Du(i)),[i,Du(i)]}function mF(e){const t=Du(e);return[Ip(e),t,Ip(t)]}function Ip(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const uv=["left","right"],dv=["right","left"],yF=["top","bottom"],xF=["bottom","top"];function vF(e,t,n){switch(e){case"top":case"bottom":return n?t?dv:uv:t?uv:dv;case"left":case"right":return t?yF:xF;default:return[]}}function wF(e,t,n,r){const s=Ps(e);let o=vF(mn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Ip)))),o}function Du(e){const t=mn(e);return pF[t]+e.slice(t.length)}function bF(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function Ok(e){return typeof e!="number"?bF(e):{top:e,right:e,bottom:e,left:e}}function Fu(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Lf(e,t){return t<0||t>=e.length}function SF(e,t){return Sl(e.current,{disabledIndices:t})}function EF(e,t){return Sl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Sl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let o=t;do o+=n?-s:s;while(o>=0&&o<=e.length-1&&Mp(e,o,r));return o}function Mp(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!$m(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function kF(e){return e.visibility==="hidden"||e.visibility==="collapse"}function $m(e,t=e?rn(e):null){return!e||!e.isConnected||!t||kF(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const CF='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function RF(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Ni(n)?n.host:null}function _p(e){for(const t of Array.from(e.children))if(vt(t)==="summary")return t;return null}function PF(e,t){const n=_p(t);return!!n&&(e===n||ye(n,e))}function Ak(e){const t=e?vt(e):"";return e!=null&&e.matches(CF)&&(t!=="summary"||e.parentElement!=null&&vt(e.parentElement)==="details"&&_p(e.parentElement)===e)&&(t!=="details"||_p(e)==null)&&(t!=="input"||e.type!=="hidden")}function jk(e){if(!Ak(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=RF(t)){const n=t!==e,r=vt(t)==="slot";if(t.hasAttribute("inert")||n&&vt(t)==="details"&&!t.open&&!PF(e,t)||t.hasAttribute("hidden")||!r&&!TF(t,n))return!1}return!0}function TF(e,t){const n=rn(e);return t?n.display!=="none":$m(e,n)}function zk(e){const t=e.tabIndex;if(t<0){const n=vt(e);if(n==="details"||n==="audio"||n==="video"||$e(e)&&e.isContentEditable)return 0}return t}function $f(e){if(vt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function NF(e,t){const n=$f(e);if(!n)return!0;const r=t.find(s=>{const o=$f(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=$f(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function Dk(e){if($e(e)&&vt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return $e(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Fk(e,t){Dk(e).forEach(n=>{Ak(n)&&t.push(n),Fk(n,t)})}function Lk(e,t,n){Dk(e).forEach(r=>{$e(r)&&r.matches(t)&&n.push(r),Lk(r,t,n)})}function Hm(e){return jk(e)&&zk(e)>=0}function $k(e){const t=[];return Fk(e,t),t.filter(jk)}function ka(e){const t=$k(e);return t.filter(n=>zk(n)>=0&&NF(n,t))}function Hk(e,t){const n=ka(e),r=n.length;if(r===0)return;const s=un(je(e)),o=n.indexOf(s),i=o===-1?t===1?0:r-1:o+t;return n[i]}function Bm(e){return Hk(je(e).body,1)||e}function Bk(e){return Hk(je(e).body,-1)||e}function Vk(e,t){if(!e)return null;const n=ka(je(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function IF(e){return Vk(e,1)}function MF(e){return Vk(e,-1)}function Xo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ye(n,r)}function _F(e){ka(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function fv(e){const t=[];Lk(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Ss(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var o;return[...!n||(o=s.context)!=null&&o.open?[s]:[],...Ss(e,s.id,n)]})}function hv(e,t){var s;let n=[],r=(s=e.find(o=>o.id===t))==null?void 0:s.parentId;for(;r;){const o=e.find(i=>i.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function ta(e){return`data-base-ui-${e}`}let mc=0;function Hf(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(mc);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),Sm;const i=requestAnimationFrame(o);return mc=i,()=>{mc===i&&(cancelAnimationFrame(i),mc=0)}}const Bf={inert:new WeakMap,"aria-hidden":new WeakMap},pv="data-base-ui-inert",Op={inert:new WeakSet,"aria-hidden":new WeakSet};let rl=new WeakMap,Vf=0;function OF(e){return Op[e]}function Wk(e){return e?Ni(e)?e.host:Wk(e.parentNode):null}const gv=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Wk(n);return e.contains(r)?r:null}).filter(n=>n!=null),mv=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},yv=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(i=>{vt(i)!=="script"&&(t.has(i)?s(i):r.push(i))})};return s(e),r};function AF(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let i=null,l=null;const a=gv(t,e),c=s?yv(t,mv(a),new Set(a)):[],u=[],f=[];if(o){const d=Bf[o],p=OF(o);l=p,i=d;const m=gv(t,Array.from(t.querySelectorAll("[aria-live]"))),v=a.concat(m);yv(t,mv(v),new Set(v)).forEach(h=>{const y=h.getAttribute(o),g=y!==null&&y!=="false",w=(d.get(h)||0)+1;d.set(h,w),u.push(h),w===1&&g&&p.add(h),g||h.setAttribute(o,o==="inert"?"":"true")})}return s&&c.forEach(d=>{const p=(rl.get(d)||0)+1;rl.set(d,p),f.push(d),p===1&&d.setAttribute(pv,"")}),Vf+=1,()=>{i&&u.forEach(d=>{const m=(i.get(d)||0)-1;i.set(d,m),m||(!(l!=null&&l.has(d))&&o&&d.removeAttribute(o),l==null||l.delete(d))}),s&&f.forEach(d=>{const p=(rl.get(d)||0)-1;rl.set(d,p),p||d.removeAttribute(pv)}),Vf-=1,Vf||(Bf.inert=new WeakMap,Bf["aria-hidden"]=new WeakMap,Op.inert=new WeakSet,Op["aria-hidden"]=new WeakSet,rl=new WeakMap)}}function xv(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=je(e[0]).body;return AF(e,o,n,r,{mark:s})}const jF=500,zF={style:{transition:"none"}},Uk="data-base-ui-click-trigger",Kk={fallbackAxisSide:"end"},DF={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Yk=S.createContext(null),qk=()=>S.useContext(Yk),FF=ta("portal");function Qk(e={}){const{ref:t,container:n,componentProps:r=mt,elementProps:s}=e,o=Td(),i=qk(),l=i==null?void 0:i.portalNode,[a,c]=S.useState(null),[u,f]=S.useState(null),d=me(b=>{b!==null&&f(b)}),p=S.useRef(null);pe(()=>{if(n===null){p.current&&(p.current=null,f(null),c(null));return}const b=(n&&(Tm(n)?n:n.current))??l??document.body;if(b==null){p.current&&(p.current=null,f(null),c(null));return}p.current!==b&&(p.current=b,f(null),c(b))},[n,l]);const m=zt("div",r,{ref:[t,d],props:[{id:o,[FF]:""},s]}),v=a&&m?vn.createPortal(m,a):null;return{node:u,nodeId:S.isValidElement(m)?m.props.id:void 0,subtree:v}}const Xk=S.forwardRef(function(t,n){const{render:r,className:s,style:o,children:i,container:l,...a}=t,{node:c,nodeId:u,subtree:f}=Qk({container:l,ref:n,componentProps:t,elementProps:a}),d=S.useRef(null),p=S.useRef(null),m=S.useRef(null),v=S.useRef(null),[b,h]=S.useState(null),y=S.useRef(!1),g=b==null?void 0:b.modal,w=b==null?void 0:b.open,E=!!b&&!b.modal&&b.open&&!!c;S.useEffect(()=>{if(!c||g)return;function R(k){c&&k.relatedTarget&&Xo(k)&&(k.type==="focusin"?y.current&&(fv(c),y.current=!1):(_F(c),y.current=!0))}return tr(be(c,"focusin",R,!0),be(c,"focusout",R,!0))},[c,g]),pe(()=>{!c||w!==!0||!y.current||(fv(c),y.current=!1)},[w,c]);const C=S.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:c,setFocusManagerState:h}),[c]);return x.jsxs(S.Fragment,{children:[f,x.jsxs(Yk.Provider,{value:C,children:[E&&c&&x.jsx(Ii,{"data-type":"outside",ref:d,onFocus:R=>{var k;if(Xo(R,c))(k=m.current)==null||k.focus();else{const N=b?b.domReference:null,I=Bk(N);I==null||I.focus()}}}),E&&c&&x.jsx("span",{"aria-owns":u,style:DF}),c&&vn.createPortal(i,c),E&&c&&x.jsx(Ii,{"data-type":"outside",ref:p,onFocus:R=>{var k;if(Xo(R,c))(k=v.current)==null||k.focus();else{const N=b?b.domReference:null,I=Bm(N);I==null||I.focus(),b!=null&&b.closeOnFocusOut&&(b==null||b.onOpenChange(!1,Me(Jl,R.nativeEvent)))}}})]})]})});function Gk(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class LF{constructor(){Ie(this,"nodesRef",{current:[]});Ie(this,"events",Gk())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Zk=S.createContext(null),Jk=S.createContext(null),_d=()=>{var e;return((e=S.useContext(Zk))==null?void 0:e.id)||null},Li=e=>{const t=S.useContext(Jk);return e??t};function $F(e){const t=Td(),n=Li(e),r=_d();return pe(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function HF(e){const{children:t,id:n}=e,r=_d();return x.jsx(Zk.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function BF(e){const{children:t,externalTree:n}=e,r=wn(()=>n??new LF).current;return x.jsx(Jk.Provider,{value:r,children:t})}function lr(e){return e==null?e:"current"in e?e.current:e}function VF(e,t){const n=et(Ct(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const vv=20;let rs=[];function Vm(){rs=rs.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function wv(e){Vm(),e&&vt(e)!=="body"&&(rs.push(new WeakRef(e)),rs.length>vv&&(rs=rs.slice(-vv)))}function bv(){var e;return Vm(),(e=rs[rs.length-1])==null?void 0:e.deref()}function WF(e){return e?Hm(e)?e:ka(e)[0]||e:null}function Sv(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=$k(e).filter(o=>{const i=o.getAttribute("data-tabindex")||"";return Hm(o)||o.hasAttribute("data-tabindex")&&!i.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function eC(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:i=!1,modal:l=!0,closeOnFocusOut:a=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:f,beforeContentFocusGuardRef:d,externalTree:p,getInsideElements:m}=e,v="rootStore"in t?t.rootStore:t,b=v.useState("open"),h=v.useState("domReferenceElement"),y=v.useState("floatingElement"),{events:g,dataRef:w}=v.context,E=me(()=>{var X;return(X=w.current.floatingContext)==null?void 0:X.nodeId}),C=s===!1,R=lv(h)&&C,k=_t(s),N=_t(o),I=_t(c),j=_t(b),L=Li(p),A=qk(),P=S.useRef(!1),M=S.useRef(!1),z=S.useRef(!1),D=S.useRef(null),T=S.useRef(""),_=S.useRef(""),O=S.useRef(null),B=S.useRef(null),$=Ti(O,d,A==null?void 0:A.beforeInsideRef),V=Ti(B,A==null?void 0:A.afterInsideRef),Y=Pr(),U=Pr(),K=zm(),Q=A!=null,H=av(y),W=me((X=H)=>X?ka(X):[]),G=me(()=>(m==null?void 0:m().filter(X=>X!=null))??[]);S.useEffect(()=>{if(r||!l)return;function X(te){te.key==="Tab"&&ye(H,un(je(H)))&&W().length===0&&!R&&Z5(te)}const q=je(H);return be(q,"keydown",X)},[r,H,l,R,W]),S.useEffect(()=>{if(r||!b)return;const X=je(H);function q(){z.current=!1}function te(Z){const ee=Ct(Z),fe=G(),oe=ye(y,ee)||ye(h,ee)||ye(A==null?void 0:A.portalNode,ee)||fe.some(xe=>xe===ee||ye(xe,ee));z.current=!oe,_.current=Z.pointerType||"keyboard",ee!=null&&ee.closest(`[${Uk}]`)&&(M.current=!0,U.start(0,()=>{M.current=!1}))}function le(){_.current="keyboard"}return tr(be(X,"pointerdown",te,!0),be(X,"pointerup",q,!0),be(X,"pointercancel",q,!0),be(X,"keydown",le,!0),q)},[r,y,h,H,b,A,U,G]),S.useEffect(()=>{if(r||!a)return;const X=je(H);function q(){M.current=!0,U.start(0,()=>{M.current=!1})}function te(fe){const oe=Ct(fe);Hm(oe)&&(D.current=oe)}function le(fe){const oe=fe.relatedTarget,xe=fe.currentTarget,Re=Ct(fe);l&&oe==null&&Re!=null&&ye(y,Re)&&wv(Re),queueMicrotask(()=>{const Se=E(),Ae=v.context.triggerElements,se=G(),ie=(oe==null?void 0:oe.hasAttribute(ta("focus-guard")))&&[O.current,B.current,A==null?void 0:A.beforeInsideRef.current,A==null?void 0:A.afterInsideRef.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,lr(f),lr(u)].includes(oe),_e=!(ye(h,oe)||ye(y,oe)||ye(oe,y)||ye(A==null?void 0:A.portalNode,oe)||se.some(ve=>ve===oe||ye(ve,oe))||Ae.hasMatchingElement(ve=>ye(ve,oe))||ie||L&&(Ss(L.nodesRef.current,Se).find(ve=>{var De,Le;return ye((De=ve.context)==null?void 0:De.elements.floating,oe)||ye((Le=ve.context)==null?void 0:Le.elements.domReference,oe)})||hv(L.nodesRef.current,Se).find(ve=>{var De,Le,Pt;return[(De=ve.context)==null?void 0:De.elements.floating,av((Le=ve.context)==null?void 0:Le.elements.floating)].includes(oe)||((Pt=ve.context)==null?void 0:Pt.elements.domReference)===oe})));if(xe===h&&H&&Sv(H),i&&xe!==h&&!$m(Re)&&un(X)===X.body){if($e(H)&&(H.focus(),i==="popup")){K.request(()=>{H.focus()});return}const ve=W(),De=D.current,Le=(De&&ve.includes(De)?De:null)||ve[ve.length-1]||H;$e(Le)&&Le.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(R||!l)&&oe&&_e&&!M.current&&(R||oe!==bv())&&(P.current=!0,v.setOpen(!1,Me(Jl,fe)))})}function Z(){z.current||(w.current.insideReactTree=!0,Y.start(0,()=>{w.current.insideReactTree=!1}))}const ee=$e(h)?h:null;if(!(!y&&!ee))return tr(ee&&be(ee,"focusout",le),ee&&be(ee,"pointerdown",q),y&&be(y,"focusin",te),y&&be(y,"focusout",le),y&&A&&be(y,"focusout",Z,!0))},[r,h,y,H,l,L,A,v,a,i,W,R,E,w,Y,U,K,u,f,G]),S.useEffect(()=>{var xe,Re,Se;if(r||!y||!b)return;const X=Array.from(((xe=A==null?void 0:A.portalNode)==null?void 0:xe.querySelectorAll(`[${ta("portal")}]`))||[]),te=(Se=(Re=(L?hv(L.nodesRef.current,E()):[]).find(Ae=>{var se;return lv(((se=Ae.context)==null?void 0:se.elements.domReference)||null)}))==null?void 0:Re.context)==null?void 0:Se.elements.domReference,Z=[...[y,...X,O.current,B.current,A==null?void 0:A.beforeOutsideRef.current,A==null?void 0:A.afterOutsideRef.current,...G()],te,lr(f),lr(u),R?h:null].filter(Ae=>Ae!=null),ee=xv(Z,{ariaHidden:l||R,mark:!1}),fe=[y,...X].filter(Ae=>Ae!=null),oe=xv(fe);return()=>{oe(),ee()}},[b,r,h,y,l,A,R,L,E,u,f,G]),pe(()=>{if(!b||r||!$e(H))return;T.current="",_.current="";const X=je(H),q=un(X);queueMicrotask(()=>{const te=k.current,le=typeof te=="function"?te(I.current||""):te;if(le===void 0||le===!1||ye(H,q))return;let ee=null;const fe=()=>(ee==null&&(ee=W(H)),ee[0]||H);let oe;le===!0||le===null?oe=fe():oe=lr(le),oe=oe||fe();const xe=ye(H,un(X));Hf(oe,{preventScroll:oe===H,shouldFocus(){if(!j.current)return!1;if(xe)return!0;const Re=un(X);return!(Re!==oe&&ye(H,Re))}})})},[r,b,H,W,k,I,j]),pe(()=>{if(r||!H)return;const X=je(H),q=un(X),te=I.current==null;wv(q);function le(ee){if(ee.open||(T.current=VF(ee.nativeEvent,_.current)),ee.reason===gt&&ee.nativeEvent.type==="mouseleave"&&(P.current=!0),ee.reason===Ek)if(ee.nested)P.current=!1;else if(eF(ee.nativeEvent)||Tk(ee.nativeEvent))P.current=!1;else{let fe=!1;je(H).createElement("div").focus({get preventScroll(){return fe=!0,!1}}),fe?P.current=!1:P.current=!0}}g.on("openchange",le);function Z(ee){const fe=N.current;let oe=typeof fe=="function"?fe(ee):fe;if(oe===void 0||oe===!1)return null;oe===null&&(oe=!0);const xe=h!=null&&h.isConnected?h:null,Re=q!=null&&q.isConnected&&vt(q)!=="body"?q:null;let Se=te?Re||xe:xe||Re;return Se||(Se=bv()||null),typeof oe=="boolean"?Se:lr(oe)||Se||null}return()=>{g.off("openchange",le);const ee=un(X),fe=G(),oe=ye(y,ee)||fe.some(Ae=>Ae===ee||ye(Ae,ee))||L&&Ss(L.nodesRef.current,E(),!1).some(Ae=>{var se;return ye((se=Ae.context)==null?void 0:se.elements.floating,ee)}),xe=N.current,Re=T.current,Se=Z(Re);queueMicrotask(()=>{const Ae=WF(Se),se=typeof xe!="boolean";if(xe&&!P.current&&$e(Ae)&&(!(!se&&Ae!==ee&&ee!==X.body)||oe)){const ie={preventScroll:!0};Re==="keyboard"&&(ie.focusVisible=!0),Ae.focus(ie)}P.current=!1})}},[r,y,H,N,I,g,L,h,E,G]),pe(()=>{if(!xo||b||!y)return;const X=un(je(y));!$e(X)||!Md(X)||ye(y,X)&&X.blur()},[b,y]),pe(()=>{if(!(r||!A))return A.setFocusManagerState({modal:l,closeOnFocusOut:a,open:b,onOpenChange:v.setOpen,domReference:h}),()=>{A.setFocusManagerState(null)}},[r,A,l,b,v,a,h]),pe(()=>{if(!(r||!H))return Sv(H),()=>{queueMicrotask(Vm)}},[r,H]);const J=!r&&(l?!R:!0)&&(Q||l);return x.jsxs(S.Fragment,{children:[J&&x.jsx(Ii,{"data-type":"inside",ref:$,onFocus:X=>{var q;if(l){const te=W();Hf(te[te.length-1])}else if(A!=null&&A.portalNode)if(P.current=!1,Xo(X,A.portalNode)){const te=Bm(h);te==null||te.focus()}else(q=lr(f??A.beforeOutsideRef))==null||q.focus()}}),n,J&&x.jsx(Ii,{"data-type":"inside",ref:V,onFocus:X=>{var q;if(l)Hf(W()[0]);else if(A!=null&&A.portalNode)if(a&&(P.current=!0),Xo(X,A.portalNode)){const te=Bk(h);te==null||te.focus()}else(q=lr(u??A.afterOutsideRef))==null||q.focus()}})]})}function UF(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:o=!1,stickIfOpen:i=!0,touchOpenDelay:l=0,reason:a=vs}=t,c="rootStore"in e?e.rootStore:e,u=c.context.dataRef,f=S.useRef(void 0),d=zm(),p=Pr(),m=S.useMemo(()=>{function v(h,y,g,w){const E=Me(a,y,g);h&&w==="touch"&&l>0?p.start(l,()=>{c.setOpen(!0,E)}):c.setOpen(h,E)}function b(h,y,g){const w=u.current.openEvent,E=c.select("domReferenceElement")!==y;return h&&E||!h||!s?!0:w&&i?!g(w.type):!1}return{onPointerDown(h){f.current=ps(h.pointerType,!0)&&Tk(h.nativeEvent)?"virtual":h.pointerType},onMouseDown(h){const y=f.current,g=h.nativeEvent,w=c.select("open");if(h.button!==0||r==="click"||ps(y,!0)&&o)return;const E=b(w,h.currentTarget,k=>k==="click"||k==="mousedown"),C=Ct(g);if(Md(C)){v(E,g,C,y);return}const R=h.currentTarget;d.request(()=>{v(E,g,R,y)})},onClick(h){if(r==="mousedown-only")return;const y=f.current;if(r==="mousedown"&&y){f.current=void 0;return}if(ps(y,!0)&&o)return;const g=c.select("open"),w=b(g,h.currentTarget,E=>E==="click"||E==="mousedown"||E==="keydown"||E==="keyup");v(w,h.nativeEvent,h.currentTarget,y)},onKeyDown(){f.current=void 0}}},[u,r,o,a,c,i,s,d,p,l]);return S.useMemo(()=>n?{reference:m}:mt,[n,m])}function KF(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var p;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},i=t.axis==="x"||t.axis==="both",l=t.axis==="y"||t.axis==="both",a=["mouseenter","mousemove"].includes(((p=t.dataRef.current.openEvent)==null?void 0:p.type)||"")&&t.pointerType!=="touch";let c=o.width,u=o.height,f=o.x,d=o.y;return n==null&&t.x&&i&&(n=o.x-t.x),r==null&&t.y&&l&&(r=o.y-t.y),f-=n||0,d-=r||0,c=0,u=0,!s||a?(c=t.axis==="y"?o.width:0,u=t.axis==="x"?o.height:0,f=i&&t.x!=null?t.x:f,d=l&&t.y!=null?t.y:d):s&&!a&&(u=t.axis==="x"?o.height:u,c=t.axis==="y"?o.width:c),s=!0,{width:c,height:u,x:f,y:d,top:d,right:f+c,bottom:d+u,left:f}}}}function Ev(e){return e!=null&&e.clientX!=null}function YF(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),i=s.useState("floatingElement"),l=s.useState("domReferenceElement"),a=s.context.dataRef,c=S.useRef(!1),u=S.useRef(null),[f,d]=S.useState(),[p,m]=S.useState([]),v=me(w=>{s.set("positionReference",w)}),b=me((w,E,C)=>{c.current||a.current.openEvent&&!Ev(a.current.openEvent)||s.set("positionReference",KF(C??l,{x:w,y:E,axis:r,dataRef:a,pointerType:f}))}),h=me(w=>{o?u.current||(b(w.clientX,w.clientY,w.currentTarget),m([])):b(w.clientX,w.clientY,w.currentTarget)}),y=ps(f)?i:o;S.useEffect(()=>{if(!n){v(l);return}if(!y)return;function w(){var R;(R=u.current)==null||R.call(u),u.current=null}const E=et(i);function C(R){const k=Ct(R);ye(i,k)?w():b(R.clientX,R.clientY)}return!a.current.openEvent||Ev(a.current.openEvent)?u.current=be(E,"mousemove",C):v(l),w},[y,n,i,a,l,s,b,v,p]),S.useEffect(()=>()=>{s.set("positionReference",null)},[s]),S.useEffect(()=>{n&&!i&&(c.current=!1)},[n,i]),S.useEffect(()=>{!n&&o&&(c.current=!0)},[n,o]);const g=S.useMemo(()=>{function w(E){d(E.pointerType)}return{onPointerDown:w,onPointerEnter:w,onMouseMove:h,onMouseEnter:h}},[h]);return S.useMemo(()=>n?{reference:g,trigger:g}:{},[n,g])}function qF(){return!1}function QF(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Wm(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:i=qF,bubbles:l,externalTree:a}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),f=c.useState("floatingElement"),{dataRef:d}=c.context,p=Li(a),m=me(typeof s=="function"?s:()=>!1),v=typeof s=="function"?m:s,b=v!==!1,h=me(()=>o),{escapeKey:y,outsidePress:g}=QF(l),w=S.useRef(!1),E=S.useRef(!1),C=S.useRef(!1),R=S.useRef(!1),k=S.useRef(""),N=S.useRef(null),I=Pr(),j=Pr(),L=me(()=>{j.clear(),d.current.insideReactTree=!1}),A=me($=>{var U;const V=(U=d.current.floatingContext)==null?void 0:U.nodeId;return(p?Ss(p.nodesRef.current,V):[]).some(K=>{var Q;return((Q=K.context)==null?void 0:Q.open)&&!K.context.dataRef.current[$]})}),P=me($=>Ff($,c.select("floatingElement"))||Ff($,c.select("domReferenceElement"))),M=me($=>{i()&&c.setOpen(!1,Me(vs,$.nativeEvent))}),z=me($=>{if(!u||!n||!r||$.key!=="Escape"||R.current||!y&&A("__escapeKeyBubbles"))return;const V=J5($)?$.nativeEvent:$,Y=Me(Pd,V);c.setOpen(!1,Y),Y.isCanceled||$.preventDefault(),!y&&!Y.isPropagationAllowed&&$.stopPropagation()}),D=me(()=>{d.current.insideReactTree=!0,j.start(0,L)}),T=me($=>{if(!u||!n||$.button!==0)return;const V=Ct($.nativeEvent);ye(c.select("floatingElement"),V)&&(w.current||(w.current=!0,E.current=!1))}),_=me($=>{!u||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&w.current&&(E.current=!0)});S.useEffect(()=>{if(!u||!n)return L;d.current.__escapeKeyBubbles=y,d.current.__outsidePressBubbles=g;const $=new bn,V=new bn;function Y(){$.clear(),R.current=!0}function U(){$.start(xo?5:0,()=>{R.current=!1})}function K(){C.current=!0,V.start(0,()=>{C.current=!1})}function Q(){w.current=!1,E.current=!1}function H(){const se=k.current,ie=se==="pen"||!se?"mouse":se,_e=h(),ve=typeof _e=="function"?_e():_e;return typeof ve=="string"?ve:ve[ie]}function W(se){const ie=H();return ie==="intentional"&&se.type!=="click"||ie==="sloppy"&&se.type==="click"}function G(se){var ve;const ie=(ve=d.current.floatingContext)==null?void 0:ve.nodeId,_e=p&&Ss(p.nodesRef.current,ie).some(De=>{var Le;return Ff(se,(Le=De.context)==null?void 0:Le.elements.floating)});return P(se)||_e}function J(se){if(W(se)){se.type!=="click"&&!P(se)&&(V.clear(),C.current=!1),L();return}if(d.current.insideReactTree){L();return}const ie=Ct(se),_e=`[${ta("inert")}]`,ve=Ee(ie)?ie.getRootNode():null,De=Array.from((Ni(ve)?ve:je(c.select("floatingElement"))).querySelectorAll(_e)),Le=c.context.triggerElements;if(ie&&(Le.hasElement(ie)||Le.hasMatchingElement(Tt=>ye(Tt,ie))))return;let Pt=Ee(ie)?ie:null;for(;Pt&&!hs(Pt);){const Tt=xs(Pt);if(hs(Tt)||!Ee(Tt))break;Pt=Tt}if(!(De.length&&Ee(ie)&&!nF(ie)&&!ye(ie,c.select("floatingElement"))&&De.every(Tt=>!ye(Pt,Tt)))){if($e(ie)&&!("touches"in se)){const Tt=hs(ie),Ir=rn(ie),rr=/auto|scroll/,vo=Tt||rr.test(Ir.overflowX),Mr=Tt||rr.test(Ir.overflowY),Ln=vo&&ie.clientWidth>0&&ie.scrollWidth>ie.clientWidth,wo=Mr&&ie.clientHeight>0&&ie.scrollHeight>ie.clientHeight,bo=Ir.direction==="rtl",So=wo&&(bo?se.offsetX<=ie.offsetWidth-ie.clientWidth:se.offsetX>ie.clientWidth),Eo=Ln&&se.offsetY>ie.clientHeight;if(So||Eo)return}if(!G(se)){if(H()==="intentional"&&C.current){V.clear(),C.current=!1;return}typeof v=="function"&&!v(se)||A("__outsidePressBubbles")||(c.setOpen(!1,Me(Ek,se)),L())}}}function X(se){H()!=="sloppy"||se.pointerType==="touch"||!c.select("open")||!n||P(se)||J(se)}function q(se){if(H()!=="sloppy"||!c.select("open")||!n||P(se))return;const ie=se.touches[0];ie&&(N.current={startTime:Date.now(),startX:ie.clientX,startY:ie.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},I.start(1e3,()=>{N.current&&(N.current.dismissOnTouchEnd=!1,N.current.dismissOnMouseDown=!1)}))}function te(se,ie){const _e=Ct(se);if(!_e)return;const ve=be(_e,se.type,()=>{ie(se),ve()})}function le(se){k.current="touch",te(se,q)}function Z(se){I.clear(),se.type==="pointerdown"&&(k.current=se.pointerType),!(se.type==="mousedown"&&N.current&&!N.current.dismissOnMouseDown)&&te(se,ie=>{ie.type==="pointerdown"?X(ie):J(ie)})}function ee(se){if(!w.current)return;const ie=E.current;if(Q(),H()==="intentional"){if(se.type==="pointercancel"){ie&&K();return}if(!G(se)){if(ie){K();return}typeof v=="function"&&!v(se)||(V.clear(),C.current=!0,L())}}}function fe(se){if(H()!=="sloppy"||!N.current||P(se))return;const ie=se.touches[0];if(!ie)return;const _e=Math.abs(ie.clientX-N.current.startX),ve=Math.abs(ie.clientY-N.current.startY),De=Math.sqrt(_e*_e+ve*ve);De>5&&(N.current.dismissOnTouchEnd=!0),De>10&&(J(se),I.clear(),N.current=null)}function oe(se){te(se,fe)}function xe(se){H()!=="sloppy"||!N.current||P(se)||(N.current.dismissOnTouchEnd&&J(se),I.clear(),N.current=null)}function Re(se){te(se,xe)}const Se=je(f),Ae=tr(r&&tr(be(Se,"keydown",z),be(Se,"compositionstart",Y),be(Se,"compositionend",U)),b&&tr(be(Se,"click",Z,!0),be(Se,"pointerdown",Z,!0),be(Se,"pointerup",ee,!0),be(Se,"pointercancel",ee,!0),be(Se,"mousedown",Z,!0),be(Se,"mouseup",ee,!0),be(Se,"touchstart",le,!0),be(Se,"touchmove",oe,!0),be(Se,"touchend",Re,!0)));return()=>{Ae(),$.clear(),V.clear(),Q(),C.current=!1,L()}},[d,f,r,b,v,u,n,y,g,z,L,h,A,P,p,c,I]);const O=S.useMemo(()=>({onKeyDown:z,onPointerDown:M,onClick:M}),[z,M]),B=S.useMemo(()=>({onKeyDown:z,onPointerDown:_,onMouseDown:_,onClickCapture:D,onMouseDownCapture($){D(),T($)},onPointerDownCapture($){D(),T($)},onMouseUpCapture:D,onTouchEndCapture:D,onTouchMoveCapture:D}),[z,D,T,_]);return S.useMemo(()=>n?{reference:O,floating:B,trigger:O}:{},[n,O,B])}function kv(e,t,n){let{reference:r,floating:s}=e;const o=pn(t),i=Lm(t),l=Fm(i),a=mn(t),c=o==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,d=r[l]/2-s[l]/2;let p;switch(a){case"top":p={x:u,y:r.y-s.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}const m=Ps(t);return m&&(p[i]+=d*(m==="end"?1:-1)*(n&&c?-1:1)),p}async function XF(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=bs(t,e),m=Ok(p),b=l[d?f==="floating"?"reference":"floating":f],h=Fu(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(b)))==null||n?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),y=f==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),w=await(o.isElement==null?void 0:o.isElement(g))&&await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1},E=Fu(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:g,strategy:a}):y);return{top:(h.top-E.top+m.top)/w.y,bottom:(E.bottom-h.bottom+m.bottom)/w.y,left:(h.left-E.left+m.left)/w.x,right:(E.right-h.right+m.right)/w.x}}const GF=50,ZF=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:XF},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=kv(c,r,a),d=r,p=0;const m={};for(let v=0;v<o.length;v++){const b=o[v];if(!b)continue;const{name:h,fn:y}=b,{x:g,y:w,data:E,reset:C}=await y({x:u,y:f,initialPlacement:r,placement:d,strategy:s,middlewareData:m,rects:c,platform:l,elements:{reference:e,floating:t}});u=g??u,f=w??f,m[h]={...m[h],...E},C&&p<GF&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:u,y:f}=kv(c,d,a)),v=-1)}return{x:u,y:f,placement:d,strategy:s,middlewareData:m}},JF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...b}=bs(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const h=mn(s),y=pn(l),g=mn(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=d||(g||!v?[Du(l)]:mF(l)),C=m!=="none";!d&&C&&E.push(...wF(l,v,m,w));const R=[l,...E],k=await a.detectOverflow(t,b),N=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(k[h]),f){const P=gF(s,i,w);N.push(k[P[0]],k[P[1]])}if(I=[...I,{placement:s,overflows:N}],!N.every(P=>P<=0)){var j,L;const P=(((j=o.flip)==null?void 0:j.index)||0)+1,M=R[P];if(M&&(!(f==="alignment"?y!==pn(M):!1)||I.every(T=>pn(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:P,overflows:I},reset:{placement:M}};let z=(L=I.filter(D=>D.overflows[0]<=0).sort((D,T)=>D.overflows[1]-T.overflows[1])[0])==null?void 0:L.placement;if(!z)switch(p){case"bestFit":{var A;const D=(A=I.filter(T=>{if(C){const _=pn(T.placement);return _===y||_==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(_=>_>0).reduce((_,O)=>_+O,0)]).sort((T,_)=>T[1]-_[1])[0])==null?void 0:A[0];D&&(z=D);break}case"initialPlacement":z=l;break}if(s!==z)return{reset:{placement:z}}}return{}}}},tC=new Set(["left","top"]);async function eL(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=mn(n),l=Ps(n),a=pn(n)==="y",c=tC.has(i)?-1:1,u=o&&a?-1:1,f=bs(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),a?{x:p*u,y:d*c}:{x:d*c,y:p*u}}const tL=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:l}=t,a=await eL(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:i}}}}},nL=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=bs(e,t),u={x:n,y:r},f=await o.detectOverflow(t,c),d=pn(s),p=Dm(d);let m=u[p],v=u[d];const b=(y,g)=>_k(g+f[y==="y"?"top":"left"],g,g-f[y==="y"?"bottom":"right"]);i&&(m=b(p,m)),l&&(v=b(d,v));const h=a.fn({...t,[p]:m,[d]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:i,[d]:l}}}}}},rL=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:o,placement:i,rects:l,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=bs(e,t),d={x:s,y:o},p=pn(i),m=Dm(p);let v=d[m],b=d[p];const h=bs(c,t),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:(n=h.mainAxis)!=null?n:0,crossAxis:(r=h.crossAxis)!=null?r:0};if(u){const E=m==="y"?"height":"width",C=l.reference[m]-l.floating[E]+y.mainAxis,R=l.reference[m]+l.reference[E]-y.mainAxis;v<C?v=C:v>R&&(v=R)}if(f){var g,w;const E=m==="y"?"width":"height",C=tC.has(mn(i)),R=l.reference[p]-l.floating[E]+(C&&((g=a.offset)==null?void 0:g[p])||0)+(C?0:y.crossAxis),k=l.reference[p]+l.reference[E]+(C?0:((w=a.offset)==null?void 0:w[p])||0)-(C?y.crossAxis:0);b<R?b=R:b>k&&(b=k)}return{[m]:v,[p]:b}}}},sL=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:i=()=>{},...l}=bs(e,t),a=await s.detectOverflow(t,l),c=mn(n),u=Ps(n),f=pn(n)==="y",{width:d,height:p}=r.floating;let m,v;c==="top"||c==="bottom"?(m=c,v=u===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(v=c,m=u==="end"?"top":"bottom");const b=p-a.top-a.bottom,h=d-a.left-a.right,y=Mi(p-a[m],b),g=Mi(d-a[v],h),w=t.middlewareData.shift,E=!w;let C=y,R=g;w!=null&&w.enabled.x&&(R=h),w!=null&&w.enabled.y&&(C=b),E&&!u&&(f?R=d-2*vr(a.left,a.right):C=p-2*vr(a.top,a.bottom)),await i({...t,availableWidth:R,availableHeight:C});const k=await s.getDimensions(o.floating);return d!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function nC(e){const t=rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=$e(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,l=zu(n)!==o||zu(r)!==i;return l&&(n=o,r=i),{width:n,height:r,$:l}}function Um(e){return Ee(e)?e:e.contextElement}function Go(e){const t=Um(e);if(!$e(t))return wr(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=nC(t);let i=(o?zu(n.width):n.width)/r,l=(o?zu(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const oL=wr(0);function rC(e){const t=et(e);return!Im()||!t.visualViewport?oL:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iL(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===et(e)}function fo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Um(e);let i=wr(1);t&&(r?Ee(r)&&(i=Go(r)):i=Go(e));const l=iL(o,n,r)?rC(o):wr(0);let a=(s.left+l.x)/i.x,c=(s.top+l.y)/i.y,u=s.width/i.x,f=s.height/i.y;if(o&&r){const d=et(o),p=Ee(r)?et(r):r;let m=d,v=Pp(m);for(;v&&p!==m;){const b=Go(v),h=v.getBoundingClientRect(),y=rn(v),g=h.left+(v.clientLeft+parseFloat(y.paddingLeft))*b.x,w=h.top+(v.clientTop+parseFloat(y.paddingTop))*b.y;a*=b.x,c*=b.y,u*=b.x,f*=b.y,a+=g,c+=w,m=et(v),v=Pp(m)}}return Fu({width:u,height:f,x:a,y:c})}function Od(e,t){const n=Cd(e).scrollLeft;return t?t.left+n:fo(Nr(e)).left+n}function sC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Od(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function lL(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=Nr(r),l=t?kd(t.floating):!1;if(r===i||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=wr(1);const u=wr(0),f=$e(r);if((f||!o)&&((vt(r)!=="body"||Ea(i))&&(a=Cd(r)),f)){const p=fo(r);c=Go(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const d=i&&!f&&!o?sC(i,a):wr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-a.scrollTop*c.y+u.y+d.y}}function aL(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function cL(e){const t=Cd(e),n=e.ownerDocument.body,r=vr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=vr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Od(e);const i=-t.scrollTop;return rn(n).direction==="rtl"&&(o+=vr(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:i}}const uL=25;function dL(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=et(e),o=Nr(e),i=s.visualViewport;let l=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){const d=!Im()||t==="fixed";r?d||(c=-i.offsetLeft,u=-i.offsetTop):(l=i.width,a=i.height,d&&(c=i.offsetLeft,u=i.offsetTop))}if(Od(o)<=0){const d=o.ownerDocument,p=d.body,m=getComputedStyle(p),v=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(o.clientWidth-p.clientWidth-v),h=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;h<=uL&&(l-=h)}return{width:l,height:a,x:c,y:u}}function fL(e,t){const n=fo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Go(e),i=e.clientWidth*o.x,l=e.clientHeight*o.y,a=s*o.x,c=r*o.y;return{width:i,height:l,x:a,y:c}}function Cv(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=dL(e,n,t);else if(t==="document")r=cL(Nr(e));else if(Ee(t))r=fL(t,n);else{const s=rC(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Fu(r)}function hL(e,t){const n=t.get(e);if(n)return n;let r=Zl(e,[],!1).filter(l=>Ee(l)&&vt(l)!=="body"),s=null;const o=rn(e).position==="fixed";let i=o?xs(e):e;for(;Ee(i)&&!hs(i);){const l=rn(i),a=Nm(i),c=s?s.position:o?"fixed":"";!a&&(c==="fixed"||c==="absolute"&&l.position==="static")?r=r.filter(f=>f!==i):s=l,i=xs(i)}return t.set(e,r),r}function pL(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?kd(t)?[]:hL(t,this._c):[].concat(n),r],l=Cv(t,i[0],s);let a=l.top,c=l.right,u=l.bottom,f=l.left;for(let d=1;d<i.length;d++){const p=Cv(t,i[d],s);a=vr(p.top,a),c=Mi(p.right,c),u=Mi(p.bottom,u),f=vr(p.left,f)}return{width:c-f,height:u-a,x:f,y:a}}function gL(e){const{width:t,height:n}=nC(e);return{width:t,height:n}}function mL(e,t,n){const r=$e(t),s=Nr(t),o=n==="fixed",i=fo(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=wr(0);if((r||!o)&&((vt(t)!=="body"||Ea(s))&&(l=Cd(t)),r)){const d=fo(t,!0,o,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}!r&&s&&(a.x=Od(s));const c=s&&!r&&!o?sC(s,l):wr(0),u=i.left+l.scrollLeft-a.x-c.x,f=i.top+l.scrollTop-a.y-c.y;return{x:u,y:f,width:i.width,height:i.height}}function Wf(e){return rn(e).position==="static"}function Rv(e,t){if(!$e(e)||rn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Nr(e)===n&&(n=n.ownerDocument.body),n}function oC(e,t){const n=et(e);if(kd(e))return n;if(!$e(e)){let s=xs(e);for(;s&&!hs(s);){if(Ee(s)&&!Wf(s))return s;s=xs(s)}return n}let r=Rv(e,t);for(;r&&O5(r)&&Wf(r);)r=Rv(r,t);return r&&hs(r)&&Wf(r)&&!Nm(r)?n:r||z5(e)||n}const yL=async function(e){const t=this.getOffsetParent||oC,n=this.getDimensions,r=await n(e.floating);return{reference:mL(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xL(e){return rn(e).direction==="rtl"}const vL={convertOffsetParentRelativeRectToViewportRelativeRect:lL,getDocumentElement:Nr,getClippingRect:pL,getOffsetParent:oC,getElementRects:yL,getClientRects:aL,getDimensions:gL,getScale:Go,isElement:Ee,isRTL:xL};function iC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wL(e,t,n){let r=null,s;const o=Nr(e);function i(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const d=e.getBoundingClientRect(),{left:p,top:m,width:v,height:b}=d;if(u||t(),!v||!b)return;const h=gc(m),y=gc(o.clientWidth-(p+v)),g=gc(o.clientHeight-(m+b)),w=gc(p),C={rootMargin:-h+"px "+-y+"px "+-g+"px "+-w+"px",threshold:vr(0,Mi(1,f))||1};let R=!0;function k(N){const I=N[0].intersectionRatio;if(!iC(d,e.getBoundingClientRect()))return l();if(I!==f){if(!R)return l();I?l(!1,I):s=setTimeout(()=>{l(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(k,{...C,root:o.ownerDocument})}catch{r=new IntersectionObserver(k,C)}r.observe(e)}const a=et(e),c=()=>l(n);return a.addEventListener("resize",c),l(!0),()=>{a.removeEventListener("resize",c),i()}}function Pv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Um(e),u=s||o?[...c?Zl(c):[],...t?Zl(t):[]]:[];u.forEach(h=>{s&&h.addEventListener("scroll",n),o&&h.addEventListener("resize",n)});const f=c&&l?wL(c,n,o):null;let d=-1,p=null;i&&(p=new ResizeObserver(h=>{let[y]=h;y&&y.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var g;(g=p)==null||g.observe(t)})),n()}),c&&!a&&p.observe(c),t&&p.observe(t));let m,v=a?fo(e):null;a&&b();function b(){const h=fo(e);v&&!iC(v,h)&&n(),v=h,m=requestAnimationFrame(b)}return n(),()=>{var h;u.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),f==null||f(),(h=p)==null||h.disconnect(),p=null,a&&cancelAnimationFrame(m)}}const bL=tL,SL=nL,EL=JF,kL=sL,CL=rL,RL=(e,t,n)=>{const r=new Map,s=n??{},o={...vL,...s.platform,_c:r};return ZF(e,t,{...s,platform:o})};var PL=typeof document<"u",TL=function(){},Bc=PL?S.useLayoutEffect:TL;function Lu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lu(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Lu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function lC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tv(e,t){const n=lC(e);return Math.round(t*n)/n}function Uf(e){const t=S.useRef(e);return Bc(()=>{t.current=e}),t}function NL(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,f]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=S.useState(r);Lu(d,r)||p(r);const[m,v]=S.useState(null),[b,h]=S.useState(null),y=S.useCallback(T=>{T!==C.current&&(C.current=T,v(T))},[]),g=S.useCallback(T=>{T!==R.current&&(R.current=T,h(T))},[]),w=o||m,E=i||b,C=S.useRef(null),R=S.useRef(null),k=S.useRef(u),N=a!=null,I=Uf(a),j=Uf(s),L=Uf(c),A=S.useCallback(()=>{if(!C.current||!R.current)return;const T={placement:t,strategy:n,middleware:d};j.current&&(T.platform=j.current),RL(C.current,R.current,T).then(_=>{const O={..._,isPositioned:L.current!==!1};P.current&&!Lu(k.current,O)&&(k.current=O,vn.flushSync(()=>{f(O)}))})},[d,t,n,j,L]);Bc(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[c]);const P=S.useRef(!1);Bc(()=>(P.current=!0,()=>{P.current=!1}),[]),Bc(()=>{if(w&&(C.current=w),E&&(R.current=E),w&&E){if(I.current)return I.current(w,E,A);A()}},[w,E,A,I,N]);const M=S.useMemo(()=>({reference:C,floating:R,setReference:y,setFloating:g}),[y,g]),z=S.useMemo(()=>({reference:w,floating:E}),[w,E]),D=S.useMemo(()=>{const T={position:n,left:0,top:0};if(!z.floating)return T;const _=Tv(z.floating,u.x),O=Tv(z.floating,u.y);return l?{...T,transform:"translate("+_+"px, "+O+"px)",...lC(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:_,top:O}},[n,l,z.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:A,refs:M,elements:z,floatingStyles:D}),[u,A,M,z,D])}const IL=(e,t)=>{const n=bL(e);return{name:n.name,fn:n.fn,options:[e,t]}},ML=(e,t)=>{const n=SL(e);return{name:n.name,fn:n.fn,options:[e,t]}},_L=(e,t)=>({fn:CL(e).fn,options:[e,t]}),OL=(e,t)=>{const n=EL(e);return{name:n.name,fn:n.fn,options:[e,t]}},AL=(e,t)=>{const n=kL(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ap=[];let jp;function jL(){return jp}function zL(e){Ap.push(e)}function aC(e){const t=(n,r)=>{const s=wn(FL).current;let o;try{jp=s;for(const i of Ap)i.before(s);o=e(n,r);for(const i of Ap)i.after(s);s.didInitialize=!0}finally{jp=void 0}return o};return t.displayName=e.displayName||e.name,t}function DL(e){return S.forwardRef(aC(e))}function FL(){return{didInitialize:!1}}const LL=bm(19),$L=LL?BL:VL;function cC(e,t,n,r,s){return $L(e,t,n,r,s)}function HL(e,t,n,r,s){const o=S.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return md.useSyncExternalStore(e.subscribe,o,o)}zL({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),md.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function BL(e,t,n,r,s){const o=jL();if(!o)return HL(e,t,n,r,s);const i=o.syncIndex;o.syncIndex+=1;let l;return o.didInitialize?(l=o.syncHooks[i],(l.store!==e||l.selector!==t||!Object.is(l.a1,n)||!Object.is(l.a2,r)||!Object.is(l.a3,s))&&(l.store!==e&&(o.didChangeStore=!0),l.store=e,l.selector=t,l.a1=n,l.a2=r,l.a3=s,l.value=t(e.getSnapshot(),n,r,s))):(l={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(l)),l.value}function VL(e,t,n,r,s){return NE.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class WL{constructor(t){Ie(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Ie(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return cC(this,t,n,r,s)}}class Ad extends WL{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){S.useDebugValue(t);const r=this;pe(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;pe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);pe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){S.useDebugValue(t);const r=this,s=n!==void 0;pe(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return S.useDebugValue(t),cC(this,this.selectors[t],n,r,s)}useContextCallback(t,n){S.useDebugValue(t);const r=me(n??Sm);this.context[t]=r}useStateSetter(t){const n=S.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const i=r(o);if(!Object.is(s,i)){const l=s;s=i,n(i,l,this)}})}}const UL={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Km extends Ad{constructor(n){const{syncOnly:r,nested:s,onOpenChange:o,triggerElements:i,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Gk(),nested:s,triggerElements:i},UL);Ie(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&tF(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});Ie(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});Ie(this,"setOpen",(n,r)=>{var s,o,i,l;if(this.syncOnly){(o=(s=this.context).onOpenChange)==null||o.call(s,n,r);return}this.dispatchOpenChange(n,r),(l=(i=this.context).onOpenChange)==null||l.call(i,n,r)});this.syncOnly=r}}function KL(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:i}=e,l=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,f=i,d=S.useRef(null);r===void 0&&d.current===null&&(d.current=new Km({open:l,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:f,floatingId:s,syncOnly:!0,nested:o}));const p=r??d.current;return t.useSyncedValue("floatingId",s),pe(()=>{const m={open:l,floatingId:s,referenceElement:a,floatingElement:c};Ee(a)&&(m.domReferenceElement=a),p.state.positionReference===p.state.referenceElement&&(m.positionReference=a),p.update(m)},[l,s,a,c,p]),p.context.onOpenChange=f,p.context.nested=o,p}function uC(e,t=!1,n=!1){const[r,s]=S.useState(e&&t?"idle":void 0),[o,i]=S.useState(e);return e&&!o&&(i(!0),s("starting")),!e&&o&&r!=="ending"&&!n&&s("ending"),!e&&!o&&r==="ending"&&s(void 0),pe(()=>{if(!e&&o&&r!=="ending"&&n){const l=Qn.request(()=>{s("ending")});return()=>{Qn.cancel(l)}}},[e,o,r,n]),pe(()=>{if(!e||t)return;const l=Qn.request(()=>{s(void 0)});return()=>{Qn.cancel(l)}},[t,e]),pe(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&s("starting");const l=Qn.request(()=>{s("idle")});return()=>{Qn.cancel(l)}},[t,e,o,r]),{mounted:o,setMounted:i,transitionStatus:r}}function dC(e,t=!1){const n=zm();return me((r,s=null)=>{n.cancel();const o=lr(e);if(o==null)return;const i=o,l=()=>{vn.flushSync(r)};if(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function a(){Promise.all(i.getAnimations().map(c=>c.finished)).then(()=>{s!=null&&s.aborted||l()},()=>{if(s!=null&&s.aborted)return;if(i.getAnimations().some(u=>u.pending||u.playState!=="finished")){a();return}l()})}if(t){const c="data-starting-style";if(!i.hasAttribute(c)){n.request(a);return}const u=new MutationObserver(()=>{i.hasAttribute(c)||(u.disconnect(),a())});u.observe(i,{attributes:!0,attributeFilter:[c]}),s==null||s.addEventListener("abort",()=>u.disconnect(),{once:!0});return}n.request(a)})}function Ca(e){const{enabled:t=!0,open:n,ref:r,onComplete:s}=e,o=me(s),i=dC(r,n);S.useEffect(()=>{if(!t)return;const l=new AbortController;return i(o,l.signal),()=>{l.abort()}},[t,n,o,i])}const Ym={tabIndex:-1,[Np]:""};function fC(e){return t=>t==="touch"?e.current:!0}function qm(e,t=!1){const n=Td(),r=_d()!=null,s=wn(()=>e(n,r)).current;return KL({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Qm({handle:e,store:t}){return pe(()=>e.attachStore(t),[e,t]),null}function YL(e,t){const n=S.useRef(null),r=S.useRef(null);return S.useCallback(s=>{if(e===void 0)return;let o=!1;if(n.current!==null){const i=n.current,l=r.current,a=t.context.triggerElements.getById(i);l&&a===l&&(t.context.triggerElements.delete(i),o=!0),n.current=null,r.current=null}if(s!==null&&(n.current=e,r.current=s,t.context.triggerElements.add(e,s),o=!0),o){const i=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==i&&t.set("triggerCount",i)}},[t,e])}function Xm(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const s=(n==null?void 0:n.id)??null;(s||t)&&(e.activeTriggerId=s,e.activeTriggerElement=n??null)}function hC(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function qL(e,t,n,r={}){var u,f,d;const s=n.reason,o=s===gt,i=t&&s===Hc,l=!t&&(s===vs||s===Pd),a=hC(n);if((f=(u=e.context).onOpenChange)==null||f.call(u,t,n),n.isCanceled)return;(d=r.onBeforeDispatch)==null||d.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const c=()=>{const p={...r.extraState,open:t};i?p.instantType="focus":l?p.instantType="dismiss":o&&(p.instantType=void 0),Xm(p,t,n.trigger,a()),e.update(p)};o?vn.flushSync(c):c()}function pC(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=YL(e,n),i=me(a=>{const c=n.select("open"),u=n.select("activeTriggerId");if(u===e){n.update({activeTriggerElement:a,...c?r:null});return}u==null&&c&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})}),l=S.useCallback(a=>{o(a),a&&i(a)},[o,i]);return pe(()=>{s&&n.update({activeTriggerElement:t.current,...r})},[s,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:s}}function Gm(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=S.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),i=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");pe(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const a=e.context.triggerElements.size,c={};e.state.triggerCount!==a&&(c.triggerCount=a);const u=e.select("activeTriggerId");let f=null;if(u){const d=e.context.triggerElements.getById(u);if(d)r.current=u,d!==e.state.activeTriggerElement&&(c.activeTriggerElement=d);else{for(const[p,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){c.activeTriggerId=p,c.activeTriggerElement=m,r.current=p;break}c.activeTriggerId===void 0&&(r.current===u?f=u:r.current=null)}}else r.current=null;if(!f&&!u&&a===1){const d=e.context.triggerElements.entries().next();if(!d.done){const[p,m]=d.value;c.activeTriggerId=p,c.activeTriggerElement=m,r.current=p}}(c.triggerCount!==void 0||c.activeTriggerId!==void 0||c.activeTriggerElement!==void 0)&&e.update(c),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const d=Me(Rd);e.setOpen(!1,d),d.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,i,l,n])}function Zm(e,t,n){const{mounted:r,setMounted:s,transitionStatus:o}=uC(e),i=t.useState("preventUnmountingOnClose"),l=e?!1:i;t.useSyncedValues({mounted:r,transitionStatus:o,preventUnmountingOnClose:l});const a=me(()=>{var c,u;s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(u=(c=t.context).onOpenChangeComplete)==null||u.call(c,!1)});return Ca({enabled:r&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||a()}}),{forceUnmount:a,transitionStatus:o}}function Jm(e,t){e.useSyncedValues(t),pe(()=>()=>{e.update({activeTriggerProps:mt,inactiveTriggerProps:mt,popupProps:mt})},[e])}function gC(e,t){pe(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),pe(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jd{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function QL(){return new Km({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jd,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function e0(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:QL(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:mt,inactiveTriggerProps:mt,popupProps:mt}}function t0(e,t,n=!1){return new Km({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const El=e=>e.triggerIdProp??e.activeTriggerId,n0=e=>e.openProp??e.open,Nv=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function mC(e,t){return t!==void 0&&n0(e)&&El(e)===t}function XL(e,t){return mC(e,t)?!0:t!==void 0&&n0(e)&&El(e)==null&&e.triggerCount===1}const r0={open:n0,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:El,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Nv,isTriggerActive:(e,t)=>t!==void 0&&El(e)===t,isOpenedByTrigger:(e,t)=>mC(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&El(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>XL(e,t)?Nv(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function yC(e){const t=S.useCallback(r=>e===void 0?Sm:e.subscribeStore(r),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return md.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function GL(e){return ZL(e,e.rootContext)}function ZL(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),o=t.useState("floatingElement"),i=t.useState("domReferenceElement"),l=t.useState("open"),a=t.useState("floatingId"),[c,u]=S.useState(null),[f,d]=S.useState(void 0),[p,m]=S.useState(void 0),v=S.useRef(null),b=Li(r),h=S.useMemo(()=>({reference:s,floating:o,domReference:i}),[s,o,i]),y=NL({...e,elements:{...h,...c&&{reference:c}}}),g=Ee(f)?f:null,w=p===void 0?t.state.floatingElement:p;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?i:g),t.useSyncedValue("floatingElement",w);const E=S.useCallback(j=>{const L=Ee(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;u(L),y.refs.setReference(L)},[y.refs]),C=S.useCallback(j=>{(Ee(j)||j===null)&&(v.current=j,d(j)),(Ee(y.refs.reference.current)||y.refs.reference.current===null||j!==null&&!Ee(j))&&y.refs.setReference(j)},[y.refs,d]),R=S.useCallback(j=>{m(j),y.refs.setFloating(j)},[y.refs]),k=S.useMemo(()=>({...y.refs,setReference:C,setFloating:R,setPositionReference:E,domReference:v}),[y.refs,C,R,E]),N=S.useMemo(()=>({...y.elements,domReference:i}),[y.elements,i]),I=S.useMemo(()=>({...y,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:a,refs:k,elements:N,nodeId:n,rootStore:t}),[y,k,N,n,t,l,a]);return pe(()=>{i&&(v.current=i)},[i]),pe(()=>{t.context.dataRef.current.floatingContext=I;const j=b==null?void 0:b.nodesRef.current.find(L=>L.id===n);j&&(j.context=I)}),S.useMemo(()=>({...y,context:I,refs:k,elements:N,rootStore:t}),[y,k,N,I,t])}const Kf=Rk&&xo;function JL(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:o,dataRef:i}=s.context,l=S.useRef(!1),a=S.useRef(null),c=S.useRef(!0),u=Pr();S.useEffect(()=>{const d=s.select("domReferenceElement");if(!n)return;const p=et(d);function m(){const h=s.select("domReferenceElement");!s.select("open")&&$e(h)&&h===un(je(h))&&(l.current=!0)}function v(){c.current=!0}function b(){c.current=!1}return tr(be(p,"blur",m),Kf&&be(p,"keydown",v,!0),Kf&&be(p,"pointerdown",b,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function d(p){if(p.reason===vs||p.reason===Pd){const m=s.select("domReferenceElement");Ee(m)&&(a.current=m,l.current=!0)}}return o.on("openchange",d),()=>{o.off("openchange",d)}},[o,n,s]);const f=S.useMemo(()=>{function d(){l.current=!1,a.current=null}return{onMouseLeave(){d()},onFocus(p){const m=p.currentTarget;if(l.current){if(a.current===m)return;d()}const v=Ct(p.nativeEvent);if(Ee(v)){if(Kf&&!p.relatedTarget){if(!c.current&&!Md(v))return}else if(!sF(v))return}const b=ju(p.relatedTarget,s.context.triggerElements),{nativeEvent:h,currentTarget:y}=p,g=typeof r=="function"?r():r;if(s.select("open")&&b||g===0||g===void 0){s.setOpen(!0,Me(Hc,h,y));return}u.start(g,()=>{l.current||s.setOpen(!0,Me(Hc,h,y))})},onBlur(p){d();const m=p.relatedTarget,v=p.nativeEvent,b=Ee(m)&&m.hasAttribute(ta("focus-guard"))&&m.getAttribute("data-type")==="outside";u.start(0,()=>{var w;const h=s.select("domReferenceElement"),y=un(je(h));!m&&y===h||ye((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,y)||ye(h,y)||b||ju(m??y,s.context.triggerElements)||s.setOpen(!1,Me(Hc,v))})}}},[i,r,s,u]);return S.useMemo(()=>n?{reference:f,trigger:f}:{},[n,f])}class s0{constructor(){Ie(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Ie(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new bn,this.restTimeout=new bn,this.handleCloseOptions=void 0}static create(){return new s0}}const $u=new WeakMap;function Hu(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&$u.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),$u.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function xC(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=$u.get(n);o&&o!==e&&Hu(o),Hu(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,$u.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function o0(e){const t=e.context.dataRef.current,n=wn(()=>t.hoverInteractionState??s0.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),jm(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function vC(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,o="rootStore"in e?e.rootStore:e,i=o.useState("open"),l=o.useState("floatingElement"),a=o.useState("domReferenceElement"),{dataRef:c}=o.context,u=Li(),f=_d(),d=o0(o),p=Pr(),m=me(()=>{var h;return Ik((h=c.current.openEvent)==null?void 0:h.type,d.interactedInside)}),v=me(()=>{var h;return iF((h=c.current.openEvent)==null?void 0:h.type)}),b=me(()=>{Hu(d)});pe(()=>{i||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,b())},[i,d,b]),S.useEffect(()=>b,[b]),pe(()=>{var h,y,g,w,E;if(n&&i&&(h=d.handleCloseOptions)!=null&&h.blockPointerEvents&&v()&&Ee(a)&&l){const C=a,R=l,k=je(l),N=(g=(y=u==null?void 0:u.nodesRef.current.find(A=>A.id===f))==null?void 0:y.context)==null?void 0:g.elements.floating;N&&(N.style.pointerEvents="");const I=d.pointerEventsScopeElement!==R?d.pointerEventsScopeElement:null,j=N!==R?N:null,L=((E=(w=d.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:E.call(w))??I??j??C.closest("[data-rootownerid]")??k.body;return xC(d,{scopeElement:L,referenceElement:C,floatingElement:R}),()=>{b()}}},[n,i,a,l,d,v,u,f,b]),S.useEffect(()=>{if(!n)return;function h(){return!!(u&&f&&Ss(u.nodesRef.current,f).length>0)}function y(k){const N=ws(r,"close",d.pointerType),I=()=>{o.setOpen(!1,Me(gt,k)),u==null||u.events.emit("floating.closed",k)};N?d.openChangeTimeout.start(N,I):(d.openChangeTimeout.clear(),I())}function g(k){const N=Ct(k);if(!rF(N)){d.interactedInside=!1;return}d.interactedInside=(N==null?void 0:N.closest("[aria-haspopup]"))!=null}function w(){d.openChangeTimeout.clear(),p.clear(),u==null||u.events.off("floating.closed",C),b()}function E(k){var L;if(h()&&u){u.events.on("floating.closed",C);return}if(ju(k.relatedTarget,o.context.triggerElements))return;const N=((L=c.current.floatingContext)==null?void 0:L.nodeId)??s,I=k.relatedTarget;if(!(u&&N&&Ee(I)&&Ss(u.nodesRef.current,N,!1).some(A=>{var P;return ye((P=A.context)==null?void 0:P.elements.floating,I)}))){if(d.handler){d.handler(k);return}b(),v()&&!m()&&y(k)}}function C(k){!u||!f||h()||p.start(0,()=>{u.events.off("floating.closed",C),o.setOpen(!1,Me(gt,k)),u.events.emit("floating.closed",k)})}const R=l;return tr(R&&be(R,"mouseenter",w),R&&be(R,"mouseleave",E),R&&be(R,"pointerdown",g,!0),()=>{u==null||u.events.off("floating.closed",C)})},[n,l,o,c,r,s,v,m,b,d,u,f,p])}const e3={current:null};function wC(e,t={}){var z;const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:i=0,move:l=!0,triggerElementRef:a=e3,externalTree:c,isActiveTrigger:u=!0,getHandleCloseContext:f,isClosing:d,shouldOpen:p,guardStaleOpen:m=!1}=t,v="rootStore"in e?e.rootStore:e,{dataRef:b,events:h}=v.context,y=Li(c),g=o0(v),w=S.useRef(!1),E=_t(s),C=_t(r),R=_t(i),k=_t(n),N=_t(p),I=_t(d),j=me(()=>{var D;return Ik((D=b.current.openEvent)==null?void 0:D.type,g.interactedInside)}),L=me(()=>{var D;return((D=N.current)==null?void 0:D.call(N))!==!1}),A=me((D,T,_)=>{const O=v.context.triggerElements;if(O.hasElement(T))return!D||!ye(D,T);if(!Ee(_))return!1;const B=_;return O.hasMatchingElement($=>ye($,B))&&(!D||!ye(D,B))}),P=me(()=>{if(!g.handler)return;je(v.select("domReferenceElement")).removeEventListener("mousemove",g.handler),g.handler=void 0}),M=me(()=>{Hu(g)});return u&&(g.handleCloseOptions=(z=E.current)==null?void 0:z.__options),S.useEffect(()=>P,[P]),S.useEffect(()=>{if(!n)return;function D(T){T.open?w.current=!1:(w.current=T.reason===gt,P(),g.openChangeTimeout.clear(),g.restTimeout.clear(),g.blockMouseMove=!0,g.restTimeoutPending=!1)}return h.on("openchange",D),()=>{h.off("openchange",D)}},[n,h,g,P]),S.useEffect(()=>{if(!n)return;function D(V,Y=!0){const U=ws(C.current,"close",g.pointerType);U?g.openChangeTimeout.start(U,()=>{v.setOpen(!1,Me(gt,V)),y==null||y.events.emit("floating.closed",V)}):Y&&(g.openChangeTimeout.clear(),v.setOpen(!1,Me(gt,V)),y==null||y.events.emit("floating.closed",V))}const T=a.current??(u?v.select("domReferenceElement"):null);if(!Ee(T))return;function _(V){var fe;if(g.openChangeTimeout.clear(),g.blockMouseMove=!1,o&&!ps(g.pointerType))return;const Y=cv(R.current),U=ws(C.current,"open",g.pointerType),K=Ct(V),Q=V.currentTarget??null,H=v.select("domReferenceElement");let W=Q;if(Ee(K)&&!v.context.triggerElements.hasElement(K)){for(const oe of v.context.triggerElements.elements())if(ye(oe,K)){W=oe;break}}Ee(Q)&&Ee(H)&&!v.context.triggerElements.hasElement(Q)&&ye(Q,H)&&(W=H);const G=W==null?!1:A(H,W,K),J=v.select("open"),X=((fe=I.current)==null?void 0:fe.call(I))??v.select("transitionStatus")==="ending",q=!J&&X&&w.current,te=!G&&Ee(W)&&Ee(H)&&ye(H,W)&&q,le=Y>0&&!U,Z=G&&(J||q)||te,ee=!J||G;if(Z){L()&&v.setOpen(!0,Me(gt,V,W));return}le||(U?g.openChangeTimeout.start(U,()=>{ee&&L()&&v.setOpen(!0,Me(gt,V,W))}):ee&&L()&&v.setOpen(!0,Me(gt,V,W)))}function O(V){if(j()){M();return}P();const Y=v.select("domReferenceElement"),U=je(Y);g.restTimeout.clear(),g.restTimeoutPending=!1;const K=b.current.floatingContext??(f==null?void 0:f());if(ju(V.relatedTarget,v.context.triggerElements))return;if(E.current&&K){v.select("open")||g.openChangeTimeout.clear();const H=a.current;g.handler=E.current({...K,tree:y,x:V.clientX,y:V.clientY,onClose(){M(),P(),k.current&&!j()&&H===v.select("domReferenceElement")&&D(V,!0)}}),U.addEventListener("mousemove",g.handler),g.handler(V);return}(g.pointerType==="touch"?!ye(v.select("floatingElement"),V.relatedTarget):!0)&&D(V)}function B(V){ye(T,V.relatedTarget)||(g.openChangeTimeout.clear(),g.restTimeout.clear(),g.restTimeoutPending=!1)}const $=m?be(T,"mouseout",B):void 0;return l?tr(be(T,"mousemove",_,{once:!0}),be(T,"mouseenter",_),be(T,"mouseleave",O),$):tr(be(T,"mouseenter",_),be(T,"mouseleave",O),$)},[P,M,b,C,v,n,E,g,u,A,j,o,l,R,a,y,k,f,I,L,m]),S.useMemo(()=>{if(!n)return;function D(T){g.pointerType=T.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(T){var K,Q,H;const{nativeEvent:_}=T,O=T.currentTarget,B=v.select("domReferenceElement"),$=v.select("open"),V=A(B,O,T.target);if(o&&!ps(g.pointerType))return;if($&&V&&((K=g.handleCloseOptions)!=null&&K.blockPointerEvents)){const W=v.select("floatingElement");if(W){const G=((H=(Q=g.handleCloseOptions)==null?void 0:Q.getScope)==null?void 0:H.call(Q))??O.ownerDocument.body;xC(g,{scopeElement:G,referenceElement:O,floatingElement:W})}}const Y=cv(R.current);if($&&!V||Y===0||!V&&g.restTimeoutPending&&T.movementX**2+T.movementY**2<2)return;g.restTimeout.clear();function U(){if(g.restTimeoutPending=!1,j())return;const W=v.select("open");!g.blockMouseMove&&(!W||V)&&L()&&v.setOpen(!0,Me(gt,_,O))}g.pointerType==="touch"?vn.flushSync(()=>{U()}):V&&$?U():(g.restTimeoutPending=!0,g.restTimeout.start(Y,U))}}},[n,g,j,A,o,v,R,L])}const Iv=.1,t3=Iv*Iv,Fe=.5;function yc(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function xc(e,t,n,r,s,o,i,l,a,c){let u=!1;return yc(e,t,n,r,s,o)&&(u=!u),yc(e,t,s,o,i,l)&&(u=!u),yc(e,t,i,l,a,c)&&(u=!u),yc(e,t,a,c,n,r)&&(u=!u),u}function n3(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function vc(e,t,n,r,s,o){const i=Math.min(n,s),l=Math.max(n,s),a=Math.min(r,o),c=Math.max(r,o);return e>=i&&e<=l&&t>=a&&t<=c}function bC(e={}){const{blockPointerEvents:t=!1}=e,n=new bn,r=({x:s,y:o,placement:i,elements:l,onClose:a,nodeId:c,tree:u})=>{const f=i==null?void 0:i.split("-")[0];let d=!1,p=null,m=null,v=typeof performance<"u"?performance.now():0;function b(y,g){const w=performance.now(),E=w-v;if(p===null||m===null||E===0)return p=y,m=g,v=w,!1;const C=y-p,R=g-m,k=C*C+R*R,N=E*E*t3;return p=y,m=g,v=w,k<N}function h(){n.clear(),a()}return function(g){n.clear();const w=l.domReference,E=l.floating;if(!w||!E||f==null||s==null||o==null)return;const{clientX:C,clientY:R}=g,k=Ct(g),N=g.type==="mouseleave",I=ye(E,k),j=ye(w,k);if(I&&(d=!0,!N))return;if(j&&(d=!1,!N)){d=!0;return}if(N&&Ee(g.relatedTarget)&&ye(E,g.relatedTarget))return;function L(){return!!(u&&Ss(u.nodesRef.current,c).length>0)}function A(){L()||h()}if(L())return;const P=w.getBoundingClientRect(),M=E.getBoundingClientRect(),z=s>M.right-M.width/2,D=o>M.bottom-M.height/2,T=M.width>P.width,_=M.height>P.height,O=(T?P:M).left,B=(T?P:M).right,$=(_?P:M).top,V=(_?P:M).bottom;if(f==="top"&&o>=P.bottom-1||f==="bottom"&&o<=P.top+1||f==="left"&&s>=P.right-1||f==="right"&&s<=P.left+1){A();return}let Y=!1;switch(f){case"top":Y=vc(C,R,O,P.top+1,B,M.bottom-1);break;case"bottom":Y=vc(C,R,O,M.top+1,B,P.bottom-1);break;case"left":Y=vc(C,R,M.right-1,V,P.left+1,$);break;case"right":Y=vc(C,R,P.right-1,V,M.left+1,$);break}if(Y)return;if(d&&!n3(C,R,P)){A();return}if(!N&&b(C,R)){A();return}let U=!1;switch(f){case"top":{const K=T?Fe/2:Fe*4,Q=T||z?s+K:s-K,H=T?s-K:z?s+K:s-K,W=o+Fe+1,G=z||T?M.bottom-Fe:M.top,J=z?T?M.bottom-Fe:M.top:M.bottom-Fe;U=xc(C,R,Q,W,H,W,M.left,G,M.right,J);break}case"bottom":{const K=T?Fe/2:Fe*4,Q=T||z?s+K:s-K,H=T?s-K:z?s+K:s-K,W=o-Fe,G=z||T?M.top+Fe:M.bottom,J=z?T?M.top+Fe:M.bottom:M.top+Fe;U=xc(C,R,Q,W,H,W,M.left,G,M.right,J);break}case"left":{const K=_?Fe/2:Fe*4,Q=_||D?o+K:o-K,H=_?o-K:D?o+K:o-K,W=s+Fe+1,G=D||_?M.right-Fe:M.left,J=D?_?M.right-Fe:M.left:M.right-Fe;U=xc(C,R,G,M.top,J,M.bottom,W,Q,W,H);break}case"right":{const K=_?Fe/2:Fe*4,Q=_||D?o+K:o-K,H=_?o-K:D?o+K:o-K,W=s-Fe,G=D||_?M.left+Fe:M.right,J=D?_?M.left+Fe:M.right:M.left+Fe;U=xc(C,R,W,Q,W,H,G,M.top,J,M.bottom);break}}U?d||n.start(40,A):A()}};return r.__options={...e,blockPointerEvents:t},r}const SC=S.createContext(void 0);function r3(){const e=S.useContext(SC);if(e===void 0)throw new Error(Yt(26));return e}const zp="ArrowUp",Dp="ArrowDown",Fp="ArrowLeft",Lp="ArrowRight",$p="Home",Hp="End",i0=new Set([zp,Dp,Fp,Lp,$p,Hp]),s3="Shift",o3=[s3,"Control","Alt","Meta"];function i3(e){return $e(e)&&e.tagName==="INPUT"}function Mv(e){return!!(i3(e)&&e.selectionStart!=null||$e(e)&&e.tagName==="TEXTAREA")}function _v(e,t,n,r){if(!e||!t||!t.scrollTo)return;let s=e.scrollLeft,o=e.scrollTop;const i=e.clientWidth<e.scrollWidth,l=e.clientHeight<e.scrollHeight;if(i&&r!=="vertical"){const a=Ov(e,t,"left"),c=wc(e),u=wc(t);n==="ltr"&&(a+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight?s=a+t.offsetWidth+u.scrollMarginRight-e.clientWidth+c.scrollPaddingRight:a-u.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft&&(s=a-u.scrollMarginLeft-c.scrollPaddingLeft)),n==="rtl"&&(a-u.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft?s=a-u.scrollMarginLeft-c.scrollPaddingLeft:a+t.offsetWidth+u.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight&&(s=a+t.offsetWidth+u.scrollMarginRight-e.clientWidth+c.scrollPaddingRight))}if(l&&r!=="horizontal"){const a=Ov(e,t,"top"),c=wc(e),u=wc(t);a-u.scrollMarginTop<e.scrollTop+c.scrollPaddingTop?o=a-u.scrollMarginTop-c.scrollPaddingTop:a+t.offsetHeight+u.scrollMarginBottom>e.scrollTop+e.clientHeight-c.scrollPaddingBottom&&(o=a+t.offsetHeight+u.scrollMarginBottom-e.clientHeight+c.scrollPaddingBottom)}e.scrollTo({left:s,top:o,behavior:"auto"})}function Ov(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[r],t.offsetParent!==e);)t=t.offsetParent;return s}function wc(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const l3={...Rm,...Cm,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},a3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:i,initialFocus:l,...a}=t,c=yo(),u=c.useState("descriptionElementId"),f=c.useState("disablePointerDismissal"),d=c.useState("floatingRootContext"),p=c.useState("popupProps"),m=c.useState("modal"),v=c.useState("mounted"),b=c.useState("nested"),h=c.useState("nestedOpenDialogCount"),y=c.useState("open"),g=c.useState("openMethod"),w=c.useState("titleElementId"),E=c.useState("transitionStatus"),C=c.useState("role"),R=d.useState("floatingId");r3(),Ca({open:y,ref:c.context.popupRef,onComplete(){var A,P;y&&((P=(A=c.context).onOpenChangeComplete)==null||P.call(A,!0))}});const k=l===void 0?fC(c.context.popupRef):l,N=h>0,I=c.useStateSetter("popupElement"),L=zt("div",t,{state:{open:y,nested:b,transitionStatus:E,nestedDialogOpen:N},props:[p,{id:R,"aria-labelledby":w,"aria-describedby":u,role:C,...Ym,hidden:!v,onKeyDown(A){i0.has(A.key)&&A.stopPropagation()},style:{"--nested-dialogs":h}},a],ref:[n,c.context.popupRef,I],stateAttributesMapping:l3});return x.jsx(eC,{context:d,openInteractionType:g,disabled:!v,closeOnFocusOut:!f,initialFocus:k,returnFocus:i,modal:m!==!1,restoreFocus:"popup",children:L})});function l0(e){return bm(19)?e:e?"true":void 0}const EC=S.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const i=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),c3=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=yo(),i=o.useState("mounted"),l=o.useState("modal"),a=o.useState("open");return i||r?x.jsx(SC.Provider,{value:r,children:x.jsxs(Xk,{ref:n,...s,children:[i&&l===!0&&x.jsx(EC,{ref:o.context.internalBackdropRef,inert:l0(!a)}),t.children]})}):null});let Av={},jv={},zv="";function zd(e,t){return Ea(e)?e:t}function Dv(e,t,n){return/hidden|clip/.test(e.getComputedStyle(zd(t,n)).overflowY)}function u3(e){if(typeof document>"u")return!1;const t=je(e);return et(t).innerWidth-t.documentElement.clientWidth>0}function d3(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=je(e),r=n.documentElement,s=n.body,o=zd(r,s),i=o.style.overflowY,l=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const a=o.offsetWidth;o.style.overflowY="hidden";const c=o.offsetWidth;return o.style.overflowY=i,r.style.scrollbarGutter=l,a===c}function f3(e){const t=je(e),n=t.documentElement,r=t.body,s=zd(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function h3(e){var p;const t=je(e),n=t.documentElement,r=t.body,s=et(n);let o=0,i=0,l=!1;const a=Qn.create();if(xo&&(((p=s.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function c(){const m=s.getComputedStyle(n),v=s.getComputedStyle(r),y=(m.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,i=n.scrollLeft,Av={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},zv=n.style.scrollBehavior,jv={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const g=n.scrollHeight>n.clientHeight,w=n.scrollWidth>n.clientWidth,E=m.overflowY==="scroll"||v.overflowY==="scroll",C=m.overflowX==="scroll"||v.overflowX==="scroll",R=Math.max(0,s.innerWidth-r.clientWidth),k=Math.max(0,s.innerHeight-r.clientHeight),N=parseFloat(v.marginTop)+parseFloat(v.marginBottom),I=parseFloat(v.marginLeft)+parseFloat(v.marginRight),j=zd(n,r);if(l=d3(e),l){n.style.scrollbarGutter=y,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(g||E)&&(n.style.overflowY="scroll"),(w||C)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:N||k?`calc(100dvh - ${N+k}px)`:"100dvh",width:I||R?`calc(100vw - ${I+R}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,Av),Object.assign(r.style,jv),l||(n.scrollTop=o,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=zv)}function f(){u(),a.request(c)}c();const d=be(s,"resize",f);return()=>{a.cancel(),u(),typeof s.removeEventListener=="function"&&d()}}class p3{constructor(){Ie(this,"lockCount",0);Ie(this,"restore",null);Ie(this,"timeoutLock",bn.create());Ie(this,"timeoutUnlock",bn.create());Ie(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Ie(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=je(t),r=n.documentElement,s=n.body,o=et(r);if(Dv(o,r,s)){const l=new o.MutationObserver(()=>{Dv(o,r,s)||(l.disconnect(),this.restore=null,this.lock(t))}),a={attributes:!0};l.observe(r,a),l.observe(s,a),this.restore=()=>l.disconnect();return}const i=Id||!u3(t);this.restore=i?f3(t):h3(t)}}const g3=new p3;function kC(e=!0,t=null){pe(()=>{if(e)return g3.acquire(t)},[e,t])}function m3({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),o=e.useState("modal"),i=e.useState("popupElement"),l=e.useState("floatingRootContext"),[a,c]=S.useState(0),[u,f]=S.useState(0),d=a===0,p=Wm(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!e.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}const v=Ct(m);if(d&&!s){if(o){const b=e.context.internalBackdropRef.current,h=e.context.backdropRef.current;return b||h?b===v||h===v||ye(v,i)&&!(v!=null&&v.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:d});return kC(r&&o===!0,i),e.useContextCallback("onNestedDialogOpen",(m,v)=>{c(m),f(v)}),pe(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(a+1,u+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,a,u,t]),Jm(e,{activeTriggerProps:p.reference,inactiveTriggerProps:p.trigger,popupProps:p.floating,nestedOpenDialogCount:a,nestedOpenDrawerCount:u}),null}const y3={...r0,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class x3 extends Ad{constructor(n,r,s){const o=new jd,i=v3(n,o,r,s);super(i,w3(o),y3);Ie(this,"setOpen",(n,r)=>{var o,i;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(i=(o=this.context).onOpenChange)==null||i.call(o,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const s={open:n};Xm(s,n,r.trigger),this.update(s)})}}function v3(e,t,n,r=!1){const s={...e0(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return s.floatingRootContext=t0(t,n,r),s}function w3(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function b3(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:i,disablePointerDismissal:l=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:f,defaultTriggerId:d=null}=t,p=e==="drawer",m=a,v=l,b="dialog",h=yo(!0),y=h!=null,g={modal:m,disablePointerDismissal:v,nested:y,role:b},w=qm((I,j)=>new x3({open:s,openProp:r,activeTriggerId:d,triggerIdProp:f,...g},I,j),!0);w.useControlledProp("openProp",r),w.useControlledProp("triggerIdProp",f),w.useSyncedValues(g),w.useContextCallback("onOpenChange",o),w.useContextCallback("onOpenChangeComplete",i);const E=w.useState("open"),C=w.useState("mounted"),R=w.useState("payload");gC(w,E),Gm(w);const{forceUnmount:k}=Zm(E,w);S.useImperativeHandle(c,()=>({unmount:k,close:()=>w.setOpen(!1,Me(Am))}),[k,w]);const N=E||C;return x.jsxs(fk.Provider,{value:w,children:[u&&x.jsx(Qm,{handle:u,store:w}),N&&x.jsx(m3,{store:w,parentContext:h==null?void 0:h.context,isDrawer:p}),typeof n=="function"?n({payload:R}):n]})}function S3(e){return b3("dialog",e)}const E3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,id:i,...l}=t,a=yo(),c=Fi(i);return a.useSyncedValueWithCleanup("titleElementId",c),zt("h2",t,{ref:n,props:[{id:c},l]})});function k3(e){const t=S.useRef(""),n=S.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:S.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function C3(e,t){const n=me((o,i)=>{(typeof e=="function"?e():e)||t(i||(Id?"touch":""))}),{onClick:r,onPointerDown:s}=k3(n);return S.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}const R3=S3,P3=V5;function T3({open:e,onOpenChange:t,title:n,subtitle:r,footer:s,children:o,className:i}){return x.jsx(R3,{open:e,onOpenChange:t,children:x.jsxs(c3,{children:[x.jsx(_5,{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm"}),x.jsxs(a3,{className:ft("rise fixed left-1/2 top-1/2 z-50 w-[min(560px,92vw)] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-line bg-panel-2 text-foreground shadow-2xl focus-visible:outline-none",i),children:[x.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-line px-5 py-4",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsx(E3,{className:"truncate text-[15px] font-semibold tracking-tight text-zinc-50",children:n}),r&&x.jsx(U5,{className:"mono mt-1 text-[11px] text-zinc-500",children:r})]}),x.jsx(P3,{render:x.jsx(Ue,{variant:"quiet",size:"icon","aria-label":"Close",children:x.jsx(Di,{})})})]}),x.jsx("div",{className:"px-5 py-4",children:o}),s&&x.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:s})]})]})})}const CC=S.forwardRef(({className:e,...t},n)=>x.jsx("input",{ref:n,className:ft("mono w-full bg-transparent py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none disabled:opacity-50",e),...t}));CC.displayName="Input";const Vc=S.forwardRef(({glyph:e,onClear:t,clearLabel:n="clear",containerClassName:r,value:s,...o},i)=>x.jsxs("div",{className:ft("flex items-center gap-1.5 rounded-md border border-line px-2 transition-colors focus-within:border-zinc-600",r),children:[e!==void 0&&x.jsx("span",{className:"shrink-0 text-zinc-600","aria-hidden":!0,children:e}),x.jsx(CC,{ref:i,value:s,...o}),t&&s?x.jsx(Ue,{variant:"ghost",size:"icon",onClick:t,title:n,"aria-label":n,className:"h-4 w-4",children:x.jsx(Di,{width:12,height:12})}):null]}));Vc.displayName="InputField";const RC=S.createContext(void 0);function Ra(e){const t=S.useContext(RC);if(t===void 0&&!e)throw new Error(Yt(47));return t}const N3={...r0,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class I3 extends Ad{constructor(n,r,s){const o=new jd;super(M3(n,o,r,s),_3(o),N3);Ie(this,"setOpen",(n,r)=>{var f,d;const s=r.reason===gt,o=r.reason===vs&&r.event.detail===0,i=!n&&(r.reason===Pd||r.reason==null),l=hC(r),a=this.select("activeTriggerId");if(!n&&r.reason===kk&&r.trigger==null&&a!=null&&(r.trigger=this.context.triggerElements.getById(a)??this.select("activeTriggerElement")??void 0),(d=(f=this.context).onOpenChange)==null||d.call(f,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const c=()=>{const p={open:n,openChangeReason:r.reason};Xm(p,n,r.trigger,l()),this.update(p)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(jF,()=>{this.set("stickIfOpen",!1)}),vn.flushSync(c)):c();let u;o?u="click":i?u="dismiss":r.reason===Jl&&(u="focus"),this.set("instantType",u)})}}function M3(e,t,n,r=!1){const s={...e0(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&(e==null?void 0:e.mounted)===void 0&&(s.mounted=!0),s.floatingRootContext=t0(t,n,r),s}function _3(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new bn,triggerElements:e}}function Fv({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,modal:i=!1,handle:l,triggerId:a,defaultTriggerId:c=null}=e,u=A3(l,{modal:i,open:r,openProp:n,activeTriggerId:c,triggerIdProp:a});u.useControlledProp("openProp",n),u.useControlledProp("triggerIdProp",a);const f=u.useState("open"),d=u.useState("mounted"),p=u.useState("payload");u.useContextCallback("onOpenChange",s),u.useContextCallback("onOpenChangeComplete",o),gC(u,f),Gm(u);const{forceUnmount:m}=Zm(f,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:i}),S.useEffect(()=>{f||u.context.stickIfOpenTimeout.clear()},[u,f]),S.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,Me(Am))}),[m,u]);const v=f||d;return x.jsxs(RC.Provider,{value:u,children:[l&&x.jsx(Qm,{handle:l,store:u}),v&&x.jsx(j3,{store:u,modal:i}),typeof t=="function"?t({payload:p}):t]})}function O3(e){return Ra(!0)?x.jsx(Fv,{props:e}):x.jsx(BF,{children:x.jsx(Fv,{props:e})})}function A3(e,t){const n=qm((r,s)=>new I3(t,r,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function j3({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=Wm(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Jm(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const z3=300;function D3(e,t){const n=S.useRef(null);function r(o){vn.flushSync(()=>{e.setOpen(!1,Me(Jl,o.nativeEvent,o.currentTarget))});const i=MF(n.current);i==null||i.focus()}function s(o){var l;const i=e.select("positionerElement");if(i&&Xo(o,i))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{vn.flushSync(()=>{e.setOpen(!1,Me(Jl,o.nativeEvent,o.currentTarget))});let a=IF(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&ye(i,a);){const c=a;if(a=Bm(a),a===c)break}a==null||a.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}const F3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:i=!1,nativeButton:l=!0,handle:a,payload:c,openOnHover:u=!1,delay:f=z3,closeDelay:d=0,id:p,...m}=t,v=Ra(!0),h=yC(a)??v;if(!h)throw new Error(Yt(74));const y=Fi(p),g=h.useState("isTriggerActive",y),w=h.useState("floatingRootContext"),E=h.useState("isOpenedByTrigger",y),C=h.useState("triggerPopupId",y),R=S.useRef(null),{registerTrigger:k,isMountedByThisTrigger:N}=pC(y,R,h,{payload:c,disabled:i,openOnHover:u,closeDelay:d}),I=h.useState("openChangeReason"),j=h.useState("stickIfOpen"),L=h.useState("openMethod"),A=h.useState("focusManagerModal"),P=wC(w,{enabled:!i&&u&&(L!=="touch"||I!==vs),mouseOnly:!0,move:!1,handleClose:bC(),restMs:f,delay:{close:d},triggerElementRef:R,isActiveTrigger:g,isClosing:()=>h.select("transitionStatus")==="ending"}),M=UF(w,{stickIfOpen:j}),z=C3(()=>h.select("open"),Q=>{h.set("openMethod",Q)}),D=h.useState("triggerProps",N),{getButtonProps:T,buttonRef:_}=Om({disabled:i,native:l}),O={open(Q){return Q&&I===vs?M5.open(Q):wk.open(Q)}},{preFocusGuardRef:B,handlePreFocusGuardFocus:$,handleFocusTargetFocus:V}=D3(h,R),U=zt("button",t,{state:{disabled:i,open:E},ref:[_,n,k,R],props:[M.reference,P,D,z,{[Uk]:"",id:y,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":C},m,T],stateAttributesMapping:O}),K=x.jsx(S.Fragment,{children:U},y);return N&&!A?x.jsxs(S.Fragment,{children:[x.jsx(Ii,{ref:B,onFocus:$}),K,x.jsx(Ii,{ref:h.context.triggerFocusTargetRef,onFocus:V})]}):K}),PC=S.createContext(void 0);function L3(){const e=S.useContext(PC);if(e===void 0)throw new Error(Yt(45));return e}const $3=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Ra().useState("mounted")||r?x.jsx(PC.Provider,{value:r,children:x.jsx(Xk,{ref:n,...s})}):null}),TC=S.createContext(void 0);function H3(){const e=S.useContext(TC);if(!e)throw new Error(Yt(46));return e}const B3=S.createContext(void 0);function NC(){const e=S.useContext(B3);return(e==null?void 0:e.direction)??"ltr"}const V3=e=>({name:"arrow",options:e,async fn(t){var _,O;const{x:n,y:r,placement:s,rects:o,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0,offsetParent:f="real"}=bs(e,t)||{};if(c==null)return{};const d=Ok(u),p={x:n,y:r},m=Lm(s),v=Fm(m),b=await i.getDimensions(c),h=m==="y",y=h?"top":"left",g=h?"bottom":"right",w=h?"clientHeight":"clientWidth",E=o.reference[v]+o.reference[m]-p[m]-o.floating[v],C=p[m]-o.reference[m],R=f==="real"?await((_=i.getOffsetParent)==null?void 0:_.call(i,c)):l.floating;let k=l.floating[w]||o.floating[v];(!k||!await((O=i.isElement)==null?void 0:O.call(i,R)))&&(k=l.floating[w]||o.floating[v]);const N=E/2-C/2,I=k/2-b[v]/2-1,j=Math.min(d[y],I),L=Math.min(d[g],I),A=j,P=k-b[v]-L,M=k/2-b[v]/2+N,z=_k(A,M,P),D=!a.arrow&&Ps(s)!=null&&M!==z&&o.reference[v]/2-(M<A?j:L)-b[v]/2<0,T=D?M<A?M-A:M-P:0;return{[m]:p[m]+T,data:{[m]:z,centerOffset:M-z-T,...D&&{alignmentOffset:T}},reset:D}}}),W3=(e,t)=>({...V3(e),options:[e,t]}),U3={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,o=t===0&&n===0&&r===0&&s===0,i=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:i.top-n>=0||i.right-t>=0||i.bottom-n>=0||i.left-t>=0||o}}}},K3={sideX:"left",sideY:"top"},Lv="--available-width",$v="--available-height";function IC(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Hv(e,t,n){const{rects:r,placement:s}=e;return{side:IC(t,mn(s),n),align:Ps(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function MC(e){return Y3(e,GL)}function Y3(e,t){var Ta,Na;const{anchor:n,positionMethod:r="absolute",side:s="bottom",sideOffset:o=0,align:i="center",alignOffset:l=0,collisionBoundary:a,collisionPadding:c=5,sticky:u=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,inline:p,keepMounted:m=!1,floatingRootContext:v,mounted:b,collisionAvoidance:h,shift:y,nodeId:g,adaptiveOrigin:w,lazyFlip:E=!1,externalTree:C}=e,[R,k]=S.useState(null);!b&&R!==null&&k(null);const N=h.side||"flip",I=h.align||"flip",j=h.fallbackAxisSide||"end",L=(y==null?void 0:y.crossAxis)??!1,A=y==null?void 0:y.rootBoundary,P=typeof n=="function"?n:void 0,M=me(P),z=P?M:n,D=_t(n),T=_t(b),O=NC()==="rtl",B=R||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":O?"left":"right","inline-start":O?"right":"left"}[s],$=i==="center"?B:`${B}-${i}`;let V=c;typeof V=="number"?V={top:V,right:V,bottom:V,left:V}:V&&(V={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0});const Y=1,U=s==="bottom"?Y:0,K=s==="top"?Y:0,Q=s==="right"?Y:0,H=s==="left"?Y:0,W={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:V},G=S.useRef(null),J=_t(o),X=_t(l),q=typeof o!="function"?o:0,te=typeof l!="function"?l:0,le=[];p&&le.push(p),le.push(IL(Ce=>{const ht=Hv(Ce,s,O),ln=typeof J.current=="function"?J.current(ht):J.current,Nt=typeof X.current=="function"?X.current(ht):X.current;return{mainAxis:ln,crossAxis:Nt,alignmentAxis:Nt}},[q,te,O,s]));const Z=I==="none"&&N!=="shift",ee=!Z&&(u||L||N==="shift"),fe=N==="none"?null:OL({...W,padding:{top:V.top+Y+U,right:V.right+Y+H,bottom:V.bottom+Y+K,left:V.left+Y+Q},mainAxis:!L&&N==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:j}),oe=Z?null:ML({...W,rootBoundary:A,mainAxis:I!=="none",crossAxis:ee,limiter:u||L?void 0:_L(Ce=>{if(!G.current)return{};const{width:ht,height:ln}=G.current.getBoundingClientRect(),Nt=pn(mn(Ce.placement)),Sn=Nt==="y"?ht:ln,an=Nt==="y"?V.left+V.right:V.top+V.bottom;return{offset:Sn/2+an/2}})},[W,u,L,A,V,I]);N==="shift"||I==="shift"||i==="center"?le.push(oe,fe):le.push(fe,oe),le.push(AL({...W,apply({elements:{floating:Ce},availableWidth:ht,availableHeight:ln,rects:Nt}){if(!T.current)return;const Sn=Ce.style;Sn.setProperty(Lv,`${ht}px`),Sn.setProperty($v,`${ln}px`);const an=et(Ce).devicePixelRatio||1,{x:Ts,y:ko,width:$n,height:$i}=Nt.reference,Hi=(Math.round((Ts+$n)*an)-Math.round(Ts*an))/an,Bi=(Math.round((ko+$i)*an)-Math.round(ko*an))/an;Sn.setProperty("--anchor-width",`${Hi}px`),Sn.setProperty("--anchor-height",`${Bi}px`)}}),W3(Ce=>({element:G.current||je(Ce.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Ce){var Oa,Aa,ja;const{elements:ht,middlewareData:ln,placement:Nt,rects:Sn,y:an}=Ce,Ts=mn(Nt),ko=pn(Ts),$n=G.current,$i=((Oa=ln.arrow)==null?void 0:Oa.x)||0,Hi=((Aa=ln.arrow)==null?void 0:Aa.y)||0,Bi=($n==null?void 0:$n.clientWidth)||0,Ld=($n==null?void 0:$n.clientHeight)||0,Vi=$i+Bi/2,Ia=Hi+Ld/2,$d=Math.abs(((ja=ln.shift)==null?void 0:ja.y)||0),Hd=Sn.reference.height/2,_r=typeof o=="function"?o(Hv(Ce,s,O)):o,Ma=$d>_r,_a={top:`${Vi}px calc(100% + ${_r}px)`,bottom:`${Vi}px ${-_r}px`,left:`calc(100% + ${_r}px) ${Ia}px`,right:`${-_r}px ${Ia}px`}[Ts],Bd=`${Vi}px ${Sn.reference.y+Hd-an}px`;return ht.floating.style.setProperty("--transform-origin",ee&&ko==="y"&&Ma?Bd:_a),{}}},U3,w),pe(()=>{!b&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[b,v]);const xe=S.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Re,elements:Se,x:Ae,y:se,middlewareData:ie,update:_e,placement:ve,context:De,isPositioned:Le,floatingStyles:Pt}=t({rootContext:v,open:m?b:void 0,placement:$,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...Ce)=>Pv(...Ce,xe),nodeId:g,externalTree:C}),{sideX:Tt,sideY:Ir}=ie.adaptiveOrigin||K3,rr=Le?r:"fixed",vo=S.useMemo(()=>{let Ce;return Le?w?Ce={position:rr,[Tt]:Ae,[Ir]:se}:Ce={...Pt,position:rr}:Ce={position:rr,top:0,left:0},Ce[Lv]="100vw",Ce[$v]="100vh",Le||(Ce.opacity=0),Ce},[w,rr,Tt,Ae,Ir,se,Pt,Le]),Mr=S.useRef(null);pe(()=>{if(!b)return;const Ce=D.current,ht=typeof Ce=="function"?Ce():Ce,Nt=(Bv(ht)?ht.current:ht)||null||null;Nt!==Mr.current&&(Re.setPositionReference(Nt),Mr.current=Nt)},[b,Re,z,D]),S.useEffect(()=>{if(!b)return;const Ce=D.current;typeof Ce!="function"&&Bv(Ce)&&Ce.current!==Mr.current&&(Re.setPositionReference(Ce.current),Mr.current=Ce.current)},[b,Re,z,D]),S.useEffect(()=>{if(m&&b&&Se.reference&&Se.floating)return Pv(Se.reference,Se.floating,_e,xe)},[m,b,Se,_e,xe]);const Ln=mn(ve),wo=IC(s,Ln,O),bo=Ps(ve)||"center",So=!!((Ta=ie.hide)!=null&&Ta.referenceHidden);pe(()=>{E&&b&&Le&&Ln!==B&&k(Ln)},[E,b,Le,Ln,B]);const Eo=S.useMemo(()=>{var Ce,ht;return{position:"absolute",top:(Ce=ie.arrow)==null?void 0:Ce.y,left:(ht=ie.arrow)==null?void 0:ht.x}},[ie.arrow]),Pa=((Na=ie.arrow)==null?void 0:Na.centerOffset)!==0;return S.useMemo(()=>({positionerStyles:vo,arrowStyles:Eo,arrowRef:G,arrowUncentered:Pa,side:wo,align:bo,physicalSide:Ln,anchorHidden:So,refs:Re,context:De,isPositioned:Le,update:_e}),[vo,Eo,G,Pa,wo,bo,Ln,So,Re,De,Le,_e])}function Bv(e){return e!=null&&"current"in e}function a0(e){return e==="starting"?zF:mt}function _C(e,t,{styles:n,transitionStatus:r,props:s,refs:o,hidden:i,inert:l=!1}){const a={...n};return l&&(a.pointerEvents="none"),zt("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:i,style:a},a0(r),s],stateAttributesMapping:Rm})}const q3=20;function Q3(e,t,n,r){const[s,o]=S.useState(!1);pe(()=>{if(!e||!t||n==null){o(!1);return}const i=je(n).documentElement.clientWidth,l=n.offsetWidth;o(i>0&&l>0&&l>=i-q3)},[e,t,n]),kC(e&&(!t||s),r)}const X3=S.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:i,positionMethod:l,side:a,align:c,sideOffset:u,alignOffset:f,collisionBoundary:d="clipping-ancestors",collisionPadding:p,arrowPadding:m,sticky:v,disableAnchorTracking:b=!1,collisionAvoidance:h=Kk,...y}=t,g=Ra(),w=L3(),E=$F(),C=g.useState("floatingRootContext"),R=g.useState("mounted"),k=g.useState("open"),N=g.useState("openChangeReason"),I=g.useState("activeTriggerElement"),j=g.useState("modal"),L=g.useState("openMethod"),A=g.useState("positionerElement"),P=g.useState("instantType"),M=g.useState("transitionStatus"),z=g.useState("adaptiveOrigin"),D=S.useRef(null),T=dC(A),_=MC({anchor:i,floatingRootContext:C,positionMethod:l,mounted:R,side:a,sideOffset:u,align:c,alignOffset:f,arrowPadding:m,collisionBoundary:d,collisionPadding:p,sticky:v,disableAnchorTracking:b,keepMounted:w,nodeId:E,collisionAvoidance:h,adaptiveOrigin:z}),O=C.useState("domReferenceElement");pe(()=>{const U=O,K=D.current;if(U&&(D.current=U),K&&U&&U!==K){g.set("instantType",void 0);const Q=new AbortController;return T(()=>{g.set("instantType","trigger-change")},Q.signal),()=>{Q.abort()}}},[O,T,g]);const B=j===!0&&N!==gt;Q3(k&&B,L==="touch",A,I);const $=g.useStateSetter("positionerElement"),V={open:k,side:_.side,align:_.align,anchorHidden:_.anchorHidden,instant:P},Y=_C(t,V,{styles:_.positionerStyles,transitionStatus:M,props:y,refs:[n,$],hidden:!R,inert:!k});return x.jsxs(TC.Provider,{value:_,children:[R&&B&&x.jsx(EC,{inert:l0(!k),cutout:I}),x.jsx(HF,{id:E,children:Y})]})}),G3=S.createContext(void 0);function Z3(e){return S.useContext(G3)}const J3=S.createContext(void 0);function e$(){const[e,t]=S.useState(0),n=me(()=>(t(s=>s+1),()=>{t(s=>Math.max(0,s-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const t$=S.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:i,finalFocus:l,...a}=t,c=Ra(),u=H3(),f=Z3()!=null,{context:d,hasClosePart:p}=e$(),m=c.useState("open"),v=c.useState("openMethod"),b=c.useState("instantType"),h=c.useState("transitionStatus"),y=c.useState("popupProps"),g=c.useState("titleElementId"),w=c.useState("descriptionElementId"),E=c.useState("modal"),C=c.useState("mounted"),R=c.useState("openChangeReason"),k=c.useState("activeTriggerElement"),N=c.useState("floatingRootContext"),I=N.useState("floatingId"),j=c.useState("disabled"),L=c.useState("openOnHover"),A=c.useState("closeDelay");Ca({open:m,ref:c.context.popupRef,onComplete(){var _,O;m&&((O=(_=c.context).onOpenChangeComplete)==null||O.call(_,!0))}}),vC(N,{enabled:L&&!j,closeDelay:A});const P=i===void 0?fC(c.context.popupRef):i,M=E!==!1&&p;c.useSyncedValue("focusManagerModal",M);const z=c.useStateSetter("popupElement"),D={open:m,side:u.side,align:u.align,instant:b,transitionStatus:h},T=zt("div",t,{state:D,ref:[n,c.context.popupRef,z],props:[y,{id:I,role:"dialog",...Ym,"aria-labelledby":g,"aria-describedby":w,onKeyDown(_){f&&i0.has(_.key)&&_.stopPropagation()}},a0(h),a],stateAttributesMapping:Pm});return x.jsx(eC,{context:N,openInteractionType:v,modal:M,disabled:!C||R===gt,initialFocus:P,returnFocus:l,restoreFocus:"popup",previousFocusableElement:$e(k)?k:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:x.jsx(J3.Provider,{value:d,children:T})})}),Bp=O3,Vp=F3,Bu=S.forwardRef(({className:e,side:t="bottom",align:n="end",sideOffset:r=4,...s},o)=>x.jsx($3,{children:x.jsx(X3,{side:t,align:n,sideOffset:r,collisionPadding:8,className:"z-40",children:x.jsx(t$,{ref:o,className:ft("rise w-72 overflow-hidden rounded-md border border-line bg-popover/95 text-zinc-300 shadow-xl backdrop-blur focus-visible:outline-none",e),...s})})}));Bu.displayName="PopoverContent";function n$({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=S.useRef(e!==void 0),[o,i]=S.useState(t),l=s?e:o,a=S.useCallback(c=>{s||i(c)},[]);return[l,a]}const OC=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function r$(){return S.useContext(OC)}function AC(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=me(s),[,i]=S.useState(!1),l=wn(o$).current,a=wn(s$).current,c=S.useRef(0),u=S.useRef(!0),f=S.useRef([]),d=S.useRef(null),p=me(()=>{u.current||(u.current=!0,i(E=>!E))}),m=me((E,C)=>{a.set(E,C),p()}),v=me(E=>{a.delete(E),p()}),b=me(E=>{const C=new Map;return n.current.length=0,r&&(r.current.length=0),E.forEach(R=>{var k,N;C.set(R.element,{...R.registration.metadata??{},index:R.index}),n.current[R.index]=R.element,r&&(r.current[R.index]=R.registration.label!==void 0?R.registration.label:((N=(k=R.registration.textRef)==null?void 0:k.current)==null?void 0:N.textContent)??R.element.textContent)}),c.current=n.current.length,C});function h(E){var k;if((k=d.current)==null||k.disconnect(),d.current=null,typeof MutationObserver!="function"||E.length<2)return;const C=new MutationObserver(N=>{if(!a$(N))return;let I=null;for(const j of E)if(j.isConnected){if(I&&jC(I,j)>0){C.disconnect(),p();return}I=j}});d.current=C;const R=new Set;for(let N=1;N<E.length;N+=1){const I=l$(E[N-1],E[N]);I&&R.add(I)}R.forEach(N=>C.observe(N,{childList:!0}))}const y=me(()=>{const[E,C]=i$(a),R=b(E);h(C),f.current=E,u.current=!1,l.forEach(k=>k(R)),o(R)});pe(()=>(u.current||b(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,b]),pe(()=>{u.current&&y()}),pe(()=>()=>{var E;(E=d.current)==null||E.disconnect(),u.current=!0},[]);const g=me(E=>(l.add(E),()=>{l.delete(E)})),w=S.useMemo(()=>({register:m,unregister:v,subscribeMapChange:g,nextIndexRef:c}),[m,v,g,c]);return x.jsx(OC.Provider,{value:w,children:t})}function s$(){return new Map}function o$(){return new Set}function i$(e){const t=new Set,n=[],r=[];e.forEach((o,i)=>{if(!i.isConnected)return;const l=o.index,a={index:l??-1,element:i,registration:o};l===null?r.push(a):l>=0&&(t.add(l),n.push(a))});let s=0;return r.sort((o,i)=>jC(o.element,i.element)),r.forEach(o=>{for(;t.has(s);)s+=1;o.index=s,n.push(o),s+=1}),t.size>0&&n.sort((o,i)=>o.index-i.index),[n,r.map(o=>o.element)]}function l$(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function a$(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function jC(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const zC=S.createContext(void 0);function c0(){const e=S.useContext(zC);if(e===void 0)throw new Error(Yt(64));return e}const Dd={tabActivationDirection:e=>({"data-activation-direction":e})},c$=S.forwardRef(function(t,n){const{className:r,defaultValue:s=0,onValueChange:o,orientation:i="horizontal",render:l,value:a,style:c,...u}=t,f=t.defaultValue!==void 0,d=S.useRef([]),[p,m]=S.useState(()=>new Map),[v,b]=n$({controlled:a,default:s,name:"Tabs",state:"value"}),h=a!==void 0,[y,g]=S.useState(()=>new Map),w=S.useRef(void 0),E=S.useCallback(H=>Wp(y,H),[y]),[C,R]=S.useState(()=>({previousValue:v,tabActivationDirection:"none"})),{previousValue:k,tabActivationDirection:N}=C;let I=N,j=!1;k!==v&&(I=Vv(k,v,i,y),j=k!=null&&v!=null&&E(v)==null);const L=j?k:v,A=k!==L||N!==I;pe(()=>{A&&R({previousValue:L,tabActivationDirection:I})},[L,A,I]);const P=me((H,W)=>{const G=Vv(v,H,i,y);W.activationDirection=G,o==null||o(H,W),!W.isCanceled&&b(H)}),M=me((H,W)=>{o==null||o(H,Me(W,void 0,void 0,{activationDirection:"none"}))}),z=me((H,W)=>(m(G=>{const J=new Map(G);return J.set(H,W),J}),()=>{m(G=>{if(G.get(H)!==W)return G;const J=new Map(G);return J.delete(H),J})})),D=S.useCallback(H=>p.get(H),[p]),T=S.useCallback(H=>{for(const W of y.values())if(H===W.value)return W.id},[y]),_=S.useMemo(()=>({getTabElementBySelectedValue:E,getTabIdByPanelValue:T,getTabPanelIdByValue:D,onValueChange:P,orientation:i,registerMountedTabPanel:z,setTabMap:g,tabActivationDirection:I,value:v}),[E,T,D,P,i,z,g,I,v]),O=S.useMemo(()=>{for(const H of y.values())if(H.value===v)return H},[y,v]),B=S.useMemo(()=>{for(const H of y.values())if(!H.disabled)return H.value},[y]),$=S.useRef(!f),V=S.useRef(s),Y=S.useRef(f),U=S.useRef(!1);pe(()=>{var X;if(h)return;function H(q,te){b(q),R({previousValue:q,tabActivationDirection:"none"}),M(q,te),$.current=!1}if(y.size===0){U.current&&v!==null&&!((X=w.current)!=null&&X.isConnected)&&H(null,nv);return}U.current=!0,w.current=y.keys().next().value;const W=O==null?void 0:O.disabled,G=O==null&&v!==null;if(!W&&v===V.current&&(Y.current=!1),Y.current&&W&&v===V.current)return;const J=$.current;if(W||G){const q=B??null;if(v===q){$.current=!1;return}let te=nv;J?te=rv:W&&(te=Ck),H(q,te);return}J&&O!=null&&(M(v,rv),$.current=!1)},[B,h,M,O,b,y,v]);const Q=zt("div",t,{state:{orientation:i,tabActivationDirection:I},ref:n,props:u,stateAttributesMapping:Dd});return x.jsx(zC.Provider,{value:_,children:x.jsx(AC,{elementsRef:d,children:Q})})});function Wp(e,t){for(const[n,r]of e.entries())if(t===r.value)return n;return null}function Vv(e,t,n,r){if(e==null||t==null)return"none";const[s,o,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],l=Wp(r,e),a=Wp(r,t);if(l==null||a==null)return l!==a&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:o:"none";const c=l.getBoundingClientRect()[s],u=a.getBoundingClientRect()[s];return u<c?o:u>c?i:"none"}const DC="data-composite-item-active";function FC(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:i,unregister:l,subscribeMapChange:a,nextIndexRef:c}=r$(),u=S.useRef(-1),[f,d]=S.useState(o==null&&t?()=>{if(u.current===-1){const b=c.current;c.current+=1,u.current=b}return u.current}:-1),p=o??f,m=S.useRef(null),v=S.useCallback(b=>{const h=m.current;h&&l(h),m.current=b,b&&i(b,{metadata:r??null,index:o??null,label:n,textRef:s})},[o,i,l,r,n,s]);return pe(()=>{if(o==null)return a(b=>{var y;const h=m.current?(y=b.get(m.current))==null?void 0:y.index:null;h!=null&&d(h)})},[o,a]),{ref:v,index:p}}function u$(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=_m(),{ref:s,index:o}=FC(e),i=n===o,l=S.useRef(null),a=Ti(s,l);return{compositeProps:{tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const u=l.current;if(!t||!u)return;const f=u.hasAttribute("disabled")||u.ariaDisabled==="true";!i&&!f&&u.focus()}},compositeRef:a,index:o}}const LC=S.createContext(void 0);function d$(){const e=S.useContext(LC);if(e===void 0)throw new Error(Yt(65));return e}const f$=S.forwardRef(function(t,n){const{className:r,disabled:s=!1,render:o,value:i,id:l,nativeButton:a=!0,style:c,...u}=t,{value:f,getTabPanelIdByValue:d,onValueChange:p,orientation:m,tabActivationDirection:v}=c0(),{activateOnFocus:b,registerTabResizeObserverElement:h,tabsListElement:y}=d$(),{highlightedIndex:g,onHighlightedIndexChange:w}=_m(),E=Fi(l),C=S.useMemo(()=>({disabled:s,id:E,value:i}),[s,E,i]),{compositeProps:R,compositeRef:k,index:N}=u$({metadata:C}),I=i===f,j=S.useRef(!1),L=S.useRef(null),A=me(U=>{var K;(K=L.current)==null||K.call(L),L.current=U?h(U):null});pe(()=>{if(j.current){j.current=!1;return}if(!(I&&N>-1&&g!==N))return;const U=y;if(U!=null){const K=un(je(U));if(K&&ye(U,K))return}s||w(N)},[I,N,g,w,s,y]);const{getButtonProps:P,buttonRef:M}=Om({disabled:s,native:a,focusableWhenDisabled:!0}),z=d(i),D=S.useRef(!1),T=S.useRef(!1);function _(U){p(i,Me(Rd,U.nativeEvent,void 0,{activationDirection:"none"}))}function O(U){I||s||_(U)}function B(U){I||s||b&&(!D.current||T.current)&&_(U)}function $(U){if(I||s)return;D.current=!0,T.current=U.button===0;const K=je(U.currentTarget);function Q(){D.current=!1,T.current=!1,K.removeEventListener("pointerup",Q),K.removeEventListener("pointercancel",Q)}K.addEventListener("pointerup",Q),K.addEventListener("pointercancel",Q)}return zt("button",t,{state:{disabled:s,active:I,orientation:m,tabActivationDirection:v},ref:[n,M,k,A],props:[R,{role:"tab","aria-controls":z,"aria-selected":I,id:E,onClick:O,onFocus:B,onPointerDown:$,[DC]:I?"":void 0,onKeyDownCapture(){j.current=!0}},u,P],stateAttributesMapping:Dd})}),h$={...Dd,...Cm},p$=S.forwardRef(function(t,n){const{className:r,value:s,render:o,keepMounted:i=!1,style:l,...a}=t,{value:c,getTabIdByPanelValue:u,orientation:f,tabActivationDirection:d,registerMountedTabPanel:p}=c0(),m=Fi(),{ref:v,index:b}=FC(),h=s===c,{mounted:y,transitionStatus:g,setMounted:w}=uC(h),E=!y,C=u(s),R={hidden:E,orientation:f,tabActivationDirection:d,transitionStatus:g},k=S.useRef(null),N=zt("div",t,{state:R,ref:[n,v,k],props:[{"aria-labelledby":C,hidden:E,id:m,role:"tabpanel",tabIndex:h?0:-1,inert:l0(!h),"data-index":b},a],stateAttributesMapping:h$});return Ca({open:h,ref:k,onComplete(){h||w(!1)}}),pe(()=>{if(!(m==null||E&&!i))return p(s,m)},[E,i,s,m,p]),i||y?N:null});function g$(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const m$=[];function y$(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:s,direction:o,highlightedIndex:i,onHighlightedIndexChange:l,rootRef:a,enableHomeAndEndKeys:c=!1,stopEventPropagation:u,disabledIndices:f,modifierKeys:d=m$}=e,[p,m]=S.useState(0),v=r!=null,b=S.useRef(null),h=Ti(b,a),y=S.useRef([]),g=S.useRef(!1),w=i??p,E=me((I,j=!1)=>{if((l??m)(I),j){const L=y.current[I];_v(b.current,L,o,n)}}),C=me(I=>{var P;if(I.size===0||g.current)return;g.current=!0;const j=Array.from(I.keys()),L=j.find(M=>M==null?void 0:M.hasAttribute(DC))??null,A=L?((P=I.get(L))==null?void 0:P.index)??-1:-1;if(A!==-1)E(A);else if(Mp(j,w,f)){const M=Sl(j,{disabledIndices:f});Lf(j,M)||E(M)}_v(b.current,L,o,n)});pe(()=>{if(f==null||i!=null||!g.current)return;const I=y.current;if(Mp(I,w,f)){const j=Sl(I,{disabledIndices:f});Lf(I,j)||E(j)}},[f,i,w,y,E]);const R=me((I,j,L)=>s?s(I,j,L,y):L),k=me(I=>{const j=I.key===$p||I.key===Hp;if(!i0.has(I.key)||!c&&j||x$(I,d)||!b.current)return;const A=o==="rtl",P=A?Fp:Lp,M=A?Lp:Fp,z=n==="vertical"?Dp:P,D=n==="vertical"?zp:M,T=Ct(I.nativeEvent);if(T!=null&&Mv(T)&&!g$(T)){const Y=T.selectionStart,U=T.selectionEnd,K=T.value;if(Y==null||I.shiftKey||Y!==U||I.key!==D&&Y<K.length||I.key!==z&&Y>0)return}let _=w;const O=SF(y,f),B=EF(y,f);r!=null&&(_=r({disabledIndices:f,elementsRef:y,event:I,highlightedIndex:w,loopFocus:t,maxIndex:B,minIndex:O,onLoop:R,orientation:n,rtl:A}));const $=n!=="vertical"&&I.key===P||n!=="horizontal"&&I.key===Dp,V=n!=="vertical"&&I.key===M||n!=="horizontal"&&I.key===zp;c&&(I.key===$p?_=O:I.key===Hp&&(_=B)),_===w&&($||V)&&(t&&_===B&&$?(_=O,s&&(_=s(I,w,_,y))):t&&_===O&&V?(_=B,s&&(_=s(I,w,_,y))):_=Sl(y.current,{startingIndex:_,decrement:V,disabledIndices:f})),_!==w&&!Lf(y.current,_)&&(u&&I.stopPropagation(),(v||j||$||V)&&I.preventDefault(),E(_,!0),queueMicrotask(()=>{var Y;(Y=y.current[_])==null||Y.focus()}))});return{props:{ref:h,onFocus(I){const j=b.current,L=Ct(I.nativeEvent);!j||L==null||!Mv(L)||L.setSelectionRange(0,L.value.length)},onKeyDown:k},highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:y,onMapChange:C,relayKeyboardEvent:k}}function x$(e,t){for(const n of o3)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function v$(e){const{render:t,className:n,style:r,refs:s=_u,props:o=_u,state:i=mt,stateAttributesMapping:l,highlightedIndex:a,onHighlightedIndexChange:c,orientation:u,grid:f,loopFocus:d,onLoop:p,enableHomeAndEndKeys:m,onMapChange:v,stopEventPropagation:b=!0,rootRef:h,disabledIndices:y,modifierKeys:g,highlightItemOnHover:w=!1,tag:E="div",...C}=e,R=NC(),{props:k,highlightedIndex:N,onHighlightedIndexChange:I,elementsRef:j,onMapChange:L,relayKeyboardEvent:A}=y$({grid:f,loopFocus:d,onLoop:p,orientation:u,highlightedIndex:a,onHighlightedIndexChange:c,rootRef:h,stopEventPropagation:b,enableHomeAndEndKeys:m,direction:R,disabledIndices:y,modifierKeys:g}),P=zt(E,e,{state:i,ref:s,props:[k,...o,C],stateAttributesMapping:l}),M=S.useMemo(()=>({highlightedIndex:N,onHighlightedIndexChange:I,highlightItemOnHover:w,relayKeyboardEvent:A}),[N,I,w,A]);return x.jsx(Sk.Provider,{value:M,children:x.jsx(AC,{elementsRef:j,onMapChange:z=>{v==null||v(z),L(z)},children:P})})}const w$=S.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:s,loopFocus:o=!0,render:i,style:l,...a}=t,{orientation:c,setTabMap:u,tabActivationDirection:f}=c0(),[d,p]=S.useState(0),[m,v]=S.useState(null),b=S.useRef(new Set),h=S.useRef(new Set),y=S.useRef(null);pe(()=>{if(typeof ResizeObserver>"u")return;const k=new ResizeObserver(()=>{b.current.forEach(N=>{N()})});return y.current=k,m&&k.observe(m),h.current.forEach(N=>{k.observe(N)}),()=>{k.disconnect(),y.current=null}},[m]);const g=me(k=>(b.current.add(k),()=>{b.current.delete(k)})),w=me(k=>{var N;return h.current.add(k),(N=y.current)==null||N.observe(k),()=>{var I;h.current.delete(k),(I=y.current)==null||I.unobserve(k)}}),E={orientation:c,tabActivationDirection:f},C={"aria-orientation":c==="vertical"?"vertical":void 0,role:"tablist"},R=S.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:g,registerTabResizeObserverElement:w,tabsListElement:m}),[r,g,w,m]);return x.jsx(LC.Provider,{value:R,children:x.jsx(v$,{render:i,className:s,style:l,state:E,refs:[n,v],props:[C,a],stateAttributesMapping:Dd,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:o,orientation:c,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:_u})})}),b$=c$,$C=S.forwardRef(({className:e,...t},n)=>x.jsx(w$,{ref:n,className:ft("flex items-center gap-0.5 rounded border border-line bg-zinc-900/60 p-0.5",e),...t}));$C.displayName="TabsList";const HC=S.forwardRef(({className:e,...t},n)=>x.jsx(f$,{ref:n,className:ft("mono cursor-pointer rounded px-1.5 py-0.5 text-[10px] text-zinc-500 transition-colors hover:text-zinc-300 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[active]:bg-zinc-700 data-[active]:text-zinc-100",e),...t}));HC.displayName="TabsTab";const Wc=S.forwardRef(({className:e,...t},n)=>x.jsx(p$,{ref:n,className:ft("focus-visible:outline-none",e),...t}));Wc.displayName="TabsPanel";const BC=S.createContext(void 0);function Fd(e){const t=S.useContext(BC);if(t===void 0&&!e)throw new Error(Yt(72));return t}const S$={...r0,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class E$ extends Ad{constructor(n,r,s){const o=new jd;super(k$(n,o,r,s),C$(o),S$);Ie(this,"setOpen",(n,r)=>{qL(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,Me(vs,n))}}function k$(e,t,n,r=!1){const s={...e0(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return s.floatingRootContext=t0(t,n,r),s}function C$(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const R$=aC(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:i="none",actionsRef:l,onOpenChange:a,onOpenChangeComplete:c,handle:u,triggerId:f,defaultTriggerId:d=null,children:p}=t,m=qm((j,L)=>new E$({open:r,openProp:s,activeTriggerId:d,triggerIdProp:f},j,L));m.useControlledProp("openProp",s),m.useControlledProp("triggerIdProp",f),m.useContextCallback("onOpenChange",a),m.useContextCallback("onOpenChangeComplete",c);const v=m.useState("open"),b=!n&&v,h=m.useState("activeTriggerId"),y=m.useState("mounted"),g=m.useState("payload");m.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:o,disabled:n}),Gm(m,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:w,transitionStatus:E}=Zm(b,m),C=m.useState("isInstantPhase"),R=m.useState("instantType"),k=m.useState("lastOpenChangeReason"),N=S.useRef(null);pe(()=>{v&&n&&m.setOpen(!1,Me(Ck))},[v,n,m]),pe(()=>{E==="ending"&&k===Rd||E!=="ending"&&C?(R!=="delay"&&(N.current=R),m.set("instantType","delay")):N.current!==null&&(m.set("instantType",N.current),N.current=null)},[E,C,k,R,m]),pe(()=>{b&&h==null&&m.set("payload",void 0)},[m,h,b]),S.useImperativeHandle(l,()=>({unmount:w,close:()=>m.setOpen(!1,Me(Am))}),[w,m]);const I=b||y||!n&&i!=="none";return x.jsxs(BC.Provider,{value:m,children:[u&&x.jsx(Qm,{handle:u,store:m}),I&&x.jsx(P$,{store:m,disabled:n,trackCursorAxis:i}),typeof p=="function"?p({payload:g}):p]})});function P$({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=Wm(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=YF(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=S.useMemo(()=>Sd(o.reference,s.reference),[o.reference,s.reference]);return Jm(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:s.floating??mt}),null}const VC=S.createContext(void 0);function T$(){return S.useContext(VC)}const Wv=600,WC="data-base-ui-tooltip-trigger";function Uv(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(Ee(s))return s}}const t=e.target;return Ee(t)?t:null}function N$(e){let t=e;for(;t;){const n=t.closest(`[${WC}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&Ee(r.host)?r.host:null}return null}const I$=DL(function(t,n){const{render:r,className:s,style:o,handle:i,payload:l,disabled:a,delay:c,closeOnClick:u=!0,closeDelay:f,id:d,...p}=t,m=Fd(!0),b=yC(i)??m;if(!b)throw new Error(Yt(82));const h=Fi(d),y=b.useState("isTriggerActive",h),g=b.useState("isOpenedByTrigger",h),w=b.useState("floatingRootContext"),E=S.useRef(null),C=c??Wv,R=f??0,{registerTrigger:k,isMountedByThisTrigger:N}=pC(h,E,b,{payload:l,closeOnClick:u,closeDelay:R}),I=T$(),{delayRef:j,isInstantPhase:L,hasProvider:A}=cF(w,{open:g}),P=o0(w);b.useSyncedValue("isInstantPhase",L);const M=b.useState("disabled"),z=a??M,D=_t(z),T=b.useState("trackCursorAxis"),_=b.useState("disableHoverablePopup"),O=S.useRef(!1),B=Pr(),$=S.useRef(void 0);function V(){return A?ws(j.current,"open")===0?0:c??I??Wv:C}function Y(q){const te=E.current;if(!te||!q)return!1;const le=N$(q);return le!==null&&le!==te&&ye(te,le)}function U(q){const te=Y(q);return O.current=te,te&&(P.openChangeTimeout.clear(),P.restTimeout.clear(),P.restTimeoutPending=!1,B.clear()),te}const K=wC(w,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!_&&T!=="both"?bC():null,restMs:V,delay(){return f==null&&A?{close:ws(j.current,"close")}:{close:R}},triggerElementRef:E,isActiveTrigger:y,isClosing:()=>b.select("transitionStatus")==="ending",shouldOpen(){return!O.current}}),Q=JL(w,{enabled:!z}).reference,H=q=>{const te=O.current,le=Uv(q),Z=U(le),ee=E.current,fe=ee&&le&&ye(ee,le);if(Z&&b.select("open")&&b.select("lastOpenChangeReason")===gt){b.setOpen(!1,Me(gt,q));return}if(te&&!Z&&fe&&!D.current&&!b.select("open")&&ee&&ps($.current)){const oe=()=>{!O.current&&!D.current&&!b.select("open")&&b.setOpen(!0,Me(gt,q,ee))},xe=V();xe===0?(B.clear(),oe()):B.start(xe,oe)}},W=b.useState("triggerProps",N);return zt("button",t,{state:{open:g},ref:[n,k,E],props:[K,Q,N||T!=="none"?W:void 0,{onMouseOver(q){H(q.nativeEvent)},onFocus(q){Y(Uv(q.nativeEvent))&&q.preventBaseUIHandler()},onMouseLeave(){O.current=!1,B.clear(),$.current=void 0},onPointerEnter(q){$.current=q.pointerType},onPointerDown(q){$.current=q.pointerType,b.set("closeOnClick",u),u&&!b.select("open")&&b.cancelPendingOpen(q.nativeEvent)},onClick(q){u&&!b.select("open")&&b.cancelPendingOpen(q.nativeEvent)},id:h,"data-trigger-disabled":z?"":void 0,[WC]:z?void 0:""},p],stateAttributesMapping:wk})}),UC=S.createContext(void 0);function M$(){const e=S.useContext(UC);if(e===void 0)throw new Error(Yt(70));return e}const _$=S.forwardRef(function(t,n){const{children:r,container:s,className:o,render:i,style:l,...a}=t,{node:c,subtree:u}=Qk({container:s,ref:n,componentProps:t,elementProps:a});return!u&&!c?null:x.jsxs(S.Fragment,{children:[u,c&&vn.createPortal(r,c)]})}),O$=S.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Fd().useState("mounted")||r?x.jsx(UC.Provider,{value:r,children:x.jsx(_$,{ref:n,...s})}):null}),KC=S.createContext(void 0);function A$(){const e=S.useContext(KC);if(e===void 0)throw new Error(Yt(71));return e}const j$=S.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:i="absolute",side:l="top",align:a="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:v=!1,collisionAvoidance:b=Kk,style:h,...y}=t,g=Fd(),w=M$(),E=g.useState("open"),C=g.useState("mounted"),R=g.useState("trackCursorAxis"),k=g.useState("disableHoverablePopup"),N=g.useState("floatingRootContext"),I=g.useState("instantType"),j=g.useState("transitionStatus"),L=g.useState("adaptiveOrigin"),A=MC({anchor:o,positionMethod:i,floatingRootContext:N,mounted:C,side:l,sideOffset:c,align:a,alignOffset:u,collisionBoundary:f,collisionPadding:d,sticky:m,arrowPadding:p,disableAnchorTracking:v,keepMounted:w,collisionAvoidance:b,adaptiveOrigin:L}),P=S.useMemo(()=>({open:E,side:A.side,align:A.align,anchorHidden:A.anchorHidden,instant:R!=="none"?"tracking-cursor":I}),[E,A.side,A.align,A.anchorHidden,R,I]),M=_C(t,P,{styles:A.positionerStyles,transitionStatus:j,props:y,refs:[n,g.useStateSetter("positionerElement")],hidden:!C,inert:!E||R==="both"||k});return x.jsx(KC.Provider,{value:A,children:M})}),z$=S.forwardRef(function(t,n){const{render:r,className:s,style:o,...i}=t,l=Fd(),{side:a,align:c}=A$(),u=l.useState("open"),f=l.useState("instantType"),d=l.useState("transitionStatus"),p=l.useState("popupProps"),m=l.useState("floatingRootContext"),v=l.useState("disabled"),b=l.useState("closeDelay");Ca({open:u,ref:l.context.popupRef,onComplete(){var w,E;u&&((E=(w=l.context).onOpenChangeComplete)==null||E.call(w,!0))}}),vC(m,{enabled:!v,closeDelay:b});const h=l.useStateSetter("popupElement");return zt("div",t,{state:{open:u,side:a,align:c,instant:f,transitionStatus:d},ref:[n,l.context.popupRef,h],props:[Ym,p,a0(d),i],stateAttributesMapping:Pm})}),D$=function(t){const{delay:n,closeDelay:r,timeout:s=400}=t,o=S.useMemo(()=>({open:n,close:r}),[n,r]);return x.jsx(VC.Provider,{value:n,children:x.jsx(aF,{delay:o,timeoutMs:s,children:t.children})})};function F$({children:e,...t}){return x.jsx(D$,{delay:150,closeDelay:80,...t,children:e})}const L$=R$,$$=I$,H$="z-50 max-w-[280px] whitespace-pre-line rounded-md border border-line bg-popover/95 px-2 py-1 text-left text-[10px] leading-relaxed text-zinc-300 shadow-xl backdrop-blur";function Vu({label:e,suppressed:t,side:n="bottom",align:r="end",children:s}){return x.jsxs(L$,{disabled:t??!1,children:[x.jsx($$,{render:s}),x.jsx(O$,{children:x.jsx(j$,{side:n,align:r,sideOffset:4,collisionPadding:8,children:x.jsx(z$,{className:ft(H$),children:e})})})]})}function YC({className:e}){return x.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:e,role:"img","aria-label":"durable",children:[x.jsx("title",{children:"durable"}),x.jsx("path",{d:"M12 2.5 21.5 12 12 21.5 2.5 12z",opacity:.35}),x.jsx("circle",{cx:"6.4",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),x.jsx("circle",{cx:"12",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),x.jsx("circle",{cx:"17.6",cy:"12",r:"1.7",fill:"currentColor",stroke:"none"}),x.jsx("path",{d:"M8.1 12h2.2M13.7 12h2.2"})]})}const B$=["pending","running","suspended","completed","failed","cancelling","cancelled","dead"],V$=100;function W$(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 s=Math.round(r/60);return s<24?`${s}h ago`:`${Math.round(s/24)}d ago`}function U$(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 u0({status:e}){const t=e==="running"||e==="awaiting"||e==="cancelling";return x.jsx("span",{className:`dot s-${e} ${t?"pulse":""}`,"aria-hidden":!0})}function qC({status:e}){return x.jsxs($t,{variant:"status",className:`s-${e} text-[11px]`,children:[x.jsx(u0,{status:e}),e]})}function K$({counts:e,filter:t,onFilter:n}){const r=Object.values(e).reduce((a,c)=>a+c,0),s=(a,c,u)=>x.jsxs(Ue,{variant:"ghost",size:"chip","aria-pressed":t===a,onClick:()=>n(a),className:ft("rounded-md",t===a&&"border-zinc-600 bg-zinc-900 text-zinc-100 hover:text-zinc-100"),children:[a!=="all"&&x.jsx(u0,{status:a}),x.jsx("span",{className:"uppercase tracking-wide",children:c}),x.jsx("span",{className:"mono tnum text-zinc-600",children:u})]},a),{data:o}=Gn({queryKey:["topology"],queryFn:()=>tt.topology(),staleTime:Number.POSITIVE_INFINITY}),i=(o==null?void 0:o.role)==="tenant",l=o?i?o.tenant?`tenant · ${o.tenant}`:"tenant":"control plane":"";return x.jsxs("header",{className:"z-10 flex items-center gap-4 border-b border-line px-5 py-3",children:[x.jsxs("div",{className:"flex items-center gap-2.5",children:[x.jsx("div",{className:"grid h-7 w-7 place-items-center rounded-md border border-brand/30 bg-brand/10",children:x.jsx(YC,{className:"h-4 w-4 text-brand"})}),x.jsxs("div",{className:"leading-none",children:[x.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"durable"}),x.jsx("div",{className:`mono text-[10px] uppercase tracking-[0.2em] ${i?"text-amber-400/80":"text-zinc-600"}`,title:i?`Tenant deployment — partition ${(o==null?void 0:o.tenant)??"(unnamed)"}`:"Control-plane deployment",children:l})]})]}),x.jsxs("div",{className:"ml-2 flex flex-wrap items-center gap-1",children:[s("all","all",r),B$.map(a=>s(a,a,e[a]??0))]}),x.jsx(Q$,{}),x.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[x.jsx("span",{className:"dot s-completed pulse","aria-hidden":!0}),"live"]})]})}function Y$(e){const t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.round(t/60);if(n<60)return`${n}m ago`;const r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function QC({status:e}){const t=e==null?void 0:e.concurrency;if(!e||!t)return x.jsx("span",{className:"mono text-[9px] text-zinc-600",children:"no status"});const n=t.limit>0&&e.inFlight>=t.limit*.8;return x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsxs("div",{className:"mono flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[10px] text-zinc-500",children:[x.jsx("span",{className:`shrink-0 rounded border px-1 text-[9px] uppercase tracking-wider ${t.mode==="adaptive"?"border-sky-500/40 bg-sky-500/10 text-sky-300":"border-zinc-600/50 bg-zinc-800/60 text-zinc-400"}`,children:t.mode==="adaptive"?`adaptive ${t.min??1}–${t.max??32}`:"fixed"}),x.jsxs("span",{className:n?"text-amber-300":"text-zinc-400",children:["in-flight"," ",x.jsxs("span",{className:"tnum",children:[e.inFlight,"/",t.limit]})]}),typeof e.rssPct=="number"&&x.jsxs("span",{className:e.rssPct>=85?"text-rose-300":"",children:["ram ",x.jsxs("span",{className:"tnum",children:[Math.round(e.rssPct),"%"]})]}),typeof e.cpuPct=="number"&&x.jsxs("span",{children:["cpu ",x.jsxs("span",{className:"tnum",children:[Math.round(e.cpuPct),"%"]})]}),typeof e.throughputPerMin=="number"&&x.jsxs("span",{children:[x.jsx("span",{className:"tnum",children:Math.round(e.throughputPerMin)}),"/min"]}),typeof e.p95Ms=="number"&&x.jsxs("span",{children:["p95 ",x.jsxs("span",{className:"tnum",children:[Math.round(e.p95Ms),"ms"]})]})]}),e.lastAdjust&&x.jsxs("div",{className:"mono text-[10px] text-zinc-500",children:[e.lastAdjust.reason," ",x.jsxs("span",{className:"tnum text-zinc-400",children:[e.lastAdjust.from,"→",e.lastAdjust.to]})," ",Y$(e.lastAdjust.at)]})]})}function q$({workers:e}){return x.jsx("div",{className:"flex flex-col divide-y divide-line-soft",children:e.map(t=>x.jsxs("div",{className:"flex flex-col gap-1 px-2.5 py-2",children:[x.jsx("span",{className:"mono truncate text-[10px] text-zinc-400",children:t.instanceId}),x.jsx(QC,{status:t.status})]},t.instanceId))})}function Q$(){const{data:e}=Gn({queryKey:["workers"],queryFn:()=>tt.workers(),refetchInterval:1e4}),[t,n]=S.useState("workers");if(!e||e.length===0)return null;const r=pI(e),s={workers:"pods",partitions:"parts",alerts:"alerts"};return x.jsxs(b$,{value:t,onValueChange:o=>n(o),className:"ml-auto flex flex-nowrap items-center gap-1.5",children:[x.jsx($C,{children:["workers","partitions","alerts"].map(o=>x.jsxs(HC,{value:o,children:[s[o],o==="alerts"&&r.starved.length>0&&x.jsx("span",{className:"tnum ml-1 rounded bg-rose-500/80 px-1 text-[9px] text-white",children:r.starved.length})]},o))}),x.jsxs("div",{className:"flex w-[300px] flex-nowrap items-center justify-end gap-1.5",children:[x.jsx(Wc,{value:"workers",className:"flex flex-nowrap items-center gap-1.5",children:x.jsx(X$,{workers:hI(e)})}),x.jsx(Wc,{value:"partitions",className:"flex flex-nowrap items-center gap-1.5",children:x.jsx(G$,{groups:e})}),x.jsx(Wc,{value:"alerts",className:"flex flex-nowrap items-center gap-1.5",children:x.jsx(Z$,{summary:r})})]})]})}const Kv="__overflow__";function Yv(e){var n;const t=(n=e.status)==null?void 0:n.concurrency;return e.status&&t?`${e.status.inFlight}/${t.limit}`:void 0}function qv({w:e}){return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"px-2.5 py-2",children:x.jsx(QC,{status:e.status})}),x.jsxs("div",{className:"max-h-48 overflow-auto border-t border-line-soft px-2.5 py-1.5",children:[x.jsxs("div",{className:"mono mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:[e.handlers.length," handlers"]}),e.handlers.map(t=>x.jsx("div",{className:"mono truncate text-[10px] text-zinc-400",children:t},t))]})]})}function X$({workers:e}){const[t,n]=S.useState(void 0),[r,s]=S.useState(void 0),o=2,i=e.slice(0,o),l=e.slice(o),a=t===Kv;return x.jsxs(x.Fragment,{children:[i.map(c=>{const u=t===c.instanceId,f=Yv(c);return x.jsxs(Bp,{open:u,onOpenChange:d=>n(d?c.instanceId:void 0),children:[x.jsx(Vu,{suppressed:u,label:`${c.instanceId}
|
|
63
|
+
${c.handlers.length} handlers · ${c.partition}${f?` · ${f} in-flight`:""}`,children:x.jsx(Vp,{render:x.jsxs(Ue,{variant:"chip",size:"xs",className:ft("mono max-w-[120px] gap-1",u&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:[x.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),x.jsx("span",{className:"truncate",children:c.instanceId}),c.partition!=="default"&&x.jsxs("span",{className:"shrink-0 text-zinc-500",children:["@",c.partition]}),x.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.handlers.length,"h",f?` · ${f}`:""]})]})})}),x.jsxs(Bu,{children:[x.jsxs("div",{className:"mono flex items-center justify-between gap-2 border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500",children:[x.jsx("span",{className:"truncate text-zinc-300",children:c.instanceId}),x.jsxs("span",{className:"shrink-0",children:[c.runtime??"node"," · ",c.partition]})]}),x.jsx(qv,{w:c})]})]},c.instanceId)}),l.length>0&&x.jsxs(Bp,{open:a,onOpenChange:c=>{n(c?Kv:void 0),s(void 0)},children:[x.jsx(Vp,{render:x.jsxs(Ue,{variant:"chip",size:"xs",className:ft("mono shrink-0",a&&"border-zinc-500 bg-zinc-800 text-zinc-200"),children:["+",l.length]})}),x.jsxs(Bu,{children:[x.jsxs("div",{className:"mono border-b border-line px-2.5 py-1.5 text-[9px] uppercase tracking-wider text-zinc-600",children:[l.length," more ",l.length===1?"pod":"pods"]}),x.jsx("div",{className:"max-h-80 divide-y divide-line-soft overflow-auto",children:l.map(c=>{const u=Yv(c),f=r===c.instanceId;return x.jsxs("div",{children:[x.jsxs("button",{type:"button",onClick:()=>s(f?void 0:c.instanceId),className:ft("mono flex w-full items-center justify-between gap-2 px-2.5 py-1.5 text-left text-[10px] hover:bg-zinc-800/50",f?"bg-zinc-800/40 text-zinc-200":"text-zinc-300"),children:[x.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[x.jsx("span",{className:`dot ${c.status?"s-completed":""}`,"aria-hidden":!0}),x.jsx("span",{className:"truncate",children:c.instanceId})]}),x.jsxs("span",{className:"tnum shrink-0 text-zinc-500",children:[c.partition!=="default"?`@${c.partition} · `:"",c.handlers.length,"h",u?` · ${u}`:""]})]}),f&&x.jsx("div",{className:"border-t border-line-soft bg-zinc-900/40",children:x.jsx(qv,{w:c})})]},c.instanceId)})})]})]})]})}function G$({groups:e}){const[t,n]=S.useState(void 0),r=dI(e);function s(o){const i=new Map;for(const l of e)if(yu(l.group)===o)for(const a of l.liveWorkers)i.has(a.instanceId)||i.set(a.instanceId,a);return[...i.values()]}return x.jsx(x.Fragment,{children:r.map(o=>{const i=o.starvedCount>0,l=t===o.partition;return x.jsxs(Bp,{open:l&&o.workerCount>0,onOpenChange:a=>n(a?o.partition:void 0),children:[x.jsx(Vu,{suppressed:l,label:`${o.partition}
|
|
64
|
+
${o.workerCount} workers · ${o.handlerCount} handlers · ${o.totalDepth} queued${i?` · ${o.starvedCount} starved`:""}`,children:x.jsx(Vp,{render:x.jsxs(Ue,{variant:"chip",size:"xs",disabled:o.workerCount===0,className:ft("mono gap-1",i&&"border-rose-500/50 bg-rose-500/15 text-rose-300",!i&&l&&"border-zinc-500 bg-zinc-800 text-zinc-200",o.workerCount>0?"cursor-pointer":"cursor-default"),children:[x.jsx("span",{className:`dot ${i?"s-failed":o.workerCount>0?"s-completed":""}`,"aria-hidden":!0}),o.partition,x.jsxs("span",{className:"tnum text-zinc-500",children:[o.workerCount,"w ",o.handlerCount,"h",o.totalDepth>0?` ${o.totalDepth}q`:"",i?` ${o.starvedCount}!`:""]})]})})}),x.jsxs(Bu,{children:[x.jsxs("div",{className:"mono flex items-center justify-between border-b border-line px-2.5 py-1.5 text-[10px] text-zinc-500",children:[x.jsx("span",{className:"text-zinc-300",children:o.partition}),x.jsxs("span",{className:"tnum",children:[o.workerCount," worker(s) · ",o.totalDepth," queued"]})]}),x.jsx(q$,{workers:s(o.partition)})]})]},o.partition)})})}function Z$({summary:e}){const t=(n,r)=>`${n} ${n===1?r:`${r}s`}`;return x.jsxs(x.Fragment,{children:[x.jsx(Vu,{label:`Route-by-handler: each @Workflow & @Step is served as its own queue.
|
|
65
|
+
${e.queueCount} queues across ${t(e.workerCount,"worker")}.`,children:x.jsxs("span",{className:"mono tnum text-[10px] text-zinc-500",children:[t(e.workflowCount,"workflow")," · ",t(e.stepCount,"step")," ·"," ",t(e.workerCount,"worker")," ·"," ",e.allDraining?x.jsx("span",{className:"text-good",children:"all draining"}):x.jsxs("span",{className:"text-rose-300",children:[e.starved.length," starved"]})]})}),e.starved.map(n=>x.jsx(Vu,{label:`${n.group}
|
|
66
|
+
${n.depth} queued, no worker consuming`,children:x.jsxs($t,{variant:"danger",className:"mono gap-1 border-rose-500/50 bg-rose-500/15 py-0.5",children:[x.jsx("span",{className:"dot s-failed","aria-hidden":!0}),x.jsx("span",{className:"max-w-[180px] truncate",children:n.group}),x.jsxs("span",{className:"tnum shrink-0",children:[n.depth,"q · 0w"]})]})},n.group))]})}function J$(){return x.jsx("ul",{className:"divide-y divide-line-soft","aria-hidden":!0,children:[0,1,2,3,4,5].map(e=>x.jsxs("li",{className:"flex flex-col gap-2 px-4 py-3",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsx("div",{className:"h-3.5 w-32 animate-pulse rounded bg-zinc-800"}),x.jsx("div",{className:"h-3 w-16 animate-pulse rounded bg-zinc-800/70"})]}),x.jsx("div",{className:"h-2.5 w-48 animate-pulse rounded bg-zinc-800/50"})]},e))})}function e4({r:e,allRuns:t,health:n,selected:r,onSelect:s,onSelectTag:o,onSelectNamespace:i,onSelectOrigin:l}){const a=qg(e,{runs:t,health:n}),c=e.namespace&&e.namespace!=="default"?e.namespace:void 0,u=zi(e.origin);return x.jsxs("button",{type:"button",onClick:()=>s(e.id),className:`flex w-full flex-col gap-1 px-4 py-3 text-left transition-colors ${r===e.id?"bg-zinc-900":"hover:bg-zinc-900/50"}`,children:[x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[x.jsx("span",{className:"truncate text-sm font-medium text-zinc-200",children:e.workflow}),c&&x.jsx($t,{variant:"tenant",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-sky-400/60 hover:text-sky-200",title:`Tenant / worker-pool partition — click to show only ${c}`,onClick:f=>{f.stopPropagation(),i(c)},children:c}),u&&x.jsx($t,{variant:"origin",className:"mono shrink-0 cursor-pointer px-1 text-[9px] hover:border-teal-400/60 hover:text-teal-200",title:`Declared by ${u} — click to show only this library's runs`,onClick:f=>{f.stopPropagation(),l({kind:"origin",origin:u})},children:ma(u)}),e.id.startsWith("dlq:")&&x.jsx($t,{variant:"danger",className:"mono shrink-0 px-1 text-[9px] uppercase tracking-wider",children:"dlq"})]}),x.jsx(qC,{status:a.status})]}),a.detail&&x.jsx("div",{className:`mono truncate text-[11px] s-${a.status}`,children:a.detail}),x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsx("span",{className:"mono truncate text-[11px] text-zinc-600",children:e.id}),x.jsx("span",{className:"shrink-0 text-[11px] text-zinc-600",children:W$(e.updatedAt)})]}),e.tags&&e.tags.length>0&&x.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map(f=>x.jsxs("span",{onClick:d=>{d.stopPropagation(),o(f)},className:ft(dk({variant:"outline"}),"mono cursor-pointer hover:border-zinc-500 hover:text-zinc-200"),children:["#",f]},f))})]})}const t4=88;function n4({runs:e,allRuns:t,health:n,loading:r,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a,emptyNotice:c,hasMore:u,loadingMore:f,onLoadMore:d}){var h;const p=S.useRef(null),m=WN({count:e.length,getScrollElement:()=>p.current,estimateSize:()=>t4,overscan:10,initialRect:{width:340,height:480}}),v=m.getVirtualItems(),b=v.length>0?((h=v[v.length-1])==null?void 0:h.index)??-1:-1;return S.useEffect(()=>{e.length!==0&&(b<e.length-1||!u||f||d==null||d())},[b,e.length,u,f,d]),r&&e.length===0?x.jsx(J$,{}):e.length===0?x.jsxs("div",{className:"flex flex-col items-start gap-2 p-6 text-sm text-zinc-600",children:[x.jsx("span",{children:c.message}),c.unclassified!==void 0&&x.jsxs(x.Fragment,{children:[x.jsxs("span",{className:"text-[11px] text-zinc-500",children:[c.unclassified," run",c.unclassified===1?"":"s"," here"," ",c.unclassified===1?"has":"have"," no recorded origin, so no package filter can match ",c.unclassified===1?"it":"them","."]}),x.jsx(Ue,{variant:"chip",size:"xs",className:"mono rounded",title:Yg,onClick:()=>a({kind:"unknown"}),children:"show unclassified"})]})]}):x.jsxs("div",{ref:p,className:"h-full overflow-auto","data-testid":"runs-list-scroll",children:[x.jsx("ul",{className:"relative divide-y divide-line-soft",style:{height:m.getTotalSize()},children:v.map(y=>{const g=e[y.index];return g?x.jsx("li",{ref:m.measureElement,"data-index":y.index,className:"absolute inset-x-0 top-0",style:{transform:`translateY(${y.start}px)`},children:x.jsx(e4,{r:g,allRuns:t,health:n,selected:s,onSelect:o,onSelectTag:i,onSelectNamespace:l,onSelectOrigin:a})},g.id):null})}),f&&x.jsx("div",{className:"mono px-4 py-2 text-center text-[11px] text-zinc-600",children:"loading more…"})]})}function r4({compensations:e,selKey:t,onSelect:n}){return x.jsxs("div",{className:"shrink-0 border-t border-amber-500/20 bg-black/20 px-7 py-3",children:[x.jsx("div",{className:"mono mb-2 text-[10px] uppercase tracking-[0.18em] text-amber-400/80",children:"compensation · unwind order"}),x.jsx("ul",{className:"flex flex-col gap-1",children:e.map(r=>{const s=`${r.runId}#${r.seq}`;return x.jsx("li",{children:x.jsxs("button",{type:"button",onClick:()=>n(r),className:`mono flex w-full items-center gap-2 rounded-md border px-2.5 py-1.5 text-left text-[11.5px] transition-colors ${s===t?"border-amber-500/50 bg-amber-500/15":"border-amber-500/20 bg-amber-500/5 hover:border-amber-500/40"}`,children:[x.jsx(u0,{status:r.status}),x.jsx("span",{className:"truncate text-amber-100",children:JN(r.name)}),x.jsx("span",{className:"ml-auto shrink-0 text-[10px] uppercase tracking-wider text-amber-400/70",children:r.status})]})},s)})})]})}function s4({id:e,onOpenRun:t}){var te,le;const n=Oi(),{data:r}=Gn({queryKey:["run",e],queryFn:async()=>fI(n.getQueryData(["run",e]),await tt.run(e)),refetchInterval:Z=>{var fe;const ee=(fe=Z.state.data)==null?void 0:fe.run.status;return ee==="running"||ee==="suspended"?1500:!1}}),{data:s=[]}=Gn({queryKey:["workers"],queryFn:()=>tt.workers(),refetchInterval:5e3}),{data:o=[]}=Gn({queryKey:["runs","",""],queryFn:()=>tt.runs(),refetchInterval:3e3}),i=(r==null?void 0:r.run.status)==="dead"?`dlq:${e}`:void 0,{data:l}=Gn({queryKey:["run",i],queryFn:()=>tt.run(i),enabled:!!i,retry:!1}),a=()=>{n.invalidateQueries({queryKey:["run",e]}),n.invalidateQueries({queryKey:["runs"]})},c=r==null?void 0:r.run.status,u=c==="running"||c==="suspended";S.useEffect(()=>{if(u)return tt.streamRun(e,Z=>{if(Z.type==="step.progress"&&Z.event&&Z.seq!=null){const ee=Z.seq,fe=Z.event;n.setQueryData(["run",e],oe=>oe&&{...oe,timeline:oe.timeline.map(xe=>xe.seq===ee?{...xe,events:[...xe.events??[],fe]}:xe)});return}n.invalidateQueries({queryKey:["run",e]})})},[e,u,n]);const f=To({mutationFn:()=>tt.retry(e),onSuccess:a}),d=To({mutationFn:Z=>tt.cancel(e,Z!==void 0?{compensate:Z}:{}),onSuccess:a}),p=To({mutationFn:()=>tt.continue(e),onSuccess:a}),m=To({mutationFn:()=>tt.redispatch(e),onSuccess:a}),v=To({mutationFn:Z=>tt.retryWithInput(e,Z),onSuccess:Z=>{n.invalidateQueries({queryKey:["runs"]}),t(Z.runId)}}),[b,h]=S.useState(!1),[y,g]=S.useState(""),[w,E]=S.useState(),C=()=>{g(JSON.stringify((r==null?void 0:r.run.input)??{},null,2)),E(void 0),h(!0)},R=()=>{let Z;try{Z=JSON.parse(y)}catch(ee){E(ee instanceof Error?ee.message:"Invalid JSON");return}h(!1),v.mutate(Z)},[k,N]=S.useState(),[I,j]=S.useState(!1),[L,A]=S.useState(new Set),[P,M]=S.useState(240);function z(Z){Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId);const ee=oe=>M(xe=>Math.max(120,Math.min(720,xe-oe.movementY))),fe=()=>{window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",fe)};window.addEventListener("pointermove",ee),window.addEventListener("pointerup",fe)}function D(Z){A(ee=>{const fe=new Set(ee);return fe.has(Z)?fe.delete(Z):fe.add(Z),fe})}if(!r)return x.jsx("div",{className:"p-8 text-sm text-zinc-600",children:"Loading run…"});const{run:T,timeline:_}=r,{body:O,compensations:B}=eI(_),$=tI(B),V=T.id.startsWith("dlq:"),Y=V?{id:T.id.slice(4),title:"Dead-letter handler",subtitle:`started because run ${T.id.slice(4)} was dead-lettered`,cta:"open dead run →"}:l?{id:`dlq:${T.id}`,title:"Dead-lettered",subtitle:"this run exceeded recovery and was routed to a DLQ handler",cta:"open DLQ handler →"}:void 0,U=B.length>0?(()=>{const Z=$.failed>0?` ${$.failed} undo${$.failed===1?"":"s"} failed after retries — check ${$.failed===1?"it":"them"} below.`:"";return $.pending>0?{title:"Compensating",subtitle:`undoing completed steps in reverse (${$.done} of ${$.total} done).${Z}`}:T.status==="cancelled"?{title:"Cancelled with compensation",subtitle:`completed steps were undone before cancelling.${Z}`}:{title:"Saga compensated",subtitle:`the run failed and its ${$.total} completed step${$.total===1?"":"s"} were undone in reverse.${Z}`}})():void 0,K=T.status==="failed"||T.status==="suspended",Q=T.status==="running"||T.status==="suspended",H=T.status==="suspended"||T.status==="running",W=O.some(Z=>Z.status==="pending"&&Z.kind==="signal"&&Z.name.startsWith("breakpoint")),G=k?`${k.step.runId}#${k.step.seq}`:void 0,J=qg(T,{runs:o,health:s,timeline:O}),X=T.namespace&&T.namespace!=="default"?T.namespace:void 0,q=zi(T.origin);return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-7 py-5",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:T.workflow}),Of(T.id)!==void 0&&x.jsx(Ue,{variant:"alt",size:"xs",onClick:()=>t(Of(T.id)),className:"mono uppercase tracking-wider",title:`Open the parent run (${Of(T.id)}) — the macro view this child belongs to`,children:"↑ parent"}),Lc(T.id)!==void 0&&x.jsx(Ue,{variant:"chip",size:"xs",onClick:()=>t(Lc(T.id)),className:"mono uppercase tracking-wider text-zinc-300",title:`This is a retry-with-input of ${Lc(T.id)} — open the original run`,children:"↩ original"}),V&&x.jsx($t,{variant:"danger",className:"mono py-0.5 uppercase tracking-wider",children:"dlq"}),x.jsx(qC,{status:J.status}),J.detail&&x.jsx("span",{className:`mono text-[11px] s-${J.status}`,children:J.detail}),X&&x.jsx($t,{variant:"tenant",className:"mono py-0.5",title:"Tenant / worker-pool partition this run belongs to",children:X}),q?x.jsx($t,{variant:"origin",className:"mono py-0.5",title:`Declared by ${q}`,children:ma(q)}):x.jsxs($t,{variant:"origin-unknown",className:"mono py-0.5",title:Yg,children:["origin ",ld]}),B.length>0&&x.jsx($t,{variant:"warn",className:ft("mono py-0.5 uppercase tracking-wider",$.pending>0&&"pulse"),title:$.pending>0?`compensating: ${$.done} of ${$.total} undone`:`${$.total} step${$.total===1?"":"s"} compensated`,children:$.pending>0?"compensating":"compensated"}),x.jsxs($t,{className:"mono bg-transparent py-0.5 text-zinc-500",children:["v",T.workflowVersion]}),x.jsxs("span",{className:"mono tnum text-[11px] text-zinc-600",children:[O.length," ",O.length===1?"step":"steps"]})]}),x.jsx("div",{className:"mono mt-1 truncate text-[11px] text-zinc-600",children:T.id}),T.tags&&T.tags.length>0&&x.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:T.tags.map(Z=>x.jsxs($t,{className:"mono",children:["#",Z]},Z))}),T.searchAttributes&&Object.keys(T.searchAttributes).length>0&&x.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:Object.entries(T.searchAttributes).map(([Z,ee])=>x.jsxs($t,{variant:"attr",className:"mono",title:"search attribute",children:[Z,"=",String(ee)]},Z))}),(te=r==null?void 0:r.children)!=null&&te.length?x.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1",children:[x.jsx("span",{className:"text-[10px] text-zinc-600",children:"children:"}),(le=r.children)==null?void 0:le.map(Z=>x.jsx(Ue,{variant:"chip",size:"xs",onClick:()=>t(Z),className:"mono px-1.5 py-0",children:Z},Z))]}):null]}),x.jsxs("div",{className:"flex shrink-0 gap-2",children:[x.jsx(Ue,{onClick:()=>j(!0),className:"mono px-2.5 normal-case tracking-normal text-zinc-400",title:"Run input / output",children:"{ }"}),W&&x.jsxs(Ue,{variant:"warn",disabled:p.isPending,onClick:()=>p.mutate(),children:[x.jsx(pM,{width:12,height:12}),"Continue"]}),x.jsxs(Ue,{variant:"brand",disabled:!K||f.isPending,onClick:()=>f.mutate(),children:[x.jsx(Sf,{width:12,height:12}),"Retry"]}),H&&x.jsxs(Ue,{variant:"info",disabled:m.isPending,onClick:()=>m.mutate(),title:"Re-dispatch stuck `pending` remote steps — recovery for a lost step dispatch (crashed worker or dropped job)",children:[x.jsx(Gg,{width:12,height:12}),"Re-dispatch"]}),(T.status==="dead"||T.status==="failed")&&x.jsxs(Ue,{variant:"alt",disabled:v.isPending,onClick:C,title:"Edit the input and re-run as a fresh linked run",children:[x.jsx(Sf,{width:12,height:12}),"Fix & replay"]}),Q&&x.jsxs(Ue,{variant:"warn",disabled:d.isPending,onClick:()=>d.mutate(!0),title:"Cancel and run saga compensations (undo completed steps in reverse)",className:"bg-transparent",children:[x.jsx(Sf,{width:12,height:12}),"Cancel + Undo"]}),x.jsxs(Ue,{className:"border-zinc-700",disabled:!Q||d.isPending,onClick:()=>d.mutate(!1),children:[x.jsx(Di,{width:12,height:12}),"Cancel"]})]})]}),Y&&x.jsxs("div",{className:"flex items-center gap-3 border-b border-rose-500/30 bg-rose-500/10 px-7 py-3",children:[x.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:"⚠"}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("div",{className:"text-[13px] font-medium text-rose-200",children:Y.title}),x.jsx("div",{className:"mono truncate text-[11px] text-rose-300/70",children:Y.subtitle})]}),x.jsx(Ue,{variant:"danger",onClick:()=>t(Y.id),className:"mono shrink-0 border-rose-500/40 bg-rose-500/15 px-2.5 text-[11px] normal-case tracking-normal text-rose-200 enabled:hover:bg-rose-500/25",children:Y.cta})]}),U&&x.jsxs("div",{className:"flex items-center gap-3 border-b border-amber-500/30 bg-amber-500/10 px-7 py-3",children:[x.jsx("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-md border border-amber-500/40 bg-amber-500/15 text-sm text-amber-300","aria-hidden":!0,children:"↺"}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("div",{className:"text-[13px] font-medium text-amber-200",children:U.title}),x.jsx("div",{className:"mono truncate text-[11px] text-amber-300/70",children:U.subtitle})]})]}),x.jsxs("div",{className:"relative grid min-h-0 flex-1",style:{gridTemplateRows:O.length>0?`1fr ${P}px`:"1fr"},children:[x.jsxs("div",{className:"relative min-h-0",children:[O.length===0?x.jsx("div",{className:"grid h-full place-items-center text-sm text-zinc-600",children:"No steps recorded yet."}):x.jsx(i5,{run:T,timeline:O,endStatus:J.status,selectedKey:G,onSelect:(Z,ee)=>N({step:Z,run:ee}),onOpenRun:t,fmtDuration:U$,expanded:L,onToggleChild:D}),(T.status==="failed"||T.status==="cancelled")&&T.error&&x.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:T.error.message})]}),O.length>0&&x.jsxs("div",{className:"relative min-h-0 overflow-hidden border-t border-line bg-black/20",children:[x.jsx("div",{onPointerDown:z,className:"absolute inset-x-0 top-0 z-10 h-1.5 -translate-y-1/2 cursor-row-resize hover:bg-brand/40",title:"Drag to resize"}),x.jsx(kM,{run:T,timeline:O,selectedKey:G,onSelect:(Z,ee)=>N({step:Z,run:ee}),onOpenRun:t,expanded:L,onToggleChild:D})]}),k&&x.jsx(IM,{step:k.step,run:k.run,onClose:()=>N(void 0),onOpenRun:t}),I&&x.jsx(MM,{run:T,onClose:()=>j(!1)})]}),B.length>0&&x.jsx(r4,{compensations:B,selKey:G,onSelect:Z=>N({step:Z,run:T})}),x.jsxs(T3,{open:b,onOpenChange:h,title:"Fix & replay",subtitle:`re-runs ${T.id} as a fresh linked run`,footer:x.jsxs(x.Fragment,{children:[x.jsx(Ue,{onClick:()=>h(!1),children:"Cancel"}),x.jsx(Ue,{variant:"alt",disabled:v.isPending,onClick:R,children:"Replay"})]}),children:[x.jsx("label",{className:"mono mb-1.5 block text-[10px] uppercase tracking-[0.18em] text-zinc-500",htmlFor:"fix-replay-input",children:"input"}),x.jsx("textarea",{id:"fix-replay-input",value:y,spellCheck:!1,onChange:Z=>{g(Z.target.value),E(void 0)},className:"mono h-64 w-full resize-y rounded-lg border border-line bg-black/40 p-3 text-[11.5px] leading-relaxed text-zinc-300 focus:border-zinc-600 focus:outline-none"}),w&&x.jsx("p",{className:"mono mt-2 rounded border border-bad/25 bg-bad/10 px-2 py-1 text-[11px] text-bad",children:w})]})]})}function Qv(){if(typeof window>"u")return;const e=window.location.hash.match(/^#\/run\/(.+)$/),t=e==null?void 0:e[1];return t?decodeURIComponent(t):void 0}function o4(){const[e,t]=S.useState("all"),[n,r]=S.useState(""),[s,o]=S.useState(""),[i,l]=S.useState(""),[a,c]=S.useState(K1),[u,f]=S.useState(()=>Qv()),d=S.useCallback(M=>{if(f(M),typeof window>"u")return;const z=M?`#/run/${encodeURIComponent(M)}`:"",D=z||window.location.pathname+window.location.search;window.location.hash!==z&&window.history.pushState(null,"",D)},[]);S.useEffect(()=>{const M=()=>f(Qv());return window.addEventListener("hashchange",M),window.addEventListener("popstate",M),()=>{window.removeEventListener("hashchange",M),window.removeEventListener("popstate",M)}},[]);const p=Oi(),m=s.split(",").map(M=>M.trim()).filter(Boolean),{data:v,isPending:b,fetchNextPage:h,hasNextPage:y,isFetchingNextPage:g}=EP({queryKey:["runs",n,m.join("|"),i],queryFn:({pageParam:M})=>tt.runsPage(void 0,n||void 0,m.length?m:void 0,{namespace:i||void 0},{limit:V$,offset:M}),initialPageParam:0,getNextPageParam:M=>{const{limit:z,offset:D,count:T}=M.page;return T===z?D+z:void 0},refetchInterval:3e3}),w=S.useMemo(()=>(v==null?void 0:v.pages.flatMap(M=>M.runs))??[],[v]),{data:E=[]}=Gn({queryKey:["workers"],queryFn:()=>tt.workers(),refetchInterval:5e3}),C=To({mutationFn:M=>tt.bulk(M,{status:e!=="all"?e:void 0,tag:n||void 0,attr:m.length?m:void 0,namespace:i||void 0,origin:a.kind==="origin"?a.origin:void 0}),onSuccess:()=>p.invalidateQueries({queryKey:["runs"]})}),R=QN(w,a),k=R.reduce((M,z)=>(M[z.status]=(M[z.status]??0)+1,M),{}),N=e==="all"?R:R.filter(M=>M.status===e),I=GN(w),j=e!=="all"||!!n||!!i||m.length>0||a.kind!=="all",L=a.kind==="unknown"?"Bulk actions cannot be scoped to unclassified runs — runs with no origin have no server-side filter. Retry or cancel them from their own run view.":void 0,A=[...new Set(w.filter(M=>qg(M,{runs:w,health:E}).status==="no-worker").map(M=>M.workflow))],P=`${e}|${n}|${m.join(",")}|${i}|${Y1(a)}`;return x.jsxs(F$,{children:[x.jsx("div",{className:"app-bg"}),x.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[x.jsx(K$,{counts:k,filter:e,onFilter:t}),A.length>0&&x.jsxs("div",{className:"flex items-center gap-2 border-b border-amber-500/30 bg-amber-500/10 px-4 py-1.5 text-[11px] text-amber-200",children:[x.jsx("span",{className:"s-no-worker inline-flex items-center gap-1.5",children:x.jsx("span",{className:"dot s-no-worker","aria-hidden":!0})}),x.jsxs("span",{children:["Runs waiting on handlers with no live worker:"," ",x.jsx("span",{className:"mono text-amber-100",children:A.join(", ")}),". Start a worker to unblock."]})]}),x.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[minmax(300px,360px)_1fr]",children:[x.jsxs("aside",{className:"flex min-h-0 flex-col border-r border-line",children:[x.jsxs("div",{className:"border-b border-line p-2",children:[x.jsx(Vc,{glyph:"#",value:n,onChange:M=>r(M.target.value),onClear:()=>r(""),clearLabel:"clear tag filter",placeholder:"filter by tag…","aria-label":"filter by tag"}),x.jsx(Vc,{glyph:"⛃",containerClassName:"mt-1.5",value:s,onChange:M=>o(M.target.value),onClear:()=>o(""),clearLabel:"clear attribute filter",placeholder:"attrs e.g. amount:gte:200, tier:eq:pro","aria-label":"filter by search attribute",title:"Typed search attributes: comma-separated key:op:value (ops eq ne gt gte lt lte)"}),x.jsx(Vc,{glyph:"@",containerClassName:"mt-1.5",value:i,onChange:M=>l(M.target.value),onClear:()=>l(""),clearLabel:"clear tenant filter",placeholder:"filter by tenant / namespace…","aria-label":"filter by tenant",title:"Tenant / worker-pool partition (WorkflowRun.namespace). Empty shows every tenant."})]}),x.jsx(lM,{runs:w,value:a,onChange:c}),j&&N.length>0&&x.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-3 py-1.5",children:[x.jsxs("span",{className:"mono text-[10px] text-zinc-500",children:[N.length," ",e!=="all"?e:""," ",n&&`#${n}`,i&&` @${i}`,a.kind==="origin"&&` ⬡${ma(a.origin)}`,a.kind==="unknown"&&` ⬡${ld}`,m.length>0&&` ⛃${m.length}`]}),x.jsx(Ue,{variant:"brand",size:"xs",disabled:C.isPending||L!==void 0,title:L,onClick:()=>C.mutate("retry"),className:"mono ml-auto rounded",children:"retry all"}),x.jsx(Ue,{variant:"danger",size:"xs",disabled:C.isPending||L!==void 0,title:L,onClick:()=>C.mutate("cancel"),className:"mono rounded",children:"cancel all"})]}),x.jsx("div",{className:"min-h-0 flex-1",children:x.jsx(n4,{runs:N,allRuns:w,health:E,loading:b,selected:u,onSelect:d,onSelectTag:r,onSelectNamespace:l,onSelectOrigin:c,hasMore:y,loadingMore:g,onLoadMore:h,emptyNotice:ZN({anyFilter:j,origin:a,unknownCount:I})},P)})]}),x.jsx("main",{className:"min-h-0",children:u?x.jsx(s4,{id:u,onOpenRun:d},u):x.jsx("div",{className:"grid h-full place-items-center text-center",children:x.jsxs("div",{className:"flex flex-col items-center",children:[x.jsx(YC,{className:"h-10 w-10 text-zinc-800"}),x.jsx("p",{className:"mt-3 text-sm text-zinc-600",children:"Select a run to see its timeline."})]})})})]})]})]})}const i4=new xP({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});W1(document.getElementById("root")).render(x.jsx(S.StrictMode,{children:x.jsx(vP,{client:i4,children:x.jsx(o4,{})})}));
|
|
67
|
+
//# sourceMappingURL=index-CV232q_B.js.map
|